From c006e5d2db31f61213e986ed60dc8f2195769044 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Tue, 19 Dec 2023 18:28:05 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E5=A4=9A=E4=B8=AA=E5=8F=82=E6=95=B0=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/request2.js | 23 ++- common/balance.js | 32 +++++ common/basic.js | 37 +++++ .../inventoryMove/job/inventoryMoveDetail.vue | 134 +++++++++--------- static/config.json | 2 +- 5 files changed, 159 insertions(+), 69 deletions(-) diff --git a/api/request2.js b/api/request2.js index 04a61954..4e501e6d 100644 --- a/api/request2.js +++ b/api/request2.js @@ -2081,8 +2081,8 @@ export function transferReceiptJobSubmit(params) { */ export function transferReceiptRecordSubmit(params) { return request({ - url: baseApi + "/magic-api/pda/job/purchasereceipt/jobSubmit", - method: "put", + url: baseApi + "/wms/transferreceipt-record-main/create", + method: "post", data: params, }); } @@ -2162,8 +2162,8 @@ export function transferIssueJobSubmit(params) { */ export function transferIssueRecordSubmit(params) { return request({ - url: baseApi + "/magic-api/pda/job/purchasereceipt/jobSubmit", - method: "put", + url: baseApi + "/wms/transferissue-record-main/create", + method: "post", data: params, }); } @@ -3012,6 +3012,21 @@ export function getBalanceByFilter(param) { }); } +/** + * 查询管理精度,多个零件,多个库位 + * @param {*} + * + */ +export function getPrecisionStrategy(param) { + return request({ + url: baseApi + "/wms/rule/getPrecisionStrategy", + method: "post", + data: param, + }); +} + + + /** * 删除文件 diff --git a/common/balance.js b/common/balance.js index 8733e89a..77dcd174 100644 --- a/common/balance.js +++ b/common/balance.js @@ -1,8 +1,40 @@ import { getManagementPrecision, + getPrecisionStrategy, getBalanceByFilter } from '@/api/request2.js'; + +/** + * "itemCode": [], + "locationCode":"INSPECT" + 管理精度策略 + * @param {*} + * + */ +export function getPrecisionStrategyList(itemList, callback) { + // let jsonParem = JSON.stringify(param) + let result = { + list: [], + success: true, + message: '' + }; + + getPrecisionStrategy(itemList).then(res => { + if (res.data == null) { + result.success = false + result.message = '未查询到管理精度信息' + } else { + result.list = res.data; + } + callback(result); + }).catch(error => { + result.success = false; + result.message = error; + callback(result); + }) +} + /** * "itemCode": [], "locationCode":"INSPECT" diff --git a/common/basic.js b/common/basic.js index f3507b2a..3b5fd75c 100644 --- a/common/basic.js +++ b/common/basic.js @@ -606,6 +606,43 @@ export function getInspectReasonList(value) { // else return 'Other' // } +export function getPackingNumberAndBatchByList(managementList, itemCode, packingNumber,locationCode, batch) { + var itemInfo = { + packingNumber: "", + batch: "" + } + + var manageType = queryManageModelByList(managementList, itemCode,locationCode) + if (manageType == "BY_QUANTITY") { + itemInfo.packingNumber = "" + itemInfo.batch = "" + } else if (manageType == "BY_BATCH") { + itemInfo.packingNumber = "" + itemInfo.batch = batch + } else if (manageType == "BY_PACKAGING") { + itemInfo.packingNumber = packingNumber + itemInfo.batch = batch + } else if (manageType == "BY_UNIQUE_ID") { + itemInfo.packingNumber = packingNumber + itemInfo.batch = batch + } + return itemInfo; +} + +export function queryManageModelByList(managementList, itemCode,locationCode) { + var result = managementList.filter(res => { + if (res.itemCode == itemCode&&res.locationCode==locationCode) { + return res.ManagementPrecision + } + }) + + if (result != undefined) { + return result[0].ManagementPrecision + } else { + return "" + } +} + // 获取业务类型字典项 export function getBusinessTypeDesc(type) { diff --git a/pages/inventoryMove/job/inventoryMoveDetail.vue b/pages/inventoryMove/job/inventoryMoveDetail.vue index d181cc1b..e1875ac8 100644 --- a/pages/inventoryMove/job/inventoryMoveDetail.vue +++ b/pages/inventoryMove/job/inventoryMoveDetail.vue @@ -48,7 +48,8 @@ inventoryMoveSubmit } from '@/api/request2.js'; import { - getManagementPrecisions + getManagementPrecisions, + getPrecisionStrategyList } from '@/common/balance.js'; import { @@ -61,7 +62,7 @@ updateTitle, navigateBack, getCurrDateTime, - getPackingNumberAndBatch, + getPackingNumberAndBatchByList, getInventoryStatusName } from '@/common/basic.js'; @@ -203,7 +204,7 @@ this.scanPopupGetFocus(); } }, - + openDetail(item) { this.$refs.jobDetailPopup.openPopup(item) }, @@ -264,16 +265,17 @@ } else { let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus); - if (itemDetail.inventoryStatus != result.balance.inventoryStatus){ - if(this.jobContent.allowModifyInventoryStatus=="TRUE"){ - this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + + if (itemDetail.inventoryStatus != result.balance.inventoryStatus) { + if (this.jobContent.allowModifyInventoryStatus == "TRUE") { + this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + + itemStatus + ']不一致,是否继续转移?', res => { if (res) { itemDetail.scaned = true; - itemDetail.handleQty = Number(result.balance.qty) ; + itemDetail.handleQty = Number(result.balance.qty); itemDetail.toInventoryStatus = result.balance.inventoryStatus; itemDetail.balance = result.balance; - itemDetail.balance.balanceQty =Number(result.balance.qty) ; + itemDetail.balance.balanceQty = Number(result.balance.qty); itemDetail.balance.stdPackQty = Number(result.package.stdPackQty) itemDetail.balance.stdPackUnit = result.package.stdPackUnit this.calcHandleQty(); @@ -281,15 +283,16 @@ this.scanPopupGetFocus(); } }); - }else { - this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + + } else { + this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + + itemStatus + ']不一致,不允许转移!', res => { this.scanPopupGetFocus(); }); } - }else { + } else { itemDetail.scaned = true; - itemDetail.handleQty = Number(result.balance.qty) ; + itemDetail.handleQty = Number(result.balance.qty); itemDetail.toInventoryStatus = result.balance.inventoryStatus; itemDetail.balance = result.balance; itemDetail.balance.balanceQty = Number(result.balance.qty); @@ -297,27 +300,6 @@ itemDetail.balance.stdPackUnit = result.package.stdPackUnit this.calcHandleQty(); } - - - // if (itemDetail.inventoryStatus != result.balance.inventoryStatus) { - // this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + - // ']不一致,是否继续转移?', res => { - // if (res) { - // itemDetail.scaned = true; - // itemDetail.handleQty = Number(result.balance.qty) ; - // itemDetail.toInventoryStatus = result.balance.inventoryStatus; - // itemDetail.balance = result.balance; - // itemDetail.balance.balanceQty = result.balance.qty; - // itemDetail.balance.stdPackQty = result.package.stdPackQty - // itemDetail.balance.stdPackUnit = result.package.stdPackUnit - // this.calcHandleQty(); - // } else { - // this.scanPopupGetFocus(); - // } - // }); - // } else { - - // } } } } @@ -362,35 +344,59 @@ title: "提交中....", mask: true }); - this.managementList = []; - //查询管理模式 - // this.detailSource.forEach(item => { - // item.subList.forEach(detail => { - // if (detail.scaned) { - // getManagementPrecisions(item.itemCode,detail.toLocationCode,res=>{ - // if (res.success) { - // this.managementList = this.managementList.concat(res.list) - - // } - // }) - // } - // }) - // }) - var params = this.setParams(); - console.log("提交" + JSON.stringify(params)) - - inventoryMoveSubmit(params).then(res => { - uni.hideLoading() - if (res.data) { - this.showCommitSuccessMessage("提交成功
生成库存转移记录
" + res.data) + //查询管理模式 + this.managementList = []; + var precisionStrategParams = this.setPrecisionStrategParams() + getPrecisionStrategyList(precisionStrategParams, res => { + if (res.success) { + this.managementList = res.list; + var params = this.setParams() + console.log("提交" + JSON.stringify(params)) + inventoryMoveSubmit(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 { - this.showErrorMessage("提交失败[" + res.msg + "]") + uni.hideLoading(); + this.showErrorMessage(res.message); } - }).catch(error => { - uni.hideLoading() - this.showErrorMessage(error) + }) + + }, + + 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.toLocationCode + } + itemList.push(result) + } + + } + }) + }) + return itemList; }, setParams() { @@ -400,12 +406,12 @@ this.detailSource.forEach(item => { item.subList.forEach(detail => { if (detail.scaned) { - // var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, - // detail.packingNumber, detail.batch); - detail.toPackingNumber = detail.packingNumber; - detail.toBatch = detail.batch; + var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, + detail.packingNumber, detail.toLocationCode, detail.batch); + detail.toPackingNumber = info.packingNumber; + detail.toBatch = info.batch; detail.toContainerNumber = ''; - + detail.toLocationCode = detail.toLocationCode; subList.push(detail) } @@ -478,7 +484,7 @@ navigateBack(1) }) }, - + } } diff --git a/static/config.json b/static/config.json index 67781eb9..5a5fa352 100644 --- a/static/config.json +++ b/static/config.json @@ -18,7 +18,7 @@ "request_url": { "name": "request_url", - "value": "http://192.168.0.230: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.180:12080/admin-api", "chenxinming": "http://192.168.0.230:12080/admin-api", From 7c1667420a90395ab50a921c85a260494653552d Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Tue, 19 Dec 2023 20:00:00 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=BA=93=E5=AD=98=E8=BD=AC=E7=A7=BB?= =?UTF-8?q?=E4=BB=BB=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", From 4de47fa58c5a12ae530a6e5294e8fa7836d7a264 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Wed, 20 Dec 2023 13:39:38 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E8=B0=83=E6=8B=A8=E5=87=BA=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mycomponents/balance/purchaseLabel.vue | 2 +- pages/transfer/coms/comTransferRecord.vue | 145 ++++++++++----------- pages/transfer/record/deliverRecord.vue | 2 +- pages/unPlanned/coms/comReceiptRecord.vue | 2 +- pages/unPlanned/record/issueRecord.vue | 24 +++- pages/unPlanned/record/receiptRecord.vue | 152 ++++++++++++++-------- static/config.json | 2 +- 7 files changed, 192 insertions(+), 137 deletions(-) diff --git a/mycomponents/balance/purchaseLabel.vue b/mycomponents/balance/purchaseLabel.vue index c4b25002..18a48b91 100644 --- a/mycomponents/balance/purchaseLabel.vue +++ b/mycomponents/balance/purchaseLabel.vue @@ -2,7 +2,7 @@ - + diff --git a/pages/transfer/coms/comTransferRecord.vue b/pages/transfer/coms/comTransferRecord.vue index 7e28bbb3..b4179202 100644 --- a/pages/transfer/coms/comTransferRecord.vue +++ b/pages/transfer/coms/comTransferRecord.vue @@ -1,16 +1,15 @@ diff --git a/static/config.json b/static/config.json index b1edf25d..01b08039 100644 --- a/static/config.json +++ b/static/config.json @@ -18,7 +18,7 @@ "request_url": { "name": "request_url", - "value": "http://192.168.0.180:12080/admin-api", + "value": "http://192.168.0.106: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", From 5f247206b0174d9b4cedb642e1b9d26a1fdbd9a6 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Wed, 20 Dec 2023 14:44:57 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=A4=96=E5=87=BA=E5=85=A5=E5=BA=93=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/request2.js | 6 +- common/basic.js | 11 --- pages/scrap/record/scrapRecord.vue | 108 +++++++++++------------ pages/unPlanned/record/issueRecord.vue | 42 ++++++--- pages/unPlanned/record/receiptRecord.vue | 58 +++++++----- 5 files changed, 125 insertions(+), 100 deletions(-) diff --git a/api/request2.js b/api/request2.js index 4e501e6d..fe9b77c1 100644 --- a/api/request2.js +++ b/api/request2.js @@ -1349,7 +1349,7 @@ export function unPlannedReceiptRequestHandle(id) { */ export function unPlannedReceiptRecordbSubmit(id, params) { return request({ - url: baseApi + "/magic-api/pda/job/purchasereturn/jobSubmit?id=" + id, + url: baseApi + "/wms/unplannedreceipt-record-main/create", method: "post", data: params, }); @@ -2819,8 +2819,8 @@ export function scrapRequestHandle(id) { */ export function scrapRecordSubmit(params) { return request({ - url: baseApi + "/wms/purchasereturn-request-main/submit", - method: "put", + url: baseApi + "/wms/scrap-record-main/create", + method: "post", data: params, }); } diff --git a/common/basic.js b/common/basic.js index 3b5fd75c..84ab342c 100644 --- a/common/basic.js +++ b/common/basic.js @@ -320,17 +320,6 @@ export function getUnPlannedIssuseReasonList(value) { return unplannedIissueReason } -//获取报废出库原因 -export function getScarpReasonList(value) { - if (scrapReasonList.length == 0) { - scrapReasonList = getDirectoryInfo("scrap_reason") - } - scrapReasonList.forEach(res => { - res.text = res.label; - res.value = res.code - }) - return scrapReasonList -} //获取检验不合格原因 export function getInspectReasonList(value) { diff --git a/pages/scrap/record/scrapRecord.vue b/pages/scrap/record/scrapRecord.vue index f2f27e65..6b54bdbd 100644 --- a/pages/scrap/record/scrapRecord.vue +++ b/pages/scrap/record/scrapRecord.vue @@ -10,7 +10,7 @@ + @change="reasonChange"> @@ -56,12 +56,12 @@ import { goHome, updateTitle, - getScarpReasonList } from '@/common/basic.js'; import { getInventoryStatusDesc, getDirectoryItemArray, + getScarpReasonList } from '@/common/directory.js'; import { @@ -94,27 +94,19 @@ data() { return { id: '', - receiptJob: {}, - received: false, - isShowPackingCode: true, - scanCount: 0, dataContent: {}, //任务内容 subList: [], //接口返回的任务subList detailSource: [], //绑定在页面上的数据源 locationTypeList: [], - toLocationInfo: {}, - businessTypeInfo: {}, - fromLocationInfo: {}, fromLocationCode: "", - isShowLocation: false, fromlocationTypeList: [], tolocationTypeList: [], - allowModifyLocation: false, inInventoryStatus: "", //目标入库库存状态 outInventoryStatus: "", //来源出库库存状态 businessType: {}, reasonList: [], - reason: "", + reasonText: "", + reasonCode:"", }; }, onLoad(option) { @@ -249,7 +241,7 @@ commit() { - if(this.reason==""){ + if(this.reasonText==""){ this.showMessage("请先选择报废原因") return; } @@ -258,19 +250,18 @@ title: "提交中....", mask: true }); - - // scrapRecordSubmit(params).then(res => { - // uni.hideLoading() - // if (res.data) { - // this.showCommitSuccessMessage("提交成功
生成采购收货记录" + res.data, ) - // } else { - // this.showErrorMessage("提交失败[" + res.msg + "]") - // } - // }).catch(error => { - // uni.hideLoading() - // this.showErrorMessage(error) - // }) + scrapRecordSubmit(params).then(res => { + uni.hideLoading() + if (res.data) { + this.showCommitSuccessMessage("提交成功
生成报废出库记录" + res.data) + } else { + this.showErrorMessage("提交失败[" + res.msg + "]") + } + }).catch(error => { + uni.hideLoading() + this.showErrorMessage(error) + }) }, @@ -279,10 +270,26 @@ 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; + detail.itemCode = detail.itemCode; + detail.itemName = detail.package.itemName; + detail.itemDesc1 = detail.package.itemDesc1; + detail.itemDesc2 = detail.package.itemDesc2; + + 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 = detail.locationCode; + detail.toLocationCode = ""; + + detail.reason = this.reasonCode; subList.push(detail) } }) @@ -290,31 +297,7 @@ return subList; }, - setRequestParams(){ - var subList = [] - var supplierCode="" - this.detailSource.forEach(item => { - item.subList.forEach(detail => { - if (detail.scaned) { - if(supplierCode==""){ - supplierCode = detail.package.supplierCode - } - 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"; - return this.dataContent; - }, + showMessage(message) { @@ -345,14 +328,18 @@ this.getFromLocationCode(location, code) }, getFromLocationCode(location, code) { - this.fromLocationInfo = location; this.fromLocationCode = code; this.openScanPopup(); }, showCommitSuccessMessage(hint) { this.$refs.comMessage.showSuccessMessage(hint, res => { - this.fromLocationCode = ''; + this.reasonCode = "" + this.reasonText = ""; + this.detailSource = []; + this.subList =[]; + this.managementList =[]; + this.dataContent ={} }) }, @@ -365,6 +352,15 @@ this.detailSource.splice(i, 1) } } + }, + reasonChange(e) { + if (e.detail.value.length == 0) { + this.reasonCode = "" + this.reasonText = "" + } else { + this.reasonCode = e.detail.value[0].value + this.reasonText = e.detail.value[0].text + } } } } diff --git a/pages/unPlanned/record/issueRecord.vue b/pages/unPlanned/record/issueRecord.vue index 8214c1ce..8d36ad07 100644 --- a/pages/unPlanned/record/issueRecord.vue +++ b/pages/unPlanned/record/issueRecord.vue @@ -7,7 +7,7 @@ + placeholder="请选择出库原因" popup-title="出库原因" :localdata="reasonList" @change="reasonChange"> @@ -98,13 +98,15 @@ toInventoryStatus: [], businessType: {}, //业务类型 detailSource: [], //绑定在页面上的数据源 - reason: "", + reasonText: "", + reasonCode:"", reasonList: [], dataContent:{} } }, mounted() { + this.reasonList = getUnPlannedIssuseReasonList(); var typeCode = "UnplannedDeliver" getBusinessType(typeCode, res => { if (res.success) { @@ -209,11 +211,12 @@ this.detailSource.splice(index, 1) }, commit() { - if (this.reason == '') { + if (this.reasonText == '') { this.showErrorMessage("请选择出库原因") return; } var params =this.setParams() + console.log("提交" + JSON.stringify(params)) // unPlannedIssueRecordSubmit(params).then(res => { // uni.hideLoading() // if (res.data) { @@ -232,8 +235,6 @@ this.detailSource.forEach(item => { item.subList.forEach(detail => { if (detail.scaned) { - // var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, - // detail.packingNumber, detail.batch); detail.itemCode = detail.itemCode; detail.itemName = detail.package.itemName; detail.itemDesc1 = detail.package.itemDesc1; @@ -241,17 +242,19 @@ detail.inventoryStatus = detail.inventoryStatus; - detail.fromPackingNumber = info.packingNumber; - detail.toPackingNumber = info.packingNumber; + detail.fromPackingNumber = detail.packingNumber; + detail.toPackingNumber = detail.packingNumber; detail.fromContainerNumber = detail.containerNumber; detail.toContainerNumber = detail.containerNumber - detail.fromBatch = info.batch; - detail.toBatch = info.batch; + detail.fromBatch = detail.batch; + detail.toBatch = detail.batch; detail.fromLocationCode = detail.locationCode; - detail.toLocationCode = detail.toLocationCode; + detail.toLocationCode = ""; + + detail.reason = this.reasonCode; subList.push(detail) } }) @@ -259,6 +262,25 @@ return subList; }, + reasonChange(e) { + if (e.detail.value.length == 0) { + this.reasonCode = "" + this.reasonText = "" + } else { + this.reasonCode = e.detail.value[0].value + this.reasonText = e.detail.value[0].text + } + }, + showCommitSuccessMessage(hint) { + this.$refs.comMessage.showSuccessMessage(hint, res => { + this.reasonCode = "" + this.reasonText = ""; + this.detailSource = []; + this.managementList =[]; + this.dataContent ={} + }) + }, + } } diff --git a/pages/unPlanned/record/receiptRecord.vue b/pages/unPlanned/record/receiptRecord.vue index ca0ecd21..f56bf620 100644 --- a/pages/unPlanned/record/receiptRecord.vue +++ b/pages/unPlanned/record/receiptRecord.vue @@ -8,7 +8,7 @@ + @change="reasonChange"> @@ -27,7 +27,7 @@ - @@ -92,14 +92,13 @@ data() { return { toLocationCode: "", - toLocationInfo: {}, toInventoryStatus: [], businessType: {}, //业务类型 detailSource: [], //绑定在页面上的数据源 businessTypeCode: "UnplannedReceipt", - reason: "", + reasonText: "", + reasonCode:"", reasonList: [], - showToLoaction:true, dataContent:{}, managementList:[] } @@ -229,11 +228,11 @@ this.detailSource.splice(index, 1) }, commit() { - if (this.showToLoaction &&this.toLocationCode == "") { + if (this.toLocationCode == "") { this.showErrorMessage("请先选择目标库位") return; } - if (this.reason == '') { + if (this.reasonText == '') { this.showErrorMessage("请选择入库原因") return; } @@ -251,19 +250,18 @@ if (res.success) { this.managementList = res.list; var params = this.setParams() - debugger console.log("提交" + JSON.stringify(params)) - // unPlannedReceiptRecordbSubmit(params).then(res => { - // uni.hideLoading() - // if (res.data) { - // this.showCommitSuccessMessage("提交成功
生成计划外入库记录
" + res.data) - // } else { - // this.showErrorMessage("提交失败[" + res.msg + "]") - // } - // }).catch(error => { - // uni.hideLoading() - // this.showErrorMessage(error) - // }) + unPlannedReceiptRecordbSubmit(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(); @@ -331,7 +329,8 @@ detail.fromLocationCode = ""; detail.toLocationCode = detail.toLocationCode; - + + detail.reason = this.reasonCode; subList.push(detail) } @@ -341,6 +340,25 @@ this.dataContent.creator = creator; return this.dataContent; }, + reasonChange(e) { + if (e.detail.value.length == 0) { + this.reasonCode = "" + this.reasonText = "" + } else { + this.reasonCode = e.detail.value[0].value + this.reasonText = e.detail.value[0].text + } + }, + showCommitSuccessMessage(hint) { + this.$refs.comMessage.showSuccessMessage(hint, res => { + this.reasonCode = "" + this.reasonText = ""; + this.detailSource = []; + this.managementList=[]; + this.dataContent ={} + this.toLocationCode ="" + }) + }, } From 1fcc01cda4e6ae6200370cd109022ebe62fad68e Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Wed, 20 Dec 2023 15:26:11 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=88=B6=E5=93=81=E4=B8=8A=E6=9E=B6?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/record.js | 2 +- mycomponents/qty/qty.vue | 2 +- .../record/productPutawayRecord.vue | 165 ++++++++++-------- static/config.json | 2 +- 4 files changed, 96 insertions(+), 75 deletions(-) diff --git a/common/record.js b/common/record.js index 353842eb..9b7af65f 100644 --- a/common/record.js +++ b/common/record.js @@ -26,7 +26,7 @@ export function createDetailInfo(data, pack) { Object.assign(detail, data) detail.balanceQty = Number(detail.qty) detail.stdPackQty = Number(pack.stdPackQty) - detail.stdPackUnit =pack.stdPackUnit + detail.stdPackUnit = pack.stdPackUnit detail.package = pack; return detail; } diff --git a/mycomponents/qty/qty.vue b/mycomponents/qty/qty.vue index b3a8f0cb..b7f2fdfc 100644 --- a/mycomponents/qty/qty.vue +++ b/mycomponents/qty/qty.vue @@ -1,7 +1,7 @@