fix:发货编号调整

This commit is contained in:
shijing 2025-08-06 15:19:28 +08:00
parent 8a445429ad
commit e3c085beec
1 changed files with 46 additions and 29 deletions

View File

@ -522,17 +522,38 @@ export default {
}, },
selectBatchChange(item) { selectBatchChange(item) {
let that = this; let that = this;
that.wprList = [];
that.mioitems = [];
if(item){ if(item){
let count = 0;
if(that.tableDatas.length>0){
that.tableDatas.forEach((item) => {
if(item.batch == that.selectBatch.batch){
count += item.count;
}
})
}
that.$API.wpm.wpr.list.req({ page: 0, mb: item.id }).then((res) => { that.$API.wpm.wpr.list.req({ page: 0, mb: item.id }).then((res) => {
that.wprList = res; res.forEach((item,index) => {
if(index>=count){
that.wprList.push(item);
}
})
console.log('that.wprList',that.wprList)
if(that.wprList.length>0){
that.wprList.forEach((item,index) => {
if(item.number_out!==null){
that.mioitems[index] = item.number_out;
}
})
}
that.form.batch = item.batch;
that.form.mb = item.id;
that.batchcount = that.wprList.length;
that.form.count = that.wprList.length;
that.form.warehouse = item.warehouse;
that.inputBatchDisable = true;
}) })
// that.getnumberOutLast();
that.form.batch = item.batch;
that.form.mb = item.id;
that.batchcount = Number(item.count);
that.form.count = Number(item.count);
that.form.warehouse = item.warehouse;
that.inputBatchDisable = true;
} }
}, },
selectBatchClear() { selectBatchClear() {
@ -541,7 +562,6 @@ export default {
this.form.batch = ""; this.form.batch = "";
this.form.count = ""; this.form.count = "";
this.form.warehouse = ""; this.form.warehouse = "";
// this.warehouseDisable = false;
this.inputBatchDisable = false; this.inputBatchDisable = false;
}, },
// //
@ -557,15 +577,21 @@ export default {
}, },
countChange(){ countChange(){
let that = this; let that = this;
if(that.mTracking == 20&&that.form.count>1&&( that.form.type == 'pur_in'|| that.form.type == 'other_in')){ that.mioitems = [];that.mioitemw = [];
that.mioitems = [];that.mioitemw = []; if(that.form.count>1){
for(let i=0;i<that.form.count;i++){ if(that.form.type == 'pur_in'|| that.form.type == 'other_in'){
let indexs = i+1; for(let i=0;i<that.form.count;i++){
indexs = indexs<10?'0'+indexs:indexs; let indexs = i+1;
that.mioitems[i] = that.cate == "halfgood"?'': that.form.batch+'-'+indexs; indexs = indexs<10?'0'+indexs:indexs;
let obj = {}; that.mioitems[i] = that.cate == "halfgood"?'': that.form.batch+'-'+indexs;
obj.number = that.mioitems[i]; let obj = {};
that.mioitemw.push(obj); obj.number = that.mioitems[i];
that.mioitemw.push(obj);
}
}else{
for(let i=0;i<that.form.count;i++){
that.mioitems[i] = that.wprList[i].number_out;
}
} }
}else{ }else{
// //
@ -686,21 +712,12 @@ export default {
return; return;
} }
}else if(that.form.type == 'sale_out'&&that.project_code=='bxerp'){ }else if(that.form.type == 'sale_out'&&that.project_code=='bxerp'){
let count = 0;
if(that.tableDatas.length>0){
that.tableDatas.forEach((item) => {
if(item.batch==that.form.batch){
count += item.count;
}
})
}
let mioitemw = []; let mioitemw = [];
that.mioitems.forEach((item,index) => { that.mioitems.forEach((item,index) => {
let index0 = count+index;
mioitemw[index]={ mioitemw[index]={
number: that.wprList[index0]? that.wprList[index0].number:'' , number: that.wprList[index]? that.wprList[index].number:'' ,
number_out : item, number_out : item,
wpr:that.wprList[index0]? that.wprList[index0].id:null wpr:that.wprList[index]? that.wprList[index].id:null
} }
}) })
that.form.mioitemw = mioitemw.filter(item=>item.wpr!==null); that.form.mioitemw = mioitemw.filter(item=>item.wpr!==null);