|
|
|
|
@ -78,7 +78,12 @@ |
|
|
|
|
label-width="0px" |
|
|
|
|
v-if="activeName == '1'" |
|
|
|
|
> |
|
|
|
|
<el-table :data="form1.tableData1" style="width: 100%" v-if="activeName == '1'"> |
|
|
|
|
<el-table |
|
|
|
|
:data="form1.tableData1" |
|
|
|
|
style="width: 100%" |
|
|
|
|
v-if="activeName == '1'" |
|
|
|
|
@selection-change="handleSelectionChange1" |
|
|
|
|
> |
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column> |
|
|
|
|
<el-table-column prop="processInfo.reworkNo" label="返工序号"> |
|
|
|
|
<template #header> |
|
|
|
|
@ -238,7 +243,11 @@ |
|
|
|
|
label-width="0px" |
|
|
|
|
v-if="activeName == '2'" |
|
|
|
|
> |
|
|
|
|
<el-table :data="form2.tableData2" style="width: 100%"> |
|
|
|
|
<el-table |
|
|
|
|
:data="form2.tableData2" |
|
|
|
|
style="width: 100%" |
|
|
|
|
@selection-change="handleSelectionChange2" |
|
|
|
|
> |
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column> |
|
|
|
|
<el-table-column prop="date" label="工序号"> |
|
|
|
|
<template #header> |
|
|
|
|
@ -296,7 +305,7 @@ |
|
|
|
|
placeholder="请选择" |
|
|
|
|
clearable |
|
|
|
|
filterable |
|
|
|
|
@change="standardChange(scope.row, scope.$index)" |
|
|
|
|
@change="standardChange(scope.row, scope.$index)" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="(item, index) in standardList" |
|
|
|
|
@ -351,7 +360,11 @@ |
|
|
|
|
label-width="0px" |
|
|
|
|
v-if="activeName == '3'" |
|
|
|
|
> |
|
|
|
|
<el-table :data="form3.tableData3" style="width: 100%"> |
|
|
|
|
<el-table |
|
|
|
|
:data="form3.tableData3" |
|
|
|
|
style="width: 100%" |
|
|
|
|
@selection-change="handleSelectionChange3" |
|
|
|
|
> |
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column> |
|
|
|
|
<el-table-column prop="trialNo" label="工序号"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
@ -423,7 +436,11 @@ |
|
|
|
|
label-width="0px" |
|
|
|
|
v-if="activeName == '4'" |
|
|
|
|
> |
|
|
|
|
<el-table :data="form4.tableData4" style="width: 100%"> |
|
|
|
|
<el-table |
|
|
|
|
:data="form4.tableData4" |
|
|
|
|
style="width: 100%" |
|
|
|
|
@selection-change="handleSelectionChange4" |
|
|
|
|
> |
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column> |
|
|
|
|
<el-table-column prop="date" label="工序号"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
@ -652,13 +669,13 @@ export default { |
|
|
|
|
// this.partInfoData = res.data.data; |
|
|
|
|
// }); |
|
|
|
|
// }, |
|
|
|
|
// 获取检验项目名字 |
|
|
|
|
projectChange(row,index) { |
|
|
|
|
// 获取检验项目名字 |
|
|
|
|
projectChange(row, index) { |
|
|
|
|
let selectName = this.projectOptions.find(item => item.id == row.projecCode); |
|
|
|
|
this.form2.tableData2[index].projectName = selectName.name; |
|
|
|
|
}, |
|
|
|
|
// 获取检验标准名字 |
|
|
|
|
standardChange(row,index) { |
|
|
|
|
standardChange(row, index) { |
|
|
|
|
let selectName = this.standardList.find(item => item.id == row.projectStandard); |
|
|
|
|
this.form2.tableData2[index].projectStandardName = selectName.name; |
|
|
|
|
}, |
|
|
|
|
@ -719,18 +736,18 @@ export default { |
|
|
|
|
const mappedData = templateData.map((item, index) => { |
|
|
|
|
// 如果模板中的字段和表格字段一致,可直接使用;否则需转换 |
|
|
|
|
return { |
|
|
|
|
processInfo:{ |
|
|
|
|
processInfo: { |
|
|
|
|
id: null, // 新增时通常设为 null |
|
|
|
|
processNo: this.getProcessNo(this.form1.tableData1), // 自动生成工序号 |
|
|
|
|
processCode: item.processCode || item.id, // 假设模板中有 processCode 或 id |
|
|
|
|
processName: item.processName, |
|
|
|
|
craftCode: item.craftCode, |
|
|
|
|
craftName: item.craftName, |
|
|
|
|
proDes: item.proDes || item.description, |
|
|
|
|
proHours: item.proHours || '', |
|
|
|
|
setoutHours: item.setoutHours || '', |
|
|
|
|
isMain: item.isMain || '0', |
|
|
|
|
} |
|
|
|
|
processNo: this.getProcessNo(this.form1.tableData1), // 自动生成工序号 |
|
|
|
|
processCode: item.processCode || item.id, // 假设模板中有 processCode 或 id |
|
|
|
|
processName: item.processName, |
|
|
|
|
craftCode: item.craftCode, |
|
|
|
|
craftName: item.craftName, |
|
|
|
|
proDes: item.proDes || item.description, |
|
|
|
|
proHours: item.proHours || '', |
|
|
|
|
setoutHours: item.setoutHours || '', |
|
|
|
|
isMain: item.isMain || '0', |
|
|
|
|
}, |
|
|
|
|
// 其他字段按需补充... |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
@ -836,10 +853,18 @@ export default { |
|
|
|
|
// 右侧tab切换 |
|
|
|
|
handleClick(value) { |
|
|
|
|
// console.log(999999, value); |
|
|
|
|
this.form1.deleteIds = []; |
|
|
|
|
this.form2.deleteIds = []; |
|
|
|
|
this.form3.deleteIds = []; |
|
|
|
|
this.form4.deleteIds = []; |
|
|
|
|
}, |
|
|
|
|
// 切换等级 |
|
|
|
|
leavelChange() { |
|
|
|
|
this.$message.success('保存成功'); |
|
|
|
|
this.getDetails(); |
|
|
|
|
this.form1.deleteIds = []; |
|
|
|
|
this.form2.deleteIds = []; |
|
|
|
|
this.form3.deleteIds = []; |
|
|
|
|
this.form4.deleteIds = []; |
|
|
|
|
}, |
|
|
|
|
// 获取工序号 |
|
|
|
|
getProcessNo(table) { |
|
|
|
|
@ -872,27 +897,27 @@ export default { |
|
|
|
|
if (this.activeName == '2') { |
|
|
|
|
this.form2.tableData2.push({ |
|
|
|
|
_tempId: this.tempId, // 临时唯一标识 |
|
|
|
|
id: null, |
|
|
|
|
trialNo: this.getProcessNo(this.form2.tableData2), |
|
|
|
|
id: null, |
|
|
|
|
trialNo: this.getProcessNo(this.form2.tableData2), |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if (this.activeName == '3') { |
|
|
|
|
this.form3.tableData3.push({ |
|
|
|
|
_tempId: this.tempId, // 临时唯一标识 |
|
|
|
|
id: null, |
|
|
|
|
trialNo: this.getProcessNo(this.form3.tableData3), |
|
|
|
|
id: null, |
|
|
|
|
trialNo: this.getProcessNo(this.form3.tableData3), |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if (this.activeName == '4') { |
|
|
|
|
this.form4.tableData4.push({ |
|
|
|
|
_tempId: this.tempId, // 临时唯一标识 |
|
|
|
|
id: null, |
|
|
|
|
trialNo: this.getProcessNo(this.form4.tableData4), |
|
|
|
|
id: null, |
|
|
|
|
trialNo: this.getProcessNo(this.form4.tableData4), |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handleSelectionChange1(val) { |
|
|
|
|
this.form1.selectIds = val.map(row => row.id || row._tempId); |
|
|
|
|
this.form1.selectIds = val.map(row => row.processInfo.id || row.processInfo._tempId); |
|
|
|
|
}, |
|
|
|
|
handleSelectionChange2(val) { |
|
|
|
|
this.form2.selectIds = val.map(row => row.id || row._tempId); |
|
|
|
|
@ -909,14 +934,75 @@ export default { |
|
|
|
|
const active = this.activeName; |
|
|
|
|
let message = '请至少选择一条数据进行删除'; |
|
|
|
|
|
|
|
|
|
if (active == '1') { |
|
|
|
|
} |
|
|
|
|
if (active == '2') { |
|
|
|
|
} |
|
|
|
|
if (active == '3') { |
|
|
|
|
} |
|
|
|
|
if (active == '4') { |
|
|
|
|
if (active === '1') { |
|
|
|
|
if (this.form1.selectIds.length === 0) { |
|
|
|
|
this.$message.warning(message); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 收集需要通过 API 删除的真实 ID(已保存的工序) |
|
|
|
|
this.form1.deleteIds = this.form1.tableData1 |
|
|
|
|
.filter(row => { |
|
|
|
|
const key = row.processInfo.id || row.processInfo._tempId; |
|
|
|
|
return this.form1.selectIds.includes(key); |
|
|
|
|
}) |
|
|
|
|
.filter(row => row.processInfo.id != null && row.processInfo.id !== '') // 仅已保存的有 id |
|
|
|
|
.map(row => row.processInfo.id); |
|
|
|
|
|
|
|
|
|
// 从表格中移除所有选中行(包括临时行) |
|
|
|
|
this.form1.tableData1 = this.form1.tableData1.filter(row => { |
|
|
|
|
const key = row.processInfo.id || row.processInfo._tempId; |
|
|
|
|
return !this.form1.selectIds.includes(key); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.form1.selectIds = []; // 清空选中状态 |
|
|
|
|
} else if (active === '2') { |
|
|
|
|
if (this.form2.selectIds.length === 0) { |
|
|
|
|
this.$message.warning(message); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.form2.deleteIds = this.form2.tableData2 |
|
|
|
|
.filter(row => this.form2.selectIds.includes(row.id || row._tempId)) |
|
|
|
|
.filter(row => row.id != null && row.id !== '') |
|
|
|
|
.map(row => row.id); |
|
|
|
|
|
|
|
|
|
this.form2.tableData2 = this.form2.tableData2.filter(row => { |
|
|
|
|
const key = row.id || row._tempId; |
|
|
|
|
return !this.form2.selectIds.includes(key); |
|
|
|
|
}); |
|
|
|
|
this.form2.selectIds = []; |
|
|
|
|
} else if (active === '3') { |
|
|
|
|
if (this.form3.selectIds.length === 0) { |
|
|
|
|
this.$message.warning(message); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.form3.deleteIds = this.form3.tableData3 |
|
|
|
|
.filter(row => this.form3.selectIds.includes(row.id || row._tempId)) |
|
|
|
|
.filter(row => row.id != null && row.id !== '') |
|
|
|
|
.map(row => row.id); |
|
|
|
|
this.form3.tableData3 = this.form3.tableData3.filter(row => { |
|
|
|
|
const key = row.id || row._tempId; |
|
|
|
|
return !this.form3.selectIds.includes(key); |
|
|
|
|
}); |
|
|
|
|
this.form3.selectIds = []; |
|
|
|
|
} else if (active === '4') { |
|
|
|
|
if (this.form4.selectIds.length === 0) { |
|
|
|
|
this.$message.warning(message); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.form4.deleteIds = this.form4.tableData4 |
|
|
|
|
.filter(row => this.form4.selectIds.includes(row.id || row._tempId)) |
|
|
|
|
.filter(row => row.id != null && row.id !== '') |
|
|
|
|
.map(row => row.id); |
|
|
|
|
|
|
|
|
|
this.form4.tableData4 = this.form4.tableData4.filter(row => { |
|
|
|
|
const key = row.id || row._tempId; |
|
|
|
|
return !this.form4.selectIds.includes(key); |
|
|
|
|
}); |
|
|
|
|
this.form4.selectIds = []; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.$message.success('删除成功'); |
|
|
|
|
}, |
|
|
|
|
submit() { |
|
|
|
|
if (this.activeName == '1') { |
|
|
|
|
@ -984,10 +1070,10 @@ export default { |
|
|
|
|
id: this.partInfoData.craftList[0].craftInfo.id, |
|
|
|
|
}, //工艺信息 |
|
|
|
|
reworkProcessVOList: newArr, |
|
|
|
|
reworkProcessDeleteIds: [], //工序删除id |
|
|
|
|
processProjectDeleteIds: [], //项目删除id |
|
|
|
|
processMeasuringToolDeleteIds: [], //量具删除id |
|
|
|
|
processMoldToolDeleteIds: [], //工装删除合集 |
|
|
|
|
reworkProcessDeleteIds: this.form1.deleteIds, //工序删除id |
|
|
|
|
processProjectDeleteIds: this.form2.deleteIds, //项目删除id |
|
|
|
|
processMeasuringToolDeleteIds: this.form3.deleteIds, //量具删除id |
|
|
|
|
processMoldToolDeleteIds: this.form4.deleteIds, //工装删除合集 |
|
|
|
|
}; |
|
|
|
|
reworkAuthorizedAccomplish(query_).then(res => { |
|
|
|
|
// this.$emit('cancel'); |
|
|
|
|
|