From 751d670a857d3534a6e40baa52e6574cfb96b55d Mon Sep 17 00:00:00 2001 From: niexiting <85552560@qq.com> Date: Tue, 19 Dec 2023 10:03:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=B4=E6=8E=A5=E9=80=80?= =?UTF-8?q?=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/purchaseReturn/record/returnRecord.vue | 117 +++++++++---------- static/config.json | 5 +- 2 files changed, 58 insertions(+), 64 deletions(-) diff --git a/pages/purchaseReturn/record/returnRecord.vue b/pages/purchaseReturn/record/returnRecord.vue index f520d534..03d0ce9a 100644 --- a/pages/purchaseReturn/record/returnRecord.vue +++ b/pages/purchaseReturn/record/returnRecord.vue @@ -54,7 +54,7 @@ createDetailInfo, calcHandleQty } from '@/common/record.js'; - + import { getManagementPrecisions } from '@/common/balance.js'; @@ -89,7 +89,7 @@ businessType: {}, //业务类型 poNumber: '', fromType: "", - dataContent : {} + dataContent: {} }; }, @@ -166,7 +166,7 @@ }) if (item == undefined) { var itemInfo = createItemInfo(balance, pack); - let newDetail = createDetailInfo(balance, pack); + let newDetail = createDetailInfo(balance, pack); itemInfo.subList.push(newDetail); this.detailSource.push(itemInfo) } else { @@ -221,8 +221,9 @@ }); if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { - + console.log("提交参数", JSON.stringify(params)); + //直接创建申请 if (this.fromType == "requestType") { var params = this.setRequestParams(); console.log("提交" + JSON.stringify(params)) @@ -231,43 +232,34 @@ if (res.data) { this.showCommitSuccessMessage("提交成功
生成采购退货申请" + res.data, ) } else { - this.showErrorMessage("提交失败"+res.msg) + 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)); - - // purchaseReturnRecordSubmit(params).then(res => { - // uni.hideLoading() - // if (res.data) { - // this.showCommitSuccessMessage("提交成功
生成采购退货记录" + res.data ) - // } else { - // this.showErrorMessage("提交失败"+res.msg) - // } - // }).catch(error => { - // uni.hideLoading() - // this.showErrorMessage(error) - // }) + + var params = this.setRecordParams(true) + console.log("提交参数", JSON.stringify(params)); + + purchaseReturnRecordSubmit(params).then(res => { + uni.hideLoading() + if (res.data) { + this.showCommitSuccessMessage("提交成功
生成采购退货记录" + res.data) } else { - uni.hideLoading(); - this.showErrorMessage(res.message); + this.showErrorMessage("提交失败" + res.msg) } - }); - + }).catch(error => { + uni.hideLoading() + this.showErrorMessage(error) + }) + } } else { @@ -279,57 +271,58 @@ setRecordParams(queryModel) { var subList = [] var creator = this.$store.state.user.id + this.dataContent.creator = creator; + 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 - } else { - detail.toPackingNumber = detail.packingNumber; - detail.toContainerNumber = detail.containerNumber - detail.toBatch = detail.toBatch; - detail.toInventoryStatus = detail.inventoryStatus - detail.toLocationCode = "" - } - + detail.itemCode = detail.itemCode; + detail.inventoryStatus = detail.inventoryStatus; + + detail.fromPackingNumber = detail.packingNumber; + detail.toPackingNumber = detail.packingNumber;; + + detail.fromContainerNumber = detail.containerNumber; + detail.toContainerNumber = detail.containerNumber + + detail.fromBatch = detail.batch; + detail.toBatch = detail.batch; + + detail.fromLocationCode = this.fromLocationCode; + detail.toLocationCode = ''; //采购退货直接出库,目标库位为空 + subList.push(detail) } }) }) this.dataContent.subList = subList - this.dataContent.creator = creator; + // this.dataContent.jobNumber = ''; return this.dataContent; }, - - setRequestParams(){ + + setRequestParams() { var subList = [] - var supplierCode="" + var supplierCode = "" this.detailSource.forEach(item => { item.subList.forEach(detail => { if (detail.scaned) { - if(supplierCode==""){ + if (supplierCode == "") { supplierCode = detail.package.supplierCode } subList.push(detail) } }) }) - + this.dataContent.subList = subList - this.dataContent.purchaseReceiptRecordNumber=""; - this.transferMode =""; - + this.dataContent.purchaseReceiptRecordNumber = ""; + this.transferMode = ""; + this.dataContent.supplierCode = supplierCode this.dataContent.businessType = "PurchasePutaway" - this.dataContent.departmentCode= "研发部门"; - this.dataContent.status= 1 ; - this.dataContent.autoCommit = "FALSE"; + this.dataContent.departmentCode = "研发部门"; + this.dataContent.status = 1; + this.dataContent.autoCommit = "FALSE"; this.dataContent.autoAgree = "FALSE"; this.dataContent.autoExecute = "FALSE"; this.dataContent.directCreateRecord = "FALSE"; @@ -383,13 +376,13 @@ this.$refs.comMessage.showSuccessMessage(hint, res => { if (this.fromType == "requestType") { navigateBack(1) - }else { + } else { //清空 this.subList = []; this.detailSource = []; this.toLocationInfo = {} } - + }) } } diff --git a/static/config.json b/static/config.json index 68341504..faa8486d 100644 --- a/static/config.json +++ b/static/config.json @@ -18,10 +18,11 @@ "request_url": { "name": "request_url", - "value": "http://192.168.0.157:12080/admin-api", + "value": "http://192.168.0.159:12080/admin-api", "dev2": "http://192.168.0.157:12080/admin-api", - "chefang": "http://192.168.0.178:12080/admin-api", + "chenfang": "http://192.168.0.178:12080/admin-api", "chenxinming": "http://192.168.0.230:12080/admin-api", + "liuchen": "http://192.168.0.159:12080/admin-api", "dev": "http://dev.ccwin-in.com:25100/api/admin-api", "local": "http://localhost:12080", "desc": "api请求地址"