yusheng vor 1 Woche
Ursprung
Commit
b011e028d1
1 geänderte Dateien mit 21 neuen und 18 gelöschten Zeilen
  1. 21 18
      src/views/inspectionTemplate/AddorUpdate.vue

+ 21 - 18
src/views/inspectionTemplate/AddorUpdate.vue

@@ -13,6 +13,7 @@
     :close-on-press-escape="false"
     append-to-body
     width="80%"
+    @choose="handleClose"
     :maxable="true"
   >
     <div class="switch" v-if="type == 'view'">
@@ -461,6 +462,21 @@
   import bpmDetail from '@/views/bpm/processInstance/detail.vue';
 
   import { getCode } from '@/api/login';
+  const dataForm = {
+    type: null,
+    qualitySchemeTemplateName: '',
+    qualitySchemeTemplateCode: '',
+    inspectionItemVOList: [],
+    status: 1,
+    templateRemark: '',
+    sampleProportion: '',
+    sampleProportionUnit: '%',
+    validityPeriod: '',
+    validityPeriodUnit: '',
+    qualityMode: '',
+    taskId: '',
+    taskName: ''
+  };
   export default {
     components: {
       termPop,
@@ -471,6 +487,7 @@
       bpmDetail
     },
     mixins: [tabMixins],
+
     data() {
       return {
         cacheKeyUrl: 'qms-c2e9664a-inspectionTemplate-AddorUpdate',
@@ -484,22 +501,7 @@
           { key: 'main', name: '检测方案详情' },
           { key: 'bpm', name: '流程详情' }
         ],
-        dataForm: {
-          id: 0,
-          type: null,
-          qualitySchemeTemplateName: '',
-          qualitySchemeTemplateCode: '',
-          inspectionItemVOList: [],
-          status: 1,
-          templateRemark: '',
-          sampleProportion: '',
-          sampleProportionUnit: '%',
-          validityPeriod: '',
-          validityPeriodUnit: '',
-          qualityMode: '',
-          taskId: '',
-          taskName: ''
-        },
+        dataForm: { ...dataForm },
         columns: [
           {
             width: 45,
@@ -782,6 +784,9 @@
       handleClose() {
         this.visible = false;
         this.templateCategoryList = [];
+        this.dataForm={
+          ...dataForm
+        }
       },
       selectionChange(selection) {
         console.log(selection, 'selection');
@@ -842,7 +847,6 @@
               templateId: this.dataForm.id,
               size: -1
             }).then((data) => {
-              console.log(data, 'data');
               this.templateCategoryList = data.list;
             });
             // this.templateCategoryList=data.templateCategoryList||[];
@@ -854,7 +858,6 @@
         });
       },
       saveTaskInstance(data) {
-        console.log(data, 'data');
         this.dataForm.taskId = data.id;
         this.dataForm.taskName = data.name;
       },