fix:玻纤输入物料扫码优化(批次也用batch情况)
This commit is contained in:
parent
94a15d41ed
commit
f0b31ffadf
|
|
@ -231,40 +231,56 @@ export default {
|
||||||
that.$message.error("批次号不存在");
|
that.$message.error("批次号不存在");
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
that.$API.wpm.wpr.list.req({number:code,page:0}).then((res) => {
|
if(that.tracking==10){//批次
|
||||||
if(res.length>0){
|
arr = that.materialOptions.filter((item) => {
|
||||||
let bwitem = {};
|
return item.batch == code;
|
||||||
bwitem.mlogb="";
|
})
|
||||||
bwitem.number=res[0].number;
|
if (arr.length > 0) {
|
||||||
bwitem.wpr=res[0].id;
|
that.form.batch = arr[0].batch;
|
||||||
let arr = that.materialOptions.filter((item) => {
|
that.form.wm_in = arr[0].id;
|
||||||
return item.id == res[0].wm;
|
that.form.count_use = arr[0].count;
|
||||||
})
|
that.wm_in = arr[0].batch;
|
||||||
if(arr.length>0){ //车间存在该批次
|
}else{
|
||||||
let batch = arr[0].batch;
|
that.wm_in = '';
|
||||||
that.wm_in = arr[0].batch;
|
that.$message.error("批次号不存在");
|
||||||
that.mlogbInCount = arr[0].count;//该批次数量
|
|
||||||
//判断日志中是否存在该批次
|
|
||||||
let arr0= that.mlogbIns.filter((item)=>{
|
|
||||||
return item.batch == batch;
|
|
||||||
})
|
|
||||||
if (arr0.length > 0) {
|
|
||||||
that.hasMlogbIn = true;
|
|
||||||
that.form.count_use = 1;
|
|
||||||
bwitem.mlogb = arr0[0].id;
|
|
||||||
}else{
|
|
||||||
that.form.batch = arr[0].batch;
|
|
||||||
that.form.wm_in = arr[0].id;
|
|
||||||
that.form.count_use = 1;
|
|
||||||
that.wm_in = arr[0].batch;
|
|
||||||
}
|
|
||||||
that.bwItemForm = bwitem;
|
|
||||||
}else{
|
|
||||||
that.wm_in = '';
|
|
||||||
that.$message.error("批次号不存在");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
}else{//单件
|
||||||
|
that.$API.wpm.wpr.list.req({number:code,page:0}).then((res) => {
|
||||||
|
if(res.length>0){
|
||||||
|
let bwitem = {};
|
||||||
|
bwitem.mlogb="";
|
||||||
|
bwitem.number=res[0].number;
|
||||||
|
bwitem.wpr=res[0].id;
|
||||||
|
let arr = that.materialOptions.filter((item) => {
|
||||||
|
return item.id == res[0].wm;
|
||||||
|
})
|
||||||
|
if(arr.length>0){ //车间存在该批次
|
||||||
|
let batch = arr[0].batch;
|
||||||
|
that.wm_in = arr[0].batch;
|
||||||
|
that.mlogbInCount = arr[0].count;//该批次数量
|
||||||
|
//判断日志中是否存在该批次
|
||||||
|
let arr0= that.mlogbIns.filter((item)=>{
|
||||||
|
return item.batch == batch;
|
||||||
|
})
|
||||||
|
if (arr0.length > 0) {
|
||||||
|
that.hasMlogbIn = true;
|
||||||
|
that.form.count_use = 1;
|
||||||
|
bwitem.mlogb = arr0[0].id;
|
||||||
|
}else{
|
||||||
|
that.form.batch = arr[0].batch;
|
||||||
|
that.form.wm_in = arr[0].id;
|
||||||
|
that.form.count_use = 1;
|
||||||
|
that.wm_in = arr[0].batch;
|
||||||
|
}
|
||||||
|
that.bwItemForm = bwitem;
|
||||||
|
}else{
|
||||||
|
that.wm_in = '';
|
||||||
|
that.$message.error("批次号不存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue