fix:wpr打印标签更换成number,以及交接扫码处理
This commit is contained in:
parent
f4ecb03144
commit
a12c395405
|
@ -706,82 +706,24 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let that = this;
|
let that = this;
|
||||||
let keys = data.split('#')[0];
|
if(data.indexOf('#')>-1){
|
||||||
|
// let keys = data.split('#')[0];
|
||||||
let id = data.split('#')[1];
|
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){
|
|
||||||
//判断是否有wpr,若无将wpr放进去
|
|
||||||
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{
|
|
||||||
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 = that.form.handoverb.filter((item) => {
|
||||||
return item.batch == res.batch&&item.state==res.state;
|
return item.batch == res.batch&&item.state==res.state;
|
||||||
})
|
})
|
||||||
|
// console.log('arr',arr)
|
||||||
if(arr.length>0){
|
if(arr.length>0){
|
||||||
that.$message.error("该批次已存在")
|
that.$message.error("该批次已存在")
|
||||||
}else{
|
}else{
|
||||||
let params = {material: res.material,type: that.type,};
|
// console.log('materialOptions',that.materialOptions)
|
||||||
that.$API.wpm.handover.mgroups.req(params).then((res) => {
|
|
||||||
that.mgroupOptions = res;
|
|
||||||
})
|
|
||||||
that.materialOptions.forEach((item) => {
|
that.materialOptions.forEach((item) => {
|
||||||
if(item.batch == res.batch){
|
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 = {};
|
let obj = {};
|
||||||
obj.wm = item.id;
|
obj.wm = item.id;
|
||||||
obj.batch = item.batch;
|
obj.batch = item.batch;
|
||||||
|
@ -804,6 +746,66 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}else{//wpr的number
|
||||||
|
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){
|
||||||
|
//判断是否有wpr,若无将wpr放进去
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -200,7 +200,6 @@
|
||||||
>
|
>
|
||||||
<template #default="scope">
|
<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>
|
||||||
<!-- <el-link :underline="false" @click="printMaterial(scope.row,'wpr')" type="primary">检验记录</el-link> -->
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</scTable>
|
</scTable>
|
||||||
|
@ -423,7 +422,8 @@ export default {
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
let code = 'wpr#'+row.id;
|
// let code = 'wpr#'+row.id;
|
||||||
|
let code = row.number;
|
||||||
let str = [
|
let str = [
|
||||||
"SIZE 70 mm,100 mm",
|
"SIZE 70 mm,100 mm",
|
||||||
"GAP 7 mm,7 mm",
|
"GAP 7 mm,7 mm",
|
||||||
|
|
Loading…
Reference in New Issue