From 0bf1a072152205a83ab8b022782a82d92c1af458 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Thu, 31 Oct 2024 17:27:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=B4=E6=8E=A5=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E4=B8=8A=E6=9E=B6,=E8=AE=A1=E5=88=92=E5=A4=96?= =?UTF-8?q?=E5=87=BA=E5=85=A5=E5=BA=93=EF=BC=8C=E7=89=A9=E6=96=99=E8=BD=AC?= =?UTF-8?q?=E9=9A=94=E7=A6=BB=EF=BC=8C=E5=BA=93=E5=AD=98=E8=BD=AC=E7=A7=BB?= =?UTF-8?q?=EF=BC=8C=20=E6=8A=A5=E5=BA=9F=E5=87=BA=E5=BA=93=EF=BC=8C?= =?UTF-8?q?=E8=B0=83=E6=8B=A8=E5=87=BA=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 8 +- .env.hella13 | 3 + .env.hella14 | 3 + .env.hella15 | 3 + .env.hella16 | 3 + .env.hella8 | 5 +- .env.hella9 | 3 + .env.production | 3 + .../record/recordComDetailCard.vue | 9 +- .../inventoryMove/coms/comMoveRecord.vue | 11 +- .../inventoryMove/record/okToHoldRecord.vue | 50 ++----- src/pages/putaway/record/putawayRecord.vue | 19 +-- src/pages/scrap/record/scrapRecord.vue | 66 +++++++- src/pages/transfer/record/deliverRecord.vue | 80 +++++++++- src/pages/transfer/record/receiptRecord.vue | 55 ++++++- src/pages/unPlanned/record/issueRecord.vue | 141 ++++++++++++------ src/pages/unPlanned/record/receiptRecord.vue | 63 +++++++- 17 files changed, 397 insertions(+), 128 deletions(-) diff --git a/.env.development b/.env.development index 9bf7280a..faacbb33 100644 --- a/.env.development +++ b/.env.development @@ -1,11 +1,15 @@ -VITE_BASE_URL=http://172.22.32.9:81/api/admin-api +# VITE_BASE_URL=http://localhost:12080/admin-api +VITE_BASE_URL=http://dev.ccwin-in.com:28051/api/admin-api VITE_BASE_URL_IMAGE=http://172.22.32.9:81/admin-api # 租户配置 -VITE_TENANT='[{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' +VITE_TENANT='[{"text":"英泰","value":1},{"text":"长春2379","value":3}]' # 是否是测试环境 VITE_isDevelopment=true # 积木报表请求路径 VITE_JMREPORT_BASE_URL='http://172.22.32.9:90' + +# 项目管理模式 批次货/包装 +VITE_MANAGE_MODEL="BY_BATCH" \ No newline at end of file diff --git a/.env.hella13 b/.env.hella13 index 9a603299..97e83b15 100644 --- a/.env.hella13 +++ b/.env.hella13 @@ -9,3 +9,6 @@ VITE_isDevelopment=false # 积木报表请求路径 VITE_JMREPORT_BASE_URL='http://172.21.32.13:90' + +# 项目管理模式 批次货/包装 +VITE_MANAGE_MODEL="BY_BATCH" \ No newline at end of file diff --git a/.env.hella14 b/.env.hella14 index 91cea3ff..441178e5 100644 --- a/.env.hella14 +++ b/.env.hella14 @@ -9,3 +9,6 @@ VITE_isDevelopment=true # 积木报表请求路径 VITE_JMREPORT_BASE_URL='http://172.21.32.14:90' + +# 项目管理模式 批次货/包装 +VITE_MANAGE_MODEL="BY_BATCH" \ No newline at end of file diff --git a/.env.hella15 b/.env.hella15 index b40ff86e..f7c9ff07 100644 --- a/.env.hella15 +++ b/.env.hella15 @@ -9,3 +9,6 @@ VITE_isDevelopment=true # 积木报表请求路径 VITE_JMREPORT_BASE_URL='https://scp.faway-hella.com' + +# 项目管理模式 批次货/包装 +VITE_MANAGE_MODEL="BY_BATCH" \ No newline at end of file diff --git a/.env.hella16 b/.env.hella16 index 406618cf..c84efd8f 100644 --- a/.env.hella16 +++ b/.env.hella16 @@ -9,3 +9,6 @@ VITE_isDevelopment=true # 积木报表请求路径 VITE_JMREPORT_BASE_URL='https://scptest.faway-hella.com' + +# 项目管理模式 批次货/包装 +VITE_MANAGE_MODEL="BY_BATCH" \ No newline at end of file diff --git a/.env.hella8 b/.env.hella8 index f6803774..8851bd7c 100644 --- a/.env.hella8 +++ b/.env.hella8 @@ -9,4 +9,7 @@ VITE_isDevelopment=false # 积木报表请求路径 -VITE_JMREPORT_BASE_URL='http://172.22.32.8:90' +VITE_JMREPORT_BASE_URL='http://172.22.32.8:90' + +# 项目管理模式 批次货/包装 +VITE_MANAGE_MODEL="BY_BATCH" \ No newline at end of file diff --git a/.env.hella9 b/.env.hella9 index fc674a67..36f3d239 100644 --- a/.env.hella9 +++ b/.env.hella9 @@ -9,3 +9,6 @@ VITE_isDevelopment=true # 积木报表请求路径 VITE_JMREPORT_BASE_URL='http://172.22.32.9:90' + +# 项目管理模式 批次货/包装 +VITE_MANAGE_MODEL="BY_BATCH" \ No newline at end of file diff --git a/.env.production b/.env.production index f6803774..49336718 100644 --- a/.env.production +++ b/.env.production @@ -10,3 +10,6 @@ VITE_isDevelopment=false # 积木报表请求路径 VITE_JMREPORT_BASE_URL='http://172.22.32.8:90' + +# 项目管理模式 批次货/包装 +VITE_MANAGE_MODEL="BY_BATCH" \ No newline at end of file diff --git a/src/mycomponents/record/recordComDetailCard.vue b/src/mycomponents/record/recordComDetailCard.vue index d0144453..c712871e 100644 --- a/src/mycomponents/record/recordComDetailCard.vue +++ b/src/mycomponents/record/recordComDetailCard.vue @@ -32,7 +32,7 @@ - + @@ -121,7 +121,12 @@ allowModifyLocation: { type: Boolean, default: false - } + }, + queryBalance: { + type: Boolean, + default: true + }, + }, watch: { diff --git a/src/pages/inventoryMove/coms/comMoveRecord.vue b/src/pages/inventoryMove/coms/comMoveRecord.vue index 9fa42e5e..fb0f46e9 100644 --- a/src/pages/inventoryMove/coms/comMoveRecord.vue +++ b/src/pages/inventoryMove/coms/comMoveRecord.vue @@ -76,8 +76,11 @@ createItemInfo, createDetailInfo, calcHandleQty, - calcHandleQtyAdd } from '@/common/record.js'; + + import { + calc + } from '@/common/calc.js'; export default { components: { @@ -330,7 +333,6 @@ } newDetail.toLocationCode = this.toLocationCode; newDetail.fromLocationCode = result.fromLocationCode - newDetail.handleQty = 0 itemp.subList.push(newDetail); this.detailSource.push(itemp) } else { @@ -355,15 +357,14 @@ if (newDetail.packingNumber == '') { newDetail.packingNumber = pack.number; } - newDetail.handleQty = 0 newDetail.toLocationCode = this.toLocationCode; newDetail.fromLocationCode = result.fromLocationCode item.subList.push(newDetail); } else { - + detail.handleQty =calc.add(detail.handleQty, result.label.qty) } } - calcHandleQtyAdd(this.detailSource,result.label); + calcHandleQty(this.detailSource); }, showErrorMessage(message) { if (this.$refs.scanPopup) { diff --git a/src/pages/inventoryMove/record/okToHoldRecord.vue b/src/pages/inventoryMove/record/okToHoldRecord.vue index e3b0a138..e025da9a 100644 --- a/src/pages/inventoryMove/record/okToHoldRecord.vue +++ b/src/pages/inventoryMove/record/okToHoldRecord.vue @@ -1,60 +1,28 @@ \ No newline at end of file + diff --git a/src/pages/putaway/record/putawayRecord.vue b/src/pages/putaway/record/putawayRecord.vue index 1ea5eab1..9ca0a5ce 100644 --- a/src/pages/putaway/record/putawayRecord.vue +++ b/src/pages/putaway/record/putawayRecord.vue @@ -91,7 +91,6 @@ createItemInfo, createDetailInfo, calcHandleQty, - calcHandleQtyAdd } from '@/common/record.js'; import { @@ -99,6 +98,10 @@ getPrecisionStrategyList, getPrecisionStrategyParams } from '@/common/balance.js'; + + import { + calc + } from '@/common/calc' import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' @@ -170,7 +173,7 @@ mounted() {}, methods: { - getScanResult(result,managementType) { + getScanResult(result,managementTypeParams) { this.managementType = managementTypeParams if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ this.setDataBatch(result) @@ -206,11 +209,8 @@ newDetail.poNumber=poNumber; newDetail.supplierCode=supplierCode; newDetail.fromInventoryStatus = balance.inventoryStatus; - newDetail.handleQty =0; - newDetail.balanceQty =result.balance.qty; itemp.subList.push(newDetail); this.detailSource.push(itemp) - calcHandleQtyAdd(this.detailSource,result.label); }) } else { @@ -231,24 +231,19 @@ newDetail.poNumber=poNumber; newDetail.supplierCode=supplierCode; newDetail.fromInventoryStatus = balance.inventoryStatus; - newDetail.handleQty =0; - newDetail.balanceQty =result.balance.qty; if(item.subList&&item.subList.length>0){ if(item.subList[0].batch!=newDetail.batch){ this.showErrorMessage("扫描的批次是["+newDetail.batch+"],请扫描["+item.subList[0].batch+"的批次的箱码") } }else { item.subList.push(newDetail); - calcHandleQtyAdd(this.detailSource,result.label); } }); } else { - if (detail.scaned == true) { - calcHandleQtyAdd(this.detailSource,result.label); - // this.showErrorMessage( "批次[" + balance.batch + "]重复扫描") - } + detail.handleQty =calc.add(detail.handleQty, result.label.handleQty) } } + this.calcHandleQty(this.detailSource) }, setData(result){ diff --git a/src/pages/scrap/record/scrapRecord.vue b/src/pages/scrap/record/scrapRecord.vue index a5b8f7c9..1c1eba10 100644 --- a/src/pages/scrap/record/scrapRecord.vue +++ b/src/pages/scrap/record/scrapRecord.vue @@ -17,7 +17,13 @@ - + + @@ -59,6 +65,10 @@ deepCopyData } from '@/common/basic.js'; + import { + calc + } from '@/common/calc' + import { getInventoryStatusDesc, getDirectoryItemArray, @@ -69,7 +79,8 @@ getBusinessType, createItemInfo, createDetailInfo, - calcHandleQty + calcHandleQty, + calcHandleQtyAdd } from '@/common/record.js'; import winScanButton from '@/mycomponents/scan/winScanButton.vue' @@ -78,6 +89,7 @@ import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' + import recordComDetailCardBatch from '@/mycomponents/record/recordComDetailCardBatch.vue' export default { components: { @@ -86,7 +98,8 @@ comBlankView, winScanLocation, winScanPackAndLocation, - recordComDetailCard + recordComDetailCard, + recordComDetailCardBatch }, data() { return { @@ -102,6 +115,7 @@ businessType: {}, reasonList: [], reasonText: "", + managementType:"" }; }, onLoad(option) { @@ -137,7 +151,50 @@ }, 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) + } + }, + + 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); // + 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(this.detailSource) + }, + + setData(result){ let balance = result.balance; let label = result.label; let pack = result.package; @@ -170,7 +227,6 @@ } } this.calcHandleQty(); - }, showErrorMessage(message) { diff --git a/src/pages/transfer/record/deliverRecord.vue b/src/pages/transfer/record/deliverRecord.vue index 6fe03d5a..f2374fe7 100644 --- a/src/pages/transfer/record/deliverRecord.vue +++ b/src/pages/transfer/record/deliverRecord.vue @@ -8,7 +8,17 @@ - + + + @@ -32,7 +42,7 @@ - + @@ -63,8 +73,11 @@ getBusinessType, createItemInfo, createDetailInfo, - calcHandleQty + calcHandleQty, } from '@/common/record.js'; + import { + calc + } from '@/common/calc' import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' @@ -73,7 +86,8 @@ import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" 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, @@ -82,7 +96,8 @@ comBlankView, winScanLocation, winScanPackAndLocation, - recordComDetailCard + recordComDetailCard, + recordComDetailCardBatch }, data() { return { @@ -98,7 +113,8 @@ businessType: {}, managementList: [], dataContent: {}, - toWarehouseCode: '' + toWarehouseCode: '', + managementType:"" }; }, @@ -131,7 +147,17 @@ onPullDownRefresh() {}, 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; @@ -166,6 +192,46 @@ } 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.inventoryStatus = "OK" + 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(this.detailSource) + }, + + showScanToLocation(item) { + this.editItem = item; + setTimeout(r => { + this.$refs.scanToLocationCode.openScanPopup(); + }) + }, + showErrorMessage(message) { this.$refs.comMessage.showErrorMessage(message, res => { diff --git a/src/pages/transfer/record/receiptRecord.vue b/src/pages/transfer/record/receiptRecord.vue index 61b9ee37..7f33326b 100644 --- a/src/pages/transfer/record/receiptRecord.vue +++ b/src/pages/transfer/record/receiptRecord.vue @@ -10,6 +10,9 @@ @@ -63,6 +66,10 @@ createDetailInfo, calcHandleQty } from '@/common/record.js'; + + import { + calc + } from '@/common/calc' import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' @@ -90,7 +97,8 @@ businessType: {}, managementList: [], dataContent: {}, - toWarehouseCode: '' + toWarehouseCode: '', + managementType:import.meta.env.VITE_MANAGE_MODEL }; }, @@ -124,6 +132,17 @@ methods: { getScanResult(result) { + var managementTypeParams =this.managementType + if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { + this.setDataBatch(result) + } else { + this.setData(result) + } + + + }, + + setData(result){ let label = result.label; let pack = result.package; var item = this.detailSource.find(res => { @@ -155,6 +174,37 @@ } 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 => { @@ -339,9 +389,6 @@ }); }, - showScanMessage(message) { - this.$refs.comMessage.showScanMessage(message); - }, afterCloseMessage() { this.scanPopupGetFocus(); diff --git a/src/pages/unPlanned/record/issueRecord.vue b/src/pages/unPlanned/record/issueRecord.vue index 42ea5f8e..27f0d6a9 100644 --- a/src/pages/unPlanned/record/issueRecord.vue +++ b/src/pages/unPlanned/record/issueRecord.vue @@ -7,11 +7,17 @@ + placeholder="请选择出库原因" popup-title="出库原因" :localdata="reasonList" @change="reasonChange"> - + + @@ -48,6 +54,7 @@ import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' + import recordComDetailCardBatch from '@/mycomponents/record/recordComDetailCardBatch.vue' import { unPlannedIssueRecordSubmit } from '@/api/request2.js'; @@ -64,8 +71,12 @@ import { createItemInfo, createDetailInfo, - calcHandleQty + calcHandleQty, } from '@/common/record.js'; + + import { + calc + } from '@/common/calc.js'; import { goHome, @@ -79,7 +90,8 @@ comBlankView, winScanLocation, winScanPackAndLocation, - recordComDetailCard + recordComDetailCard, + recordComDetailCardBatch }, props: {}, data() { @@ -91,9 +103,11 @@ businessType: {}, //业务类型 detailSource: [], //绑定在页面上的数据源 reasonText: "", - reasonCode:"", + reasonCode: "", reasonList: [], - dataContent:{} + dataContent: {}, + managementType:"" + } }, @@ -111,8 +125,7 @@ }); }, - onLoad(option) { - }, + onLoad(option) {}, methods: { openScanPopup() { @@ -135,11 +148,55 @@ this.fromLocationCode = location.code; this.openScanPopup(); }, - getScanResult(result) { - this.getDataSource(result) + getScanResult(result,managementTypeParams) { + this.managementType = managementTypeParams + console.log(managementTypeParams) + if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { + this.setDataBatch(result) + } else { + this.setData(result) + } }, - getDataSource(result) { + setDataBatch(result) { + let balance = result.balance; + 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(balance, pack); + let newDetail = createDetailInfo(balance, pack); // + // newDetail.inventoryStatus ="OK"; + itemp.subList.push(newDetail); + this.detailSource.push(itemp) + this.packGetFocus() + } else { + var detail = item.subList.find(r => { + if (r.batch == balance.batch && + r.locationCode == balance.locationCode && + r.inventoryStatus == balance.inventoryStatus && + r.scaned == true) { + return r; + } + }) + + if (detail == undefined) { + let newDetail = createDetailInfo(balance, pack); + item.subList.push(newDetail); + this.packGetFocus() + }else { + detail.handleQty =calc.add(detail.handleQty, result.label.qty) + } + } + this.calcHandleQty(this.detailSource) + + }, + + setData(result) { let balance = result.balance; let label = result.label; let pack = result.package; @@ -177,9 +234,9 @@ this.calcHandleQty(); }, - - packGetFocus(){ - if(this.$refs.scanPopup){ + + packGetFocus() { + if (this.$refs.scanPopup) { this.$refs.scanPopup.packGetFocus() } }, @@ -216,20 +273,20 @@ this.showErrorMessage("请选择出库原因") return; } - var params =this.setParams() - console.log("提交" + JSON.stringify(params)) - unPlannedIssueRecordSubmit(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 params = this.setParams() + console.log("提交" + JSON.stringify(params)) + unPlannedIssueRecordSubmit(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) + }) + }, setParams() { var subList = [] @@ -242,24 +299,24 @@ submitItem.itemName = detail.package.itemName; submitItem.itemDesc1 = detail.package.itemDesc1; submitItem.itemDesc2 = detail.package.itemDesc2; - + submitItem.inventoryStatus = detail.inventoryStatus; - + submitItem.fromPackingNumber = detail.packingNumber; submitItem.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.reasonCode; submitItem.qty = detail.handleQty; - submitItem.package =""; + submitItem.package = ""; submitItem.detailDataType = 1; subList.push(submitItem) } @@ -270,7 +327,7 @@ this.dataContent.creator = creator; return this.dataContent; }, - + reasonChange(e) { if (e.detail.value.length == 0) { this.reasonCode = "" @@ -282,20 +339,20 @@ }, showCommitSuccessMessage(hint) { this.$refs.comMessage.showSuccessMessage(hint, res => { - this.clearData(); + this.clearData(); }) }, - clearData(){ + clearData() { this.reasonCode = "" this.reasonText = ""; this.detailSource = []; - this.managementList =[]; - this.dataContent ={} + this.managementList = []; + this.dataContent = {} } - + } } + \ No newline at end of file diff --git a/src/pages/unPlanned/record/receiptRecord.vue b/src/pages/unPlanned/record/receiptRecord.vue index 8529bcd0..efeaf748 100644 --- a/src/pages/unPlanned/record/receiptRecord.vue +++ b/src/pages/unPlanned/record/receiptRecord.vue @@ -14,8 +14,11 @@ - + @@ -105,7 +108,8 @@ reasonList: [], dataContent: {}, managementList: [], - toLocationAreaTypeList:[] + toLocationAreaTypeList:[], + managementType:import.meta.env.VITE_MANAGE_MODEL } }, @@ -122,7 +126,8 @@ }); }, - onLoad(option) {}, + onLoad(option) { + }, methods: { openScanPopup() { @@ -132,6 +137,16 @@ this.toLocationCode = code; }, getScanResult(result) { + var managementTypeParams =this.managementType + if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { + this.setDataBatch(result) + } else { + this.setData(result) + } + + }, + + setData(result){ let label = result.label; let pack = result.package; var item = this.detailSource.find(res => { @@ -153,7 +168,7 @@ return r; } }) - + if (detail == undefined) { let newDetail = this.createDetailInfo(label, pack); item.subList.push(newDetail); @@ -162,11 +177,45 @@ if (detail.scaned) { this.showErrorMessage("箱码[" + pack.number + "]批次[" + pack.batch + "]已经扫描") } - + + } + } + 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(){