fix:玻纤日志输入物料去掉默认主要批次
This commit is contained in:
parent
e4184d3849
commit
1ac73237f9
|
|
@ -699,10 +699,14 @@ export default {
|
||||||
if(data.indexOf('#')>-1){
|
if(data.indexOf('#')>-1){
|
||||||
let id = data.split('#')[1];
|
let id = data.split('#')[1];
|
||||||
this.$API.cm.labelmat.item.req(id).then((res) => {
|
this.$API.cm.labelmat.item.req(id).then((res) => {
|
||||||
let arr = that.form.handoverb.filter((item) => {
|
let arr = [];
|
||||||
return item.batch == res.batch&&item.state==res.state;
|
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){
|
if(arr.length>0){
|
||||||
|
that.wm_in = "";
|
||||||
that.$message.error("该批次已存在")
|
that.$message.error("该批次已存在")
|
||||||
}else{
|
}else{
|
||||||
that.materialOptions.forEach((item) => {
|
that.materialOptions.forEach((item) => {
|
||||||
|
|
@ -727,14 +731,22 @@ export default {
|
||||||
handoverbw.push(obj1);
|
handoverbw.push(obj1);
|
||||||
})
|
})
|
||||||
obj.handoverbw = handoverbw;
|
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{//wpr的number
|
}else{//wpr的number
|
||||||
debugger;
|
|
||||||
that.$API.wpm.wpr.list.req({number:data,page:0}).then((res) => {
|
that.$API.wpm.wpr.list.req({number:data,page:0}).then((res) => {
|
||||||
if(res.length>0){
|
if(res.length>0){
|
||||||
let indexs = 0,arr =[];
|
let indexs = 0,arr =[];
|
||||||
|
|
@ -753,6 +765,7 @@ export default {
|
||||||
return item1.wpr == res[0].id;
|
return item1.wpr == res[0].id;
|
||||||
})
|
})
|
||||||
if(arr1.length>0){
|
if(arr1.length>0){
|
||||||
|
that.wm_in = "";
|
||||||
that.$message.error("该物料已存在");
|
that.$message.error("该物料已存在");
|
||||||
}else{
|
}else{
|
||||||
let obj1 = {};
|
let obj1 = {};
|
||||||
|
|
@ -760,6 +773,7 @@ export default {
|
||||||
obj1.number = res[0].number;
|
obj1.number = res[0].number;
|
||||||
that.form.handoverb[indexs].count+=1;
|
that.form.handoverb[indexs].count+=1;
|
||||||
that.form.handoverb[indexs].handoverbw.push(obj1);
|
that.form.handoverb[indexs].handoverbw.push(obj1);
|
||||||
|
that.wm_in = "";
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
that.form.handoverb[indexs].handoverbw = [];
|
that.form.handoverb[indexs].handoverbw = [];
|
||||||
|
|
@ -768,6 +782,7 @@ export default {
|
||||||
obj1.number = res[0].number;
|
obj1.number = res[0].number;
|
||||||
that.form.handoverb[indexs].count=1;
|
that.form.handoverb[indexs].count=1;
|
||||||
that.form.handoverb[indexs].handoverbw.push(obj1);
|
that.form.handoverb[indexs].handoverbw.push(obj1);
|
||||||
|
that.wm_in = "";
|
||||||
}
|
}
|
||||||
}else{//handoverb里没有有这个物料批次
|
}else{//handoverb里没有有这个物料批次
|
||||||
console.log('handoverb里没有有这个物料批次');
|
console.log('handoverb里没有有这个物料批次');
|
||||||
|
|
@ -792,7 +807,11 @@ export default {
|
||||||
that.form.handoverb.push(obj2);
|
that.form.handoverb.push(obj2);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
that.wm_in = "";
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
that.wm_in = "";
|
||||||
|
that.$message.error("该批次不存在")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue