|
|
@@ -25,6 +25,9 @@
|
|
|
:datasource="datasource"
|
|
|
:need-page="false"
|
|
|
class="table_list"
|
|
|
+ row-key="id"
|
|
|
+ cache-key="user-setting-matter-2510241427"
|
|
|
+ @refresh="getMatterList"
|
|
|
>
|
|
|
<template v-slot:toolbar>
|
|
|
<el-button
|
|
|
@@ -109,6 +112,11 @@
|
|
|
width: 45,
|
|
|
align: 'center'
|
|
|
},
|
|
|
+ {
|
|
|
+ prop: 'produceTaskName',
|
|
|
+ label: '工序名称',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
{
|
|
|
prop: 'itemType',
|
|
|
label: '类型',
|
|
|
@@ -140,8 +148,8 @@
|
|
|
slot: 'action'
|
|
|
}
|
|
|
],
|
|
|
- // 当前行数据
|
|
|
- currentRow: null,
|
|
|
+ // 配置工序数据
|
|
|
+ currentRows: [],
|
|
|
// 添加事项列表
|
|
|
addPOs: [],
|
|
|
deletedIds: [],
|
|
|
@@ -169,20 +177,36 @@
|
|
|
updateVisible(val) {
|
|
|
this.visible = val;
|
|
|
},
|
|
|
- openSetting(row) {
|
|
|
- console.log('row', row);
|
|
|
- this.currentRow = row;
|
|
|
+ openSetting(rows) {
|
|
|
+ console.log('rows', rows);
|
|
|
+
|
|
|
+ if (Array.isArray(rows)) {
|
|
|
+ this.currentRows = rows;
|
|
|
+ } else {
|
|
|
+ this.currentRows = [rows];
|
|
|
+ }
|
|
|
+
|
|
|
this.visible = true;
|
|
|
- this.getMatterList(row);
|
|
|
+ this.getMatterList();
|
|
|
+ // if (rows.length > 1) {
|
|
|
+ // this.bankColumns.splice(1, 0, {
|
|
|
+ // prop: 'produceTaskName',
|
|
|
+ // label: '工序名称',
|
|
|
+ // align: 'center'
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // this.bankColumns = this.bankColumns.filter(
|
|
|
+ // (col) => col.prop !== 'produceTaskName'
|
|
|
+ // );
|
|
|
+ // }
|
|
|
},
|
|
|
// 查询事项数据
|
|
|
async getMatterList() {
|
|
|
const { list } = await produceTaskRecordRules({
|
|
|
- produceTaskId: this.currentRow.id,
|
|
|
+ produceTaskIds: this.currentRows.map((row) => row.id),
|
|
|
pageNum: 1,
|
|
|
size: 9999,
|
|
|
isTemplate: 0
|
|
|
- // reportWorkType: this.reportWorkType
|
|
|
});
|
|
|
console.log('list', list);
|
|
|
// 表格数据
|
|
|
@@ -216,20 +240,23 @@
|
|
|
console.log('matter', matter);
|
|
|
const id = 'tem' + new Date().getTime();
|
|
|
// 添加事项
|
|
|
- this.matterList.push({
|
|
|
- ...matter,
|
|
|
- id: id,
|
|
|
- produceTaskId: this.currentRow.id,
|
|
|
- produceTaskName: this.currentRow.name,
|
|
|
- reportWorkType: this.reportWorkType
|
|
|
- });
|
|
|
- this.addPOs.push({
|
|
|
- ...matter,
|
|
|
- id: id,
|
|
|
- produceTaskId: this.currentRow.id,
|
|
|
- produceTaskName: this.currentRow.name,
|
|
|
- reportWorkType: this.reportWorkType
|
|
|
+ this.currentRows.forEach((task) => {
|
|
|
+ this.matterList.push({
|
|
|
+ ...matter,
|
|
|
+ id: id + task.id,
|
|
|
+ produceTaskId: task.id,
|
|
|
+ produceTaskName: task.name,
|
|
|
+ reportWorkType: this.reportWorkType
|
|
|
+ });
|
|
|
+ this.addPOs.push({
|
|
|
+ ...matter,
|
|
|
+ id: id + task.id,
|
|
|
+ produceTaskId: task.id,
|
|
|
+ produceTaskName: task.name,
|
|
|
+ reportWorkType: this.reportWorkType
|
|
|
+ });
|
|
|
});
|
|
|
+
|
|
|
this.handleSort();
|
|
|
},
|
|
|
editMatter(matter) {
|
|
|
@@ -251,10 +278,7 @@
|
|
|
(item) => item.id !== matter.id
|
|
|
);
|
|
|
this.updatePOs.push({
|
|
|
- ...matter,
|
|
|
- produceTaskId: this.currentRow.id,
|
|
|
- produceTaskName: this.currentRow.name,
|
|
|
- reportWorkType: this.reportWorkType
|
|
|
+ ...matter
|
|
|
});
|
|
|
} else {
|
|
|
// 如果是临时id,直接更新addPOs
|
|
|
@@ -306,8 +330,6 @@
|
|
|
await produceTaskRecordRulesBatchSave({
|
|
|
addPOs: this.addPOs,
|
|
|
deletedIds: this.deletedIds,
|
|
|
- produceTaskId: this.currentRow.id,
|
|
|
- produceTaskName: this.currentRow.name,
|
|
|
updatePOs: this.updatePOs
|
|
|
});
|
|
|
this.$message.success('保存成功');
|