fix:日志数据回显

This commit is contained in:
shijing 2025-05-15 13:21:29 +08:00
parent e30f3645f8
commit 6f8d5ba993
5 changed files with 105 additions and 66 deletions

View File

@ -331,6 +331,10 @@ export default {
type: String,
default: "",
},
mlogId: {
type: String,
default: "",
},
mgroup: {
type: String,
default: "",
@ -387,7 +391,9 @@ export default {
isSaveing: false,
options: [],
testitems:[],
mlogdefect:[],
qct_defects:[],
mlogindefect:[],
qct_indefects:[],
teamOptions:[],
routeOptions: [],
@ -459,6 +465,15 @@ export default {
that.defectinform[item.defect_name] = 0;
})
that.qct_indefects=res.qct_defects;
if(that.mlogindefect.length>0){
that.qct_indefects.forEach(item => {
that.mlogindefect.forEach(item2=>{
if(item.defect==item2.defect){
that.defectinform[item.defect_name] = item2.count;
}
})
})
}
})
//material_out
that.$API.qm.qct.getQct.req({material: that.material_out,tag:'process'}).then((res) => {
@ -466,16 +481,16 @@ export default {
that.defectform[item.defect_name] = 0;
})
that.qct_defects=res.qct_defects;
if(that.mlogdefect.length>0){
that.qct_defects.forEach(item => {
that.mlogdefect.forEach(item2=>{
if(item.defect==item2.defect){
that.defectform[item.defect_name] = item2.count;
}
})
})
}
})
// if(that.mlogbItem.qct!==null){
// that.$API.qm.qct.item.req(that.mlogbItem.qct).then((res) => {
// res.qct_defects.forEach((item) => {
// that.defectform[item.defect_name] = that.defectform[item.defect_name]?that.defectform[item.defect_name]:0;
// })
// that.max_defect_rate =Number(res.max_defect_rate);
// that.qct_defects=res.qct_defects;
// })
// }
},
getEquipment() {
let that = this;
@ -494,8 +509,7 @@ export default {
that.$API.mtm.route.item.req(that.route).then(res=>{
that.material_in = res.material_in;
that.material_out = that.form.material_out = res.material_out;
that.getdefects();
that.getMlogObj();
});
},
//
@ -579,9 +593,17 @@ export default {
}
return this;
},
getMlogObj(){
let that = this;
this.$API.wpm.mlog.item.req(that.mlogId).then((res) => {
console.log("this.$API.wpm.mlog.item", res);
that.mlogindefect = res.mlogindefect;
that.mlogdefect = res.mlogdefect;
that.getdefects();
})
},
//
setData(data) {
console.log("data", data);
Object.assign(this.form, data);
},
countUseChange(){
@ -616,12 +638,6 @@ export default {
that.form.mgroup = that.mgroup;
let mlogdefect = [],mlogindefect =[];
that.qct_defects.forEach(item => {
if(that.defectinform[item.defect_name]>0){
let objin = {};
objin.defect = item.defect;
objin.count = that.defectinform[item.defect_name];
mlogindefect.push(objin);
}
if(that.defectform[item.defect_name]>0){
let obj = {};
obj.defect = item.defect;
@ -629,6 +645,15 @@ export default {
mlogdefect.push(obj)
}
})
that.qct_indefects.forEach(item => {
if(that.defectinform[item.defect_name]>0){
let objin = {};
objin.defect = item.defect;
objin.count = that.defectinform[item.defect_name];
mlogindefect.push(objin);
}
})
that.form.qct = that.qct;
that.form.mlogdefect = mlogdefect;
that.form.mlogindefect = mlogindefect;

View File

@ -120,6 +120,7 @@
<save-dialog
v-if="dialog.save"
ref="saveDialogs"
:mlogId="mlogId"
:fmlog="fmlogId"
:mgroup="mgroup"
:route="route"
@ -290,6 +291,7 @@ export default {
});
},
table_edit(row){
this.mlogId = row.id;
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialogs.open('edit').setData(row);

View File

@ -336,6 +336,7 @@
:mlog="mlogId"
:mgroup="mgroup"
:is_fix = "is_fix"
:mlogbindefect = "mlogbindefect"
:mgroupMtype="mgroupMtype"
:mgroupName = "mgroupName"
:codeText = "codeText"
@ -349,6 +350,7 @@
ref="checkDialog"
:deptId="deptId"
:mgroupMtype="mgroupMtype"
:mlogboutdefect = "mlogboutdefect"
@success="handleCheckSuccess"
@closed="dialog.check = false"
>
@ -556,6 +558,8 @@ export default {
options: [],
tableData:[],
tableData2:[],
mlogbindefect:[],
mlogboutdefect:[],
saveInDialog: false,
ticketDialog:false,
printVisible:false,
@ -728,12 +732,14 @@ export default {
});
},
table_out_check(row) {
this.dialog.check = true;
let that = this;
that.mlogboutdefect = row.mlogbdefect;
let obj = {};
Object.assign(obj, row);
obj.mgroup_name = this.mlogItem.mgroup_name;
this.$nextTick(() => {
this.$refs.checkDialog.open(obj);
obj.mgroup_name = that.mlogItem.mgroup_name;
that.$nextTick(() => {
that.dialog.check = true;
that.$refs.checkDialog.open(obj);
});
},

View File

@ -292,7 +292,11 @@ export default {
deptId:{
type: String,
default: "",
}
},
mlogboutdefect:{
type:Array,
default:()=>[]
},
},
data() {
return {
@ -306,7 +310,6 @@ export default {
count_ok_full:0,
count_notok: 0,
mlogbdefect:[],
mlogbindefect:[],
test_user_name:""
},
count_ok_b:0,
@ -377,7 +380,13 @@ export default {
let that = this;
that.visible = true;
that.mlogbItem = data;
that.count_json = []
that.form.batch = data.batch;
that.form.count_real =Number(data.count_real);
that.form.count_ok= Number(data.count_ok);
that.form.count_ok_full= Number(data.count_ok_full);
that.form.count_notok= Number(data.count_notok);
that.count_ok_b = that.form.count_ok- Number(data.count_ok_full);
that.count_json = [];
if(data.count_json_from.length>0){
data.count_json_from.forEach((item) => {
let cells = item.end-item.start+1;
@ -401,18 +410,6 @@ export default {
item.count_test = that.count_cell;
that.count_json.push(item);
})
that.form.batch = data.batch;
if(data.mlogbdefect.length>0){
that.form.test_user_name = data.test_user_name;
console.log('data.mlogbdefect有数据',data.mlogbdefect);
data.mlogbdefect.forEach((item2) => {
that.defectform[item2.defect_name] = Number(item2.count);
})
}
that.form.count_real =Number(data.count_real);
that.form.count_ok= Number(data.count_ok);
that.form.count_notok= Number(data.count_notok);
that.count_ok_b = that.form.count_ok- Number(data.count_ok_full);
//
if(that.mgroupMtype==20){
if(data.count_json_wx.ok_num&&data.count_json_wx.ok_num!==null){
@ -437,10 +434,19 @@ export default {
if(that.mlogbItem.qct!==null){
that.$API.qm.qct.item.req(that.mlogbItem.qct).then((res) => {
res.qct_defects.forEach((item) => {
that.defectform[item.defect_name] = that.defectform[item.defect_name]?that.defectform[item.defect_name]:0;
that.defectform[item.defect_name] = 0;
})
that.max_defect_rate =Number(res.max_defect_rate);
that.max_defect_rate =res.max_defect_rate?Number(res.max_defect_rate):null;
that.qct_defects=res.qct_defects;
if(that.mlogboutdefect.length>0){
that.qct_defects.forEach(item => {
that.mlogboutdefect.forEach(item2=>{
if(item.defect==item2.defect){
that.defectform[item.defect_name] = item2.count;
}
})
})
}
})
}
},

View File

@ -152,7 +152,7 @@
<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="defectinform[item.defect_name]"
v-model="defectform[item.defect_name]"
:min="0"
style="width: 100%"
controls-position="right"
@ -209,7 +209,11 @@ export default {
mgroupMtype:{
type: String,
default: "",
}
},
mlogbindefect:{
type:Array,
default:()=>[]
},
},
emits: ["success", "closed"],
data() {
@ -248,7 +252,7 @@ export default {
cellsList:[],
qct_defects:[],
materialOptions: [],
defectinform:{},
defectform:{},
visible: false,
isSaveing: false,
setFiltersVisible: false,
@ -321,24 +325,20 @@ export default {
},
getdefects(){
let that = this;
that.$API.qm.qct.list.req({qctmat__material:that.materialIn,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.defectinform[item.defect_name] = 0;
that.$API.qm.qct.getQct.req({material: that.materialIn,tag:'process'}).then((res) => {
res.qct_defects.forEach((item) => {
that.defectform[item.defect_name] = 0;
})
that.qct_defects=res.qct_defects;
let count_pn_jgqbl = 0;
if(data.mlogbindefect.length>0){
that.qct_defects.forEach(item => {
data.mlogbindefect.forEach(item2=>{
if(item.defect==item2.defect){
count_pn_jgqbl+=item2.count;
that.defectform[item.defect_name] = item2.count;
}
})
that.qct_defects=res.qct_defects;
let count_pn_jgqbl = 0;
if(data.mlogbindefect.length>0){
that.qct_defects.forEach(item => {
data.mlogbindefect.forEach(item2=>{
if(item.defect==item2.defect){
count_pn_jgqbl+=item2.count;
that.defectinform[item.defect_name] = item2.count;
}
})
})
}
})
}
})
@ -402,7 +402,7 @@ export default {
that.form.count_pn_jgqbl = 0;
that.qct_defects.forEach(item => {
if(item.defect_okcate==30){
that.form.count_pn_jgqbl += that.defectinform[item.defect_name];
that.form.count_pn_jgqbl += that.defectform[item.defect_name];
}
})
that.countCellChanges();
@ -417,17 +417,17 @@ export default {
if(that.mgroupMtype==10&&that.cellsList.length>0){
that.form.count_json_from = that.cellsList;
}
let count_pn_jgqbl = 0,mlogbindefect=[];
let count_pn_jgqbl = 0,mlogbdefect=[];
that.qct_defects.forEach(item => {
if(that.defectinform[item.defect_name]>0){
count_pn_jgqbl += that.defectinform[item.defect_name] ;
if(that.defectform[item.defect_name]>0){
count_pn_jgqbl += that.defectform[item.defect_name] ;
let obj = {};
obj.defect = item.defect;
obj.count = that.defectinform[item.defect_name];
mlogbindefect.push(obj);
obj.count = that.defectform[item.defect_name];
mlogbdefect.push(obj);
}
})
that.form.mlogbindefect = mlogbindefect;
that.form.mlogbdefect = mlogbdefect;
that.form.count_pn_jgqbl = count_pn_jgqbl;
that.$API.wpm.mlogb.in.req(that.form).then((res) => {
that.isSaveing = false;