From 1930f8887be615fd0411379e79bb809aa14a84f1 Mon Sep 17 00:00:00 2001 From: niexiting <85552560@qq.com> Date: Thu, 21 Dec 2023 13:08:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E6=9E=B6=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mycomponents/location/requiredLocation.vue | 13 +- mycomponents/record/recordComDetailCard.vue | 3 +- pages/putaway/record/putawayRecord.vue | 150 ++++++-------------- static/config.json | 2 +- 4 files changed, 54 insertions(+), 114 deletions(-) diff --git a/mycomponents/location/requiredLocation.vue b/mycomponents/location/requiredLocation.vue index 0ac2a93c..ff43f421 100644 --- a/mycomponents/location/requiredLocation.vue +++ b/mycomponents/location/requiredLocation.vue @@ -5,9 +5,12 @@ padding-right: 10rpx; font-size:32rpx;"> - {{title}} -   请扫描 -   {{locationCode}} + + {{title}} + +   请扫描 +   {{locationCode}} + - - + @@ -56,12 +55,6 @@ getDirectoryItemArray } from '@/common/directory.js'; - import { - getDetailOption, - getDetailRemoveOption, - getDetailEditRemoveOption - } from '@/common/array.js'; - import { getBusinessType, createItemInfo, @@ -116,15 +109,6 @@ }; }, onLoad(option) { - this.fromType = option.fromType - if (this.fromType == "requestType") { - this.showToLoaction = false - updateTitle("原料上架申请") - } else { - updateTitle("原料上架记录") - this.showToLoaction = true - - } var typeCode = "PurchasePutaway" getBusinessType(typeCode, res => { if (res.success) { @@ -188,10 +172,10 @@ showErrorMessage(message) { this.$refs.comMessage.showErrorMessage(message, res => { - if (res) { - } + if (res) {} }); }, + calcHandleQty() { for (let item of this.detailSource) { item.qty = 0; @@ -207,6 +191,7 @@ updateData() { this.calcHandleQty(); }, + removeItem(index, item) { this.detailSource.splice(index, 1) }, @@ -228,6 +213,7 @@ } this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); }, + showFromLocationPopup() { this.$nextTick(() => { this.$refs.scanLocationCode.openScanPopup(); @@ -259,110 +245,60 @@ mask: true }); - if (this.fromType == "requestType") { - var params = this.setRequestParams() - console.log("提交" + JSON.stringify(params)) - // putawayRequestSubmit(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 { - //记录有目标库位,需要查询管理模式 - var itemCodes = [] - this.detailSource.forEach(item => { - itemCodes.push(item.itemCode) - }) - //获取管理模式,封装参数 - getManagementPrecisions(itemCodes, this.toLocationCode, res => { - if (res.success) { - this.managementList = res.list; - var params = this.setRecordParams(true) - console.log("提交参数", JSON.stringify(params)); - - // putawayRecordSubmit(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); - } - }); - } - }, - - setRecordParams(queryModel) { - var subList = [] - var creator = this.$store.state.user.id + //记录有目标库位,需要查询管理模式 + var itemCodes = [] this.detailSource.forEach(item => { - item.subList.forEach(detail => { - if (detail.scaned) { - if (queryModel) { - var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, - detail.packingNumber, detail.batch); - detail.toPackingNumber = info.packingNumber;; - detail.toContainerNumber = detail.containerNumber - detail.toBatch = info.batch; - detail.toInventoryStatus = detail.inventoryStatus - detail.toLocationCode = this.toLocationCode + itemCodes.push(item.itemCode) + }) + //获取管理模式,封装参数 + getManagementPrecisions(itemCodes, this.toLocationCode, res => { + if (res.success) { + this.managementList = res.list; + var params = this.setRecordParams(true) + console.log("提交参数", JSON.stringify(params)); + + putawayRecordSubmit(params).then(res => { + uni.hideLoading() + if (res.data) { + this.showCommitSuccessMessage("提交成功
生成采购上架记录" + res.data, ) } else { - // detail.toPackingNumber = detail.packingNumber; - // detail.toContainerNumber = detail.containerNumber - // detail.toBatch = detail.toBatch; - // detail.toInventoryStatus = detail.inventoryStatus - // detail.toLocationCode = "" + this.showErrorMessage("提交失败[" + res.msg + "]") } + }).catch(error => { + uni.hideLoading() + this.showErrorMessage(error) + }) + } else { + uni.hideLoading(); + this.showErrorMessage(res.message); + } + }); - subList.push(detail) - } - }) - }) - this.dataContent.subList = subList - this.dataContent.creator = creator; - return this.dataContent; }, - - setRequestParams(){ + + setRecordParams(queryModel) { var subList = [] - var supplierCode="" + var creator = this.$store.state.user.id this.detailSource.forEach(item => { item.subList.forEach(detail => { if (detail.scaned) { - if(supplierCode==""){ - supplierCode = detail.package.supplierCode - } + var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, + detail.packingNumber, detail.batch); + detail.toPackingNumber = info.packingNumber;; + detail.toContainerNumber = detail.containerNumber + detail.toBatch = info.batch; + detail.toInventoryStatus = detail.inventoryStatus + detail.toLocationCode = this.toLocationCode + detail.package=null; subList.push(detail) } }) }) - this.dataContent.subList = subList - this.dataContent.supplierCode = supplierCode - this.dataContent.businessType = "PurchasePutaway" - this.dataContent.departmentCode= "研发部门"; - this.dataContent.status= 1 ; - this.dataContent.autoCommit = "FALSE"; - this.dataContent.autoAgree = "FALSE"; - this.dataContent.autoExecute = "FALSE"; - this.dataContent.directCreateRecord = "FALSE"; + this.dataContent.creator = creator; return this.dataContent; }, - showMessage(message) { this.$refs.comMessage.showMessage(message, res => { if (res) {} diff --git a/static/config.json b/static/config.json index c33affa0..7426682e 100644 --- a/static/config.json +++ b/static/config.json @@ -18,7 +18,7 @@ "request_url": { "name": "request_url", - "value": "http://192.168.0.106:12080/admin-api", + "value": "http://dev.ccwin-in.com:25100/api/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",