-
{{ item2.number }}
-
+
+
+ {{ item2.number }}
+
+
+
+ {{ item2.number }}
+
-
+
@@ -232,25 +237,27 @@ export default {
if(arrs.length>1){
that.form.handoverb[index].wpr = '';
arrs.forEach(arr=>{
- that.wprOptions.forEach(item=>{
+ let obj = {};
+ obj.number = arr;
+ let options = that.wprOptions.filter(item=>{return item.number.indexOf(arr) > -1&&!item.disabled});
+ if(options.length>0){
+ obj.wpr = options[0].id;
+ barchArrs.push(arr);
+ }
+ that.form.handoverb[index].handoverbw.push(obj);
+ that.wprOptions.forEach(item=>{
if(item.number.indexOf(arr) > -1&&!item.disabled){
item.disabled = true;
- let obj = {};
- obj.number = item.number;
- obj.wpr = item.id;
- barchArrs.push(arr);
- that.form.handoverb[index].handoverbw.push(obj);
- that.form.handoverb[index].count = that.form.handoverb[index].handoverbw.length;
}
})
+
})
+ that.form.handoverb[index].count = barchArrs.length;
//如果arrs里有不是这个批次的wpr,提示错误
let diff = arrs.filter(item => !barchArrs.includes(item));
that.diff = diff;
- console.log('diff',diff)
if(diff.length>0){
that.$message.warning("物料"+diff.join(",")+"不在该批次中");
- // that.$confirm("物料"+diff.join(",")+"不在该批次中", "提示", {type: "warning",}).then(() => {});
}
}else{
//放入对应的行中的handoverb中,并且在列表中disabled
@@ -332,6 +339,7 @@ export default {
let total = 0;
if(this.form.handoverb.length>0){
this.form.handoverb.forEach(item=>{
+ item.handoverbw = item.handoverbw.filter(item=>{ return item.wpr&&item.wpr!==''&&item.wpr!==null&&item.wpr!==undefined})
total += item.count;
})
}