返工任务处理逻辑调整

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"> <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();
}); });
}, },

Loading…
Cancel
Save