diff --git a/src/views/inm/mioitem_form.vue b/src/views/inm/mioitem_form.vue index e607adf4..99d66483 100644 --- a/src/views/inm/mioitem_form.vue +++ b/src/views/inm/mioitem_form.vue @@ -522,17 +522,38 @@ export default { }, selectBatchChange(item) { let that = this; + that.wprList = []; + that.mioitems = []; 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.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() { @@ -541,7 +562,6 @@ export default { this.form.batch = ""; this.form.count = ""; this.form.warehouse = ""; - // this.warehouseDisable = false; this.inputBatchDisable = false; }, //显示 @@ -557,15 +577,21 @@ export default { }, countChange(){ 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 = []; - for(let i=0;i1){ + if(that.form.type == 'pur_in'|| that.form.type == 'other_in'){ + for(let i=0;i0){ - that.tableDatas.forEach((item) => { - if(item.batch==that.form.batch){ - count += item.count; - } - }) - } let mioitemw = []; that.mioitems.forEach((item,index) => { - let index0 = count+index; mioitemw[index]={ - number: that.wprList[index0]? that.wprList[index0].number:'' , + number: that.wprList[index]? that.wprList[index].number:'' , 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);