From 8e9c312ad9b6b10a64bbe129f2614cf00997f7b7 Mon Sep 17 00:00:00 2001 From: zhang_li Date: Fri, 11 Apr 2025 18:19:31 +0800 Subject: [PATCH] =?UTF-8?q?YT-2361ASN=E8=AE=A2=E5=8D=95=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E6=94=B6=E8=B4=A7=EF=BC=8C=E4=BD=BF=E7=94=A8PDA=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E6=94=B6=E8=B4=A7=E6=97=B6=EF=BC=8C=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E7=AE=B1=E6=A0=87=E7=AD=BE=E8=BE=BE=E5=88=B01=E5=8D=83?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E7=B3=BB=E7=BB=9FPDA=E5=8D=A1=E6=AD=BB?= =?UTF-8?q?=EF=BC=8C=E9=9C=80=E8=A6=81=E4=BA=A7=E5=93=81=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B9=E6=A1=88=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../job/purchaseReceiptAsn.vue | 196 ++++++++++++++---- 1 file changed, 155 insertions(+), 41 deletions(-) diff --git a/src/pages/purchaseReceipt/job/purchaseReceiptAsn.vue b/src/pages/purchaseReceipt/job/purchaseReceiptAsn.vue index 8ea9aeec..d9604051 100644 --- a/src/pages/purchaseReceipt/job/purchaseReceiptAsn.vue +++ b/src/pages/purchaseReceipt/job/purchaseReceiptAsn.vue @@ -14,7 +14,7 @@ - + @@ -69,6 +69,7 @@ jobList: [], detailOptions: [], detailRemoveOption: [], + ishsowLoading:false }; }, onShow() {}, @@ -82,6 +83,7 @@ this.$nextTick(()=>{ this.openScanPopup() }) + // this.getList() }, onNavigationBarButtonTap(e) { if (e.index === 0) { @@ -275,12 +277,9 @@ } }).catch(error => { this.showMessage(error + "\n扫描[" + result.scanMessage + "]") - - this.scanPopupGetFocus() }) } catch (e) { this.showMessage(e.message) - this.scanPopupGetFocus() } }, calcHandleQty(detailSource) { @@ -388,48 +387,103 @@ } }, - commit(){ - let str ='' - let str1 ='' + //展示的数据 + showTableData () { + return this.jobList.slice(0,9) + }, + // 仅用于数据量多获取测试数据用 + getList(type) { + let that = this; + this.loadingType = "loading"; + var filters = [] + filters.push({ + column: "status", + action: "in", + value: '1,2' + }) + getPurchaseReceiptASNJobList({ + filters: filters, + pageNo: 1, + pageSize: 50, + }).then(async res => { + let resultList = res.data.list; + resultList.forEach(item=>{ + item.scaned=true + item.packageDOS.forEach(cur=>{ + cur.scaned=true + }) + }) + this.jobList = [...resultList,...resultList,...resultList,...resultList,...resultList,...resultList,...resultList,...resultList,...resultList,...resultList] + let k=0 + this.jobList.forEach(item=>{ + item.packageDOS.forEach(cur=>{ + cur.scaned=true + k++ + }) + }) + console.log(3444,k) + }).catch(error => { + }) + }, + getParams(){ this.params = [] let obj = {} let obj1 = {} - let count = 0 + let kkkkk=0 + console.log(99,this.jobList) this.jobList.forEach(item=>{ if(item.scaned){ - count++ obj = {...item} obj.id = item.masterId let isHaveObj = this.params.find(i => i.asnNumber == item.asnNumber) if(isHaveObj){ - console.log(22,isHaveObj) item.packageDOS.forEach(cur=>{ if(cur.scaned){ obj1 = { - ...cur, - ...item, - packingNumber:cur.number, - number:'', - deliNo:item.deliNo, + // ...cur, + // ...item,item + id: item.id, + arriveDate: item.arriveDate, + produceDate: cur.produceDate, + expireDate: cur.expireDate, + inventoryStatus: item.inventoryStatus, + toLocationCode: cur.toLocationCode, + poNumber: cur.poNumber, + poLine: cur.poLine, + packQty:cur.packQty, + packUnit:cur.packUnit, + qty:item.qty, + orderQty:item.orderQty, + uom:item.uom, + supplierQty:item.supplierQty, + supplierUom:item.supplierUom, + convertRate:cur.convertRate, + jobDetailId: cur.detailId, itemCode:item.itemCode, - itemDesc:item.itemDesc, + itemName:item.itemName, itemDesc1:item.itemDesc1, itemDesc2:item.itemDesc2, + masterId:item.id, + number:'', + projectCode:item.projectCode, + fromOwnerCode:item.fromOwnerCode, + toOwnerCode:item.toOwnerCode, + packingNumber:cur.number, + parentPackingNumber:item.parentPackingNumber, + poLineType:item.poLineType, + tenantId:cur.tenantId, + sourceType:item.sourceType, + deliNo:item.deliNo, itemName:item.itemName, backNumber:item.backNumber, - packQty:cur.packQty, - packUnit:cur.packUnit, purchaseQty:cur.purchaseQty, purchaseStdQty:cur.purchaseStdQty, purchaseUom:cur.purchaseUom, - qty:item.qty, remark:cur.remark, supplierBatch:cur.supplierBatch, supplierCode:cur.supplierCode, toLocationCode:item.toLocationCode, - uom:item.uom, handleQty:cur.handleQty, - qty:item.qty, } isHaveObj.subList.push(obj1) } @@ -439,53 +493,109 @@ item.packageDOS.forEach(cur=>{ if(cur.scaned){ obj1 = { - ...cur, - ...item, - packingNumber:cur.number, - number:'', - deliNo:item.deliNo, + // ...cur, + // ...item, + // packingNumber:cur.number, + // number:'', + // deliNo:item.deliNo, + // itemCode:item.itemCode, + // itemDesc:item.itemDesc, + // itemDesc1:item.itemDesc1, + // itemDesc2:item.itemDesc2, + // itemName:item.itemName, + // backNumber:item.backNumber, + // packQty:cur.packQty, + // packUnit:cur.packUnit, + // purchaseQty:cur.purchaseQty, + // purchaseStdQty:cur.purchaseStdQty, + // purchaseUom:cur.purchaseUom, + // qty:item.qty, + // remark:cur.remark, + // supplierBatch:cur.supplierBatch, + // supplierCode:cur.supplierCode, + // toLocationCode:item.toLocationCode, + // uom:item.uom, + // handleQty:cur.handleQty, + // qty:item.qty, + id: item.id, + arriveDate: item.arriveDate, + produceDate: cur.produceDate, + expireDate: cur.expireDate, + inventoryStatus: item.inventoryStatus, + toLocationCode: cur.toLocationCode, + poNumber: cur.poNumber, + poLine: cur.poLine, + packQty:cur.packQty, + packUnit:cur.packUnit, + qty:item.qty, + orderQty:item.orderQty, + uom:item.uom, + supplierQty:item.supplierQty, + supplierUom:item.supplierUom, + convertRate:cur.convertRate, + jobDetailId: cur.detailId, itemCode:item.itemCode, - itemDesc:item.itemDesc, + itemName:item.itemName, itemDesc1:item.itemDesc1, itemDesc2:item.itemDesc2, + number:'', + projectCode:item.projectCode, + fromOwnerCode:item.fromOwnerCode, + toOwnerCode:item.toOwnerCode, + packingNumber:cur.number, + parentPackingNumber:item.parentPackingNumber, + poLineType:item.poLineType, + tenantId:cur.tenantId, + sourceType:item.sourceType, + deliNo:item.deliNo, itemName:item.itemName, backNumber:item.backNumber, - packQty:cur.packQty, - packUnit:cur.packUnit, purchaseQty:cur.purchaseQty, purchaseStdQty:cur.purchaseStdQty, purchaseUom:cur.purchaseUom, - qty:item.qty, remark:cur.remark, supplierBatch:cur.supplierBatch, supplierCode:cur.supplierCode, toLocationCode:item.toLocationCode, - uom:item.uom, handleQty:cur.handleQty, - qty:item.qty, } obj.subList.push(obj1) } }) - console.log(obj) this.params.push(obj) } } - if(item.handleQty>0 && item.handleQty < item.qty){ - str += `ASN单号【${item.asnNumber}】物料代码【${item.itemCode}】实际收货数量【${item.handleQty}】小于任务数量【${item.qty}】,\n` - } - if(!item.handleQty){ - str1 += `ASN单号【${item.asnNumber}】物料代码【${item.itemCode}】实际收货数量为0,\n` - } - }) + }) this.params.forEach(item=>{ delete item.packageDOS item.subList.forEach(cur=>{ + kkkkk++ delete cur.packageDOS, delete item.masterId }) }) + console.log('count:'+kkkkk) + return this.params + }, + commit(){ + let str ='' + let str1 ='' + let count = 0 + if(this.ishsowLoading)return; + this.ishsowLoading =true + this.jobList.forEach(item=>{ + if(item.scaned){ + count++ + } + if(item.handleQty>0 && item.handleQty < item.qty){ + str += `ASN单号【${item.asnNumber}】物料代码【${item.itemCode}】实际收货数量【${item.handleQty}】小于任务数量【${item.qty}】,\n` + } + if(!item.handleQty){ + str1 += `ASN单号【${item.asnNumber}】物料代码【${item.itemCode}】实际收货数量为0,\n` + } + }) + if(count == 0){ this.$refs.comMessage.showMessage('扫描数量为0,请先扫描') return @@ -502,6 +612,7 @@ if (res) { this.submitJob() } + this.ishsowLoading =false }); }else{ this.submitJob() @@ -512,7 +623,9 @@ title: "加载中....", mask: true }); - purchaseReceiptJobSubmitASN(this.params).then(res => { + const params1 = this.getParams() + console.log(99,JSON.stringify(params1)) + purchaseReceiptJobSubmitASN(params1).then(res => { if (res.data) { // this.showCommitSuccessMessage("提交成功\n生成采购上架记录\n" + res.data) let str ='' @@ -525,6 +638,7 @@ } }) uni.hideLoading() + this.ishsowLoading =false if(str){ this.showCommitSuccessMessage(str+str1) }else{