From 4b5852df3388daac0a1064ba3134dde99a3ae0a2 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Fri, 1 Nov 2024 11:45:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages.json | 56 ++ .../customerReturn/record/returnRecord.vue | 54 +- src/pages/deliver/record/deliverRecord.vue | 75 +- src/pages/issue/record/directIssue.vue | 219 +----- src/pages/issue/record/directIssueByBatch.vue | 549 +++++++++++++++ .../record/fgDirectPutawayByBatch.vue | 48 ++ .../record/productPutawayRecord.vue | 297 +------- .../record/productPutawayRecordByBatch.vue | 651 ++++++++++++++++++ .../record/semiDirectPutawayByBatch.vue | 48 ++ .../coms/comProductRecordBatch.vue | 2 +- .../record/productReceiptRecord.vue | 118 +--- .../record/productReceiptRecordByBatch.vue | 492 +++++++++++++ src/pages/scrap/record/scrapRecord.vue | 90 +-- src/pages/transfer/record/deliverRecord.vue | 12 +- src/pages/transfer/record/receiptRecord.vue | 43 +- .../transfer/record/receiptRecordByBatch.vue | 482 +++++++++++++ src/pages/unPlanned/record/issueRecord.vue | 12 +- src/pages/unPlanned/record/receiptRecord.vue | 44 +- .../unPlanned/record/receiptRecordByBatch.vue | 450 ++++++++++++ 19 files changed, 3011 insertions(+), 731 deletions(-) create mode 100644 src/pages/issue/record/directIssueByBatch.vue create mode 100644 src/pages/productPutaway/record/fgDirectPutawayByBatch.vue create mode 100644 src/pages/productPutaway/record/productPutawayRecordByBatch.vue create mode 100644 src/pages/productPutaway/record/semiDirectPutawayByBatch.vue create mode 100644 src/pages/productReceipt/record/productReceiptRecordByBatch.vue create mode 100644 src/pages/transfer/record/receiptRecordByBatch.vue create mode 100644 src/pages/unPlanned/record/receiptRecordByBatch.vue diff --git a/src/pages.json b/src/pages.json index 3b6dd86d..32a54c13 100644 --- a/src/pages.json +++ b/src/pages.json @@ -716,6 +716,35 @@ } } }, + { + "path": "pages/issue/record/directIssueByBatch", + "style": { + "navigationBarTitleText": "直接发料", + "enablePullDownRefresh": false, + "titleNView": { + "autoBackButton": "true", + "buttons": [ + // 右边按钮 + { + + "float": "right", + "fontSize": "58rpx", //按钮上文字的大小 + "text": "\ue696", + "fontSrc": "/static/ali_icon/iconfont.ttf" + + }, + { + + "float": "right", + "fontSize": "52rpx", //按钮上文字的大小 + "text": "\ue6e2", + "fontSrc": "/static/ali_icon/iconfont.ttf" + } + ] + } + } + }, + { "path": "pages/issue/record/directIssue0816", "style": { @@ -1418,6 +1447,15 @@ "enablePullDownRefresh": false } }, + + { + "path": "pages/productReceipt/record/productReceiptRecordByBatch", + "style": { + "navigationBarTitleText": "制品收货记录", + "enablePullDownRefresh": false + } + }, + { "path": "pages/productPutaway/job/productPutawayJob", "style": { @@ -1478,6 +1516,24 @@ } }, + + { + "path": "pages/productPutaway/record/fgDirectPutawayByBatch", + "style": { + "navigationBarTitleText": "装配直接上架", + "enablePullDownRefresh": false + + } + }, + + { + "path": "pages/productPutaway/record/semiDirectPutawayByBatch", + "style": { + "navigationBarTitleText": "预生产直接上架", + "enablePullDownRefresh": false + + } + }, { diff --git a/src/pages/customerReturn/record/returnRecord.vue b/src/pages/customerReturn/record/returnRecord.vue index da15f46f..3c321a2c 100644 --- a/src/pages/customerReturn/record/returnRecord.vue +++ b/src/pages/customerReturn/record/returnRecord.vue @@ -70,6 +70,10 @@ createDetailInfo, calcHandleQty } from '@/common/record.js'; + + import { + calc + } from '@/common/calc.js'; import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' @@ -109,7 +113,8 @@ toLocationAreaTypeList: [], managementList: [], toWarehouseCode: '', - toInventoryStatuses:"" + toInventoryStatuses:"", + managementType:"" }; }, onLoad(option) { @@ -145,7 +150,18 @@ }, methods: { - getScanResult(result) { + getScanResult(result,managementTypeParams) { + this.managementType = managementTypeParams + console.log(managementTypeParams) + if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { + this.setDataBatch(result) + } else { + this.setData(result) + } + + }, + + setData(result){ let balance = result.balance; let label = result.label; let pack = result.package; @@ -180,7 +196,39 @@ } } this.calcHandleQty(); - + }, + setDataBatch(result){ + let balance = result.balance; + let label = result.label; + let pack = result.package; + var item = this.detailSource.find(res => { + if (res.itemCode == balance.itemCode) { + return res + } + }) + if (item == undefined) { + + var itemp = createItemInfo(balance, pack); + let newDetail = createDetailInfo(balance, pack); // + newDetail.packingNumber =pack.number + itemp.subList.push(newDetail); + this.detailSource.push(itemp) + } else { + var detail = item.subList.find(r => { + if (r.batch == balance.batch && + r.locationCode == balance.locationCode && + r.inventoryStatus == balance.inventoryStatus) { + return r; + } + }) + if (detail == undefined) { + let newDetail = createDetailInfo(balance, pack); + item.subList.push(newDetail); + } else { + detail.handleQty =calc.add(detail.handleQty, result.label.qty) + } + } + this.calcHandleQty(); }, showErrorMessage(message) { diff --git a/src/pages/deliver/record/deliverRecord.vue b/src/pages/deliver/record/deliverRecord.vue index 048328c0..0b10be85 100644 --- a/src/pages/deliver/record/deliverRecord.vue +++ b/src/pages/deliver/record/deliverRecord.vue @@ -8,7 +8,9 @@ - @@ -80,6 +82,9 @@ calcHandleQty } from '@/common/record.js'; + import { + calc + } from '@/common/calc.js'; import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' @@ -115,7 +120,8 @@ customerCode : "", dataContent:{}, managementList:[], - deliverType:''//发货类型:寄售库CUST,三方库THIRD_PARTY + deliverType:'',//发货类型:寄售库CUST,三方库THIRD_PARTY + managementType:"" }; }, onLoad(option) { @@ -162,7 +168,20 @@ mounted() {}, methods: { - getScanResult(result) { + getScanResult(result,managementTypeParams) { + this.managementType = managementTypeParams + if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { + this.setDataBatch(result) + } else { + this.setData(result) + } + + + + + }, + + setData(result){ let balance = result.balance; let label = result.label; let pack = result.package; @@ -197,8 +216,42 @@ } } this.calcHandleQty(); - }, + + setDataBatch(result){ + let balance = result.balance; + let label = result.label; + let pack = result.package; + let labelQty =result.label.qty; + let balanceQty =result.balance.qty; + var item = this.detailSource.find(res => { + if (res.itemCode == balance.itemCode) { + return res + } + }) + if (item == undefined) { + var itemp = createItemInfo(balance, pack); + let newDetail = createDetailInfo(balance, pack); // + itemp.subList.push(newDetail); + this.detailSource.push(itemp) + } else { + var detail = item.subList.find(r => { + if (r.batch == balance.batch && + r.locationCode == balance.locationCode && + r.inventoryStatus == balance.inventoryStatus) { + return r; + } + }) + if (detail == undefined) { + let newDetail = createDetailInfo(balance, pack); + item.subList.push(newDetail); + } else { + detail.handleQty =calc.add(detail.handleQty, result.label.qty) + } + } + this.calcHandleQty(); + }, + showErrorMessage(message) { this.$refs.comMessage.showErrorMessage(message, res => { if (res) { @@ -228,12 +281,16 @@ }, openScanPopup() { - - if (this.fromLocationCode == "") { - this.showFromLocationPopup(); - return + if (this.businessType) { + if (this.fromLocationCode == "") { + this.showFromLocationPopup(); + return + } + this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); + } else { + this.getBusinessType() } - this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); + }, showFromLocationPopup() { diff --git a/src/pages/issue/record/directIssue.vue b/src/pages/issue/record/directIssue.vue index fffd929f..b0d956cf 100644 --- a/src/pages/issue/record/directIssue.vue +++ b/src/pages/issue/record/directIssue.vue @@ -1,7 +1,7 @@ @@ -63,8 +50,7 @@ import { productPutawayRecordSubmit, getrecommendLocationExpectin, - recommendLocationRemoveExpectin, - getBalanceByFilter + recommendLocationRemoveExpectin } from '@/api/request2.js'; import { goHome, @@ -72,8 +58,7 @@ deepCopyData } from '@/common/basic.js'; import { - getPrecisionStrategyList, - getManagementPrecisions + getPrecisionStrategyList } from '@/common/balance.js'; import { @@ -85,13 +70,8 @@ getBusinessType, createItemInfo, createDetailInfo, - calcHandleQty, - calcHandleQtyAdd + calcHandleQty } from '@/common/record.js'; - - import { - calc - } from '@/common/calc.js'; import winScanButton from '@/mycomponents/scan/winScanButton.vue' import requiredLocation from '@/mycomponents/location/requiredLocation.vue' @@ -101,8 +81,6 @@ import winScanPackage from '@/mycomponents/scan/winScanPackage.vue' import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' - import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" - import recordComDetailCardBatch from '@/mycomponents/record/recordComDetailCardBatch.vue' import { updateTitle } from '@/common/basic.js'; @@ -116,9 +94,7 @@ recordComDetailCard, winScanPackage, winScanLocation, - winComScanBalance, - winScanPackAndLocation, - recordComDetailCardBatch + winComScanBalance }, data() { return { @@ -138,8 +114,7 @@ businessType: {}, managementList: [], type: '', - editItem: null, - managementType:'' + editItem: null }; }, // 装配收货:type = 'assemble' @@ -173,143 +148,11 @@ }, methods: { - getScanResult(result,managementTypeParams) { - this.managementType = managementTypeParams - if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ - this.setDataBatch(result) - }else{ - this.setData(result) - } + getScanResult(result) { + this.setData(result); }, - async setDataBatch(result) { - let balance = result.balance; - let label = result.label; - let pack = result.package; - var item = this.detailSource.find(res => { - if (res.itemCode == balance.itemCode) { - return res - } - }) - if (item == undefined) { - var itemp = createItemInfo(balance, pack); - // itemp.containerNumber="" - let newDetail = createDetailInfo(balance, pack); // - newDetail.fromLocationCode=balance.locationCode - - newDetail.parentNumber = pack.parentNumber; - newDetail.packingNumber = pack.number - newDetail.packUnit = pack.packUnit; - newDetail.packQty = pack.packQty; - if (balance.lableQty) { - newDetail.handleQty = balance.lableQty - } - newDetail.handleQty =0; - newDetail.balanceQty =result.balance.qty; - itemp.subList.push(newDetail); - this.detailSource.push(itemp) - this.itemCode = balance.itemCode; - this.fromLocationCode = balance.locationCode - await this.getRecommendLocation(balance,result) - await this.scanPopupGetFocus() - } else { - var detail = item.subList.find(r => { - if (r.batch == balance.batch && - r.fromLocationCode == balance.locationCode && - r.inventoryStatus == balance.inventoryStatus) { - return r; - } - }) - if (detail == undefined) { - //如果最开始扫父,在扫子,提示已经扫描父包装 - //如果扫子在扫父,提示扫描的是父包装,是否移除子包装,是移除子包装,显示父包装 - //扫描的是子包装, - if (pack.parentNumber) { - var checkData = item.subList.find(r => { - if (r.packingNumber == pack.parentNumber && - r.batch == balance.batch&& - r.fromLocationCode == balance.locationCode) { - return r; - } - }) - if (checkData) { - //提示已经扫描 - this.showErrorMessage("扫描箱码[" + pack.number + "]批次[" + balance.batch + - "]的父包装已经扫描") - console.log("父包装已经扫描") - } else { - let newDetail = createDetailInfo(balance, pack); - newDetail.parentNumber = pack.parentNumber; - newDetail.packingNumber = pack.number - newDetail.packUnit = pack.packUnit; - newDetail.packQty = pack.packQty; - newDetail.fromLocationCode=balance.locationCode - if (balance.lableQty) { - newDetail.handleQty = balance.lableQty - } - newDetail.handleQty =0; - newDetail.balanceQty =result.balance.qty; - item.subList.push(newDetail); - } - } else { - //扫描的是父包装 - var checkData = item.subList.find(r => { - if (r.parentNumber == pack.number && - r.batch == balance.batch&& - r.fromLocationCode == balance.locationCode) { - return r; - } - }) - if (checkData) { - //是否移除 - this.$refs.comMessage.showQuestionMessage("箱码[" + checkData.parentNumber+"]" + "批次[" + balance - .batch + "]是父包装,是否移除子包装", res => { - if (res) { - item.subList = []; - let newDetail = createDetailInfo(balance, pack); - newDetail.parentNumber = pack.parentNumber; - newDetail.packingNumber = pack.number - newDetail.packUnit = pack.packUnit; - newDetail.packQty = pack.packQty; - newDetail.fromLocationCode=balance.locationCode - if (balance.lableQty) { - newDetail.handleQty = balance.lableQty - } - newDetail.handleQty =0; - newDetail.balanceQty =result.balance.qty; - item.subList.push(newDetail); - calcHandleQtyAdd(this.detailSource,result.label); - } - }) - console.log("扫描的是父包装,是否移除子包装") - } else { - let newDetail = createDetailInfo(balance, pack); - newDetail.fromLocationCode=balance.locationCode - newDetail.parentNumber = pack.parentNumber; - newDetail.packingNumber = pack.number - newDetail.packUnit = pack.packUnit; - newDetail.packQty = pack.packQty; - if (balance.lableQty) { - newDetail.handleQty = balance.lableQty - } - newDetail.handleQty =0; - newDetail.balanceQty =result.balance.qty; - item.subList.push(newDetail); - } - } - - this.scanPopupGetFocus() - } else { - if (detail.scaned == true) { - // detail.handleQty = calc.add(detail.handleQty,result.label.qty) - // this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描") - } - } - } - calcHandleQtyAdd(this.detailSource,result.label); - }, - - async setData(result) { + setData(result) { let balance = result.balance; let label = result.label; let pack = result.package; @@ -336,11 +179,12 @@ this.detailSource.push(itemp) this.itemCode = balance.itemCode; this.fromLocationCode = balance.locationCode - await this.getRecommendLocation(balance,result) - await this.scanPopupGetFocus() + this.getRecommendLocation(balance) + this.scanPopupGetFocus() } else { var detail = item.subList.find(r => { - if (r.batch == balance.batch && + if (r.packingNumber == pack.number && + r.batch == balance.batch && r.fromLocationCode == balance.locationCode && r.inventoryStatus == balance.inventoryStatus) { return r; @@ -421,15 +265,14 @@ this.scanPopupGetFocus() } else { if (detail.scaned == true) { - detail.handleQty = calc.add(detail.handleQty,result.label.qty) - // this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描") + this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描") } } } calcHandleQty(this.detailSource); }, - async getRecommendLocation(balance,result) { + getRecommendLocation(balance) { uni.showLoading({ title: '扫描中...', mask: true @@ -442,88 +285,24 @@ batch: balance.batch }; console.log(JSON.stringify(param)) - await getrecommendLocationExpectin(param).then(async result1 => { + getrecommendLocationExpectin(param).then(result => { uni.hideLoading(); let item = this.detailSource.find(res => { - if (res.itemCode == balance.itemCode) { + if (res.itemCode == balance.itemCode && res.containerNumber == balance + .packingNumber) { return res } }) - item.toLocationCode = result1.data.code; - item.expectinNumber = result1.data.expectinNumber; - await this.getToLocationBalance(item.toLocationCode,result) + item.toLocationCode = result.data.code; + item.expectinNumber = result.data.expectinNumber; this.$forceUpdate(); + }).catch(error => { uni.hideLoading() this.showErrorMessage(error); }) }, - //查询到目标库位的库存余额 - async getToLocationBalance(toLocationCode,result) { - uni.showLoading({ - title: '查询中', - mask: true - }) - var filters = [] - if (result.package.parentNumber) { - var packingNumber = result.package.parentNumber + "," + result.package.number; - filters.push({ - column: "packingNumber", - action: "in", - value: packingNumber - }) - } else { - filters.push({ - column: "packingNumber", - action: "==", - value: result.package.number - }) - } - filters.push({ - column: "itemCode", - action: "==", - value: result.package.itemCode - }) - filters.push({ - column: "batch", - action: "==", - value: result.package.batch - }) - - filters.push({ - column: "areaType", - action: "in", - value: this.toLocationAreaTypeList.join(',') - }) - - - var params = { - filters: filters, - pageNo: 1, - pageSize: 100, - } - await getManagementPrecisions([result.package.itemCode], toLocationCode,async 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'){ - uni.hideLoading() - }else{ - await getBalanceByFilter(params).then(res => { - uni.hideLoading() - if (res.data.list.length > 0) { - this.showErrorMessage("包装在库位【" + res.data.list[0].locationCode + "】已有库存余额"); - } - // callback(res.data) - }).catch(err => { - this.showErrorMessage(err.message); - }) - } - } - }) - - }, //移除推荐的预占用库位 removeRecommendLocation(lst) { let param = { @@ -571,9 +350,7 @@ openScanPopup() { if (this.businessType) { - this.toLocationAreaTypeList = getDirectoryItemArray(this.businessType.inAreaTypes) - // this.$refs.scanPopup.openScanPopup(this.businessType); - this.openFromLocationScanPopup() + this.$refs.scanPopup.openScanPopup(this.businessType); } else { this.getBusinessType() } @@ -596,18 +373,7 @@ this.$refs.scanPopup.losefocus(); } }, - openFromLocationScanPopup() { - if (this.fromLocationCode == "") { - this.showFromLocationPopup(); - return - } - this.$refs.winScanPackAndLocationRef.openScanPopupForType(this.fromLocationCode, this.businessType); - }, - showFromLocationPopup() { - this.$nextTick(() => { - this.$refs.winScanFromLocation.openScanPopup(); - }) - }, + scanLocationCode(location, code) { this.toLocationCode = code this.detailSource.forEach(item => { @@ -626,15 +392,7 @@ }); var params = this.setParams() - console.log("提交" + JSON.stringify(params)) - const isHaveItem =params.subList.find(item=>item.handleQty > item.balanceQty) - if(isHaveItem){ - this.showErrorMessage(`物料号${isHaveItem.itemCode}`) - this.$refs.comMessage.showConfirmWarningModal('物料号'+isHaveItem.itemCode+'数量[' + isHaveItem.handleQty + ']不允许大于库存数量[' + isHaveItem.balanceQty + ']') - uni.hideLoading() - return - } productPutawayRecordSubmit(params).then(res => { uni.hideLoading() if (res.data) { @@ -745,14 +503,7 @@ getToLocationCode(location, code) { this.editItem.toLocationCode = code; }, - getLocation(location, code) { - this.getFromLocationCode(location, code) - }, - getFromLocationCode(location, code) { - this.fromLocationInfo = location; - this.fromLocationCode = code; - this.openScanPopup(); - }, + showCommitSuccessMessage(hint) { this.$refs.comMessage.showSuccessMessage(hint, res => { this.clearData(); diff --git a/src/pages/productPutaway/record/productPutawayRecordByBatch.vue b/src/pages/productPutaway/record/productPutawayRecordByBatch.vue new file mode 100644 index 00000000..2d410e6d --- /dev/null +++ b/src/pages/productPutaway/record/productPutawayRecordByBatch.vue @@ -0,0 +1,651 @@ + + + + + \ No newline at end of file diff --git a/src/pages/productPutaway/record/semiDirectPutawayByBatch.vue b/src/pages/productPutaway/record/semiDirectPutawayByBatch.vue new file mode 100644 index 00000000..22ed7f1c --- /dev/null +++ b/src/pages/productPutaway/record/semiDirectPutawayByBatch.vue @@ -0,0 +1,48 @@ + + + + + \ No newline at end of file diff --git a/src/pages/productReceipt/coms/comProductRecordBatch.vue b/src/pages/productReceipt/coms/comProductRecordBatch.vue index ba777607..3b5fdd2a 100644 --- a/src/pages/productReceipt/coms/comProductRecordBatch.vue +++ b/src/pages/productReceipt/coms/comProductRecordBatch.vue @@ -17,7 +17,7 @@ + :isShowPack="true" :isShowFromLocation="true"> diff --git a/src/pages/productReceipt/record/productReceiptRecord.vue b/src/pages/productReceipt/record/productReceiptRecord.vue index 6b0ba794..d12eabf4 100644 --- a/src/pages/productReceipt/record/productReceiptRecord.vue +++ b/src/pages/productReceipt/record/productReceiptRecord.vue @@ -8,11 +8,8 @@ - - + @updateData="updateData" @removePack="removePack"> @@ -45,12 +42,6 @@ - - - - - @@ -88,20 +79,14 @@ import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' import comProductRecord from '@/pages/productReceipt/coms/comProductRecord.vue' - import comProductRecordBatch from '@/pages/productReceipt/coms/comProductRecordBatch.vue' import comBlankView from '@/mycomponents/common/comBlankView.vue' - import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" - import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" export default { components: { winScanButton, winScanPack, comProductRecord, - comProductRecordBatch, comBlankView, - winScanLocation, - winScanPackAndLocation, }, data() { return { @@ -123,7 +108,6 @@ workShopName: "", productionLineName: "", workStationName: "", - managementType:'' }; }, onLoad(option) { @@ -158,53 +142,7 @@ mounted() {}, methods: { - getScanResult(result,managementTypeParams ) { - this.managementType = managementTypeParams - if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ - this.setDataBatch(result) - }else{ - this.setData(result) - } - }, - async setDataBatch(result) { - let label = result.label; - let pack = result.package; - - var item = this.detailSource.find(res => { - if (res.itemCode == label.itemCode) { - return res - } - }) - - if (item == undefined) { - var itemp = this.createItemInfo(label, pack); - let newDetail = this.createDetailInfo(label, pack); - newDetail.handleQty =0; - newDetail.balanceQty =result.balance.qty; - itemp.subList.push(newDetail); - this.detailSource.push(itemp) - } else { - var detail = item.subList.find(r => { - if (r.packingNumber == label.packingNumber && - r.batch == label.batch) { - return r; - } - }) - - if (detail == undefined) { - let newDetail = this.createDetailInfo(label, pack); - newDetail.handleQty =0; - newDetail.balanceQty =result.balance.qty; - item.subList.push(newDetail); - } else { - if (detail.scaned == true) { - // this.showErrorMessage("箱码[" + label.packingNumber + "批次[" + label.batch + "]重复扫描") - } - } - } - this.calcHandleQtyAdd(result.label); - }, - async setData(result) { + getScanResult(result) { let label = result.label; let pack = result.package; @@ -280,40 +218,14 @@ this.$forceUpdate(); }, - calcHandleQtyAdd(label) { - for (let item of this.detailSource) { - item.handleQty = item.handleQty || new Decimal(0).toNumber(); - for (let detail of item.subList) { - if (detail != undefined) { - item.handleQty = calc.add(item.handleQty,label.qty) - detail.handleQty = calc.add(detail.handleQty,label.qty) - } - } - } - console.log(this.detailSource) - this.scanPopupGetFocus(); - this.$forceUpdate(); - }, updateData() { this.calcHandleQty(); }, openScanPopup() { - // this.$refs.scanPopup.openScanPopup(); - this.openFromLocationScanPopup() - }, - openFromLocationScanPopup() { - if (this.fromLocationCode == "") { - this.showFromLocationPopup(); - return - } - this.$refs.winScanPackAndLocationRef.openScanPopupForType(this.fromLocationCode, this.businessType); - }, - showFromLocationPopup() { - this.$nextTick(() => { - this.$refs.winScanFromLocation.openScanPopup(); - }) + this.$refs.scanPopup.openScanPopup(); }, + commit() { if (this.positionInfo == "请选择位置") { this.showMessage("请先选择位置") @@ -328,21 +240,12 @@ }); this.managementList = []; var precisionStrategParams = this.setPrecisionStrategParams() - + getPrecisionStrategyList(precisionStrategParams, res => { if (res.success) { this.managementList = res.list; var params = this.setParams() - - console.log("提交",params) - const isHaveItem =params.subList.find(item=>item.handleQty > item.balanceQty) - if(isHaveItem){ - this.showErrorMessage(`物料号${isHaveItem.itemCode}`) - this.$refs.comMessage.showConfirmWarningModal('物料号'+isHaveItem.itemCode+'数量[' + isHaveItem.handleQty + ']不允许大于库存数量[' + isHaveItem.balanceQty + ']') - uni.hideLoading() - return - } - return + console.log("提交" + JSON.stringify(params)) productionReceiptRecordSubmit(params).then(res => { uni.hideLoading() if (res.data) { @@ -476,14 +379,7 @@ this.$refs.scanPopup.losefocus(); } }, - getLocation(location, code) { - this.getFromLocationCode(location, code) - }, - getFromLocationCode(location, code) { - this.fromLocationInfo = location; - this.fromLocationCode = code; - this.openScanPopup(); - }, + afterCloseMessage() { this.scanPopupGetFocus(); }, diff --git a/src/pages/productReceipt/record/productReceiptRecordByBatch.vue b/src/pages/productReceipt/record/productReceiptRecordByBatch.vue new file mode 100644 index 00000000..d12eabf4 --- /dev/null +++ b/src/pages/productReceipt/record/productReceiptRecordByBatch.vue @@ -0,0 +1,492 @@ + + + + + diff --git a/src/pages/scrap/record/scrapRecord.vue b/src/pages/scrap/record/scrapRecord.vue index 1c1eba10..c7366ea6 100644 --- a/src/pages/scrap/record/scrapRecord.vue +++ b/src/pages/scrap/record/scrapRecord.vue @@ -8,8 +8,9 @@ 报废原因 : - - + + @@ -18,14 +19,13 @@ - @@ -59,28 +59,27 @@ import { scrapRecordSubmit } from '@/api/request2.js'; - + import { goHome, deepCopyData } from '@/common/basic.js'; - + import { calc } from '@/common/calc' - + import { getInventoryStatusDesc, getDirectoryItemArray, getScarpReasonList } from '@/common/directory.js'; - + import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty, - calcHandleQtyAdd } from '@/common/record.js'; import winScanButton from '@/mycomponents/scan/winScanButton.vue' @@ -90,7 +89,7 @@ import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import recordComDetailCardBatch from '@/mycomponents/record/recordComDetailCardBatch.vue' - + export default { components: { winScanButton, @@ -115,12 +114,12 @@ businessType: {}, reasonList: [], reasonText: "", - managementType:"" + managementType: "" }; }, onLoad(option) { uni.setNavigationBarTitle({ - title: option.title + title: option.title }) this.reasonList = getScarpReasonList(); var typeCode = "Scrap" @@ -148,20 +147,20 @@ onPullDownRefresh() {}, mounted() { - + }, methods: { - getScanResult(result,managementTypeParams) { + getScanResult(result, managementTypeParams) { this.managementType = managementTypeParams - console.log("模式"+managementTypeParams) + console.log("模式" + managementTypeParams) if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { this.setDataBatch(result) } else { this.setData(result) } }, - - setDataBatch(result){ + + setDataBatch(result) { let balance = result.balance; let label = result.label; let pack = result.package; @@ -187,14 +186,14 @@ let newDetail = createDetailInfo(balance, pack); item.subList.push(newDetail); } else { - detail.handleQty =calc.add(detail.handleQty, result.label.qty) + detail.handleQty = calc.add(detail.handleQty, result.label.qty) } } - + this.calcHandleQty(this.detailSource) }, - - setData(result){ + + setData(result) { let balance = result.balance; let label = result.label; let pack = result.package; @@ -255,12 +254,15 @@ }, openScanPopup() { - - if (this.fromLocationCode == "") { - this.showFromLocationPopup(); - return + if (this.businessType) { + if (this.fromLocationCode == "") { + this.showFromLocationPopup(); + return + } + this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); + } else { + this.getBusinessType() } - this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); }, showFromLocationPopup() { this.$nextTick(() => { @@ -269,13 +271,13 @@ }, closeScanPopup() { - if(this.$refs.scanPopup!=undefined){ + if (this.$refs.scanPopup != undefined) { this.$refs.scanPopup.closeScanPopup(); } }, scanPopupGetFocus() { - if(this.$refs.scanPopup!=undefined){ + if (this.$refs.scanPopup != undefined) { this.$refs.scanPopup.getfocus(); } }, @@ -313,33 +315,33 @@ submitItem.itemName = detail.package.itemName; submitItem.itemDesc1 = detail.package.itemDesc1; submitItem.itemDesc2 = detail.package.itemDesc2; - + submitItem.inventoryStatus = detail.inventoryStatus; - + detail.fromPackingNumber = detail.packingNumber; detail.toPackingNumber = detail.packingNumber; - + submitItem.fromContainerNumber = detail.containerNumber; submitItem.toContainerNumber = detail.containerNumber - + submitItem.fromBatch = detail.batch; submitItem.toBatch = detail.batch; - + submitItem.fromLocationCode = detail.locationCode; submitItem.toLocationCode = ""; - + submitItem.reason = this.reasonText; submitItem.qty = detail.handleQty; - submitItem.package =""; + submitItem.package = ""; subList.push(submitItem) } }) }) - - this.dataContent.subList =subList + + this.dataContent.subList = subList this.dataContent.creator = creator; return this.dataContent; - + }, showScanMessage(message) { @@ -366,7 +368,7 @@ this.clearData(); }) }, - clearData(){ + clearData() { this.fromLocationCode = ""; this.reasonText = ""; this.detailSource = []; @@ -423,4 +425,4 @@ background: #e0e0e0; } - + \ No newline at end of file diff --git a/src/pages/transfer/record/deliverRecord.vue b/src/pages/transfer/record/deliverRecord.vue index f2374fe7..6112df4d 100644 --- a/src/pages/transfer/record/deliverRecord.vue +++ b/src/pages/transfer/record/deliverRecord.vue @@ -262,11 +262,15 @@ }, openScanPopup() { - if (this.fromLocationCode == "") { - this.showFromLocationPopup(); - return + if (this.businessType) { + if (this.fromLocationCode == "") { + this.showFromLocationPopup(); + return + } + this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); + } else { + this.getBusinessType() } - this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); }, showFromLocationPopup() { this.$nextTick(() => { diff --git a/src/pages/transfer/record/receiptRecord.vue b/src/pages/transfer/record/receiptRecord.vue index 7f33326b..6bd706b5 100644 --- a/src/pages/transfer/record/receiptRecord.vue +++ b/src/pages/transfer/record/receiptRecord.vue @@ -97,8 +97,7 @@ businessType: {}, managementList: [], dataContent: {}, - toWarehouseCode: '', - managementType:import.meta.env.VITE_MANAGE_MODEL + toWarehouseCode: '' }; }, @@ -132,14 +131,7 @@ methods: { getScanResult(result) { - var managementTypeParams =this.managementType - if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { - this.setDataBatch(result) - } else { - this.setData(result) - } - - + this.setData(result) }, setData(result){ @@ -174,37 +166,6 @@ } this.calcHandleQty(); }, - - setDataBatch(result){ - let label = result.label; - let pack = result.package; - var item = this.detailSource.find(res => { - if (res.itemCode == label.itemCode) { - return res - } - }) - if (item == undefined) { - var itemp = createItemInfo(label, pack); - let newDetail = createDetailInfo(label, pack); // - newDetail.inventoryStatus = "OK" - itemp.subList.push(newDetail); - this.detailSource.push(itemp) - } else { - var detail = item.subList.find(r => { - if (r.packingNumber == label.packingNumber && - r.batch == label.batch) { - return r; - } - }) - if (detail == undefined) { - let newDetail = createDetailInfo(label, pack); - item.subList.push(newDetail); - } else { - detail.handleQty =calc.add(detail.handleQty, result.label.qty) - } - } - this.calcHandleQty(); - }, showErrorMessage(message) { this.$refs.comMessage.showErrorMessage(message, res => { diff --git a/src/pages/transfer/record/receiptRecordByBatch.vue b/src/pages/transfer/record/receiptRecordByBatch.vue new file mode 100644 index 00000000..7f33326b --- /dev/null +++ b/src/pages/transfer/record/receiptRecordByBatch.vue @@ -0,0 +1,482 @@ + + + + + diff --git a/src/pages/unPlanned/record/issueRecord.vue b/src/pages/unPlanned/record/issueRecord.vue index 27f0d6a9..4aac5d33 100644 --- a/src/pages/unPlanned/record/issueRecord.vue +++ b/src/pages/unPlanned/record/issueRecord.vue @@ -129,11 +129,15 @@ methods: { openScanPopup() { - if (this.fromLocationCode == "") { - this.showFromLocationPopup(); - return + if (this.businessType) { + if (this.fromLocationCode == "") { + this.showFromLocationPopup(); + return + } + this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); + } else { + this.getBusinessType() } - this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); }, showFromLocationPopup() { this.$nextTick(() => { diff --git a/src/pages/unPlanned/record/receiptRecord.vue b/src/pages/unPlanned/record/receiptRecord.vue index efeaf748..288134b6 100644 --- a/src/pages/unPlanned/record/receiptRecord.vue +++ b/src/pages/unPlanned/record/receiptRecord.vue @@ -109,7 +109,6 @@ dataContent: {}, managementList: [], toLocationAreaTypeList:[], - managementType:import.meta.env.VITE_MANAGE_MODEL } }, @@ -137,13 +136,7 @@ this.toLocationCode = code; }, getScanResult(result) { - var managementTypeParams =this.managementType - if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { - this.setDataBatch(result) - } else { - this.setData(result) - } - + this.setData(result) }, setData(result){ @@ -183,41 +176,6 @@ this.calcHandleQty(); }, - setDataBatch(result){ - let label = result.label; - let pack = result.package; - var item = this.detailSource.find(res => { - if (res.itemCode == label.itemCode) { - return res - } - }) - if (item == undefined) { - var itemp = this.createItemInfo(label, pack); - let newDetail = this.createDetailInfo(label, pack); - itemp.subList.push(newDetail); - this.detailSource.push(itemp) - this.getfocus() - - } else { - var detail = item.subList.find(r => { - if (r.packingNumber == pack.number && - r.batch == pack.batch) { - return r; - } - }) - - if (detail == undefined) { - let newDetail = this.createDetailInfo(label, pack); - item.subList.push(newDetail); - this.getfocus() - } else { - detail.handleQty =calc.add(detail.handleQty, result.label.qty) - - } - } - this.calcHandleQty(); - }, - getfocus(){ if(this.$refs.scanPopup){ this.$refs.scanPopup.getfocus() diff --git a/src/pages/unPlanned/record/receiptRecordByBatch.vue b/src/pages/unPlanned/record/receiptRecordByBatch.vue new file mode 100644 index 00000000..efeaf748 --- /dev/null +++ b/src/pages/unPlanned/record/receiptRecordByBatch.vue @@ -0,0 +1,450 @@ + + + + +