fix:加工前不良关联检验表

This commit is contained in:
shijing 2025-03-11 17:12:08 +08:00
parent 9b6e9cc438
commit f890ca086d
1 changed files with 55 additions and 3 deletions

View File

@ -171,6 +171,17 @@
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-for="item in qct_defects" :key="item.id">
<el-form-item :label="item.defect_name">
<el-input-number
v-model="defectform[item.defect_name]"
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
@ -209,7 +220,12 @@
</el-descriptions>
</div>
<div style="padding-left: 50px" v-else>
<el-descriptions :column="4">
<el-descriptions :column="4" v-if="props.row.mlogbdefect.length>0">
<el-descriptions-item v-for="item in props.row.mlogbdefect" :label="item.defect_name" :key="item.id">
{{item.count}}
</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="4" v-else>
<el-descriptions-item label="划伤">{{
props.row.count_n_hs
}}</el-descriptions-item>
@ -494,7 +510,9 @@ export default {
4: "已完成",
5: "已关闭",
},
defectform:{},
fileList:[],
qct_defects:[],
tableDataWm:[],
test_file:'',
deptId: "",
@ -563,7 +581,30 @@ export default {
})
});
},
getdefects(){
let that = this;
that.$API.qm.qct.list.req({qctmat__material:that.mlogItem.material_in,page:0,tags:'process'}).then((res) => {
if(res.length>0){
that.$API.qm.qct.item.req(res[0].id).then((res) => {
res.qct_defects.forEach((item) => {
that.defectform[item.defect_name] = 0;
})
that.qct_defects=res.qct_defects;
})
}
})
},
countChange() {
let that = this;
that.saveInForm.count_pn_jgqbl = 0;
that.qct_defects.forEach(item => {
if(item.defect_okcate==30){
that.saveInForm.count_pn_jgqbl += that.defectform[item.defect_name];
}
})
},
//
setData(data) {
Object.assign(this.form, data);
@ -588,6 +629,7 @@ export default {
//
table_in_edit(row) {
this.saveInForm = row;
this.getdefects();
this.saveInDialog = true;
},
//
@ -597,8 +639,18 @@ export default {
if (valid) {
that.isSaveing = true;
let obj = {};
let count_pn_jgqbl = 0,mlogbdefect=[];
that.qct_defects.forEach(item => {
count_pn_jgqbl += that.defectform[item.defect_name] ;
let obj = {};
obj.defect = item.defect;
obj.count = that.defectform[item.defect_name];
obj.mlogb = that.saveInForm.id;
mlogbdefect.push(obj);
})
obj.count_use = that.saveInForm.count_use;
obj.count_pn_jgqbl = that.saveInForm.count_pn_jgqbl;
obj.mlogbdefect = mlogbdefect;
obj.count_pn_jgqbl = count_pn_jgqbl;
that.$API.wpm.mlogb.updateIn
.req(that.saveInForm.id, obj)
.then((res) => {