|
|
|
@ -22,7 +22,7 @@ |
|
|
|
<div class="table-btn-left"> |
|
|
|
<div class="table-btn-left"> |
|
|
|
<el-button type="primary" plain @click="addTable()">插入一行</el-button> |
|
|
|
<el-button type="primary" plain @click="addTable()">插入一行</el-button> |
|
|
|
<el-button type="danger" plain @click="delTable()">删除选择行</el-button> |
|
|
|
<el-button type="danger" plain @click="delTable()">删除选择行</el-button> |
|
|
|
<el-button type="primary" @click="submit()">保存</el-button> |
|
|
|
<el-button type="primary" @click="submit()" :loading="craftLoading">保存</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="table-btn-right" v-if="activeName == '1'"> |
|
|
|
<div class="table-btn-right" v-if="activeName == '1'"> |
|
|
|
@ -31,7 +31,7 @@ |
|
|
|
<el-button type="primary" @change="reworkNoNumSave()">保存</el-button> --> |
|
|
|
<el-button type="primary" @change="reworkNoNumSave()">保存</el-button> --> |
|
|
|
<el-input placeholder="请输入内容" v-model="reworkNoNum"> |
|
|
|
<el-input placeholder="请输入内容" v-model="reworkNoNum"> |
|
|
|
<template #append> |
|
|
|
<template #append> |
|
|
|
<el-button :icon="Search" @click="reworkNoNumSave()">保存</el-button> |
|
|
|
<el-button @click="reworkNoNumSave()">保存</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-input> |
|
|
|
</el-input> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -202,7 +202,7 @@ |
|
|
|
<el-table-column prop="ocId" label="外协厂商"> |
|
|
|
<el-table-column prop="ocId" label="外协厂商"> |
|
|
|
<template #default="scope"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-input |
|
|
|
<el-input |
|
|
|
v-model="scope.row.ocId" |
|
|
|
v-model="scope.row.processInfo.ocId" |
|
|
|
placeholder="请输入" |
|
|
|
placeholder="请输入" |
|
|
|
style="width: 100%" |
|
|
|
style="width: 100%" |
|
|
|
></el-input> |
|
|
|
></el-input> |
|
|
|
@ -263,14 +263,15 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template #default="scope"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-form-item |
|
|
|
<el-form-item |
|
|
|
:prop="`tableData2[${scope.$index}].projectName`" |
|
|
|
:prop="`tableData2[${scope.$index}].projecCode`" |
|
|
|
:rules="formRules2.projectName" |
|
|
|
:rules="formRules2.projecCode" |
|
|
|
> |
|
|
|
> |
|
|
|
<el-select |
|
|
|
<el-select |
|
|
|
v-model="scope.row.projectName" |
|
|
|
v-model="scope.row.projecCode" |
|
|
|
placeholder="请选择" |
|
|
|
placeholder="请选择" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
filterable |
|
|
|
filterable |
|
|
|
|
|
|
|
@change="projectChange(scope.row, scope.$index)" |
|
|
|
> |
|
|
|
> |
|
|
|
<el-option |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in projectOptions" |
|
|
|
v-for="(item, index) in projectOptions" |
|
|
|
@ -295,6 +296,7 @@ |
|
|
|
placeholder="请选择" |
|
|
|
placeholder="请选择" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
filterable |
|
|
|
filterable |
|
|
|
|
|
|
|
@change="standardChange(scope.row, scope.$index)" |
|
|
|
> |
|
|
|
> |
|
|
|
<el-option |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in standardList" |
|
|
|
v-for="(item, index) in standardList" |
|
|
|
@ -314,7 +316,7 @@ |
|
|
|
></el-input> |
|
|
|
></el-input> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> --> |
|
|
|
</el-table-column> --> |
|
|
|
<el-table-column prop="proHours" label="定额工时(分钟)"> |
|
|
|
<el-table-column prop="proHours" label="定额工时(分钟)"> |
|
|
|
<template #header> |
|
|
|
<template #header> |
|
|
|
<span><i style="color: red">*</i>定额工时(分钟)</span> |
|
|
|
<span><i style="color: red">*</i>定额工时(分钟)</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
@ -382,11 +384,11 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template #default="scope"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-form-item :prop="`tableData3[${scope.$index}].tool`" :rules="formRules3.tool"> |
|
|
|
<el-form-item :prop="`tableData3[${scope.$index}].tool`" :rules="formRules3.tool"> |
|
|
|
<el-input |
|
|
|
<el-input |
|
|
|
v-model="scope.row.tool" |
|
|
|
v-model="scope.row.tool" |
|
|
|
placeholder="请输入" |
|
|
|
placeholder="请输入" |
|
|
|
style="width: 100%" |
|
|
|
style="width: 100%" |
|
|
|
></el-input> |
|
|
|
></el-input> |
|
|
|
<!-- <el-select v-model="scope.row.tool" placeholder="请选择" clearable filterable> |
|
|
|
<!-- <el-select v-model="scope.row.tool" placeholder="请选择" clearable filterable> |
|
|
|
<el-option label="是" value="1"></el-option> |
|
|
|
<el-option label="是" value="1"></el-option> |
|
|
|
<el-option label="否" value="2"></el-option> |
|
|
|
<el-option label="否" value="2"></el-option> |
|
|
|
@ -530,6 +532,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
craftLoading: false, |
|
|
|
processLevel: null, |
|
|
|
processLevel: null, |
|
|
|
data: [], |
|
|
|
data: [], |
|
|
|
defaultProps: { |
|
|
|
defaultProps: { |
|
|
|
@ -611,7 +614,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
formRules2: { |
|
|
|
formRules2: { |
|
|
|
trialNo: [{ required: true, message: '请输入', trigger: ['change', 'submit'] }], |
|
|
|
trialNo: [{ required: true, message: '请输入', trigger: ['change', 'submit'] }], |
|
|
|
projectName: [{ required: true, message: '请选择', trigger: ['change', 'submit'] }], |
|
|
|
projecCode: [{ required: true, message: '请选择', trigger: ['change', 'submit'] }], |
|
|
|
projectStandard: [{ required: true, message: '请输入', trigger: ['change', 'submit'] }], |
|
|
|
projectStandard: [{ required: true, message: '请输入', trigger: ['change', 'submit'] }], |
|
|
|
proHours: [{ required: true, message: '请输入', trigger: ['change', 'submit'] }], |
|
|
|
proHours: [{ required: true, message: '请输入', trigger: ['change', 'submit'] }], |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -649,6 +652,16 @@ export default { |
|
|
|
// this.partInfoData = res.data.data; |
|
|
|
// this.partInfoData = res.data.data; |
|
|
|
// }); |
|
|
|
// }); |
|
|
|
// }, |
|
|
|
// }, |
|
|
|
|
|
|
|
// 获取检验项目名字 |
|
|
|
|
|
|
|
projectChange(row,index) { |
|
|
|
|
|
|
|
let selectName = this.projectOptions.find(item => item.id == row.projecCode); |
|
|
|
|
|
|
|
this.form2.tableData2[index].projectName = selectName.name; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 获取检验标准名字 |
|
|
|
|
|
|
|
standardChange(row,index) { |
|
|
|
|
|
|
|
let selectName = this.standardList.find(item => item.id == row.projectStandard); |
|
|
|
|
|
|
|
this.form2.tableData2[index].projectStandardName = selectName.name; |
|
|
|
|
|
|
|
}, |
|
|
|
getStandardList() { |
|
|
|
getStandardList() { |
|
|
|
getStandardList().then(res => { |
|
|
|
getStandardList().then(res => { |
|
|
|
this.standardList = res.data.data; |
|
|
|
this.standardList = res.data.data; |
|
|
|
@ -706,7 +719,8 @@ export default { |
|
|
|
const mappedData = templateData.map((item, index) => { |
|
|
|
const mappedData = templateData.map((item, index) => { |
|
|
|
// 如果模板中的字段和表格字段一致,可直接使用;否则需转换 |
|
|
|
// 如果模板中的字段和表格字段一致,可直接使用;否则需转换 |
|
|
|
return { |
|
|
|
return { |
|
|
|
id: null, // 新增时通常设为 null |
|
|
|
processInfo:{ |
|
|
|
|
|
|
|
id: null, // 新增时通常设为 null |
|
|
|
processNo: this.getProcessNo(this.form1.tableData1), // 自动生成工序号 |
|
|
|
processNo: this.getProcessNo(this.form1.tableData1), // 自动生成工序号 |
|
|
|
processCode: item.processCode || item.id, // 假设模板中有 processCode 或 id |
|
|
|
processCode: item.processCode || item.id, // 假设模板中有 processCode 或 id |
|
|
|
processName: item.processName, |
|
|
|
processName: item.processName, |
|
|
|
@ -716,6 +730,7 @@ export default { |
|
|
|
proHours: item.proHours || '', |
|
|
|
proHours: item.proHours || '', |
|
|
|
setoutHours: item.setoutHours || '', |
|
|
|
setoutHours: item.setoutHours || '', |
|
|
|
isMain: item.isMain || '0', |
|
|
|
isMain: item.isMain || '0', |
|
|
|
|
|
|
|
} |
|
|
|
// 其他字段按需补充... |
|
|
|
// 其他字段按需补充... |
|
|
|
}; |
|
|
|
}; |
|
|
|
}); |
|
|
|
}); |
|
|
|
@ -856,29 +871,23 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.activeName == '2') { |
|
|
|
if (this.activeName == '2') { |
|
|
|
this.form2.tableData2.push({ |
|
|
|
this.form2.tableData2.push({ |
|
|
|
processInfo: { |
|
|
|
_tempId: this.tempId, // 临时唯一标识 |
|
|
|
_tempId: this.tempId, // 临时唯一标识 |
|
|
|
|
|
|
|
id: null, |
|
|
|
id: null, |
|
|
|
processNo: this.getProcessNo(this.form1.tableData1), |
|
|
|
trialNo: this.getProcessNo(this.form2.tableData2), |
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.activeName == '3') { |
|
|
|
if (this.activeName == '3') { |
|
|
|
this.form3.tableData3.push({ |
|
|
|
this.form3.tableData3.push({ |
|
|
|
processInfo: { |
|
|
|
_tempId: this.tempId, // 临时唯一标识 |
|
|
|
_tempId: this.tempId, // 临时唯一标识 |
|
|
|
|
|
|
|
id: null, |
|
|
|
id: null, |
|
|
|
processNo: this.getProcessNo(this.form1.tableData1), |
|
|
|
trialNo: this.getProcessNo(this.form3.tableData3), |
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.activeName == '4') { |
|
|
|
if (this.activeName == '4') { |
|
|
|
this.form4.tableData4.push({ |
|
|
|
this.form4.tableData4.push({ |
|
|
|
processInfo: { |
|
|
|
_tempId: this.tempId, // 临时唯一标识 |
|
|
|
_tempId: this.tempId, // 临时唯一标识 |
|
|
|
|
|
|
|
id: null, |
|
|
|
id: null, |
|
|
|
processNo: this.getProcessNo(this.form1.tableData1), |
|
|
|
trialNo: this.getProcessNo(this.form4.tableData4), |
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -914,6 +923,7 @@ export default { |
|
|
|
// 调用单个 Form 的校验方法 |
|
|
|
// 调用单个 Form 的校验方法 |
|
|
|
this.$refs.tableForm1.validate((isValid, invalidFields) => { |
|
|
|
this.$refs.tableForm1.validate((isValid, invalidFields) => { |
|
|
|
if (isValid) { |
|
|
|
if (isValid) { |
|
|
|
|
|
|
|
this.craftLoading = true; |
|
|
|
this.submitData(); |
|
|
|
this.submitData(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
@ -921,6 +931,7 @@ export default { |
|
|
|
if (this.activeName == '2') { |
|
|
|
if (this.activeName == '2') { |
|
|
|
this.$refs.tableForm2.validate((isValid, invalidFields) => { |
|
|
|
this.$refs.tableForm2.validate((isValid, invalidFields) => { |
|
|
|
if (isValid) { |
|
|
|
if (isValid) { |
|
|
|
|
|
|
|
this.craftLoading = true; |
|
|
|
this.submitData(); |
|
|
|
this.submitData(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
@ -928,6 +939,7 @@ export default { |
|
|
|
if (this.activeName == '3') { |
|
|
|
if (this.activeName == '3') { |
|
|
|
this.$refs.tableForm3.validate((isValid, invalidFields) => { |
|
|
|
this.$refs.tableForm3.validate((isValid, invalidFields) => { |
|
|
|
if (isValid) { |
|
|
|
if (isValid) { |
|
|
|
|
|
|
|
this.craftLoading = true; |
|
|
|
this.submitData(); |
|
|
|
this.submitData(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
@ -935,6 +947,7 @@ export default { |
|
|
|
if (this.activeName == '4') { |
|
|
|
if (this.activeName == '4') { |
|
|
|
this.$refs.tableForm4.validate((isValid, invalidFields) => { |
|
|
|
this.$refs.tableForm4.validate((isValid, invalidFields) => { |
|
|
|
if (isValid) { |
|
|
|
if (isValid) { |
|
|
|
|
|
|
|
this.craftLoading = true; |
|
|
|
this.submitData(); |
|
|
|
this.submitData(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
@ -942,10 +955,10 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
submitData() { |
|
|
|
submitData() { |
|
|
|
let newArr = []; |
|
|
|
let newArr = []; |
|
|
|
console.log('newArr', newArr); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.treeLeave == 2) { |
|
|
|
if (this.treeLeave == 2) { |
|
|
|
this.treeNodes.processList.forEach(item => { |
|
|
|
this.form1.tableData1.forEach(item => { |
|
|
|
|
|
|
|
console.log('item4444', item); |
|
|
|
newArr.push({ |
|
|
|
newArr.push({ |
|
|
|
...item.processInfo, |
|
|
|
...item.processInfo, |
|
|
|
processProjectVOList: item.projectList || [], |
|
|
|
processProjectVOList: item.projectList || [], |
|
|
|
@ -978,6 +991,7 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
reworkAuthorizedAccomplish(query_).then(res => { |
|
|
|
reworkAuthorizedAccomplish(query_).then(res => { |
|
|
|
// this.$emit('cancel'); |
|
|
|
// this.$emit('cancel'); |
|
|
|
|
|
|
|
this.craftLoading = false; |
|
|
|
this.getDetails(); |
|
|
|
this.getDetails(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|