fix:交接记录可以更改批次号,以及解决扫码重复的情况

This commit is contained in:
shijing 2025-01-17 09:12:23 +08:00
parent d3db926789
commit c99e2c8d1b
1 changed files with 28 additions and 10 deletions

View File

@ -113,6 +113,16 @@
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="更改批次">
<el-switch v-model="change_batch"></el-switch>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="change_batch">
<el-form-item label="新批次号">
<el-input v-model="form.new_batch" placeholder="新批次号"></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="处理备注">
<el-input v-model="form.note" placeholder="处理备注"></el-input>
@ -182,7 +192,7 @@
v-model="listItem.count"
controls-position="right"
:min="0"
step="1"
:step="1"
:max="listItem.count_cando"
:disabled="mode==='show'"
:step-strictly="true"
@ -258,6 +268,7 @@ export default {
recive_user: null,
recive_mgroup: null,
handoverb:[],
new_batch:''
},
rules: {
batch: [
@ -321,6 +332,7 @@ export default {
bwVisible:false,
scanVisible:false,
isSaveing: false,
change_batch:false,
setFiltersVisible: false,
};
},
@ -364,7 +376,6 @@ export default {
},
showbw(index){
this.bwIndex = index;
console.log('this.form.handoverb[index].handoverbw',this.form.handoverb[index].handoverbw);
this.bwVisible = true;
},
bwVisibleClose(){
@ -390,6 +401,10 @@ export default {
}
})
that.getCkUserList();//
}else if(that.type==30){
this.getUserList3();
}else{
this.getUserList2();
}
});
},
@ -563,6 +578,9 @@ export default {
}else{
this.getUserList2();
}
if(data.new_batch!==''&&data.new_batch!==undefined&&data.new_batch!==null){
this.change_batch = true;
}
},
//
setFilters(filters) {
@ -592,20 +610,21 @@ export default {
//handoverb
if(arr.length>0){
//wprwpr
if(arr[0].handoverbw&&arr[0].handoverbw.length>0){
if(that.form.handoverb[0].handoverbw&&that.form.handoverb[0].handoverbw.length>0){
let arr1 = [];
arr1 = arr[0].handoverbw.filter((item1) => {
item1.wpr = item1.id;
arr1 = that.form.handoverb[0].handoverbw.filter((item1) => {
return item1.wpr == res.id;
})
if(arr1.length>0){
that.$message.error("该物料已存在");
// console.log('0',that.form);
}else{
let obj1 = {};
obj1.wpr = res.id;
obj1.number = res.number;
that.form.handoverb[indexs].count+=1;
that.form.handoverb[indexs].handoverbw.push(obj1);
console.log('1',that.form);
// console.log('1',that.form);
}
}else{
that.form.handoverb[indexs].handoverbw = [];
@ -614,11 +633,10 @@ export default {
obj1.number = res.number;
that.form.handoverb[indexs].count=1;
that.form.handoverb[indexs].handoverbw.push(obj1);
console.log('2',that.form);
// console.log('2',that.form);
}
}else{//handoverb
that.materialOptions.forEach((item) => {
console.log('item.id',item.id);
if(item.id == res.wm){
let obj2 = {};
obj2.wm = item.id;
@ -631,7 +649,7 @@ export default {
obj3.number = res.number;
obj2.handoverbw.push(obj3);
that.form.handoverb.push(obj2);
console.log('3',that.form);
// console.log('3',that.form);
}
})
}
@ -653,7 +671,7 @@ export default {
obj.count_cando = item.count;
obj.count = item.count;
that.form.handoverb.push(obj);
console.log('4',that.form);
// console.log('4',that.form);
}
})
}