fix:扫描物料识别修改

This commit is contained in:
shijing 2025-11-11 09:34:09 +08:00
parent 7d9f86a8ab
commit 41929415aa
1 changed files with 8 additions and 7 deletions

View File

@ -592,6 +592,7 @@ export default {
},
materialChange() {
let that = this;
that.form.new_batch = "";
let totalCount = 0,data = [];
if(that.selectItems.length>0){
data = that.materialOptions.filter((item) => {
@ -630,7 +631,6 @@ export default {
that.form.handoverb = data;
},
getWprList(id,index){
console.log('id',id,'index',index);
let that = this;
let handoverbw = [];
that.$API.wpm.wpr.list.req({wm:id,page:0,can_use:'yes'}).then((res) => {
@ -713,7 +713,6 @@ export default {
//
setData(data) {
let that = this;
console.log('交接记录查看',data)
this.totalCount = data.count?data.count:data.handoverb.count;
Object.assign(this.form, data);
this.$API.system.user.list.req({ depts: data.send_dept, page: 0 }).then((res) => {
@ -823,6 +822,7 @@ export default {
return item.batch == data;
})
if(arr.length>0){//
console.log('批次处理');
let arr2 = [];
if(that.form.handoverb&&that.form.handoverb.length>0){
arr2 = that.form.handoverb.filter((item) => {
@ -833,7 +833,7 @@ export default {
that.$message.error("该批次已存在")
}else{
if(that.type==50){
that.form.new_batch = data[0].batch+'-G';
that.form.new_batch = arr[0].batch+'-G';
}
let params = {material: arr[0].material,type: that.type};
that.$API.wpm.handover.mgroups.req(params).then((res0) => {
@ -850,19 +850,20 @@ export default {
that.form.handoverb.push(obj2);
}
}else{//
console.log('单件处理');
let res = await that.$API.wpm.wpr.list.req({number:data,page:0});
if(res.length>0){
let indexs = 0,arr =[];
let indexs = 0,arrs =[];
if( that.form.handoverb&&that.form.handoverb.length>0){
that.form.handoverb.forEach((item,index) => {
if(item.wm == res[0].wm){
indexs = index;
arr.push(item);
arrs.push(item);
}
})
}
//handoverb
if(arr.length>0){
if(arrs.length>0){
//wprwpr
if(that.form.handoverb[indexs].handoverbw&&that.form.handoverb[indexs].handoverbw.length>0){
let arr1 = [];
@ -890,7 +891,7 @@ export default {
that.materialOptions.forEach((item) => {
if(item.id == res[0].wm){
if(that.type==50){
that.form.new_batch = data[0].batch+'-G';
that.form.new_batch = item.batch+'-G';
}
let params = {material: item.material,type: that.type};
that.$API.wpm.handover.mgroups.req(params).then((res1) => {