ysy 2 лет назад
Родитель
Сommit
1fe93214d3

+ 1 - 1
src/views/technology/route/components/production/index.vue

@@ -57,7 +57,7 @@ export default {
 
 
         {
-          prop: 'id',
+          prop: 'code',
           label: '工序编码',
           // sortable: 'custom',
           showOverflowTooltip: true,

+ 10 - 2
src/views/technology/route/components/user-edit.vue

@@ -69,7 +69,7 @@
 
     </el-form>
 
-    <user-taskinstance :isEdit="isUpdate" ref="taskRef" :taskInfo="form" @taskList="taskList" />
+    <user-taskinstance :isEdit="isUpdate" ref="taskRef" :taskInfo="form" @taskList="taskList" @remove="remove" />
 
 
 
@@ -161,6 +161,7 @@ export default {
       isUpdate: false,
 
       taskInstanceList: [],
+      removeList: []
 
 
 
@@ -196,10 +197,12 @@ export default {
           this.$message.warning('至少配置一条工序才能保存');
           return;
         }
+      
 
         let param = {
           taskInstanceList: this.taskInstanceList,
-          routingInfo: this.form
+          routingInfo: this.form,
+          removeList: this.removeList
         }
 
         route
@@ -235,7 +238,12 @@ export default {
 
     taskList(list) {
       this.taskInstanceList = list
+    
     },
+    remove(list) {
+      this.removeList = list
+    }
+
 
 
   },

+ 10 - 2
src/views/technology/route/components/user-taskinstance.vue

@@ -204,9 +204,15 @@ export default {
       this.$refs.table.reload();
     },
     remove(row) {
-      const data = this.$refs.table.getData() ?? [];
-      this.$refs.table.setData(data.filter((d) => d.id !== row.id));
+      const data = this.$refs.table.getData();
+      if(row.id) {
+        this.removeList.push(row.id)
+      }
+   
+      this.$refs.table.setData(data.filter((d) => this.isEdit ?  d.id !== row.id : d.sourceTaskId !== row.sourceTaskId));
+
       this.$emit('taskList', this.$refs.table.getData())
+      this.$emit('remove', this.removeList)
     },
     /* 表格数据源 */
 
@@ -215,6 +221,7 @@ export default {
     },
 
     async getList() {
+      this.removeList =[]
       if (this.isEdit) {
         const res = await route.taskinstanceList({
           routingId: this.taskInfo.id,
@@ -225,6 +232,7 @@ export default {
 
         let arr = res.list.map((it) => {
           it.detail.orderNum = it.orderNum
+
           return it.detail
         });
         this.$refs.table.setData([...arr]);