返工任务处理逻辑调整

dev-scheduling
zhangdi 3 months ago
parent 22065affb2
commit 3566b82898
  1. 70
      src/views/processManagement/components/processMainte/reworkProcessPlanning.vue

@ -22,7 +22,7 @@
<div class="table-btn-left">
<el-button type="primary" plain @click="addTable()">插入一行</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 class="table-btn-right" v-if="activeName == '1'">
@ -31,7 +31,7 @@
<el-button type="primary" @change="reworkNoNumSave()">保存</el-button> -->
<el-input placeholder="请输入内容" v-model="reworkNoNum">
<template #append>
<el-button :icon="Search" @click="reworkNoNumSave()">保存</el-button>
<el-button @click="reworkNoNumSave()">保存</el-button>
</template>
</el-input>
</div>
@ -202,7 +202,7 @@
<el-table-column prop="ocId" label="外协厂商">
<template #default="scope">
<el-input
v-model="scope.row.ocId"
v-model="scope.row.processInfo.ocId"
placeholder="请输入"
style="width: 100%"
></el-input>
@ -263,14 +263,15 @@
</template>
<template #default="scope">
<el-form-item
:prop="`tableData2[${scope.$index}].projectName`"
:rules="formRules2.projectName"
:prop="`tableData2[${scope.$index}].projecCode`"
:rules="formRules2.projecCode"
>
<el-select
v-model="scope.row.projectName"
v-model="scope.row.projecCode"
placeholder="请选择"
clearable
filterable
@change="projectChange(scope.row, scope.$index)"
>
<el-option
v-for="(item, index) in projectOptions"
@ -295,6 +296,7 @@
placeholder="请选择"
clearable
filterable
@change="standardChange(scope.row, scope.$index)"
>
<el-option
v-for="(item, index) in standardList"
@ -314,7 +316,7 @@
></el-input>
</template>
</el-table-column> -->
<el-table-column prop="proHours" label="定额工时(分钟)">
<el-table-column prop="proHours" label="定额工时(分钟)">
<template #header>
<span><i style="color: red">*</i>定额工时(分钟)</span>
</template>
@ -382,11 +384,11 @@
</template>
<template #default="scope">
<el-form-item :prop="`tableData3[${scope.$index}].tool`" :rules="formRules3.tool">
<el-input
v-model="scope.row.tool"
placeholder="请输入"
style="width: 100%"
></el-input>
<el-input
v-model="scope.row.tool"
placeholder="请输入"
style="width: 100%"
></el-input>
<!-- <el-select v-model="scope.row.tool" placeholder="请选择" clearable filterable>
<el-option label="是" value="1"></el-option>
<el-option label="否" value="2"></el-option>
@ -530,6 +532,7 @@ export default {
},
data() {
return {
craftLoading: false,
processLevel: null,
data: [],
defaultProps: {
@ -611,7 +614,7 @@ export default {
},
formRules2: {
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'] }],
proHours: [{ required: true, message: '请输入', trigger: ['change', 'submit'] }],
},
@ -649,6 +652,16 @@ export default {
// 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().then(res => {
this.standardList = res.data.data;
@ -706,7 +719,8 @@ export default {
const mappedData = templateData.map((item, index) => {
// 使
return {
id: null, // null
processInfo:{
id: null, // null
processNo: this.getProcessNo(this.form1.tableData1), //
processCode: item.processCode || item.id, // processCode id
processName: item.processName,
@ -716,6 +730,7 @@ export default {
proHours: item.proHours || '',
setoutHours: item.setoutHours || '',
isMain: item.isMain || '0',
}
// ...
};
});
@ -856,29 +871,23 @@ export default {
}
if (this.activeName == '2') {
this.form2.tableData2.push({
processInfo: {
_tempId: this.tempId, //
_tempId: this.tempId, //
id: null,
processNo: this.getProcessNo(this.form1.tableData1),
},
trialNo: this.getProcessNo(this.form2.tableData2),
});
}
if (this.activeName == '3') {
this.form3.tableData3.push({
processInfo: {
_tempId: this.tempId, //
_tempId: this.tempId, //
id: null,
processNo: this.getProcessNo(this.form1.tableData1),
},
trialNo: this.getProcessNo(this.form3.tableData3),
});
}
if (this.activeName == '4') {
this.form4.tableData4.push({
processInfo: {
_tempId: this.tempId, //
_tempId: this.tempId, //
id: null,
processNo: this.getProcessNo(this.form1.tableData1),
},
trialNo: this.getProcessNo(this.form4.tableData4),
});
}
},
@ -914,6 +923,7 @@ export default {
// Form
this.$refs.tableForm1.validate((isValid, invalidFields) => {
if (isValid) {
this.craftLoading = true;
this.submitData();
}
});
@ -921,6 +931,7 @@ export default {
if (this.activeName == '2') {
this.$refs.tableForm2.validate((isValid, invalidFields) => {
if (isValid) {
this.craftLoading = true;
this.submitData();
}
});
@ -928,6 +939,7 @@ export default {
if (this.activeName == '3') {
this.$refs.tableForm3.validate((isValid, invalidFields) => {
if (isValid) {
this.craftLoading = true;
this.submitData();
}
});
@ -935,6 +947,7 @@ export default {
if (this.activeName == '4') {
this.$refs.tableForm4.validate((isValid, invalidFields) => {
if (isValid) {
this.craftLoading = true;
this.submitData();
}
});
@ -942,10 +955,10 @@ export default {
},
submitData() {
let newArr = [];
console.log('newArr', newArr);
if (this.treeLeave == 2) {
this.treeNodes.processList.forEach(item => {
this.form1.tableData1.forEach(item => {
console.log('item4444', item);
newArr.push({
...item.processInfo,
processProjectVOList: item.projectList || [],
@ -978,6 +991,7 @@ export default {
};
reworkAuthorizedAccomplish(query_).then(res => {
// this.$emit('cancel');
this.craftLoading = false;
this.getDetails();
});
},

Loading…
Cancel
Save