From 33c4e059eeb71de6f186bc4ee22e05bfd3bd5aeb Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Wed, 24 Mar 2021 18:23:45 +0800
Subject: [PATCH] 问题修复

---
 src/views/parcel/parcel.vue |   54 +++++++++++++++++++++++++++++++-----------------------
 1 files changed, 31 insertions(+), 23 deletions(-)

diff --git a/src/views/parcel/parcel.vue b/src/views/parcel/parcel.vue
index 5880aa1..1385463 100644
--- a/src/views/parcel/parcel.vue
+++ b/src/views/parcel/parcel.vue
@@ -19,26 +19,32 @@
                @refresh-change="refreshChange"
                @on-load="onLoad">
         
-      <template slot="menu">
-        <el-button type="text" @click="dialogVisible=true">点击打开 Dialog</el-button>
+      <template slot-scope="{ type, size, row }" slot="menu">
 
-        <el-dialog title="提示" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
-          <span>这是一段信息</span>
-          <span slot="footer" class="dialog-footer">
-            <el-button @click="dialogVisible = false">取 消</el-button>
-            <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
-          </span>
-        </el-dialog>
+        <el-button
+          v-if="row.imgUrl != null || row.imgUrl != ''"
+          icon="el-icon-view"
+          :size="size"
+          :type="type"
+          @click.stop="handleParcelPic(row)"
+          >查看包裹图片
+        </el-button>
+        
       </template>
 
-
+      
     </avue-crud>
-    
+    <el-dialog class="parcel-dialog" title="包裹图片" :visible.sync="dialogTableVisible" :append-to-body="true" :close-on-click-modal="false"
+          @opened="parcelConversation = true" @close="(parcelConversation = false), (oldParcelSatart = false)" >
+          <div>
+            <img :src="'data:image/png;base64,'+imgUrl" >
+          </div>
+    </el-dialog>
   </basic-container>
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/parcel/parcel";
+  import {getList, getDetail, getParcelPic} from "@/api/parcel/parcel";
   import {mapGetters} from "vuex";
 
   export default {
@@ -46,8 +52,11 @@
       return {
         form: {},
         query: {},
+        imgUrl:'',
         loading: true,
-        dialogVisible: false,
+        dialogTableVisible: false,
+        parcelConversation:false,
+        oldParcelSatart:false,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -97,11 +106,11 @@
               hide:true
             },
             {
-              label: "过机时间",
+              label: "安检时间",
               prop: "samplingTime",
             },
             {
-              label: "过机时间",
+              label: "安检时间",
               prop: "dateTime",
               type: "datetime",
               format: "yyyy-MM-dd HH:mm:ss",
@@ -217,13 +226,6 @@
       refreshChange() {
         this.onLoad(this.page, this.query);
       },
-      handleClose(done) {
-        this.$confirm('确认关闭?')
-          .then(_ => {
-            done();
-          })
-          .catch(_ => {});
-      },
       onLoad(page, params = {}) {
         debugger;
         const { dateTime } = this.query;
@@ -231,7 +233,6 @@
           ...params,
         };
 
-        debugger;
         if (this.$route.query.decisioDiagramResult && this.$route.query!='' && this.$route.query!=null && this.$route.query!=undefined ) {
             if (this.$route.query.startTime != undefined && this.$route.query.startTime != null && this.$route.query.startTime != "" ) {
               this.page.currentPage = 1;
@@ -280,6 +281,13 @@
           this.loading = false;
           this.selectionClear();
         });
+      },
+      handleParcelPic(row) {
+        console.log(row.imgUrl);
+        getParcelPic(row.imgUrl).then(res => {
+            this.imgUrl = res.data.data.imgBase64;
+          });
+        this.dialogTableVisible = true;
       }
     }
   };

--
Gitblit v1.9.3