fix:扫描物料识别修改
This commit is contained in:
parent
7d9f86a8ab
commit
41929415aa
|
|
@ -592,6 +592,7 @@ export default {
|
||||||
},
|
},
|
||||||
materialChange() {
|
materialChange() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
that.form.new_batch = "";
|
||||||
let totalCount = 0,data = [];
|
let totalCount = 0,data = [];
|
||||||
if(that.selectItems.length>0){
|
if(that.selectItems.length>0){
|
||||||
data = that.materialOptions.filter((item) => {
|
data = that.materialOptions.filter((item) => {
|
||||||
|
|
@ -630,7 +631,6 @@ export default {
|
||||||
that.form.handoverb = data;
|
that.form.handoverb = data;
|
||||||
},
|
},
|
||||||
getWprList(id,index){
|
getWprList(id,index){
|
||||||
console.log('id',id,'index',index);
|
|
||||||
let that = this;
|
let that = this;
|
||||||
let handoverbw = [];
|
let handoverbw = [];
|
||||||
that.$API.wpm.wpr.list.req({wm:id,page:0,can_use:'yes'}).then((res) => {
|
that.$API.wpm.wpr.list.req({wm:id,page:0,can_use:'yes'}).then((res) => {
|
||||||
|
|
@ -713,7 +713,6 @@ export default {
|
||||||
//表单注入数据
|
//表单注入数据
|
||||||
setData(data) {
|
setData(data) {
|
||||||
let that = this;
|
let that = this;
|
||||||
console.log('交接记录查看',data)
|
|
||||||
this.totalCount = data.count?data.count:data.handoverb.count;
|
this.totalCount = data.count?data.count:data.handoverb.count;
|
||||||
Object.assign(this.form, data);
|
Object.assign(this.form, data);
|
||||||
this.$API.system.user.list.req({ depts: data.send_dept, page: 0 }).then((res) => {
|
this.$API.system.user.list.req({ depts: data.send_dept, page: 0 }).then((res) => {
|
||||||
|
|
@ -823,6 +822,7 @@ export default {
|
||||||
return item.batch == data;
|
return item.batch == data;
|
||||||
})
|
})
|
||||||
if(arr.length>0){//有批次
|
if(arr.length>0){//有批次
|
||||||
|
console.log('批次处理');
|
||||||
let arr2 = [];
|
let arr2 = [];
|
||||||
if(that.form.handoverb&&that.form.handoverb.length>0){
|
if(that.form.handoverb&&that.form.handoverb.length>0){
|
||||||
arr2 = that.form.handoverb.filter((item) => {
|
arr2 = that.form.handoverb.filter((item) => {
|
||||||
|
|
@ -833,7 +833,7 @@ export default {
|
||||||
that.$message.error("该批次已存在")
|
that.$message.error("该批次已存在")
|
||||||
}else{
|
}else{
|
||||||
if(that.type==50){
|
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};
|
let params = {material: arr[0].material,type: that.type};
|
||||||
that.$API.wpm.handover.mgroups.req(params).then((res0) => {
|
that.$API.wpm.handover.mgroups.req(params).then((res0) => {
|
||||||
|
|
@ -850,19 +850,20 @@ export default {
|
||||||
that.form.handoverb.push(obj2);
|
that.form.handoverb.push(obj2);
|
||||||
}
|
}
|
||||||
}else{//单件
|
}else{//单件
|
||||||
|
console.log('单件处理');
|
||||||
let res = await that.$API.wpm.wpr.list.req({number:data,page:0});
|
let res = await that.$API.wpm.wpr.list.req({number:data,page:0});
|
||||||
if(res.length>0){
|
if(res.length>0){
|
||||||
let indexs = 0,arr =[];
|
let indexs = 0,arrs =[];
|
||||||
if( that.form.handoverb&&that.form.handoverb.length>0){
|
if( that.form.handoverb&&that.form.handoverb.length>0){
|
||||||
that.form.handoverb.forEach((item,index) => {
|
that.form.handoverb.forEach((item,index) => {
|
||||||
if(item.wm == res[0].wm){
|
if(item.wm == res[0].wm){
|
||||||
indexs = index;
|
indexs = index;
|
||||||
arr.push(item);
|
arrs.push(item);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//handoverb里有这个物料批次
|
//handoverb里有这个物料批次
|
||||||
if(arr.length>0){
|
if(arrs.length>0){
|
||||||
//判断是否有wpr,若无将wpr放进去
|
//判断是否有wpr,若无将wpr放进去
|
||||||
if(that.form.handoverb[indexs].handoverbw&&that.form.handoverb[indexs].handoverbw.length>0){
|
if(that.form.handoverb[indexs].handoverbw&&that.form.handoverb[indexs].handoverbw.length>0){
|
||||||
let arr1 = [];
|
let arr1 = [];
|
||||||
|
|
@ -890,7 +891,7 @@ export default {
|
||||||
that.materialOptions.forEach((item) => {
|
that.materialOptions.forEach((item) => {
|
||||||
if(item.id == res[0].wm){
|
if(item.id == res[0].wm){
|
||||||
if(that.type==50){
|
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};
|
let params = {material: item.material,type: that.type};
|
||||||
that.$API.wpm.handover.mgroups.req(params).then((res1) => {
|
that.$API.wpm.handover.mgroups.req(params).then((res1) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue