fix:日志物料根据route的material_in筛选

This commit is contained in:
shijing 2026-02-10 13:51:44 +08:00
parent 41db9a55f1
commit 2f2928fcb0
1 changed files with 9 additions and 18 deletions

View File

@ -450,15 +450,18 @@ export default {
that.getRoute(); that.getRoute();
that.gettestitem(); that.gettestitem();
that.form.fmlog = that.fmlog; that.form.fmlog = that.fmlog;
// that.form.handle_date = that.$TOOL.dateFormat2(new Date());
that.form.work_start_time = that.$TOOL.dateFormat(new Date()); that.form.work_start_time = that.$TOOL.dateFormat(new Date());
if(that.is_fix){
that.getMaterial();
}
}, },
methods: { methods: {
changeRoute(){ changeRoute(){
let that = this; let that = this;
that.routeOptions.forEach(item=>{ that.routeOptions.forEach(item=>{
if(item.id==that.form.route){ if(item.id==that.form.route){
console.log('item',item) that.material_in = item.material_in;
that.getMaterial();
that.getdefects(item.id,item.material_in,item.material_out); that.getdefects(item.id,item.material_in,item.material_out);
} }
}) })
@ -511,9 +514,7 @@ export default {
}, },
getdefects(route,material_in,material_out){ getdefects(route,material_in,material_out){
let that = this; let that = this;
console.log('getdefects')
if(that.is_fix&&that.materialFix!==null&&that.materialFix!==''){ if(that.is_fix&&that.materialFix!==null&&that.materialFix!==''){
console.log('that.materialFix',that.materialFix)
that.$API.qm.qct.getQct.req({material: that.materialFix,tag:'process'}).then((res) => { that.$API.qm.qct.getQct.req({material: that.materialFix,tag:'process'}).then((res) => {
res.qct_defects.forEach((item) => { res.qct_defects.forEach((item) => {
that.defectform[item.defect_name] = 0; that.defectform[item.defect_name] = 0;
@ -530,10 +531,7 @@ export default {
} }
}) })
}else{ }else{
console.log('route',route)
if(route!==null){ if(route!==null){
console.log('material_in',material_in)
console.log('material_out',material_out)
that.$API.qm.qct.getQct.req({material:material_in,tag:'process'}).then((res) => { that.$API.qm.qct.getQct.req({material:material_in,tag:'process'}).then((res) => {
res.qct_defects.forEach((item) => { res.qct_defects.forEach((item) => {
that.defectinform[item.defect_name] = 0; that.defectinform[item.defect_name] = 0;
@ -591,6 +589,7 @@ export default {
that.$API.mtm.route.item.req(that.route).then(res=>{ that.$API.mtm.route.item.req(that.route).then(res=>{
that.material_in = res.material_in; that.material_in = res.material_in;
that.material_out = that.form.material_out = res.material_out; that.material_out = that.form.material_out = res.material_out;
that.getMaterial();
if(that.mlogId){ if(that.mlogId){
that.getMlogObj(); that.getMlogObj();
} }
@ -637,8 +636,9 @@ export default {
}else{ }else{
params.tag = 'todo'; params.tag = 'todo';
params.state = 10;// params.state = 10;//
params.material = that.material_in; params.material = that.material_in!==''?that.material_in:'';
} }
console.log('that.material_in:',that.material_in);
that.$API.wpm.wmaterial.list.req(params).then((res) => { that.$API.wpm.wmaterial.list.req(params).then((res) => {
that.materialOptions = res; that.materialOptions = res;
if(that.codeText!==''){ if(that.codeText!==''){
@ -679,19 +679,13 @@ export default {
let id = codeText.split('#')[1]; let id = codeText.split('#')[1];
that.$API.cm.labelmat.item.req(id).then((res) => { that.$API.cm.labelmat.item.req(id).then((res) => {
that.codeBatch = res.batch; that.codeBatch = res.batch;
that.getMaterial(); }).catch((err) => {})
}).catch((err) => {
that.getMaterial();
})
}else{
that.getMaterial();
} }
return this; return this;
}, },
getMlogObj(){ getMlogObj(){
let that = this; let that = this;
this.$API.wpm.mlog.item.req(that.mlogId).then((res) => { this.$API.wpm.mlog.item.req(that.mlogId).then((res) => {
console.log("this.$API.wpm.mlog.item", res);
that.mlogindefect = res.mlogindefect; that.mlogindefect = res.mlogindefect;
that.mlogdefect = res.mlogdefect; that.mlogdefect = res.mlogdefect;
that.getdefects(that.route,that.material_in,that.material_out); that.getdefects(that.route,that.material_in,that.material_out);
@ -703,7 +697,6 @@ export default {
}, },
handleUsersChange(){ handleUsersChange(){
this.form.handle_user = this.form.handle_users.length>0?this.form.handle_users[0]:null; this.form.handle_user = this.form.handle_users.length>0?this.form.handle_users[0]:null;
console.log('handleUsersChange',this.form.handle_users)
}, },
countUseChange(){ countUseChange(){
let that = this; let that = this;
@ -726,7 +719,6 @@ export default {
}) })
that.form.count_real = that.form.count_use - that.form.count_pn_jgqbl; that.form.count_real = that.form.count_use - that.form.count_pn_jgqbl;
that.form.count_ok = that.form.count_real - that.form.count_notok; that.form.count_ok = that.form.count_real - that.form.count_notok;
}, },
// //
submit() { submit() {
@ -752,7 +744,6 @@ export default {
mlogindefect.push(objin); mlogindefect.push(objin);
} }
}) })
that.form.qct = that.qct; that.form.qct = that.qct;
that.form.mlogdefect = mlogdefect; that.form.mlogdefect = mlogdefect;
that.form.mlogindefect = mlogindefect; that.form.mlogindefect = mlogindefect;