fix:玻纤交接记录扫描批次,显示物料工序
This commit is contained in:
parent
135b950432
commit
3b20f98e2c
|
|
@ -64,7 +64,8 @@
|
||||||
<el-row v-for="(listItem,$index) in form.handoverb" :key="listItem">
|
<el-row v-for="(listItem,$index) in form.handoverb" :key="listItem">
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
<el-form-item label="交接物料">
|
<el-form-item label="交接物料">
|
||||||
<el-input v-model="listItem.batch" disabled></el-input>
|
<!-- <sapn>{{ listItem.batch }}({{ listItem.process }})</sapn> -->
|
||||||
|
<el-input :placeholder="listItem.batch+'('+listItem.process+')'" disabled></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="5">
|
<el-col :span="5">
|
||||||
|
|
@ -532,6 +533,7 @@ export default {
|
||||||
this.addShow = true;
|
this.addShow = true;
|
||||||
},
|
},
|
||||||
delMaterial(index){
|
delMaterial(index){
|
||||||
|
this.selectItems.splice(index,1);
|
||||||
this.form.handoverb.splice(index,1);
|
this.form.handoverb.splice(index,1);
|
||||||
this.countChange();
|
this.countChange();
|
||||||
},
|
},
|
||||||
|
|
@ -569,8 +571,9 @@ export default {
|
||||||
data.forEach((item,index)=>{
|
data.forEach((item,index)=>{
|
||||||
item.wm = item.id;
|
item.wm = item.id;
|
||||||
item.count = item.count_cando;
|
item.count = item.count_cando;
|
||||||
totalCount += item.count_cando;
|
totalCount += Number(item.count_cando);
|
||||||
item.tracking = item.material_.tracking;
|
item.tracking = item.material_.tracking;
|
||||||
|
item.process = item.material_.process_name;
|
||||||
item.handoverbw = [];
|
item.handoverbw = [];
|
||||||
that.getWprList(item.id,index);
|
that.getWprList(item.id,index);
|
||||||
})
|
})
|
||||||
|
|
@ -598,9 +601,11 @@ export default {
|
||||||
let totalCount = 0;
|
let totalCount = 0;
|
||||||
if(this.form.handoverb.length>0){
|
if(this.form.handoverb.length>0){
|
||||||
this.form.handoverb.forEach(item=>{
|
this.form.handoverb.forEach(item=>{
|
||||||
totalCount += item.count;
|
totalCount += Number(item.count);
|
||||||
})
|
})
|
||||||
that.totalCount = totalCount;
|
that.totalCount = totalCount;
|
||||||
|
}else{
|
||||||
|
that.totalCount = 0;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
countChanges(index){
|
countChanges(index){
|
||||||
|
|
@ -723,6 +728,7 @@ export default {
|
||||||
let obj = {};
|
let obj = {};
|
||||||
obj.wm = item.id;
|
obj.wm = item.id;
|
||||||
obj.batch = item.batch;
|
obj.batch = item.batch;
|
||||||
|
obj.batch = item.batch.material_.process_name;
|
||||||
obj.count_cando = item.count;
|
obj.count_cando = item.count;
|
||||||
obj.count = item.count;
|
obj.count = item.count;
|
||||||
obj.handoverbw = [];
|
obj.handoverbw = [];
|
||||||
|
|
@ -752,74 +758,109 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}else{//wpr的number
|
}else{//wpr的number
|
||||||
that.$API.wpm.wpr.list.req({number:data,page:0}).then((res) => {
|
let arr = [];
|
||||||
if(res.length>0){
|
arr = that.materialOptions.filter((item) => {
|
||||||
let indexs = 0,arr =[];
|
return item.batch == data;
|
||||||
if( that.form.handoverb&&that.form.handoverb.length>0){
|
})
|
||||||
arr = that.form.handoverb.filter((item,index) => {
|
if(arr.length>0){//有批次
|
||||||
indexs = index;
|
let arr2 = [];
|
||||||
return item.wm == res[0].wm;
|
if(that.form.handoverb&&that.form.handoverb.length>0){
|
||||||
})
|
arr2 = that.form.handoverb.filter((item) => {
|
||||||
|
return item.batch == data;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if(arr2.length>0){
|
||||||
|
that.wm_in = "";
|
||||||
|
that.$message.error("该批次已存在")
|
||||||
|
}else{
|
||||||
|
let params = {material: arr[0].material,type: that.type};
|
||||||
|
that.$API.wpm.handover.mgroups.req(params).then((res0) => {
|
||||||
|
that.mgroupOptions = res0;
|
||||||
|
})
|
||||||
|
let obj2 = {};
|
||||||
|
obj2.wm = arr[0].id;
|
||||||
|
obj2.batch = arr[0].batch;
|
||||||
|
obj2.process = arr[0].material_.process_name;
|
||||||
|
obj2.count_cando = arr[0].count;
|
||||||
|
obj2.count = arr[0].count;
|
||||||
|
if(that.form.handoverb&&that.form.handoverb.length>0){
|
||||||
|
that.form.handoverb.push(obj2);
|
||||||
|
}else{
|
||||||
|
that.form.handoverb = [];
|
||||||
|
that.form.handoverb.push(obj2);
|
||||||
}
|
}
|
||||||
//handoverb里有这个物料批次
|
that.wm_in = "";
|
||||||
if(arr.length>0){
|
}
|
||||||
//判断是否有wpr,若无将wpr放进去
|
}else{//单件
|
||||||
if(that.form.handoverb[0].handoverbw&&that.form.handoverb[0].handoverbw.length>0){
|
that.$API.wpm.wpr.list.req({number:data,page:0}).then((res) => {
|
||||||
let arr1 = [];
|
if(res.length>0){
|
||||||
arr1 = that.form.handoverb[0].handoverbw.filter((item1) => {
|
let indexs = 0,arr =[];
|
||||||
return item1.wpr == res[0].id;
|
if( that.form.handoverb&&that.form.handoverb.length>0){
|
||||||
|
arr = that.form.handoverb.filter((item,index) => {
|
||||||
|
indexs = index;
|
||||||
|
return item.wm == res[0].wm;
|
||||||
})
|
})
|
||||||
if(arr1.length>0){
|
}
|
||||||
that.wm_in = "";
|
//handoverb里有这个物料批次
|
||||||
that.$message.error("该物料已存在");
|
if(arr.length>0){
|
||||||
|
//判断是否有wpr,若无将wpr放进去
|
||||||
|
if(that.form.handoverb[indexs].handoverbw&&that.form.handoverb[indexs].handoverbw.length>0){
|
||||||
|
let arr1 = [];
|
||||||
|
arr1 = that.form.handoverb[indexs].handoverbw.filter((item1) => {
|
||||||
|
return item1.wpr == res[0].id;
|
||||||
|
})
|
||||||
|
if(arr1.length>0){
|
||||||
|
that.wm_in = "";
|
||||||
|
that.$message.error("该物料已存在");
|
||||||
|
}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);
|
||||||
|
that.wm_in = "";
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
|
that.form.handoverb[indexs].handoverbw = [];
|
||||||
let obj1 = {};
|
let obj1 = {};
|
||||||
obj1.wpr = res[0].id;
|
obj1.wpr = res[0].id;
|
||||||
obj1.number = res[0].number;
|
obj1.number = res[0].number;
|
||||||
that.form.handoverb[indexs].count+=1;
|
that.form.handoverb[indexs].count=1;
|
||||||
that.form.handoverb[indexs].handoverbw.push(obj1);
|
that.form.handoverb[indexs].handoverbw.push(obj1);
|
||||||
that.wm_in = "";
|
that.wm_in = "";
|
||||||
}
|
}
|
||||||
}else{
|
}else{//handoverb里没有有这个物料批次
|
||||||
that.form.handoverb[indexs].handoverbw = [];
|
that.materialOptions.forEach((item) => {
|
||||||
let obj1 = {};
|
if(item.id == res[0].wm){
|
||||||
obj1.wpr = res[0].id;
|
let params = {material: item.material,type: that.type};
|
||||||
obj1.number = res[0].number;
|
that.$API.wpm.handover.mgroups.req(params).then((res1) => {
|
||||||
that.form.handoverb[indexs].count=1;
|
that.mgroupOptions = res1;
|
||||||
that.form.handoverb[indexs].handoverbw.push(obj1);
|
})
|
||||||
|
let obj2 = {};
|
||||||
|
obj2.wm = item.id;
|
||||||
|
obj2.batch = item.batch;
|
||||||
|
obj2.process = item.material_.process_name;
|
||||||
|
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 = [];
|
||||||
|
that.form.handoverb.push(obj2);
|
||||||
|
}
|
||||||
|
})
|
||||||
that.wm_in = "";
|
that.wm_in = "";
|
||||||
}
|
}
|
||||||
}else{//handoverb里没有有这个物料批次
|
}else{
|
||||||
console.log('handoverb里没有有这个物料批次');
|
|
||||||
that.materialOptions.forEach((item) => {
|
|
||||||
if(item.id == res[0].wm){
|
|
||||||
console.log('item',item);
|
|
||||||
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 = [];
|
|
||||||
that.form.handoverb.push(obj2);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
that.wm_in = "";
|
that.wm_in = "";
|
||||||
|
that.$message.error("该批次不存在")
|
||||||
}
|
}
|
||||||
}else{
|
})
|
||||||
that.wm_in = "";
|
}
|
||||||
that.$message.error("该批次不存在")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
this.countChange();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue