Explorar el Código

优化质检报告弹窗多开功能并修复路由离开时弹窗关闭问题,移除未使用的模板列表赋值逻辑

yusheng hace 4 meses
padre
commit
5362bccd9e

+ 1 - 0
src/components/workList/wokePopup.vue

@@ -5,6 +5,7 @@
     :before-close="handleClose"
     :close-on-click-modal="false"
     :close-on-press-escape="false"
+    multiple
     append-to-body
     resizable
     :maxable="true"

+ 5 - 5
src/views/inspectionProjectRequest/index.vue

@@ -611,11 +611,11 @@
             'inspectionProjectRequest'
           );
         } else {
-          if (type != 'detail') {
-            res.sampleList.forEach((item) => {
-              item.qualitySampleTemplateList = res.templateList;
-            });
-          }
+          // if (type != 'detail') {
+          //   res.sampleList.forEach((item) => {
+          //     item.qualitySampleTemplateList = res.templateList;
+          //   });
+          // }
           this.$refs.sampleReportRef.open(
             res,
             type,

+ 5 - 5
src/views/inspectionProjectTask/index.vue

@@ -412,11 +412,11 @@
             'inspectionProjectTask'
           );
         } else {
-          if (type != 'detail') {
-            res.data.sampleList.forEach((item) => {
-              item.qualitySampleTemplateList = res.data.templateList;
-            });
-          }
+          // if (type != 'detail') {
+          //   res.data.sampleList.forEach((item) => {
+          //     item.qualitySampleTemplateList = res.data.templateList;
+          //   });
+          // }
 
           this.$refs.sampleReportRef.open(
             res.data,

+ 5 - 5
src/views/inspectionWork/components/inspectionProjectReport.vue

@@ -9,7 +9,7 @@
     append-to-body
     width="80%"
     resizable
-
+    multiple
     :maxable="true"
 
   >
@@ -905,10 +905,10 @@
 
       handleClose() {
         this.visible = false;
-        // console.log(this.visible, 'asd');
-        // if (this.$refs.wokePopupRef) {
-        //   this.$refs.wokePopupRef.visible = false;
-        // }
+
+        if (this.$refs.wokePopupRef) {
+          this.$refs.wokePopupRef.visible = false;
+        }
       },
       handleConfirm() {
         let isHandleConfirm = false;

+ 6 - 4
src/views/inspectionWork/edit.vue

@@ -399,10 +399,12 @@
       }
     },
 
-    // beforeRouteLeave(to, from, next) {
-    //   this.$refs.inspectionProjectReportRef.handleClose();
-    //   next();
-    // },
+    beforeRouteLeave(to, from, next) {
+      this.$refs.inspectionProjectReportRef.handleClose();
+      this.$nextTick(() => {
+        next();
+      });
+    },
     data() {
       const defaultForm = function () {
         return {