From 7c1667420a90395ab50a921c85a260494653552d Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Tue, 19 Dec 2023 20:00:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=AD=98=E8=BD=AC=E7=A7=BB=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inventoryMove/job/inventoryMoveDetail.vue | 3 +- pages/transfer/coms/comTransferRecord.vue | 162 +++++++++++++----- pages/transfer/record/deliverRecord.vue | 2 +- static/config.json | 2 +- 4 files changed, 119 insertions(+), 50 deletions(-) diff --git a/pages/inventoryMove/job/inventoryMoveDetail.vue b/pages/inventoryMove/job/inventoryMoveDetail.vue index e1875ac8..e425e564 100644 --- a/pages/inventoryMove/job/inventoryMoveDetail.vue +++ b/pages/inventoryMove/job/inventoryMoveDetail.vue @@ -351,6 +351,7 @@ getPrecisionStrategyList(precisionStrategParams, res => { if (res.success) { this.managementList = res.list; + var params = this.setParams() console.log("提交" + JSON.stringify(params)) inventoryMoveSubmit(params).then(res => { @@ -380,7 +381,7 @@ if (detail.scaned) { var filterResult = itemList.filter(res => { if (res.itemCode == item.itemCode - &&res.locationCode == detail.locationCode) { + &&res.locationCode == detail.toLocationCode) { return res } }) diff --git a/pages/transfer/coms/comTransferRecord.vue b/pages/transfer/coms/comTransferRecord.vue index 9aeea896..7e28bbb3 100644 --- a/pages/transfer/coms/comTransferRecord.vue +++ b/pages/transfer/coms/comTransferRecord.vue @@ -49,9 +49,13 @@ transferIssueRecordSubmit, transferReceiptRecordSubmit } from '@/api/request2.js'; + import { + getPrecisionStrategyList + } from '@/common/balance.js'; import { goHome, + getPackingNumberAndBatchByList } from '@/common/basic.js'; import { @@ -116,12 +120,15 @@ inInventoryStatus: "", //目标入库库存状态 outInventoryStatus: "", //来源出库库存状态 businessType: {}, + managementList:[], + dataContent: {} + }; }, mounted(option) { var typeCode ="" - if(this.transferType=="TransferDeliver"){ - typeCode = "TransferDeliver" + if(this.transferType=="Transfer"){ + typeCode = "Transfer" }else if(this.transferType=="TransferReceipt"){ typeCode = "TransferReceipt" } @@ -251,57 +258,119 @@ this.showMessage("请先选择目标库位") return; } - //允许部分提交 - uni.showLoading({ - title: "提交中....", - mask: true - }); - - var params = this.setParams(); - console.log("提交" + JSON.stringify(params)) - if(this.transferType=="transferIssue"){ - // transferIssueRecordSubmit(params).then(res => { - // uni.hideLoading() - // if (res.data) { - // this.showCommitSuccessMessage("提交成功
生成采购收货记录" + res.data, ) - // } else { - // this.showErrorMessage("提交失败[" + res.msg + "]") - // } - // }).catch(error => { - // uni.hideLoading() - // this.showErrorMessage(error) - // }) + if(this.detailSource.length > 0 && this.detailSource[0].subList.length > 0){ + //查询管理模式 + uni.showLoading({ + title: "提交中....", + mask: true + }); + this.managementList = []; + var precisionStrategParams = this.setPrecisionStrategParams() - }else if(this.transferType=="transferReceipt"){ - // transferReceiptRecordSubmit(params).then(res => { - // uni.hideLoading() - // if (res.data) { - // this.showCommitSuccessMessage("提交成功
生成采购收货记录" + res.data, ) - // } else { - // this.showErrorMessage("提交失败[" + res.msg + "]") - // } - // }).catch(error => { - // uni.hideLoading() - // this.showErrorMessage(error) - // }) + getPrecisionStrategyList(precisionStrategParams, res => { + if (res.success) { + this.managementList = res.list; + var params = this.setParams() + console.log("提交" + JSON.stringify(params)) + if(this.transferType=="Transfer"){ + transferIssueRecordSubmit(params).then(res => { + uni.hideLoading() + if (res.data) { + this.showCommitSuccessMessage("提交成功
生成调拨出库记录
" + res.data) + } else { + this.showErrorMessage("提交失败[" + res.msg + "]") + } + }).catch(error => { + uni.hideLoading() + this.showErrorMessage(error) + }) + }else if(this.transferType=="TransferReceipt"){ + // transferReceiptRecordSubmit(params).then(res => { + // uni.hideLoading() + // if (res.data) { + // this.showCommitSuccessMessage("提交成功
生成调拨入库记录
" + res.data) + // } else { + // this.showErrorMessage("提交失败[" + res.msg + "]") + // } + // }).catch(error => { + // uni.hideLoading() + // this.showErrorMessage(error) + // }) + } + + } else { + uni.hideLoading(); + this.showErrorMessage(res.message); + } + }) + + }else { + this.showErrorMessage("没有要提交的数据,请先扫描") } + + + }, + + setPrecisionStrategParams(){ + var itemList = [] + this.detailSource.forEach(item => { + item.subList.forEach(detail => { + if (detail.scaned) { + var filterResult = itemList.filter(res => { + if (res.itemCode == item.itemCode + &&res.locationCode == detail.locationCode) { + return res + } + }) + //去掉重复元素 + if(filterResult.length==0){ + var result = { + itemCode: item.itemCode, + locationCode: detail.locationCode + } + itemList.push(result) + } + + } + }) + }) + return itemList; }, setParams() { + var subList = [] + var creator = this.$store.state.user.id this.detailSource.forEach(item => { item.subList.forEach(detail => { if (detail.scaned) { - // var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, - // detail.packingNumber, detail.batch); - // detail.toPackingNumber =info.packingNumber; - // detail.toBatch =info.batch; + var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, + detail.packingNumber, detail.locationCode, detail.batch); + + detail.itemCode = detail.itemCode; + detail.inventoryStatus = detail.inventoryStatus; + + detail.fromPackingNumber = info.packingNumber; + detail.toPackingNumber = info.packingNumber; + + detail.fromContainerNumber = detail.containerNumber; + detail.toContainerNumber = detail.containerNumber + + detail.fromBatch =info.batch; + detail.toBatch = info.batch; + + detail.fromLocationCode = detail.locationCode; + detail.toLocationCode = detail.locationCode; + + subList.push(detail) } }) }) - return subList; + this.dataContent.subList =subList; + this.dataContent.creator =creator; + return this.dataContent; }, @@ -338,14 +407,13 @@ this.openScanPopup(); }, getToLocationCode(location, code) { - if (this.fromLocationCode == code) { - uni.showToast({ - title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", - duration: 2000 - }) - return - } - this.ToLocationCodeInfo = location; + // if (this.fromLocationCode == code) { + // uni.showToast({ + // title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", + // duration: 2000 + // }) + // return + // } this.toLocationCode = code; }, diff --git a/pages/transfer/record/deliverRecord.vue b/pages/transfer/record/deliverRecord.vue index d5b0a598..1082c1bd 100644 --- a/pages/transfer/record/deliverRecord.vue +++ b/pages/transfer/record/deliverRecord.vue @@ -1,6 +1,6 @@ diff --git a/static/config.json b/static/config.json index 5a5fa352..b1edf25d 100644 --- a/static/config.json +++ b/static/config.json @@ -18,7 +18,7 @@ "request_url": { "name": "request_url", - "value": "http://192.168.0.159:12080/admin-api", + "value": "http://192.168.0.180:12080/admin-api", "dev2": "http://192.168.0.157:12080/admin-api", "chefang": "http://192.168.0.180:12080/admin-api", "chenxinming": "http://192.168.0.230:12080/admin-api",