fix:日志物料根据route的material_in筛选
This commit is contained in:
parent
41db9a55f1
commit
2f2928fcb0
|
|
@ -450,15 +450,18 @@ export default {
|
|||
that.getRoute();
|
||||
that.gettestitem();
|
||||
that.form.fmlog = that.fmlog;
|
||||
// that.form.handle_date = that.$TOOL.dateFormat2(new Date());
|
||||
that.form.work_start_time = that.$TOOL.dateFormat(new Date());
|
||||
if(that.is_fix){
|
||||
that.getMaterial();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeRoute(){
|
||||
let that = this;
|
||||
that.routeOptions.forEach(item=>{
|
||||
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);
|
||||
}
|
||||
})
|
||||
|
|
@ -511,9 +514,7 @@ export default {
|
|||
},
|
||||
getdefects(route,material_in,material_out){
|
||||
let that = this;
|
||||
console.log('getdefects')
|
||||
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) => {
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.defectform[item.defect_name] = 0;
|
||||
|
|
@ -530,10 +531,7 @@ export default {
|
|||
}
|
||||
})
|
||||
}else{
|
||||
console.log('route',route)
|
||||
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) => {
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.defectinform[item.defect_name] = 0;
|
||||
|
|
@ -591,6 +589,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.getMaterial();
|
||||
if(that.mlogId){
|
||||
that.getMlogObj();
|
||||
}
|
||||
|
|
@ -637,8 +636,9 @@ export default {
|
|||
}else{
|
||||
params.tag = 'todo';
|
||||
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.materialOptions = res;
|
||||
if(that.codeText!==''){
|
||||
|
|
@ -679,19 +679,13 @@ export default {
|
|||
let id = codeText.split('#')[1];
|
||||
that.$API.cm.labelmat.item.req(id).then((res) => {
|
||||
that.codeBatch = res.batch;
|
||||
that.getMaterial();
|
||||
}).catch((err) => {
|
||||
that.getMaterial();
|
||||
})
|
||||
}else{
|
||||
that.getMaterial();
|
||||
}).catch((err) => {})
|
||||
}
|
||||
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(that.route,that.material_in,that.material_out);
|
||||
|
|
@ -703,7 +697,6 @@ export default {
|
|||
},
|
||||
handleUsersChange(){
|
||||
this.form.handle_user = this.form.handle_users.length>0?this.form.handle_users[0]:null;
|
||||
console.log('handleUsersChange',this.form.handle_users)
|
||||
},
|
||||
countUseChange(){
|
||||
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_ok = that.form.count_real - that.form.count_notok;
|
||||
|
||||
},
|
||||
//表单提交方法
|
||||
submit() {
|
||||
|
|
@ -752,7 +744,6 @@ export default {
|
|||
mlogindefect.push(objin);
|
||||
}
|
||||
})
|
||||
|
||||
that.form.qct = that.qct;
|
||||
that.form.mlogdefect = mlogdefect;
|
||||
that.form.mlogindefect = mlogindefect;
|
||||
|
|
|
|||
Loading…
Reference in New Issue