fix:玻纤日志输入物料去掉默认主要批次

This commit is contained in:
shijing 2025-03-13 16:34:52 +08:00
parent e4184d3849
commit 1ac73237f9
1 changed files with 24 additions and 5 deletions

View File

@ -699,10 +699,14 @@ export default {
if(data.indexOf('#')>-1){
let id = data.split('#')[1];
this.$API.cm.labelmat.item.req(id).then((res) => {
let arr = that.form.handoverb.filter((item) => {
return item.batch == res.batch&&item.state==res.state;
})
let arr = [];
if(that.form.handoverb&&that.form.handoverb.length>0){
arr = that.form.handoverb.filter((item) => {
return item.batch == res.batch&&item.state==res.state;
})
}
if(arr.length>0){
that.wm_in = "";
that.$message.error("该批次已存在")
}else{
that.materialOptions.forEach((item) => {
@ -727,14 +731,22 @@ export default {
handoverbw.push(obj1);
})
obj.handoverbw = handoverbw;
that.form.handoverb.push(obj);
if(that.form.handoverb&&that.form.handoverb.length>0){
that.form.handoverb.push(obj);
}else{
that.form.handoverb = [];
that.form.handoverb.push(obj);
}
that.wm_in = "";
})
}else{
that.$message.error("该批次不存在")
that.wm_in = "";
}
})
}
})
}else{//wprnumber
debugger;
that.$API.wpm.wpr.list.req({number:data,page:0}).then((res) => {
if(res.length>0){
let indexs = 0,arr =[];
@ -753,6 +765,7 @@ export default {
return item1.wpr == res[0].id;
})
if(arr1.length>0){
that.wm_in = "";
that.$message.error("该物料已存在");
}else{
let obj1 = {};
@ -760,6 +773,7 @@ export default {
obj1.number = res[0].number;
that.form.handoverb[indexs].count+=1;
that.form.handoverb[indexs].handoverbw.push(obj1);
that.wm_in = "";
}
}else{
that.form.handoverb[indexs].handoverbw = [];
@ -768,6 +782,7 @@ export default {
obj1.number = res[0].number;
that.form.handoverb[indexs].count=1;
that.form.handoverb[indexs].handoverbw.push(obj1);
that.wm_in = "";
}
}else{//handoverb
console.log('handoverb里没有有这个物料批次');
@ -792,7 +807,11 @@ export default {
that.form.handoverb.push(obj2);
}
})
that.wm_in = "";
}
}else{
that.wm_in = "";
that.$message.error("该批次不存在")
}
})
}