ysy 2 سال پیش
والد
کامیت
4b2efcb0ed

+ 8 - 9
src/views/technology/productParam/components/ParamModal.vue

@@ -22,9 +22,6 @@
                 </template>
 
 
-
-
-
             </ele-pro-table>
 
 
@@ -54,16 +51,15 @@ export default {
                     type: 'selection',
                     width: 45,
                     align: 'center',
-                    // selectable: (row, index) => {
-                    //   return !this.data.some((it) => it.id == row.id);
-                    // },
+                    selectable: (row, index) => {
+                      return !this.tableData.some((it) => it.id == row.id);
+                    },
                     reserveSelection: true,
                     fixed: 'left'
                 },
                 {
                     prop: 'code',
                     label: '参数编码',
-                    // sortable: 'custom',
                     showOverflowTooltip: true,
                     align: 'center',
                     minWidth: 110
@@ -118,7 +114,7 @@ export default {
                     showOverflowTooltip: true
                 },
 
-           
+
             ],
             statusList: [
                 { label: '工艺', value: 0 },
@@ -131,6 +127,8 @@ export default {
             // 表格选中数据
             selection: [],
 
+            tableData: []
+
         }
     },
 
@@ -162,7 +160,7 @@ export default {
         },
         open(item) {
             if (item) {
-
+                this.tableData = item
 
             }
             this.visible = true
@@ -175,6 +173,7 @@ export default {
 
         handleClose() {
             this.visible = false
+            this.$refs.table.setSelectedRows([]);
             this.selection = []
 
         },

+ 17 - 3
src/views/technology/productParam/components/user-edit.vue

@@ -150,7 +150,7 @@
 
             <!-- 操作列 -->
             <template v-slot:action="{ row }">
-              <el-popconfirm class="ele-action" title="确定要删除当前工序吗?" @confirm="remove(row)">
+              <el-popconfirm class="ele-action" title="确定要删除当前参数吗?" @confirm="remove(row)">
                 <template v-slot:reference>
                   <el-link type="danger" :underline="false" icon="el-icon-delete">
                     删除
@@ -244,7 +244,8 @@ export default {
       loading: false,
       // 是否是修改
       isUpdate: false,
-
+      tableData: [],
+      removeList: [],
 
       // 表格列配置
       columns: [
@@ -311,6 +312,7 @@ export default {
           showOverflowTooltip: true
         }
       ],
+  
     };
   },
   computed: {
@@ -351,7 +353,8 @@ export default {
     },
 
     openParam() {
-      this.$refs.paramRefs.open(this.form.taskParam)
+      this.tableData = this.$refs.table.getData()
+      this.$refs.paramRefs.open(this.tableData)
     },
 
 
@@ -361,7 +364,18 @@ export default {
       this.$refs.table.setData([...arr, ...this.$refs.table.getData()]);
     },
 
+    remove(row) {
+        const data = this.$refs.table.getData() ?? [];
 
+        if (row.id) {
+          this.removeList.push(row.id);
+          this.$refs.table.setData(data.filter((d) => d.id !== row.id));
+        } else {
+          this.$refs.table.setData(
+            data.filter((d) => d.paramId !== row.paramId)
+          );
+        }
+      },
 
     /* 保存编辑 */
     save() {