fix:wpr打印标签更换成number,以及交接扫码处理

This commit is contained in:
shijing 2025-02-08 16:47:29 +08:00
parent f4ecb03144
commit a12c395405
2 changed files with 71 additions and 69 deletions

View File

@ -706,82 +706,24 @@ export default {
return;
}
let that = this;
let keys = data.split('#')[0];
let id = data.split('#')[1];
if(keys=='wpr'){
that.$API.wpm.wpr.item.req(id).then((res) => {
if(res){
let indexs = 0;
let arr = that.form.handoverb.filter((item,index) => {
indexs = index;
return item.wm == res.wm;
})
//handoverb
if(arr.length>0){
//wprwpr
if(that.form.handoverb[0].handoverbw&&that.form.handoverb[0].handoverbw.length>0){
let arr1 = [];
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);
}
}else{
that.form.handoverb[indexs].handoverbw = [];
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('2',that.form);
}
}else{//handoverb
let params = {material: res.material,type: that.type,};
that.$API.wpm.handover.mgroups.req(params).then((res) => {
that.mgroupOptions = res;
})
that.materialOptions.forEach((item) => {
if(item.id == res.wm){
let obj2 = {};
obj2.wm = item.id;
obj2.batch = item.batch;
obj2.count_cando = item.count;
obj2.handoverbw = [];
obj2.count = 1;
let obj3 = {};
obj3.wpr = res.id;
obj3.number = res.number;
obj2.handoverbw.push(obj3);
that.form.handoverb.push(obj2);
// console.log('3',that.form);
}
})
}
}
})
}else{
if(data.indexOf('#')>-1){
// let keys = data.split('#')[0];
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;
})
// console.log('arr',arr)
if(arr.length>0){
that.$message.error("该批次已存在")
}else{
let params = {material: res.material,type: that.type,};
that.$API.wpm.handover.mgroups.req(params).then((res) => {
that.mgroupOptions = res;
})
// console.log('materialOptions',that.materialOptions)
that.materialOptions.forEach((item) => {
if(item.batch == res.batch){
let params = {material: item.material,type: that.type};
that.$API.wpm.handover.mgroups.req(params).then((res0) => {
that.mgroupOptions = res0;
})
let obj = {};
obj.wm = item.id;
obj.batch = item.batch;
@ -804,6 +746,66 @@ export default {
})
}
})
}else{//wprnumber
that.$API.wpm.wpr.list.req({number:data,page:0}).then((res) => {
if(res.length>0){
let indexs = 0;
let arr = that.form.handoverb.filter((item,index) => {
indexs = index;
return item.wm == res[0].wm;
})
//handoverb
if(arr.length>0){
//wprwpr
if(that.form.handoverb[0].handoverbw&&that.form.handoverb[0].handoverbw.length>0){
let arr1 = [];
arr1 = that.form.handoverb[0].handoverbw.filter((item1) => {
return item1.wpr == res[0].id;
})
if(arr1.length>0){
that.$message.error("该物料已存在");
// console.log('0',that.form);
}else{
let obj1 = {};
obj1.wpr = res[0].id;
obj1.number = res[0].number;
that.form.handoverb[indexs].count+=1;
that.form.handoverb[indexs].handoverbw.push(obj1);
// console.log('1',that.form);
}
}else{
that.form.handoverb[indexs].handoverbw = [];
let obj1 = {};
obj1.wpr = res[0].id;
obj1.number = res[0].number;
that.form.handoverb[indexs].count=1;
that.form.handoverb[indexs].handoverbw.push(obj1);
// console.log('2',that.form);
}
}else{//handoverb
that.materialOptions.forEach((item) => {
if(item.id == res[0].wm){
let params = {material: item.material,type: that.type};
that.$API.wpm.handover.mgroups.req(params).then((res1) => {
that.mgroupOptions = res1;
})
let obj2 = {};
obj2.wm = item.id;
obj2.batch = item.batch;
obj2.count_cando = item.count;
obj2.handoverbw = [];
obj2.count = 1;
let obj3 = {};
obj3.wpr = res[0].id;
obj3.number = res[0].number;
obj2.handoverbw.push(obj3);
that.form.handoverb.push(obj2);
// console.log('3',that.form);
}
})
}
}
})
}
},
},

View File

@ -200,7 +200,6 @@
>
<template #default="scope">
<el-link :underline="false" @click="printMaterial(scope.row,'wpr')" type="primary">物料标签</el-link>
<!-- <el-link :underline="false" @click="printMaterial(scope.row,'wpr')" type="primary">检验记录</el-link> -->
</template>
</el-table-column>
</scTable>
@ -423,7 +422,8 @@ export default {
});
})
}else{
let code = 'wpr#'+row.id;
// let code = 'wpr#'+row.id;
let code = row.number;
let str = [
"SIZE 70 mm,100 mm",
"GAP 7 mm,7 mm",