Browse Source

生产进度报表查询图片

zengtx 2 years ago
parent
commit
683ab1ee23

+ 41 - 0
src/views/reportForms/full-rate-table/progtressImg.vue

@@ -0,0 +1,41 @@
+<template>
+  <a-modal
+    title="图片"
+    width="60%"
+    :footer="null"
+    :visible="visible"
+    @cancel="close"
+  >
+  <img :src="URL" style="margin: auto;"/>
+
+  </a-modal>
+</template>
+
+<script>
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+
+export default {
+  name: 'Detail', // 明细 弹框
+  mixins: [JeecgListMixin],
+  components: { },
+  data() {
+    return {      
+      visible:false,
+      URL:'',
+      dd:'',
+    }
+  },
+  watch: {
+    dd(newVal) {
+    this.URL='data:image/jpeg;base64,'+newVal
+}
+},
+ 
+  methods: {
+ close(){
+    this.visible = false
+},
+}}
+</script>
+<style lang="less" scoped>
+</style>

+ 13 - 8
src/views/reportForms/pro-progress-report.vue

@@ -115,13 +115,13 @@
         <!-- 图片 弹框-->
         <span slot="imageslot">
           <a>查看</a>
-          <!-- <img style="width:50px;heigth:50px" :src="record.image" /> -->
         </span>
       </a-table>
     </a-card>
 
     <!-- 单个订单报表 抽屉 -->
     <salesOrderDetails-drawer ref="salesOrderDetailsDrawer" @ok="modalFormOk"></salesOrderDetails-drawer>
+    <imgModal ref="imgdetal"></imgModal>
   </div>
 </template>
 
@@ -131,13 +131,13 @@ import JEllipsis from '@/components/jeecg/JEllipsis'
 import moment from 'moment'
 
 import salesOrderDetailsDrawer from '@views/reportForms/pro-progress-report/salesOrderDetailsDrawer.vue'
-
+import imgModal from '@views/reportForms/full-rate-table/progtressImg.vue'
 import { proProgressList, getImg } from '@api/reportForms/pro-progress-report.js'
 
 export default {
   name: 'ProProgressReport', // 生产进度报表
   mixins: [JeecgListMixin],
-  components: { JEllipsis, moment, salesOrderDetailsDrawer },
+  components: { JEllipsis, moment, salesOrderDetailsDrawer,imgModal },
 
   data() {
     let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
@@ -290,12 +290,16 @@ export default {
       return {
         on: {
           click: event => {
-            console.log('【查看】的图片ID', record.pictureId)
+           // console.log('【查看】的图片ID', record.pictureId)
+           if( record.pictureId == null ||  record.pictureId=='undefined' ||  record.pictureId == ""){
+            this.$message.error("没有找到图片!");
+            return;
+           }
             this.$nextTick(() => {
               getImg({ pictureId: record.pictureId }).then(res => {
-                if (res.success) {
-                  console.log('图片返回结果', res.result)
-                }
+               // console.log('数据:', res[0].picture)
+                this.$refs.imgdetal.visible = true
+                this.$refs.imgdetal.dd = res[0].picture
               })
             })
 
@@ -324,7 +328,8 @@ export default {
     onDateChange(value, dateString) {
       this.queryParam.DDate = dateString
       this.queryParam.DPreDateBT = dateString
-    }
+    },
+  
   }
 }
 </script>