From 22a79a29b358b4c2797349fa9fa5d7407a68e433 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 8 Oct 2024 14:43:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=85=E8=A3=85=E6=8D=A2=E6=89=B9=E6=AC=A120?= =?UTF-8?q?24/9/13=2019:30:14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/balance.js | 2 +- .../detail/comDetailCardBatch.vue | 226 ++++++++++++++++ .../detail/comJobDetailCardBatch.vue | 2 - .../detail/comRecommendDetailCardBatch.vue | 241 ++++++++++++++++++ src/mycomponents/recommend/recommend.vue | 2 +- src/mycomponents/recommend/recommendBatch.vue | 168 ++++++++++++ .../scan/winScanPackAndLocation.vue | 5 + src/pages/count/coms/comCountDetailcards.vue | 2 +- src/pages/count/job/countLightDetail.vue | 118 ++++++--- src/pages/customerReturn/job/returnDetail.vue | 26 +- .../coms/comInventoryDetailCardBatch.vue | 203 +++++++++++++++ .../inventoryMove/job/inventoryMoveDetail.vue | 30 ++- .../issue/coms/comIssueDetailCardBatch.vue | 183 +++++++++++++ src/pages/issue/coms/comScanIssuePack.vue | 2 + src/pages/issue/job/issueDetail.vue | 99 +++---- .../job/productPutawayDetail.vue | 33 ++- .../coms/comProductDetailCardBatch.vue | 206 +++++++++++++++ .../job/ccProductReceiptDetail.vue | 29 ++- .../job/productReceiptDetail.vue | 30 ++- .../job/productRecycleJobDetail.vue | 70 +++-- .../job/productionReceiptDetail.vue | 10 +- .../productionReturn/job/okToReturnDetail.vue | 29 ++- .../coms/comReturnDetailCardBatch.vue | 176 +++++++++++++ src/pages/purchaseReturn/job/returnDetail.vue | 85 ++++-- .../repleinsh/coms/comScanReplishPack.vue | 2 + .../scrap/coms/comScrapDetailCardBatch.vue | 162 ++++++++++++ src/pages/scrap/job/scrapJobDetail.vue | 71 ++++-- .../coms/comReceiptDetailCardBatch.vue | 211 +++++++++++++++ src/pages/unPlanned/job/issueJobDetail.vue | 69 +++-- src/pages/unPlanned/job/receiptJobDetail.vue | 29 ++- 30 files changed, 2313 insertions(+), 208 deletions(-) create mode 100644 src/mycomponents/detail/comDetailCardBatch.vue create mode 100644 src/mycomponents/detail/comRecommendDetailCardBatch.vue create mode 100644 src/mycomponents/recommend/recommendBatch.vue create mode 100644 src/pages/inventoryMove/coms/comInventoryDetailCardBatch.vue create mode 100644 src/pages/issue/coms/comIssueDetailCardBatch.vue create mode 100644 src/pages/productReceipt/coms/comProductDetailCardBatch.vue create mode 100644 src/pages/purchaseReturn/coms/comReturnDetailCardBatch.vue create mode 100644 src/pages/scrap/coms/comScrapDetailCardBatch.vue create mode 100644 src/pages/unPlanned/coms/comReceiptDetailCardBatch.vue diff --git a/src/common/balance.js b/src/common/balance.js index a8012fbd..75e207e5 100644 --- a/src/common/balance.js +++ b/src/common/balance.js @@ -330,7 +330,7 @@ export function byBatch(label, locationCode, fromInventoryStatuses, callback) { filters.push({ column: "packingNumber", action: "==", - value: null + value: '' }) filters.push({ column: "locationCode", diff --git a/src/mycomponents/detail/comDetailCardBatch.vue b/src/mycomponents/detail/comDetailCardBatch.vue new file mode 100644 index 00000000..a45e3033 --- /dev/null +++ b/src/mycomponents/detail/comDetailCardBatch.vue @@ -0,0 +1,226 @@ + + + + + \ No newline at end of file diff --git a/src/mycomponents/detail/comJobDetailCardBatch.vue b/src/mycomponents/detail/comJobDetailCardBatch.vue index 56368dfa..c80074bb 100644 --- a/src/mycomponents/detail/comJobDetailCardBatch.vue +++ b/src/mycomponents/detail/comJobDetailCardBatch.vue @@ -29,7 +29,6 @@ import pack from '@/mycomponents/balance/pack.vue' import detailList from '@/mycomponents/detail/detailList.vue' import packageList from '@/mycomponents/package/packageList.vue' - import packageListBatch from '@/mycomponents/package/packageListBatch.vue' import location from '@/mycomponents/balance/location.vue' import toLocation from '@/mycomponents/balance/toLocation.vue' import batch from '@/mycomponents/balance/batch.vue' @@ -52,7 +51,6 @@ receiptDetailInfoPopup, detailList, packageList, - packageListBatch, location, toLocation, batch, diff --git a/src/mycomponents/detail/comRecommendDetailCardBatch.vue b/src/mycomponents/detail/comRecommendDetailCardBatch.vue new file mode 100644 index 00000000..acfc3d3b --- /dev/null +++ b/src/mycomponents/detail/comRecommendDetailCardBatch.vue @@ -0,0 +1,241 @@ + + + + + \ No newline at end of file diff --git a/src/mycomponents/recommend/recommend.vue b/src/mycomponents/recommend/recommend.vue index 4aa55e52..664d0e83 100644 --- a/src/mycomponents/recommend/recommend.vue +++ b/src/mycomponents/recommend/recommend.vue @@ -5,7 +5,7 @@ - + diff --git a/src/mycomponents/recommend/recommendBatch.vue b/src/mycomponents/recommend/recommendBatch.vue new file mode 100644 index 00000000..04ded7d0 --- /dev/null +++ b/src/mycomponents/recommend/recommendBatch.vue @@ -0,0 +1,168 @@ + + + + + \ No newline at end of file diff --git a/src/mycomponents/scan/winScanPackAndLocation.vue b/src/mycomponents/scan/winScanPackAndLocation.vue index 75100eac..63055f71 100644 --- a/src/mycomponents/scan/winScanPackAndLocation.vue +++ b/src/mycomponents/scan/winScanPackAndLocation.vue @@ -328,6 +328,11 @@ uni.hideLoading(); if (res.success) { this.managementPrecision = res.managementPrecision + if (this.managementPrecision == 'BY_BATCH') { + res.data.list.forEach(item => { + item.packingNumber = '' + }) + } this.chooseWhich = '2' if (res.data && res.data.list && res.data.list.length > 1) { this.showBalanceSelect(res.data.list); diff --git a/src/pages/count/coms/comCountDetailcards.vue b/src/pages/count/coms/comCountDetailcards.vue index 9b45c358..822ab974 100644 --- a/src/pages/count/coms/comCountDetailcards.vue +++ b/src/pages/count/coms/comCountDetailcards.vue @@ -3,7 +3,7 @@ - + diff --git a/src/pages/count/job/countLightDetail.vue b/src/pages/count/job/countLightDetail.vue index ff0d71b1..86861d7b 100644 --- a/src/pages/count/job/countLightDetail.vue +++ b/src/pages/count/job/countLightDetail.vue @@ -36,15 +36,13 @@ - + :right-options="item.scaned?scanOptions:detailOptions"> + {{index+1}}. - + @@ -57,8 +55,7 @@ - + @@ -68,9 +65,8 @@ - + @@ -111,6 +107,10 @@ getClearOption } from '@/common/array.js'; + import { + getManagementPrecisions, + } from '@/common/balance.js'; + import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' @@ -155,11 +155,13 @@ allDetails: [], scanOptions: [], detailOptions: [], + managementList: [], + managementType: '' }; }, onLoad(option) { uni.setNavigationBarTitle({ - title: option.title+'详情' + title: option.title + '详情' }) this.id = option.id; if (this.id != undefined) { @@ -242,7 +244,7 @@ title: "加载中....", mask: true }); - getCountJobDetail(that.id).then(res => { + getCountJobDetail(that.id).then(async res => { uni.hideLoading(); if (res.data == null) { that.showMessage('未获取到详情'); @@ -254,10 +256,30 @@ item.recommendQty = item.qty item.handleQty = 0 item.countTime = new Date() - item.fromLocationCode =that.fromLocationCode; + item.fromLocationCode = that.fromLocationCode; }) that.allDetails = res.data.subList; that.allCount = res.data.subList.length; + //获取管理模式,封装参数 + var itemCodes = [] + this.allDetails.forEach(item => { + itemCodes.push(item.itemCode) + item.scaned = false + }) + await getManagementPrecisions(itemCodes, that.fromLocationCode, res => { + if (res.success) { + this.managementList = res.list; + this.managementType = this.managementList.some(item => item.ManagementPrecision == + 'BY_BATCH') ? 'BY_BATCH' : '' + if (this.managementType == 'BY_BATCH') { + this.allDetails.forEach(item => { + item.packingNumber = '' + item.toPackingNumber = '' + item.fromPackingNumber = '' + }) + } + } + }) that.initList() } @@ -304,7 +326,7 @@ if (res) { item.scaned = false; item.handleQty = 0; - this.showList.splice(index,1) + this.showList.splice(index, 1) this.$emit('removePack') } }); @@ -359,7 +381,7 @@ res => { //创建盘点信息,标记为已经扫描 if (res) { - var detail = this.createAddDetailInfo(pack,qty) + var detail = this.createAddDetailInfo(pack, qty) detail.countTime = new Date(); this.allDetails.push(detail) this.updateList(); @@ -388,13 +410,13 @@ } else { //未扫描,赋值 selectItem.scaned = true; - selectItem.balanceQty= Number(qty) + selectItem.balanceQty = Number(qty) selectItem.handleQty = Number(qty) selectItem.packQty = pack.packQty selectItem.packUnit = pack.packUnit - selectItem.parentPackingNumber =pack.parentPackingNumber - selectItem.locationCode =this.fromLocationCode - selectItem.fromLocationCode =this.fromLocationCode + selectItem.parentPackingNumber = pack.parentPackingNumber + selectItem.locationCode = this.fromLocationCode + selectItem.fromLocationCode = this.fromLocationCode this.$refs.countQtyEdit.openEditPopupShowSeconds(selectItem, null); @@ -441,7 +463,7 @@ //创建盘盈的明细 - createAddDetailInfo(pack,qty) { + createAddDetailInfo(pack, qty) { var detail = { masterId: this.jobContent.id, //新增的明细 scaned: true, @@ -458,7 +480,7 @@ packQty: pack.packQty, packUnit: pack.packUnit, projectCode: "", - recommendQty:Number(qty), + recommendQty: Number(qty), qty: Number(qty), handleQty: Number(qty), uom: pack.uom, @@ -467,7 +489,7 @@ countQty: Number(qty), balanceQty: Number(qty), fromLocationCode: this.fromLocationCode, - locationCode:this.fromLocationCode, + locationCode: this.fromLocationCode, creator: this.$store.state.user.id, countTime: new Date() } @@ -498,8 +520,8 @@ if (!item.scaned) { item.scaned = true; item.handleQty = 0 - item.locationCode =this.fromLocationCode - item.fromLocationCode =this.fromLocationCode + item.locationCode = this.fromLocationCode + item.fromLocationCode = this.fromLocationCode } }) this.submitJob(); @@ -525,22 +547,32 @@ title: "提交中....", mask: true }); - var params = this.setParams() - console.log("提交参数", JSON.stringify(params)); - countJobSubmit(params).then(res => { - uni.hideLoading() - const str =res.data || '' - this.showCommitSuccessMessage("提交成功\n生成盘点记录\n" + str) - // if (res.data) { - // this.showCommitSuccessMessage("提交成功\n生成盘点记录\n" + res.data) - // } else { - // this.showErrorMessage("提交失败[" + res.msg + "]") - // } - }).catch(error => { - uni.hideLoading() - this.showErrorMessage(error) + //获取管理模式,封装参数 + var itemCodes = [] + this.allDetails.forEach(item => { + itemCodes.push(item.itemCode) + item.scaned = false + }) + getManagementPrecisions(itemCodes, this.fromLocationCode, res => { + if (res.success) { + this.managementList = res.list; + var params = this.setParams() + console.log("提交参数", JSON.stringify(params)); + countJobSubmit(params).then(res => { + uni.hideLoading() + const str = res.data || '' + this.showCommitSuccessMessage("提交成功\n生成盘点记录\n" + str) + // if (res.data) { + // this.showCommitSuccessMessage("提交成功\n生成盘点记录\n" + res.data) + // } else { + // this.showErrorMessage("提交失败[" + res.msg + "]") + // } + }).catch(error => { + uni.hideLoading() + this.showErrorMessage(error) + }) + } }) - }, setParams() { @@ -550,6 +582,12 @@ this.allDetails.forEach(item => { if (item.scaned) { item.countQty = item.handleQty; + var info = getPackingNumberAndBatch(this.managementList, item.itemCode, + item.packingNumber, item.batch); + item.toPackingNumber = info.packingNumber; + item.packingNumber = info.packingNumber; + item.fromPackingNumber = info.packingNumber; + } subList.push(item) }) diff --git a/src/pages/customerReturn/job/returnDetail.vue b/src/pages/customerReturn/job/returnDetail.vue index 5e84d17d..b89836b9 100644 --- a/src/pages/customerReturn/job/returnDetail.vue +++ b/src/pages/customerReturn/job/returnDetail.vue @@ -16,11 +16,15 @@ + + + :locationAreaTypeList="toLocationAreaTypeList" v-else> @@ -80,6 +84,7 @@ import winScanPack from '@/mycomponents/scan/winScanPack.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue' import comLableDetailCard from "@/mycomponents/detail/comLableDetailCard.vue" + import comDetailCardBatch from "@/mycomponents/detail/comDetailCardBatch.vue" import detailInfoPopup from '@/pages/customerReturn/coms/detailInfoPopup.vue' import jobTop from '@/mycomponents/job/jobTop.vue' @@ -90,7 +95,8 @@ winScanPack, locationCompare, comLableDetailCard , - detailInfoPopup + detailInfoPopup, + comDetailCardBatch }, data() { return { @@ -100,6 +106,7 @@ subList: [], //接口返回的任务subList detailSource: [], //绑定在页面上的数据源 managementList: [], + managementType:'', fromLocationCode: "", toLocationCode: "", toLocationAreaTypeList: [], @@ -190,6 +197,19 @@ that.toLocationCode = that.subList[0].toLocationCode } that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes) + //获取管理模式,封装参数 + var itemCodes = [] + this.detailSource.forEach(item => { + itemCodes.push(item.itemCode) + item.scaned = false + }) + getManagementPrecisions(itemCodes, that.fromLocationCode, res => { + if (res.success) { + this.managementList = res.list; + this.managementType = this.managementList.some(item => item.ManagementPrecision == + 'BY_BATCH') ? 'BY_BATCH' : '' + } + }) } else { that.showMessage('列表数据为0'); } @@ -379,6 +399,8 @@ var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, detail.packingNumber, detail.batch); detail.toPackingNumber = info.packingNumber; + detail.packingNumber = info.packingNumber; + detail.fromPackingNumber = info.packingNumber; detail.toContainerNumber = detail.containerNumber; detail.toBatch = info.batch; detail.toLocationCode = detail.toLocationCode; diff --git a/src/pages/inventoryMove/coms/comInventoryDetailCardBatch.vue b/src/pages/inventoryMove/coms/comInventoryDetailCardBatch.vue new file mode 100644 index 00000000..0151ec1d --- /dev/null +++ b/src/pages/inventoryMove/coms/comInventoryDetailCardBatch.vue @@ -0,0 +1,203 @@ + + + + + \ No newline at end of file diff --git a/src/pages/inventoryMove/job/inventoryMoveDetail.vue b/src/pages/inventoryMove/job/inventoryMoveDetail.vue index fe2ab334..2c4b9560 100644 --- a/src/pages/inventoryMove/job/inventoryMoveDetail.vue +++ b/src/pages/inventoryMove/job/inventoryMoveDetail.vue @@ -12,10 +12,15 @@ + + + @openDetail="openDetail" v-else> @@ -72,6 +77,7 @@ import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' import comInventoryDetailCard from '@/pages/inventoryMove/coms/comInventoryDetailCard.vue' + import comInventoryDetailCardBatch from '@/pages/inventoryMove/coms/comInventoryDetailCardBatch.vue' import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue' import jobTop from '@/mycomponents/job/jobTop.vue' @@ -83,6 +89,7 @@ winScanButton, winScanPack, comInventoryDetailCard, + comInventoryDetailCardBatch, winScanPackAndLocation, detailInfoPopup, jobTop @@ -97,6 +104,7 @@ toLocationInfo: {}, businessTypeInfo: {}, managementList: [], + managementType:'', businessTypeCode: '', toLocationCode: '', toInventoryStatus: '', @@ -224,7 +232,7 @@ mask: true }); - getInventoryMoveJobDetail(that.id).then(res => { + getInventoryMoveJobDetail(that.id).then(async res => { uni.hideLoading(); if (res.data == null) { that.showMessage('未获取到详情'); @@ -234,7 +242,21 @@ that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes); that.jobStatus = res.data.status that.subList = res.data.subList; - that.detailSource = getDataSource(that.subList) + that.detailSource =await getDataSource(that.subList) + //获取管理模式,封装参数 + var itemCodes = [] + this.detailSource.forEach(item => { + itemCodes.push(item.itemCode) + item.scaned = false + }) + this.toLocationCode = that.subList[0].toLocationCode + getManagementPrecisions(itemCodes, this.toLocationCode, res => { + if (res.success) { + this.managementList = res.list; + this.managementType = this.managementList.some(item => item.ManagementPrecision == + 'BY_BATCH') ? 'BY_BATCH' : '' + } + }) } else { that.showMessage('列表数据为0'); } @@ -490,6 +512,8 @@ var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, detail.packingNumber, detail.toLocationCode, detail.batch); detail.toPackingNumber = info.packingNumber; + detail.packingNumber = info.packingNumber; + detail.fromPackingNumber = info.packingNumber; detail.toBatch = info.batch; detail.toContainerNumber = ''; // detail.toLocationCode = this.toLocationCode; diff --git a/src/pages/issue/coms/comIssueDetailCardBatch.vue b/src/pages/issue/coms/comIssueDetailCardBatch.vue new file mode 100644 index 00000000..b70a9763 --- /dev/null +++ b/src/pages/issue/coms/comIssueDetailCardBatch.vue @@ -0,0 +1,183 @@ + + + + + \ No newline at end of file diff --git a/src/pages/issue/coms/comScanIssuePack.vue b/src/pages/issue/coms/comScanIssuePack.vue index 362fa484..ddf3fb37 100644 --- a/src/pages/issue/coms/comScanIssuePack.vue +++ b/src/pages/issue/coms/comScanIssuePack.vue @@ -426,6 +426,8 @@ } else { this.getToLocationBalance(result) } + }else{ + this.queryBalance(result) } }, diff --git a/src/pages/issue/job/issueDetail.vue b/src/pages/issue/job/issueDetail.vue index 3151bad4..0c10e75f 100644 --- a/src/pages/issue/job/issueDetail.vue +++ b/src/pages/issue/job/issueDetail.vue @@ -19,11 +19,14 @@ :productionLineCode="toLocation.productionLineCode" :workStationCode="toLocation.workStationCode" :rawLocationCode="toLocation.toLocationCode"> --> + + + @updateData='updateData' v-else> @@ -82,6 +85,7 @@ import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue' + import comIssueDetailCardBatch from '@/pages/issue/coms/comIssueDetailCardBatch.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue' import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue' import jobTop from '@/mycomponents/job/jobTop.vue' @@ -97,7 +101,8 @@ comScanIssuePack, jobTop, workStation, - balanceSelect + balanceSelect, + comIssueDetailCardBatch }, data() { return { @@ -108,7 +113,9 @@ detailOptions: [], scanOptions: [], jobStatus: "", - scanMessage: '' + scanMessage: '', + managementList: [], + managementType: "" }; }, @@ -206,11 +213,27 @@ that.subList = res.data.subList; that.detailSource = getDataSource(that.detailSource, that.subList) that.jobContent.detailToLocationCode = res.data.subList[0].toLocationCode + that.fromLocationCode = that.subList[0].fromLocationCode //任务中已经扫描,模拟扫描赋值 if (this.scanMessage) { this.openScanPopupSimulate(this.scanMessage); } + //获取管理模式,封装参数 + var itemCodes = [] + that.detailSource.forEach(item => { + item.Items.forEach((cur) => { + itemCodes.push(cur.itemCode) + }) + item.scaned = false + }) + getManagementPrecisions(itemCodes, that.fromLocationCode, res => { + if (res.success) { + this.managementList = res.list; + this.managementType = this.managementList.some(item => item.ManagementPrecision == + 'BY_BATCH') ? 'BY_BATCH' : '' + } + }) setTimeout(r => { that.resizeCollapse(); }, 100) @@ -241,34 +264,7 @@ this.resizeCollapse(); }, - // submit() { - //3.如果是按批次先进先出发料提交时如果扫描的箱码不是先进的批次,则报错 - //:请扫描XXX批次,改批次满足先进先出规则。否则可以直接提交 - // var isOutIn = getApp().globalData.feed_configList.filter( - // res => { - // if (res.name == 'feed_isOutIn') { - // return res; - // } - // }); - - - // this.dataContent.itemCodeList.forEach(res => { - // if (res.handleQty > res.recommendQty) { - // this.$refs.modal.showConfirmMessageModal('实际数量大于需求数量,是否提交?', confirm => { - // if (confirm) { - // //提交 - // uni.showToast({ - // title: "提交" - // }) - // } - // }) - // } else { - // uni.showToast({ - // title: "扫描的数量" + res.handleQty + "]小于推荐数量[" + res.recommendQty + "]" - // }) - // } - // }) - // }, + submit() { uni.showLoading({ @@ -334,50 +330,33 @@ let record = {}; record.handleQty = r.qty; - record.fromPackingNumber = r - .packingNumber; + record.fromPackingNumber = r.packingNumber; record.fromBatch = r.batch; - record.fromContainerNumber = r - .ContainerNumber; - - record.toContainerNumber = r - .ContainerNumber; - record.toInventoryStatus = r - .inventoryStatus; - // record.toLocationCode = subItem - // .toLocationCode; + record.fromContainerNumber = r.ContainerNumber; - record.toLocationCode = this.jobContent - .detailToLocationCode; + record.toContainerNumber = r.ContainerNumber; + record.toInventoryStatus = r.inventoryStatus; + record.toLocationCode = this.jobContent.detailToLocationCode; record.supplierCode = r.supplierCode; - let single_price = r.balance - .singlePrice == null ? 0 : r - .balance - .singlePrice; + let single_price = r.balance.singlePrice == null ? 0 : r.balance.singlePrice; record.singlePrice = single_price; record.amount = single_price * r.qty; //使用在途库不改变管理模式 if (item.onTheWayLocationCode) { - record.toPackingNumber = r - .packingNumber; + record.toPackingNumber = r.packingNumber; record.toBatch = r.batch; } else { - var info = - getPackingNumberAndBatch( - this.managementList, r - .itemCode, - r.packingNumber, r - .batch); - record.toPackingNumber = info - .packingNumber; + var info =getPackingNumberAndBatch(this.managementList, r.itemCode,r.packingNumber, r.batch); + record.toPackingNumber = info.packingNumber; + record.packingNumber = info.packingNumber; + record.fromPackingNumber = info.packingNumber; record.toBatch = info.batch; } - record.fromParentPackingNumber = r - .parentPackingNumber; + record.fromParentPackingNumber = r.parentPackingNumber; subItem.recordList.push(record); }) subList.push(deepCopyData(subItem)); diff --git a/src/pages/productPutaway/job/productPutawayDetail.vue b/src/pages/productPutaway/job/productPutawayDetail.vue index f3827242..1b3feb82 100644 --- a/src/pages/productPutaway/job/productPutawayDetail.vue +++ b/src/pages/productPutaway/job/productPutawayDetail.vue @@ -14,9 +14,13 @@ + + + :locationAreaTypeList='toLocationAreaTypeList' v-else> @@ -86,6 +90,7 @@ import locationCompare from '@/mycomponents/location/locationCompare.vue' import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" + import comDetailCardBatch from "@/mycomponents/detail/comDetailCardBatch.vue" import detailInfoPopup from '@/pages/productPutaway/coms/detailInfoPopup.vue' import jobTop from '@/mycomponents/job/jobTop.vue' @@ -96,6 +101,7 @@ winScanPackAndLocation, locationCompare, comDetailCard, + comDetailCardBatch, detailInfoPopup, jobTop }, @@ -107,6 +113,7 @@ subList: [], //接口返回的任务subList detailSource: [], //绑定在页面上的数据源 managementList: [], + managementType:'', fromLocationCode: "", toLocationCode: "", toLocationAreaTypeList: [], @@ -201,7 +208,7 @@ title: "加载中....", mask: true }); - getProductPutawayJobDetail(that.id).then(res => { + getProductPutawayJobDetail(that.id).then(async res => { uni.hideLoading(); if (res.data == null) { that.showMessage('未获取到详情'); @@ -213,7 +220,7 @@ that.fromLocationCode = that.subList[0].fromLocationCode that.jobToLocationCode = that.subList[0].toLocationCode that.toLocationAreaTypeList = getLocationTypeArray(that.jobContent.toAreaTypes) - that.detailSource = getDataSource(that.subList) + that.detailSource =await getDataSource(that.subList) that.isCheckLocation = getSwitchInfoByCode(that.switchCode) if (that.isCheckLocation) { @@ -224,7 +231,19 @@ if (this.scanMessage) { this.openScanPopupSimulate(this.scanMessage) } - + //获取管理模式,封装参数 + var itemCodes = [] + this.detailSource.forEach(item => { + itemCodes.push(item.itemCode) + item.scaned = false + }) + getManagementPrecisions(itemCodes, that.jobToLocationCode, res => { + if (res.success) { + this.managementList = res.list; + this.managementType = this.managementList.some(item => item.ManagementPrecision == + 'BY_BATCH') ? 'BY_BATCH' : '' + } + }) } else { that.showMessage('列表数据为0'); } @@ -252,7 +271,7 @@ }, updateData() { - this.calcHandleQty(); + // this.calcHandleQty(); }, openDetail(item) { @@ -328,7 +347,7 @@ this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result .fromLocationCode + "】不在列表中") } else { - + detail.scaned = true if (!itemDetail.cancleScanedHiht && itemDetail.scaned) { this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result .fromLocationCode + "】已经扫描") @@ -485,6 +504,8 @@ var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, detail.packingNumber, detail.batch); detail.toPackingNumber = info.packingNumber; + detail.packingNumber = info.packingNumber; + detail.fromPackingNumber = info.packingNumber; detail.toBatch = info.batch; detail.toContainerNumber = ''; detail.toLocationCode = this.toLocationCode; diff --git a/src/pages/productReceipt/coms/comProductDetailCardBatch.vue b/src/pages/productReceipt/coms/comProductDetailCardBatch.vue new file mode 100644 index 00000000..2b950cba --- /dev/null +++ b/src/pages/productReceipt/coms/comProductDetailCardBatch.vue @@ -0,0 +1,206 @@ + + + + + \ No newline at end of file diff --git a/src/pages/productReceipt/job/ccProductReceiptDetail.vue b/src/pages/productReceipt/job/ccProductReceiptDetail.vue index 4508d57a..daee73d3 100644 --- a/src/pages/productReceipt/job/ccProductReceiptDetail.vue +++ b/src/pages/productReceipt/job/ccProductReceiptDetail.vue @@ -42,9 +42,13 @@ + + + :locationAreaTypeList='toLocationAreaTypeList' v-else> @@ -112,6 +116,7 @@ import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" import jobTop from '@/mycomponents/job/jobTop.vue' import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue" + import comProductDetailCardBatch from "@/pages/productReceipt/coms/comProductDetailCardBatch.vue" export default { @@ -122,7 +127,8 @@ locationCompare, winScanPack, jobTop, - comProductDetailCard + comProductDetailCard, + comProductDetailCardBatch }, data() { return { @@ -140,6 +146,7 @@ jobToLocationCode: "", scanMessage: "", status: '', + managementType:'' }; }, onLoad(option) { @@ -233,6 +240,19 @@ if (that.scanMessage) { this.$refs.scanPopup.simulateScan(that.scanMessage); } + //获取管理模式,封装参数 + var itemCodes = [] + this.detailSource.forEach(item => { + itemCodes.push(item.itemCode) + item.scaned = false + }) + getManagementPrecisions(itemCodes, that.jobToLocationCode, res => { + if (res.success) { + this.managementList = res.list; + this.managementType = this.managementList.some(item => item.ManagementPrecision == + 'BY_BATCH') ? 'BY_BATCH' : '' + } + }) } else { that.showMessage('列表数据为0'); } @@ -255,6 +275,7 @@ if (detail == undefined) { this.showErrorMessage("物料号【" + itemCode + "】不在列表中") } else { + detail.scaned = true var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch == batch); @@ -289,7 +310,7 @@ updateData() { - calcHandleQty(this.detailSource); + // calcHandleQty(this.detailSource); }, @@ -457,6 +478,8 @@ var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, detail.packingNumber, detail.batch); detail.toPackingNumber = info.packingNumber; + detail.packingNumber = info.packingNumber; + detail.fromPackingNumber = info.packingNumber; detail.toBatch = info.batch; detail.toContainerNumber = ''; detail.toInventoryStatus = detail.inventoryStatus diff --git a/src/pages/productReceipt/job/productReceiptDetail.vue b/src/pages/productReceipt/job/productReceiptDetail.vue index 08f70a97..2d8887dc 100644 --- a/src/pages/productReceipt/job/productReceiptDetail.vue +++ b/src/pages/productReceipt/job/productReceiptDetail.vue @@ -41,9 +41,13 @@ + + + :locationAreaTypeList='toLocationAreaTypeList' v-else> @@ -111,6 +115,7 @@ import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" import jobTop from '@/mycomponents/job/jobTop.vue' import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue" + import comProductDetailCardBatch from "@/pages/productReceipt/coms/comProductDetailCardBatch.vue" export default { @@ -121,7 +126,8 @@ locationCompare, winScanPack, jobTop, - comProductDetailCard + comProductDetailCard, + comProductDetailCardBatch }, data() { return { @@ -135,6 +141,7 @@ detailSource: [], //绑定在页面上的数据源 toLocationAreaTypeList: [], managementList: [], + managementType:'', jobStatus: "", jobToLocationCode: "", status: '', @@ -241,7 +248,19 @@ if (that.scanMessage) { this.$refs.scanPopup.simulateScan(that.scanMessage); } - + //获取管理模式,封装参数 + var itemCodes = [] + this.detailSource.forEach(item => { + itemCodes.push(item.itemCode) + item.scaned = false + }) + getManagementPrecisions(itemCodes, that.jobToLocationCode, res => { + if (res.success) { + this.managementList = res.list; + this.managementType = this.managementList.some(item => item.ManagementPrecision == + 'BY_BATCH') ? 'BY_BATCH' : '' + } + }) } else { that.showMessage('列表数据为0'); } @@ -264,6 +283,7 @@ if (detail == undefined) { this.showErrorMessage("物料号【" + itemCode + "】不在列表中") } else { + detail.scaned = true var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch == batch); @@ -298,7 +318,7 @@ updateData() { - calcHandleQty(this.detailSource); + // calcHandleQty(this.detailSource); }, @@ -447,6 +467,8 @@ var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, detail.packingNumber, detail.batch); detail.toPackingNumber = info.packingNumber; + detail.packingNumber = info.packingNumber; + detail.fromPackingNumber = info.packingNumber; detail.toBatch = info.batch; detail.toContainerNumber = ''; detail.toInventoryStatus = detail.inventoryStatus diff --git a/src/pages/productRecycle/job/productRecycleJobDetail.vue b/src/pages/productRecycle/job/productRecycleJobDetail.vue index f9c8bf00..0eed8fb0 100644 --- a/src/pages/productRecycle/job/productRecycleJobDetail.vue +++ b/src/pages/productRecycle/job/productRecycleJobDetail.vue @@ -12,8 +12,12 @@ + + + @updateData='updateData' @openDetail="openDetail" v-else> @@ -71,6 +75,7 @@ import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" + import comDetailCardBatch from "@/mycomponents/detail/comDetailCardBatch.vue" import recycleDetailInfoPopup from '@/pages/productRecycle/coms/recycleDetailInfoPopup.vue' import jobTop from '@/mycomponents/job/jobTop.vue' @@ -80,6 +85,7 @@ winScanButton, winScanPackAndLocation, comDetailCard, + comDetailCardBatch, recycleDetailInfoPopup, jobTop }, @@ -92,7 +98,8 @@ detailSource: [], //绑定在页面上的数据源 businessTypeInfo: {}, managementList: [], - jobStatus: "" + jobStatus: "", + managementType: '' }; }, onLoad(option) { @@ -170,7 +177,7 @@ mask: true }); - getProductRecycleDetail(that.id).then(res => { + getProductRecycleDetail(that.id).then(async res => { uni.hideLoading(); if (res.data == null) { that.showMessage('未获取到详情'); @@ -183,7 +190,21 @@ res.fromLocationCode = res.toLocationCode }) that.toLocationCode = that.jobContent.toLocationCode - that.detailSource = getDataSource(that.subList); + that.detailSource =await getDataSource(that.subList); + //获取管理模式,封装参数 + var itemCodes = [] + this.detailSource.forEach(item => { + itemCodes.push(item.itemCode) + item.scaned = false + }) + that.fromLocationCode = that.subList[0].fromLocationCode + getManagementPrecisions(itemCodes, that.fromLocationCode, res => { + if (res.success) { + this.managementList = res.list; + this.managementType = this.managementList.some(item => item.ManagementPrecision == + 'BY_BATCH') ? 'BY_BATCH' : '' + } + }) } else { that.showMessage('列表数据为0'); } @@ -223,7 +244,7 @@ }, updateData() { - this.calcHandleQty(); + // this.calcHandleQty(); }, getScanResult(result) { @@ -237,6 +258,7 @@ if (detail == undefined) { this.showMessage("物料号【" + itemCode + "】不在列表中") } else { + detail.scaned = true let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); //箱码、批次、库位、状态 都相等 itemDetail = detail.subList.find(r => { @@ -372,21 +394,28 @@ title: "提交中....", mask: true }); - - var params = this.setParams() - console.log("提交参数", JSON.stringify(params)); - productRecycleJobsubmit(params).then(res => { - uni.hideLoading() - if (res.data) { - this.showCommitSuccessMessage(res.data) - } else { - this.showErrorMessage("提交失败[" + res.msg + "]") + var itemCodes = [] + this.detailSource.forEach(item => { + itemCodes.push(item.itemCode) + }) + getManagementPrecisions(itemCodes, this.fromLocationCode, res => { + if (res.success) { + this.managementList = res.list; + var params = this.setParams() + console.log("提交参数", JSON.stringify(params)); + productRecycleJobsubmit(params).then(res => { + uni.hideLoading() + if (res.data) { + this.showCommitSuccessMessage(res.data) + } else { + this.showErrorMessage("提交失败[" + res.msg + "]") + } + }).catch(error => { + uni.hideLoading() + this.showErrorMessage(error) + }) } - }).catch(error => { - uni.hideLoading() - this.showErrorMessage(error) }) - }, setParams() { @@ -401,6 +430,11 @@ detail.toBatch = detail.batch; detail.toLocationCode = detail.toLocationCode; + var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, + detail.packingNumber, detail.batch); + detail.toPackingNumber = info.packingNumber; + detail.packingNumber = info.packingNumber; + detail.fromPackingNumber = info.packingNumber; subList.push(detail) } }) diff --git a/src/pages/productionReceipt/job/productionReceiptDetail.vue b/src/pages/productionReceipt/job/productionReceiptDetail.vue index 99183b38..79e685ad 100644 --- a/src/pages/productionReceipt/job/productionReceiptDetail.vue +++ b/src/pages/productionReceipt/job/productionReceiptDetail.vue @@ -14,10 +14,14 @@ + + - + @@ -82,6 +86,7 @@ import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" + import comDetailCardBatch from "@/mycomponents/detail/comDetailCardBatch.vue" import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue' import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.vue' import jobTop from '@/mycomponents/job/jobTop.vue' @@ -94,7 +99,8 @@ comDetailCard, detailInfoPopup, comIssueRequestInfo, - jobTop + jobTop, + comDetailCardBatch }, data() { return { diff --git a/src/pages/productionReturn/job/okToReturnDetail.vue b/src/pages/productionReturn/job/okToReturnDetail.vue index 13bf02c5..8a9e23ab 100644 --- a/src/pages/productionReturn/job/okToReturnDetail.vue +++ b/src/pages/productionReturn/job/okToReturnDetail.vue @@ -179,7 +179,7 @@ title: "加载中....", mask: true }); - getProductionReturnJobDetail(that.id).then(res => { + getProductionReturnJobDetail(that.id).then((async res => { uni.hideLoading(); if (res.data == null) { that.showMessage('未获取到详情'); @@ -188,14 +188,35 @@ that.jobContent = res.data; that.jobStatus = res.data.status that.subList = res.data.subList; - that.detailSource = getDataSource(that.subList) + that.detailSource =await getDataSource(that.subList) that.fromLocationCode = that.subList[0].fromLocationCode that.jobToLocationCode = that.subList[0].toLocationCode that.titleInfo = that.subList[0]; that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes); - + //获取管理模式,封装参数 + var itemCodes = [] + this.detailSource.forEach(item => { + itemCodes.push(item.itemCode) + item.scaned = false + }) + await getManagementPrecisions(itemCodes, that.fromLocationCode, res => { + if (res.success) { + this.managementList = res.list; + this.managementType = this.managementList.some(item => item.ManagementPrecision == + 'BY_BATCH') ? 'BY_BATCH' : '' + if(this.managementType == 'BY_BATCH'){ + that.detailSource.forEach(item=>{ + item.subList.forEach(cur=>{ + cur.packingNumber='' + cur.toPackingNumber='' + cur.fromPackingNumber='' + }) + }) + } + } + }) } else { that.showMessage('列表数据为0'); } @@ -414,6 +435,8 @@ var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, detail.packingNumber, detail.batch); detail.toPackingNumber = detail.packingNumber; + detail.packingNumber = detail.packingNumber; + detail.fromPackingNumber = detail.packingNumber; detail.toContainerNumber = detail.containerNumber; detail.toBatch = detail.batch; diff --git a/src/pages/purchaseReturn/coms/comReturnDetailCardBatch.vue b/src/pages/purchaseReturn/coms/comReturnDetailCardBatch.vue new file mode 100644 index 00000000..1238e443 --- /dev/null +++ b/src/pages/purchaseReturn/coms/comReturnDetailCardBatch.vue @@ -0,0 +1,176 @@ + + + + + \ No newline at end of file diff --git a/src/pages/purchaseReturn/job/returnDetail.vue b/src/pages/purchaseReturn/job/returnDetail.vue index ea58b775..cb79675b 100644 --- a/src/pages/purchaseReturn/job/returnDetail.vue +++ b/src/pages/purchaseReturn/job/returnDetail.vue @@ -27,12 +27,18 @@ :productionLineCode="toLocation.productionLineCode" :workStationCode="toLocation.workStationCode" :rawLocationCode="toLocation.toLocationCode"> --> + + - + @@ -98,6 +104,7 @@ import returnDetailInfoPopup from '@/pages/purchaseReturn/coms/returnDetailInfoPopup.vue' import jobTop from '@/mycomponents/job/jobTop.vue' import comReturnDetailCard from '@/pages/purchaseReturn/coms/comReturnDetailCard.vue' + import comReturnDetailCardBatch from '@/pages/purchaseReturn/coms/comReturnDetailCardBatch.vue' import comScanReturnPack from '@/pages/purchaseReturn/coms/comScanReturnPack.vue' export default { @@ -108,7 +115,8 @@ comReturnDetailCard, returnDetailInfoPopup, jobTop, - comScanReturnPack + comScanReturnPack, + comReturnDetailCardBatch }, data() { @@ -122,7 +130,9 @@ managementList: [], jobStatus: "", poNumber:"", - fromLocationCode:"" + fromLocationCode:"", + managementList:[], + managementType:'' }; }, onLoad(option) { @@ -213,6 +223,23 @@ that.detailSource = getDataSource(that.detailSource,that.subList); that.fromLocationCode =that.subList[0].fromLocationCode that.poNumber =that.subList[0].poNumber + + //获取管理模式,封装参数 + var itemCodes = [] + that.detailSource.forEach(item => { + item.Items.forEach((cur)=>{ + itemCodes.push(cur.itemCode) + }) + item.scaned = false + }) + console.log(that.detailSource) + getManagementPrecisions(itemCodes, that.fromLocationCode, res => { + if (res.success) { + this.managementList = res.list; + this.managementType = this.managementList.some(item => item.ManagementPrecision == + 'BY_BATCH') ? 'BY_BATCH' : '' + } + }) } else { that.showMessage('列表数据为0'); } @@ -350,19 +377,30 @@ title: "提交中....", mask: true }); - - var params = this.setParams() - console.log("提交参数", JSON.stringify(params)); - purchaseReturnJobsubmit(params).then(res => { - uni.hideLoading() - if (res.data) { - this.showCommitSuccessMessage(res.data) - } else { - this.showErrorMessage("提交失败[" + res.msg + "]") + var itemCodes = [] + this.detailSource.forEach(item => { + item.Items.forEach(cur=>{ + itemCodes.push(cur.itemCode) + }) + }) + //获取管理模式,封装参数 + getManagementPrecisions(itemCodes, this.fromLocationCode, res => { + if (res.success) { + this.managementList = res.list; + var params = this.setParams() + console.log("提交参数", JSON.stringify(params)); + purchaseReturnJobsubmit(params).then(res => { + uni.hideLoading() + if (res.data) { + this.showCommitSuccessMessage(res.data) + } else { + this.showErrorMessage("提交失败[" + res.msg + "]") + } + }).catch(error => { + uni.hideLoading() + this.showErrorMessage(error) + }) } - }).catch(error => { - uni.hideLoading() - this.showErrorMessage(error) }) }, @@ -382,18 +420,17 @@ batch.Records.forEach(r => { let record = {}; record.handleQty = r.qty; - record.toContainerNumber = r - .ContainerNumber; - record.inventoryStatus = r - .inventoryStatus; - record.toLocationCode = subItem - .toLocationCode; + record.toContainerNumber = r.ContainerNumber; + record.inventoryStatus = r.inventoryStatus; + record.toLocationCode = subItem.toLocationCode; record.supplierCode = r.supplierCode; //使用在途库不改变管理模式 - record.toPackingNumber = r - .packingNumber; - record.fromBatch = r.batch; + var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,record.packingNumber, detail.batch); + record.toPackingNumber = info.packingNumber; + record.packingNumber = info.packingNumber; + record.fromPackingNumber = info.packingNumber; + record.fromBatch = r.batch; record.fromPackingNumber = r.packingNumber subItem.recordList.push(record); }) diff --git a/src/pages/repleinsh/coms/comScanReplishPack.vue b/src/pages/repleinsh/coms/comScanReplishPack.vue index 8a983675..9310142f 100644 --- a/src/pages/repleinsh/coms/comScanReplishPack.vue +++ b/src/pages/repleinsh/coms/comScanReplishPack.vue @@ -265,6 +265,8 @@ } else { this.getToLocationBalance(result) } + }else{ + this.getToLocationBalance(result) } }, diff --git a/src/pages/scrap/coms/comScrapDetailCardBatch.vue b/src/pages/scrap/coms/comScrapDetailCardBatch.vue new file mode 100644 index 00000000..beaef040 --- /dev/null +++ b/src/pages/scrap/coms/comScrapDetailCardBatch.vue @@ -0,0 +1,162 @@ + + + + + diff --git a/src/pages/scrap/job/scrapJobDetail.vue b/src/pages/scrap/job/scrapJobDetail.vue index f8a274ee..0722f6e2 100644 --- a/src/pages/scrap/job/scrapJobDetail.vue +++ b/src/pages/scrap/job/scrapJobDetail.vue @@ -14,8 +14,11 @@ + + + @remove="updateData" @updateData="updateData" v-else> @@ -68,6 +71,7 @@ import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' import comScrapDetailCard from '@/pages/scrap/coms/comScrapDetailCard.vue' + import comScrapDetailCardBatch from '@/pages/scrap/coms/comScrapDetailCardBatch.vue' import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import jobTop from '@/mycomponents/job/jobTop.vue' @@ -77,6 +81,7 @@ winScanButton, winScanPack, comScrapDetailCard, + comScrapDetailCardBatch, winScanPackAndLocation, jobTop }, @@ -91,7 +96,9 @@ toLocationInfo: {}, businessTypeInfo: {}, managementList: [], - jobStatus:"" + jobStatus:"", + managementType: '', + jobStatus: "" }; }, onLoad(option) { @@ -166,7 +173,7 @@ title: "加载中....", mask: true }); - getScrapJobDetail(that.id).then(res => { + getScrapJobDetail(that.id).then(async res => { uni.hideLoading(); if (res.data == null) { that.showMessage('未获取到详情'); @@ -175,7 +182,21 @@ that.jobContent = res.data; that.jobStatus = res.data.status that.subList = res.data.subList; - that.detailSource = getDataSource(that.subList) + that.detailSource = await getDataSource(that.subList) + //获取管理模式,封装参数 + var itemCodes = [] + this.detailSource.forEach(item => { + itemCodes.push(item.itemCode) + item.scaned = false + }) + that.fromLocationCode = that.subList[0].fromLocationCode + await getManagementPrecisions(itemCodes, that.fromLocationCode, res => { + if (res.success) { + this.managementList = res.list; + this.managementType = this.managementList.some(item => item.ManagementPrecision == + 'BY_BATCH') ? 'BY_BATCH' : '' + } + }) } else { that.showMessage('列表数据为0'); } @@ -336,26 +357,36 @@ } }, - submitJob() { + async submitJob() { uni.showLoading({ title: "提交中....", mask: true }); - //没有目标库位,不查询管理模式 - var params = this.setParams() - console.log("提交参数", JSON.stringify(params)); - scrapJobSubmit(params).then(res => { - uni.hideLoading() - if (res.data) { - this.showCommitSuccessMessage("提交成功\n生成报废出库记录\n" + res.data) - } else { - this.showErrorMessage("提交失败[" + res.msg + "]") + //获取管理模式,封装参数 + var itemCodes = [] + this.detailSource.forEach(item => { + itemCodes.push(item.itemCode) + item.scaned = false + }) + await getManagementPrecisions(itemCodes, that.fromLocationCode, res => { + if (res.success) { + this.managementList = res.list; + //没有目标库位,不查询管理模式 + var params = this.setParams() + console.log("提交参数", JSON.stringify(params)); + scrapJobSubmit(params).then(res => { + uni.hideLoading() + if (res.data) { + this.showCommitSuccessMessage("提交成功\n生成报废出库记录\n" + res.data) + } else { + this.showErrorMessage("提交失败[" + res.msg + "]") + } + }).catch(error => { + uni.hideLoading() + this.showErrorMessage(error) + }) } - }).catch(error => { - uni.hideLoading() - this.showErrorMessage(error) }) - }, setParams() { @@ -369,6 +400,10 @@ detail.toInventoryStatus = ""; detail.toLocationCode = ""; detail.toBatch = detail.batch; + var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,detail.packingNumber, detail.batch); + detail.toPackingNumber = info.packingNumber; + detail.packingNumber = info.packingNumber; + detail.fromPackingNumber = info.packingNumber; subList.push(detail) } }) diff --git a/src/pages/unPlanned/coms/comReceiptDetailCardBatch.vue b/src/pages/unPlanned/coms/comReceiptDetailCardBatch.vue new file mode 100644 index 00000000..79d5df26 --- /dev/null +++ b/src/pages/unPlanned/coms/comReceiptDetailCardBatch.vue @@ -0,0 +1,211 @@ + + + + + \ No newline at end of file diff --git a/src/pages/unPlanned/job/issueJobDetail.vue b/src/pages/unPlanned/job/issueJobDetail.vue index b805ee30..9f548107 100644 --- a/src/pages/unPlanned/job/issueJobDetail.vue +++ b/src/pages/unPlanned/job/issueJobDetail.vue @@ -18,8 +18,11 @@ + + + @remove="updateData" @updateData="updateData" @openDetail="openDetail" v-else> @@ -81,6 +84,7 @@ import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import comRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue" + import comRecommendDetailCardBatch from "@/mycomponents/detail/comRecommendDetailCardBatch.vue" import detailInfoPopup from '@/pages/unPlanned/coms/detailInfoPopup.vue' import jobTop from '@/mycomponents/job/jobTop.vue' @@ -90,6 +94,7 @@ winScanButton, winScanPackAndLocation, comRecommendDetailCard, + comRecommendDetailCardBatch, detailInfoPopup, jobTop }, @@ -102,6 +107,7 @@ detailSource: [], //绑定在页面上的数据源 businessTypeInfo: {}, managementList: [], + managementType: '', jobStatus: "" }; }, @@ -171,7 +177,7 @@ title: "加载中....", mask: true }); - getUnPlannedIssueJobDetail(that.id).then(res => { + getUnPlannedIssueJobDetail(that.id).then(async res => { uni.hideLoading(); if (res.data == null) { that.showMessage('未获取到详情'); @@ -183,7 +189,21 @@ that.subList.forEach(item=>{ item.isRecommend = true }) - that.detailSource = getDataSource(that.subList) + that.detailSource = await getDataSource(that.subList) + //获取管理模式,封装参数 + var itemCodes = [] + this.detailSource.forEach(item => { + itemCodes.push(item.itemCode) + item.scaned = false + }) + that.fromLocationCode = that.subList[0].fromLocationCode + await getManagementPrecisions(itemCodes, that.fromLocationCode, res => { + if (res.success) { + this.managementList = res.list; + this.managementType = this.managementList.some(item => item.ManagementPrecision == + 'BY_BATCH') ? 'BY_BATCH' : '' + } + }) } else { that.showErrorMessage('列表数据为0'); } @@ -346,20 +366,33 @@ title: "提交中....", mask: true }); - //没有目标库位,不查询管理模式 - var params = this.setParams() - console.log("提交参数", JSON.stringify(params)); - unPlannedIssueJobSubmit(params).then(res => { - uni.hideLoading() - if (res.data) { - this.showCommitSuccessMessage("提交成功\n生成计划外出库记录\n" + res.data) - } else { - this.showErrorMessage("提交失败[" + res.msg + "]") - } - }).catch(error => { - uni.hideLoading() - this.showErrorMessage(error) + var itemCodes = [] + this.detailSource.forEach(item => { + itemCodes.push(item.itemCode) + item.scaned = false }) + getManagementPrecisions(itemCodes, this.fromLocationCode, res => { + if (res.success) { + this.managementList = res.list; + //没有目标库位,不查询管理模式 + var params = this.setParams() + console.log("提交参数", JSON.stringify(params)); + unPlannedIssueJobSubmit(params).then(res => { + uni.hideLoading() + if (res.data) { + this.showCommitSuccessMessage("提交成功\n生成计划外出库记录\n" + res.data) + } else { + this.showErrorMessage("提交失败[" + res.msg + "]") + } + }).catch(error => { + uni.hideLoading() + this.showErrorMessage(error) + }) + } else { + uni.hideLoading(); + this.showErrorMessage(res.message); + } + }); }, @@ -373,6 +406,10 @@ detail.toPackingNumber = detail.packingNumber; detail.toContainerNumber = ''; detail.toBatch = detail.batch; + var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,detail.packingNumber, detail.batch); + detail.toPackingNumber = info.packingNumber; + detail.packingNumber = info.packingNumber; + detail.fromPackingNumber = info.packingNumber; subList.push(detail) } }) diff --git a/src/pages/unPlanned/job/receiptJobDetail.vue b/src/pages/unPlanned/job/receiptJobDetail.vue index 949ba2a7..c2396f7b 100644 --- a/src/pages/unPlanned/job/receiptJobDetail.vue +++ b/src/pages/unPlanned/job/receiptJobDetail.vue @@ -12,9 +12,13 @@ + + + :locationAreaTypeList='toLocationAreaTypeList' v-else> @@ -71,6 +75,7 @@ import winScanPack from '@/mycomponents/scan/winScanPack.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue' import comReceiptDetailCard from '@/pages/unPlanned/coms/comReceiptDetailCard.vue' + import comReceiptDetailCardBatch from '@/pages/unPlanned/coms/comReceiptDetailCardBatch.vue' import jobTop from '@/mycomponents/job/jobTop.vue' export default { @@ -79,6 +84,7 @@ winScanButton, winScanPack, comReceiptDetailCard, + comReceiptDetailCardBatch, locationCompare, jobTop }, @@ -94,6 +100,7 @@ toLocationInfo: {}, businessTypeInfo: {}, managementList: [], + managementType:'', jobStatus: "", jobToLocationCode: "" }; @@ -160,7 +167,7 @@ title: "加载中....", mask: true }); - getUnPlannedReceiptJobDetail(that.id).then(res => { + getUnPlannedReceiptJobDetail(that.id).then(async res => { uni.hideLoading(); if (res.data == null) { that.showMessage('未获取到详情'); @@ -168,10 +175,22 @@ if (res.data.subList.length > 0) { that.jobContent = res.data; that.jobStatus = res.data.status - that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes); + that.toLocationAreaTypeList =getDirectoryItemArray(that.jobContent.toAreaTypes); that.subList = res.data.subList; that.jobToLocationCode = that.subList[0].toLocationCode - that.detailSource = getDataSource(that.subList) + that.detailSource =await getDataSource(that.subList) + //获取管理模式,封装参数 + var itemCodes = [] + this.detailSource.forEach(item => { + itemCodes.push(item.itemCode) + item.scaned = false + }) + getManagementPrecisions(itemCodes, that.jobToLocationCode, res => { + if (res.success) { + this.managementList = res.list; + this.managementType = this.managementList.some(item => item.ManagementPrecision == 'BY_BATCH') ? 'BY_BATCH' : '' + } + }) } else { that.showErrorMessage('列表数据为0'); } @@ -342,6 +361,8 @@ var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, detail.packingNumber, detail.batch); detail.toPackingNumber = info.packingNumber; + detail.packingNumber = info.packingNumber; + detail.fromPackingNumber = info.packingNumber; detail.toBatch = info.batch; detail.toLocationCode = this.toLocationCode detail.toContainerNumber = '';