diff --git a/pages/count/job/countDetail.vue b/pages/count/job/countDetail.vue index f5752834..2b5a9c3c 100644 --- a/pages/count/job/countDetail.vue +++ b/pages/count/job/countDetail.vue @@ -498,7 +498,7 @@ // // if (res.data) { // // this.showCommitSuccessMessage("提交成功
生成采购收货记录" + res.data.Number, ) // // } else { - // // this.showErrorMessage("提交失败") + // // this.showErrorMessage("提交失败[" + res.msg + "]") // // } // // uni.hideLoading() // // }).catch(error => { diff --git a/pages/count/record/countRecord.vue b/pages/count/record/countRecord.vue index 302094d2..73771c26 100644 --- a/pages/count/record/countRecord.vue +++ b/pages/count/record/countRecord.vue @@ -397,7 +397,7 @@ // this.showCommitSuccessMessage("提交成功" + hint, ) // } else { - // this.showErrorMessage("提交失败") + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // }).catch(error => { // uni.hideLoading() diff --git a/pages/customerReturn/job/returnDetail.vue b/pages/customerReturn/job/returnDetail.vue index b232a251..962e1737 100644 --- a/pages/customerReturn/job/returnDetail.vue +++ b/pages/customerReturn/job/returnDetail.vue @@ -371,7 +371,7 @@ // this.showCommitSuccessMessage("提交成功" + hint) // } else { - // this.showErrorMessage("提交失败") + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // }).catch(error => { // uni.hideLoading() diff --git a/pages/customerReturn/record/returnRecord.vue b/pages/customerReturn/record/returnRecord.vue index e867950c..8b3fa9e6 100644 --- a/pages/customerReturn/record/returnRecord.vue +++ b/pages/customerReturn/record/returnRecord.vue @@ -17,7 +17,7 @@ - @@ -51,9 +51,14 @@ getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js'; + + import { + getManagementPrecisions + } from '@/common/balance.js'; import { goHome, - updateTitle + updateTitle, + getPackingNumberAndBatch } from '@/common/basic.js'; import { @@ -109,12 +114,15 @@ allowModifyLocation: false, inInventoryStatus: "", //目标入库库存状态 outInventoryStatus: "", //来源出库库存状态 - fromType :"" + fromType :"", + showToLoaction:true }; }, onLoad(option) { this.fromType = option.fromType - if(this.fromType=="requestType"){ updateTitle("客户退货申请") }else { updateTitle("客户退货记录") } + if(this.fromType=="requestType"){ updateTitle("客户退货申请") + this.showToLoaction = false; }else { updateTitle("客户退货记录") + this.showToLoaction = true; } var typeCode = "Customerreturn" getBusinessType(typeCode, res => { if (res.success) { @@ -255,95 +263,97 @@ }, commit() { - if (this.toLocationCode == "") { + if (this.showToLoaction &&this.toLocationCode == "") { this.showMessage("请先选择目标库位") return; } - //允许部分提交 + uni.showLoading({ title: "提交中....", mask: true }); - var params = this.setParams(); - console.log("提交" + JSON.stringify(params)) - // (this.id, params).then(res => { - // uni.hideLoading() - // if (res.data) { - // var hint = res.data.Number; - // this.showCommitSuccessMessage("提交成功" + hint, ) - - // } else { - // this.showErrorMessage("提交失败") - // } - // }).catch(error => { - // uni.hideLoading() - // this.showErrorMessage(error) - // }) - - }, - - setParams() { - var params = { - requestNumber: this.jobContent.requestNumber, - jobNumber: "", - asnNumber: this.jobContent.asnNumber, - ppNumber: this.jobContent.ppNumber, - supplierCode: this.jobContent.supplierCode, - ReceiptDock: this.jobContent.ReceiptDock, - carrierCode: this.jobContent.carrierCode, - transferMode: this.jobContent.transferMode, - vehiclePlateNumber: this.jobContent.vehiclePlateNumber, - fromWarehouseCode: this.toLocationInfo.WarehouseCode, - toWarehouseCode: this.toLocationInfo.WarehouseCode, - OutTransaction: this.businessType.OutTransactionType, //出库事务类型 - InTransaction: this.businessType.InTransactionType, //入库事务类型 - executeTime: "2023-08-4 16:30:11", //执行时间 - activeDate: "2023-08-4 16:30:11", //生效时间 - available: "1", //是否可用 0不可用,1可用 - requestTime: this.jobContent.requestTime, - dueTime: "2023-08-4 16:30:11", //截止时间 - departmentCode: this.jobContent.departmentCode, - UserPositionCode: "", //岗位 - interfaceType: "jklxPURCHASE_RECEIPT", //接口类型 - Number: this.jobContent.Number, - businessType: this.jobContent.businessType, - remark: this.jobContent.remark, - creationTime: this.jobContent.creationTime, - Creatorld: this.jobContent.Creatorld, - creatorName: this.jobContent.creatorName, - extraProperties: this.jobContent.extraProperties, - Siteld: this.jobContent.Siteld, - Code: "", - subList: [ - - ], + if(this.fromType=="requestType"){ + var params = this.setParams(false) + 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.setParams(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); + } + }); } - this.detailSource.forEach(res => { - res.subList.forEach(res1 => { - if (res1.scaned) { - res1.record.FromLocationGroupCode = ""; - res1.record.FromAreaCode = ""; - res1.record.ToLocationGroupCode = this.toLocationInfo.LocationGroupCode; - res1.record.ToAreaCode = this.toLocationInfo.AreaCode; - res1.record.VisualInspectResult = ""; //目检结果 - res1.record.VisualInspectPhotos = ""; //目检照片 - res1.record.FailedReason = ""; //不合格原因 - res1.record.MassDefect = ""; //质量缺陷 - res1.record.SinglePrice = ""; //单价 - res1.record.Amount = ""; //金额 - res1.record.Code = ""; - res1.record.JobDetailID = res1.record.id; - res1.record.interfaceType = "jklxPURCHASE_RECEIPT"; - params.subList.push(res1.record) + }, + + setParams(queryModel) { + var subList = [] + var creator = this.$store.state.user.id + this.detailSource.forEach(item => { + item.subList.forEach(detail => { + if (detail.scaned) { + // var subItem = {}; + // Object.assign(subItem, detail) + 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 = "" + } + + subList.push(detail) } }) }) - - return params; + this.jobContent.subList = subList + this.jobContent.creator = creator; + return this.jobContent; }, + showMessage(message) { this.$refs.comMessage.showMessage(message, res => { if (res) {} diff --git a/pages/deliver/job/deliverDetail.vue b/pages/deliver/job/deliverDetail.vue index 1d7bc4e9..f753256b 100644 --- a/pages/deliver/job/deliverDetail.vue +++ b/pages/deliver/job/deliverDetail.vue @@ -377,7 +377,7 @@ // if (res.data) { // this.showCommitSuccessMessage("提交成功
生成制品收货记录" + res.data, ) // } else { - // this.showErrorMessage("提交失败"+res.msg) + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // }).catch(error => { // uni.hideLoading() diff --git a/pages/deliver/record/deliverRecord.vue b/pages/deliver/record/deliverRecord.vue index 6ca627a4..338dcbde 100644 --- a/pages/deliver/record/deliverRecord.vue +++ b/pages/deliver/record/deliverRecord.vue @@ -120,17 +120,15 @@ businessType: {}, customerList: [], customer: "", - fromType: "" + fromType: "", + showToLoaction: true }; }, onLoad(option) { this.fromType = option.fromType - if (this.fromType == "requestType") { - updateTitle("制品发货申请") - } else { - updateTitle("制品发货记录") - } - var typeCode = "Deliver" + this.updateTitle(); + + var typeCode = "DeliverRequest" getBusinessType(typeCode, res => { if (res.success) { this.businessType = res.businessType; @@ -168,6 +166,15 @@ mounted() {}, methods: { + updateTitle() { + if (this.fromType == "requestType") { + updateTitle("制品发货申请") + } else { + updateTitle("制品发货记录") + } + }, + + getScanResult(result) { let balance = result.balance; let label = result.label; @@ -283,81 +290,56 @@ var params = this.setParams(); console.log("提交" + JSON.stringify(params)) - // (this.id, params).then(res => { - // uni.hideLoading() - // if (res.data) { - // var hint = res.data.Number; - // this.showCommitSuccessMessage("提交成功" + hint, ) - - // } else { - // this.showErrorMessage("提交失败") - // } - // }).catch(error => { - // uni.hideLoading() - // this.showErrorMessage(error) - // }) + if (this.fromType == "requestType") { + // deliverRequestSubmit(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 { + // deliverRecordSubmit(params).then(res => { + // uni.hideLoading() + // if (res.data) { + // this.showCommitSuccessMessage("提交成功
生成采购收货记录" + res.data, ) + // } else { + // this.showErrorMessage("提交失败"+res.msg) + // } + // }).catch(error => { + // uni.hideLoading() + // this.showErrorMessage(error) + // }) + } + }, setParams() { - var params = { - requestNumber: this.jobContent.requestNumber, - jobNumber: "", - asnNumber: this.jobContent.asnNumber, - ppNumber: this.jobContent.ppNumber, - supplierCode: this.jobContent.supplierCode, - receiptDock: this.jobContent.receiptDock, - carrierCode: this.jobContent.carrierCode, - transferMode: this.jobContent.transferMode, - vehiclePlateNumber: this.jobContent.vehiclePlateNumber, - fromWarehouseCode: this.toLocationInfo.WarehouseCode, - toWarehouseCode: this.toLocationInfo.WarehouseCode, - OutTransaction: this.businessTypeInfo.OutTransactionType, //出库事务类型 - InTransaction: this.businessTypeInfo.InTransactionType, //入库事务类型 - executeTime: "2023-08-4 16:30:11", //执行时间 - activeDate: "2023-08-4 16:30:11", //生效时间 - available: "1", //是否可用 0不可用,1可用 - requestTime: this.jobContent.requestTime, - dueTime: "2023-08-4 16:30:11", //截止时间 - departmentCode: this.jobContent.departmentCode, - UserPositionCode: "", //岗位 - interfaceType: "jklxPURCHASE_RECEIPT", //接口类型 - Number: this.jobContent.Number, - businessType: this.jobContent.businessType, - remark: this.jobContent.remark, - creationTime: this.jobContent.creationTime, - Creatorld: this.jobContent.Creatorld, - creatorName: this.jobContent.creatorName, - extraProperties: this.jobContent.extraProperties, - Siteld: this.jobContent.Siteld, - Code: "", - subList: [ - - ], - } - - this.detailSource.forEach(res => { - res.subList.forEach(res1 => { - if (res1.scaned) { - res1.record.FromLocationGroupCode = ""; - res1.record.FromAreaCode = ""; - res1.record.ToLocationGroupCode = this.toLocationInfo.LocationGroupCode; - res1.record.ToAreaCode = this.toLocationInfo.AreaCode; - res1.record.VisualInspectResult = ""; //目检结果 - res1.record.VisualInspectPhotos = ""; //目检照片 - res1.record.FailedReason = ""; //不合格原因 - res1.record.MassDefect = ""; //质量缺陷 - res1.record.SinglePrice = ""; //单价 - res1.record.Amount = ""; //金额 - res1.record.Code = ""; - res1.record.JobDetailID = res1.record.id; - res1.record.interfaceType = "jklxPURCHASE_RECEIPT"; - params.subList.push(res1.record) + var subList = [] + var creator = this.$store.state.user.id + this.detailSource.forEach(item => { + item.subList.forEach(detail => { + if (detail.scaned) { + // var subItem = {}; + // Object.assign(subItem, detail) + detail.toPackingNumber = detail.packingNumber; + detail.toContainerNumber = detail.containerNumber + detail.toBatch = detail.toBatch; + detail.toInventoryStatus = detail.inventoryStatus + detail.toLocationCode = "" + + subList.push(detail) } }) }) - - return params; + this.jobContent.subList = subList + this.jobContent.creator = creator; + return this.jobContent; }, showMessage(message) { @@ -400,7 +382,6 @@ }) return } - this.ToLocationCodeInfo = location; this.toLocationCode = code; }, diff --git a/pages/inventoryMove/job/inventoryMoveDetail.vue b/pages/inventoryMove/job/inventoryMoveDetail.vue index 7f56a10d..52498132 100644 --- a/pages/inventoryMove/job/inventoryMoveDetail.vue +++ b/pages/inventoryMove/job/inventoryMoveDetail.vue @@ -333,7 +333,7 @@ // if (res.data) { // this.showCommitSuccessMessage("提交成功
生成库存转移记录" + res.data) // } else { - // this.showErrorMessage("提交失败"+res.msg) + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // }).catch(error => { // uni.hideLoading() diff --git a/pages/issue/record/issueRecord.vue b/pages/issue/record/issueRecord.vue index b65c5db6..3bf4646a 100644 --- a/pages/issue/record/issueRecord.vue +++ b/pages/issue/record/issueRecord.vue @@ -172,7 +172,7 @@ if (res.data) { this.showCommitSuccessMessage("提交成功
生成发料申请" + res.data) } else { - this.showErrorMessage("提交失败" + res.msg) + this.showErrorMessage("提交失败[" + res.msg + "]") } }).catch(error => { uni.hideLoading() @@ -186,7 +186,7 @@ if (res.data) { this.showCommitSuccessMessage("提交成功
生成发料记录" + res.data) } else { - this.showErrorMessage("提交失败" + res.msg) + this.showErrorMessage("提交失败[" + res.msg + "]") } }).catch(error => { uni.hideLoading() diff --git a/pages/issue/request/issueRequestSubmit.vue b/pages/issue/request/issueRequestSubmit.vue index c82c7510..e92d1329 100644 --- a/pages/issue/request/issueRequestSubmit.vue +++ b/pages/issue/request/issueRequestSubmit.vue @@ -164,7 +164,7 @@ if (res.data) { this.showCommitSuccessMessage("提交成功
生成发料申请" + res.data) } else { - this.showErrorMessage("提交失败" + res.msg) + this.showErrorMessage("提交失败[" + res.msg + "]") } }).catch(error => { uni.hideLoading() diff --git a/pages/package/record/mergePackageRecord.vue b/pages/package/record/mergePackageRecord.vue index 916cfc55..2d57c1dd 100644 --- a/pages/package/record/mergePackageRecord.vue +++ b/pages/package/record/mergePackageRecord.vue @@ -255,7 +255,7 @@ // this.showCommitSuccessMessage("提交成功" + hint, ) // } else { - // this.showErrorMessage("提交失败") + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // }).catch(error => { // uni.hideLoading() diff --git a/pages/package/record/mergePackageRecord.vue.b17252 b/pages/package/record/mergePackageRecord.vue.b17252 index f7919ee0..8afcfbbe 100644 --- a/pages/package/record/mergePackageRecord.vue.b17252 +++ b/pages/package/record/mergePackageRecord.vue.b17252 @@ -250,7 +250,7 @@ // this.showCommitSuccessMessage("提交成功" + hint, ) // } else { - // this.showErrorMessage("提交失败") + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // }).catch(error => { // uni.hideLoading() diff --git a/pages/package/record/mergePackageRecord.vue.y17252 b/pages/package/record/mergePackageRecord.vue.y17252 index 46226bca..7b01c114 100644 --- a/pages/package/record/mergePackageRecord.vue.y17252 +++ b/pages/package/record/mergePackageRecord.vue.y17252 @@ -254,7 +254,7 @@ // this.showCommitSuccessMessage("提交成功" + hint, ) // } else { - // this.showErrorMessage("提交失败") + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // }).catch(error => { // uni.hideLoading() diff --git a/pages/package/record/overPackageRecord.vue b/pages/package/record/overPackageRecord.vue index b84644d8..b8e62b86 100644 --- a/pages/package/record/overPackageRecord.vue +++ b/pages/package/record/overPackageRecord.vue @@ -279,7 +279,7 @@ // this.showCommitSuccessMessage("提交成功" + hint, ) // } else { - // this.showErrorMessage("提交失败") + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // }).catch(error => { // uni.hideLoading() diff --git a/pages/package/record/splitPackageRecord.vue b/pages/package/record/splitPackageRecord.vue index c56dfecb..61d08164 100644 --- a/pages/package/record/splitPackageRecord.vue +++ b/pages/package/record/splitPackageRecord.vue @@ -279,7 +279,7 @@ // this.showCommitSuccessMessage("提交成功" + hint, ) // } else { - // this.showErrorMessage("提交失败") + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // }).catch(error => { // uni.hideLoading() diff --git a/pages/productDismantle/job/productDismantleDetail.vue b/pages/productDismantle/job/productDismantleDetail.vue index 9855c2b1..5641a2c4 100644 --- a/pages/productDismantle/job/productDismantleDetail.vue +++ b/pages/productDismantle/job/productDismantleDetail.vue @@ -356,7 +356,7 @@ // if (res.data) { // this.showCommitSuccessMessage("提交成功
生成采购收货记录" + res.data.Number, ) // } else { - // this.showErrorMessage("提交失败") + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // uni.hideLoading() // }).catch(error => { diff --git a/pages/productDismantle/record/productDismantleRecord.vue b/pages/productDismantle/record/productDismantleRecord.vue index c72bdba1..f6ba5a74 100644 --- a/pages/productDismantle/record/productDismantleRecord.vue +++ b/pages/productDismantle/record/productDismantleRecord.vue @@ -246,7 +246,7 @@ // if (res.data) { // this.showCommitSuccessMessage("提交成功
生成采购收货记录" + res.data, ) // } else { - // this.showErrorMessage("提交失败"+res.msg) + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // }).catch(error => { // uni.hideLoading() diff --git a/pages/productPutaway/job/productPutawayDetail.vue b/pages/productPutaway/job/productPutawayDetail.vue index 8631c7e7..538b27bb 100644 --- a/pages/productPutaway/job/productPutawayDetail.vue +++ b/pages/productPutaway/job/productPutawayDetail.vue @@ -388,7 +388,7 @@ // if (res.data) { // this.showCommitSuccessMessage("提交成功
生成制品上架记录" + res.data) // } else { - // this.showErrorMessage("提交失败"+res.msg) + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // }).catch(error => { // uni.hideLoading() diff --git a/pages/productPutaway/record/productPutawayRecord.vue b/pages/productPutaway/record/productPutawayRecord.vue index 4b31331b..4b6e6e41 100644 --- a/pages/productPutaway/record/productPutawayRecord.vue +++ b/pages/productPutaway/record/productPutawayRecord.vue @@ -18,7 +18,7 @@
- @@ -49,7 +49,12 @@ } from '@/api/request2.js'; import { goHome, + updateTitle, + getPackingNumberAndBatch } from '@/common/basic.js'; + import { + getManagementPrecisions + } from '@/common/balance.js'; import { getInventoryStatusDesc, @@ -109,10 +114,13 @@ allowModifyLocation: false, inInventoryStatus: "", //目标入库库存状态 outInventoryStatus: "", //来源出库库存状态 - businessType: {} + businessType: {}, + showToLoaction:true }; }, onLoad(option) { + this.fromType = option.fromType; + this.updateTitle(); var typeCode = "ProductPutaway" getBusinessType(typeCode, res => { if (res.success) { @@ -124,6 +132,7 @@ this.$refs.comMessage.showBreakMessage(res.message ); } }); + }, //返回首页 onNavigationBarButtonTap(e) { @@ -139,6 +148,16 @@ mounted() { }, methods: { + updateTitle(){ + if(this.fromType=="requestType"){ + this.showToLoaction=false + updateTitle("制品上架申请") + }else { + updateTitle("制品上架记录") + this.showToLoaction=true + } + }, + getScanResult(result) { let balance = result.balance; let label = result.label; @@ -237,47 +256,96 @@ }, commit() { - if (this.toLocationCode == "") { + if (this.showToLoaction &&this.toLocationCode == "") { this.showMessage("请先选择目标库位") return; } - //允许部分提交 + uni.showLoading({ title: "提交中....", mask: true }); - - var params = this.setParams(); - console.log("提交" + JSON.stringify(params)) + + if(this.fromType=="requestType"){ + var params = this.setParams(false) + console.log("提交" + JSON.stringify(params)) // productPutawayRequestSubmit(params).then(res => { // uni.hideLoading() // 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.setParams(true) + console.log("提交参数", JSON.stringify(params)); - // productPutawayRecordSubmit(params).then(res => { - // uni.hideLoading() - // if (res.data) { - // this.showCommitSuccessMessage("提交成功
生成采购收货记录" + res.data, ) - // } else { - // this.showErrorMessage("提交失败"+res.msg) - // } - // }).catch(error => { - // uni.hideLoading() - // this.showErrorMessage(error) - // }) + // productPutawayRecordSubmit(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); + } + }); } - }, + + setParams(queryModel) { + var subList = [] + var creator = this.$store.state.user.id + this.detailSource.forEach(item => { + item.subList.forEach(detail => { + if (detail.scaned) { + // var subItem = {}; + // Object.assign(subItem, detail) + 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 = "" + } + + subList.push(detail) + } + }) + }) + this.jobContent.subList = subList + this.jobContent.creator = creator; + return this.jobContent; + }, showMessage(message) { diff --git a/pages/productReceipt/job/productReceiptDetail.vue b/pages/productReceipt/job/productReceiptDetail.vue index a52f9f91..8bb89015 100644 --- a/pages/productReceipt/job/productReceiptDetail.vue +++ b/pages/productReceipt/job/productReceiptDetail.vue @@ -337,7 +337,7 @@ // if (res.data) { // this.showCommitSuccessMessage("提交成功
生成制品收货记录" + res.data, ) // } else { - // this.showErrorMessage("提交失败"+res.msg) + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // }).catch(error => { // uni.hideLoading() diff --git a/pages/productReceipt/record/productReceiptRecord.vue b/pages/productReceipt/record/productReceiptRecord.vue index 49675d40..de429815 100644 --- a/pages/productReceipt/record/productReceiptRecord.vue +++ b/pages/productReceipt/record/productReceiptRecord.vue @@ -237,7 +237,7 @@ // if (res.data) { // this.showCommitSuccessMessage("提交成功
生成采购收货记录" + res.data, ) // } else { - // this.showErrorMessage("提交失败"+res.msg) + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // }).catch(error => { // uni.hideLoading() diff --git a/pages/productionReceipt/job/productionReceiptDetail.vue b/pages/productionReceipt/job/productionReceiptDetail.vue index e758ab73..e60e1f4a 100644 --- a/pages/productionReceipt/job/productionReceiptDetail.vue +++ b/pages/productionReceipt/job/productionReceiptDetail.vue @@ -381,7 +381,7 @@ // if (res.data) { // this.showCommitSuccessMessage("提交成功
生成发料接收记录" + res.data) // } else { - // this.showErrorMessage("提交失败"+res.msg) + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // }).catch(error => { // uni.hideLoading() diff --git a/pages/productionReceipt/record/productionReceiptRecord.vue b/pages/productionReceipt/record/productionReceiptRecord.vue index f5de1a4f..62530bc6 100644 --- a/pages/productionReceipt/record/productionReceiptRecord.vue +++ b/pages/productionReceipt/record/productionReceiptRecord.vue @@ -244,7 +244,7 @@ // if (res.data) { // this.showCommitSuccessMessage("提交成功
生成采购收货记录" + res.data, ) // } else { - // this.showErrorMessage("提交失败"+res.msg) + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // }).catch(error => { // uni.hideLoading() diff --git a/pages/productionReturn/coms/comReturn.vue b/pages/productionReturn/coms/comReturn.vue index a478b677..7104b729 100644 --- a/pages/productionReturn/coms/comReturn.vue +++ b/pages/productionReturn/coms/comReturn.vue @@ -17,7 +17,7 @@
- @@ -48,7 +48,9 @@ } from '@/api/request2.js'; import { - goHome + goHome, + updateTitle, + getPackingNumberAndBatch } from '@/common/basic.js'; import { @@ -61,6 +63,9 @@ createDetailInfo, calcHandleQty } from '@/common/record.js'; + import { + getManagementPrecisions + } from '@/common/balance.js'; import winScanButton from '@/mycomponents/scan/winScanButton.vue' import requiredLocation from '@/mycomponents/location/requiredLocation.vue' @@ -99,6 +104,17 @@ }, + + watch: { + fromType: { + handler(newName, oldName) { + this.updateTitle() + }, + immediate: true, + deep: true + } + }, + data() { return { id: '', @@ -113,6 +129,7 @@ toLocationCode: '', tolocationTypeList: [], businessType: {}, + showToLoaction:false }; }, @@ -135,7 +152,10 @@ this.$refs.comMessage.showBreakMessage(res.message); } }); + + }, + //返回首页 onNavigationBarButtonTap(e) { if (e.index === 0) { @@ -150,6 +170,25 @@ }, methods: { + updateTitle(){ + if(this.businessTypeCode=='returnToStore'){ + if(this.fromType == 'requestType'){ + updateTitle("合格退料申请") + this.showToLoaction=false + }else { + updateTitle("合格退料记录") + this.showToLoaction=true + } + }else if(this.businessTypeCode=='returnToHold'){ + if(this.fromType == 'requestType'){ + updateTitle("隔离退料申请") + this.showToLoaction=false + }else { + updateTitle("隔离退料记录") + this.showToLoaction=true + } + } + }, showFromLocationPopup() { this.$nextTick(() => { this.$refs.scanFromLocationCode.openScanPopup(); @@ -208,7 +247,6 @@ }, - removePack() { for (var i = 0; i < this.detailSource.length; i++) { var item = this.detailSource[i]; @@ -236,103 +274,97 @@ }, commit() { - if (this.toLocationCode == "") { + if (this.showToLoaction &&this.toLocationCode == "") { this.showMessage("请先选择目标库位") return; } - //允许部分提交 - if (this.jobContent.allowPartialComplete == "TRUE") { - uni.showLoading({ - title: "提交中....", - mask: true - }); - - var params = this.setParams(); + + uni.showLoading({ + title: "提交中....", + mask: true + }); + + if(this.fromType=="requestType"){ + var params = this.setParams(false) console.log("提交" + JSON.stringify(params)) - // (this.id, params).then(res => { + // productionReturnRequestSubmit(params).then(res => { // uni.hideLoading() // if (res.data) { - // var hint = res.data.Number; - // this.showCommitSuccessMessage("提交成功" + hint, ) - + // this.showCommitSuccessMessage("提交成功
生成采购收货记录" + res.data, ) // } else { - // this.showErrorMessage("提交失败") + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // }).catch(error => { // uni.hideLoading() // this.showErrorMessage(error) // }) - } else { - this.calcScanCount(); - if (this.scanCount < this.subList.length) { - this.showMessage('请完成扫描后,再进行提交
' + "已经扫描[" + this.scanCount + "]总共[" + this.subList.length + - "]"); - } + }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.setParams(true) + console.log("提交参数", JSON.stringify(params)); + + // productionReturnRecordSubmit(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); + } + }); } }, - - setParams() { - var params = { - requestNumber: this.jobContent.requestNumber, - jobNumber: "", - asnNumber: this.jobContent.asnNumber, - ppNumber: this.jobContent.ppNumber, - supplierCode: this.jobContent.supplierCode, - ReceiptDock: this.jobContent.ReceiptDock, - carrierCode: this.jobContent.carrierCode, - transferMode: this.jobContent.transferMode, - vehiclePlateNumber: this.jobContent.vehiclePlateNumber, - fromWarehouseCode: this.toLocationInfo.WarehouseCode, - toWarehouseCode: this.toLocationInfo.WarehouseCode, - OutTransaction: this.businessType.OutTransactionType, //出库事务类型 - InTransaction: this.businessType.InTransactionType, //入库事务类型 - executeTime: "2023-08-4 16:30:11", //执行时间 - activeDate: "2023-08-4 16:30:11", //生效时间 - available: "1", //是否可用 0不可用,1可用 - requestTime: this.jobContent.requestTime, - dueTime: "2023-08-4 16:30:11", //截止时间 - departmentCode: this.jobContent.departmentCode, - UserPositionCode: "", //岗位 - interfaceType: "jklxPURCHASE_RECEIPT", //接口类型 - Number: this.jobContent.Number, - businessType: this.jobContent.businessType, - remark: this.jobContent.remark, - creationTime: this.jobContent.creationTime, - Creatorld: this.jobContent.Creatorld, - creatorName: this.jobContent.creatorName, - extraProperties: this.jobContent.extraProperties, - Siteld: this.jobContent.Siteld, - Code: "", - subList: [ - - ], - } - - this.detailSource.forEach(res => { - res.subList.forEach(res1 => { - if (res1.scaned) { - res1.record.FromLocationGroupCode = ""; - res1.record.FromAreaCode = ""; - res1.record.ToLocationGroupCode = this.toLocationInfo.LocationGroupCode; - res1.record.ToAreaCode = this.toLocationInfo.AreaCode; - res1.record.VisualInspectResult = ""; //目检结果 - res1.record.VisualInspectPhotos = ""; //目检照片 - res1.record.FailedReason = ""; //不合格原因 - res1.record.MassDefect = ""; //质量缺陷 - res1.record.SinglePrice = ""; //单价 - res1.record.Amount = ""; //金额 - res1.record.Code = ""; - res1.record.JobDetailID = res1.record.id; - res1.record.interfaceType = "jklxPURCHASE_RECEIPT"; - params.subList.push(res1.record) + + setParams(queryModel) { + var subList = [] + var creator = this.$store.state.user.id + this.detailSource.forEach(item => { + item.subList.forEach(detail => { + if (detail.scaned) { + // var subItem = {}; + // Object.assign(subItem, detail) + 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 = "" + } + + subList.push(detail) } }) }) - - return params; + this.jobContent.subList = subList + this.jobContent.creator = creator; + return this.jobContent; }, + showMessage(message) { this.scanPopupLoseFocus(); this.$refs.comMessage.showMessage(message, res => { diff --git a/pages/productionReturn/job/returnDetail.vue b/pages/productionReturn/job/returnDetail.vue index a06991ab..8ab84e96 100644 --- a/pages/productionReturn/job/returnDetail.vue +++ b/pages/productionReturn/job/returnDetail.vue @@ -365,7 +365,7 @@ // this.showCommitSuccessMessage("提交成功" + hint) // } else { - // this.showErrorMessage("提交失败") + // this.showErrorMessage("提交失败[" + res.msg + "]") // } // }).catch(error => { // uni.hideLoading() diff --git a/pages/productionReturn/record/returnToHold.vue b/pages/productionReturn/record/returnToHold.vue index e62a47a6..361fc623 100644 --- a/pages/productionReturn/record/returnToHold.vue +++ b/pages/productionReturn/record/returnToHold.vue @@ -1,11 +1,11 @@ diff --git a/static/config.json b/static/config.json index 98262940..0e975816 100644 --- a/static/config.json +++ b/static/config.json @@ -18,7 +18,7 @@ "request_url": { "name": "request_url", - "value": "http://192.168.0.157:12080/admin-api", + "value": "http://dev.ccwin-in.com:25100/api/admin-api", "dev2":"http://192.168.0.157:12080/admin-api", "dev":"http://dev.ccwin-in.com:25100/api/admin-api", "local":"http://localhost:12080",