|
|
|
@ -180,7 +180,7 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="proDes" label="工序描述" align="left"> |
|
|
|
<el-table-column prop="proDes" label="工序描述" align="left"> |
|
|
|
<template #header> |
|
|
|
<template #header> |
|
|
|
<span><i style="color: red">*</i>工序描述</span> |
|
|
|
<span><i style="color: red">*</i>工序描述</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
@ -432,6 +432,8 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
tableData2: [], |
|
|
|
tableData2: [], |
|
|
|
tableData: [], |
|
|
|
tableData: [], |
|
|
|
|
|
|
|
processDeleteIds: [], //工序删除id |
|
|
|
|
|
|
|
projectDeleteIds: [], //项目的删除id |
|
|
|
}, |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
rules: { |
|
|
|
promodel: { |
|
|
|
promodel: { |
|
|
|
@ -620,8 +622,8 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
this.ruleForm.tableData = res.data.data.proDetailVOList; |
|
|
|
this.ruleForm.tableData = res.data.data.proDetailVOList; |
|
|
|
this.ruleForm.tableData.forEach(item => { |
|
|
|
this.ruleForm.tableData.forEach(item => { |
|
|
|
item.ppsId = item.ppsId+''; |
|
|
|
item.ppsId = item.ppsId + ''; |
|
|
|
item.caId = item.caId+''; |
|
|
|
item.caId = item.caId + ''; |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.treeData = [{ label: '工序列表', processList: res.data.data.proDetailVOList }]; |
|
|
|
this.treeData = [{ label: '工序列表', processList: res.data.data.proDetailVOList }]; |
|
|
|
}); |
|
|
|
}); |
|
|
|
@ -665,7 +667,60 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 删除一行 |
|
|
|
// 删除一行 |
|
|
|
delTable(row, index) { |
|
|
|
delTable(row, index) { |
|
|
|
this.ruleForm.tableData.splice(index, 1); |
|
|
|
// this.ruleForm.tableData.splice(index, 1); |
|
|
|
|
|
|
|
if (this.activeName === '1') { |
|
|
|
|
|
|
|
const selected = this.selectedProcessRows; |
|
|
|
|
|
|
|
if (selected.length === 0) { |
|
|
|
|
|
|
|
this.$message.warning('请至少选择一条工序数据'); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 收集有 id 的行(用于后续提交删除) |
|
|
|
|
|
|
|
const idsToDelete = selected |
|
|
|
|
|
|
|
.filter(row => row.id != null && row.id !== '') |
|
|
|
|
|
|
|
.map(row => row.id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.ruleForm.processDeleteIds.push(...idsToDelete); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 从 tableData 中移除选中行(包括临时行) |
|
|
|
|
|
|
|
const tempIds = selected.map(row => row._tempId).filter(id => id != null); |
|
|
|
|
|
|
|
const realIds = selected.map(row => row.id).filter(id => id != null); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.ruleForm.tableData = this.ruleForm.tableData.filter(row => { |
|
|
|
|
|
|
|
if (row.id != null) { |
|
|
|
|
|
|
|
return !realIds.includes(row.id); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return !tempIds.includes(row._tempId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$message.success('删除成功'); |
|
|
|
|
|
|
|
} else if (this.activeName === '2') { |
|
|
|
|
|
|
|
const selected = this.selectedProjectRows; |
|
|
|
|
|
|
|
if (selected.length === 0) { |
|
|
|
|
|
|
|
this.$message.warning('请至少选择一条项目数据'); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const idsToDelete = selected |
|
|
|
|
|
|
|
.filter(row => row.id != null && row.id !== '') |
|
|
|
|
|
|
|
.map(row => row.id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.ruleForm.projectDeleteIds.push(...idsToDelete); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const tempIds = selected.map(row => row._tempId).filter(id => id != null); |
|
|
|
|
|
|
|
const realIds = selected.map(row => row.id).filter(id => id != null); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.ruleForm.tableData2 = this.ruleForm.tableData2.filter(row => { |
|
|
|
|
|
|
|
if (row.id != null) { |
|
|
|
|
|
|
|
return !realIds.includes(row.id); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return !tempIds.includes(row._tempId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$message.success('删除成功'); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
submit() { |
|
|
|
submit() { |
|
|
|
@ -705,6 +760,8 @@ export default { |
|
|
|
let query = { |
|
|
|
let query = { |
|
|
|
promodel, |
|
|
|
promodel, |
|
|
|
tableData, |
|
|
|
tableData, |
|
|
|
|
|
|
|
processDeleteIds: this.ruleForm.processDeleteIds, |
|
|
|
|
|
|
|
projectDeleteIds: this.ruleForm.projectDeleteIds, |
|
|
|
}; |
|
|
|
}; |
|
|
|
console.log('提交数据:', query); |
|
|
|
console.log('提交数据:', query); |
|
|
|
|
|
|
|
|
|
|
|
|