ysy 1 год назад
Родитель
Сommit
68a20aada7

+ 15 - 7
src/views/inspectionPoint/components/newEdit.vue

@@ -127,13 +127,13 @@
             return false;
           }
 
-          if (this.type == 'add') {
-            delete this.form.id;
-          }
-          delete this.form.createTime;
+          let param = {
+            ...this.form,
+            qualityLevelList: this.inspectList.map((item) => item.id)
+          };
 
           let URL = this.type == 'add' ? save : update;
-          URL(this.form)
+          URL(param)
             .then((msg) => {
               this.loading = false;
               this.$message.success(msg);
@@ -158,10 +158,18 @@
 
       chooseModal(list) {
         this.inspectList = list || [];
-        
       }
     }
   };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+  :deep(
+      .el-dialog:not(.ele-dialog-form)
+        .el-dialog__body
+        .el-form
+        .el-form-item:last-child
+    ) {
+    margin-bottom: 22px;
+  }
+</style>

+ 2 - 2
src/views/inspectionPoint/components/newEquipmentDialog.vue

@@ -35,7 +35,7 @@
             height="calc(100vh - 385px)"
             full-height="calc(100vh - 116px)"
             tool-class="ele-toolbar-form"
-            cache-key="inspectionClassify"
+            cache-key="newEquipmentDialog"
             row-key="id"
           >
             <!-- 表头工具栏 -->
@@ -242,7 +242,6 @@
         this.current = info;
         this.$nextTick(() => {
           this.categoryLevelId = info.id;
-
           this.rootCategoryLevelId = info.rootCategoryLevelId;
           this.reload();
         });
@@ -282,6 +281,7 @@
 
         _arr = this.selection.map((m) => {
           return {
+            parentId: m.id,
             ...m.itemVO
           };
         });

+ 17 - 9
src/views/inspectionPoint/components/newInspectionProjectList.vue

@@ -7,7 +7,7 @@
       height="calc(100vh - 435px)"
       full-height="calc(100vh - 156px)"
       tool-class="ele-toolbar-form"
-      cache-key="inspectionClassify"
+      cache-key="newInspectionProjectList"
       row-key="id"
     >
       <!-- 表头工具栏 -->
@@ -51,14 +51,13 @@
           v-for="(item, idx) in row.toolList"
           :key="idx"
           >{{ item.name }}
-          <span
-            v-if="row.toolList && idx != row.toolList.length - 1"
+          <span v-if="row.toolList && idx != row.toolList.length - 1"
             >,
           </span></div
         >
       </template>
 
-      <template v-slot:action="{ row }">
+      <template v-slot:action="{ row, $index }">
         <el-popconfirm
           class="ele-action"
           title="确定要删除此质检项吗?"
@@ -92,8 +91,13 @@
     watch: {
       inspectList: {
         handler(list) {
-
-            this.$refs.table.setData([...list]);
+          this.$nextTick(() => {
+            if (list.length > 0) {
+              this.$refs.table.setData([...list]);
+            } else {
+              this.$refs.table.setData([]);
+            }
+          });
         },
         immediate: true,
         deep: true
@@ -148,9 +152,7 @@
             label: '工艺要求',
             prop: 'inspectionStandard',
             formatter: (row, column, cellValue) => {
-              return (
-                row.symbol + ' ' + cellValue + ' ' + row.unit
-              );
+              return row.symbol + ' ' + cellValue + ' ' + row.unit;
             },
             minWidth: 150
           },
@@ -201,6 +203,12 @@
       datasource() {
         return [];
       },
+
+      remove(index) {
+        let _list = this.$refs.table.getData() || [];
+        _list.splice(index, 1);
+        this.$refs.table.setData([..._list]);
+      },
       openAdd() {
         this.$emit('openAdd');
       }