From 19ad1242fa77bd62d49b652a848abdc38f8756da Mon Sep 17 00:00:00 2001 From: niexiting <85552560@qq.com> Date: Mon, 29 Jul 2024 15:07:45 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=94=B6=E8=B4=A7?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=A2=9E=E5=8A=A0=E7=A7=BB=E9=99=A4=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mycomponents/package/packageList.vue | 44 +++++++++++-- .../coms/comReceiptDetailCard.vue | 66 ++++++++++++++----- 2 files changed, 87 insertions(+), 23 deletions(-) diff --git a/src/mycomponents/package/packageList.vue b/src/mycomponents/package/packageList.vue index 30cad4ee..fa822d9e 100644 --- a/src/mycomponents/package/packageList.vue +++ b/src/mycomponents/package/packageList.vue @@ -4,14 +4,23 @@ - + @@ -104,13 +113,36 @@ }, methods: { - swipeClick(e, item) { + swipeClick(e, item, type) { if (e.content.text == "编辑") { this.edit(item) } else if (e.content.text == "移除") { - this.remove(item) + if (type == 'parent') { + this.removeParent(item); + } else { + this.remove(item) + } } }, + removeParent(item) { + this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?", + res => { + if (res) { + item.scaned = false + item.handleQty = null; + item.packList.forEach(subItem => { + subItem.scaned = false + subItem.handleQty = null; + }) + + this.$emit('updateData') + this.$forceUpdate() + } + }); + }, + + + remove(item) { this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?", res => { diff --git a/src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue b/src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue index 7906aa22..6f69f982 100644 --- a/src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue +++ b/src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue @@ -3,10 +3,17 @@ - + @@ -32,11 +39,12 @@ import { getDetailOption, - getPurchaseReceiptOption + getPurchaseReceiptOption, + getRemoveOption } from '@/common/array.js'; export default { - + components: { itemCompareQty, recommend, @@ -77,7 +85,9 @@ }, locatonItem: {}, detailOptions: [], - scanOptions: [] + scanOptions: [], + options: [], + removeOptions: [], } }, @@ -89,21 +99,23 @@ this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam .allowModifyLocation) } - + if (this.removeOptions.length == 0) { + this.removeOptions = getRemoveOption(); + } }, updated() { console.log('updated') }, - methods: { - collapseChange(){ + methods: { + collapseChange() { setTimeout(() => { this.resizeCollapse(); }, 500) }, - + resizeCollapse() { this.$nextTick(r => { this.$refs.collapse.resize() @@ -132,7 +144,7 @@ } else if (e.content.text == "库位") { this.showLocation(item) } else if (e.content.text == "移除") { - this.remove(item) + this.removeScan(item) } }, edit(item) { @@ -153,22 +165,42 @@ this.showItem = item; this.$refs.jobDetailPopup.openPopup(item) }, - remove(item) { - this.$refs.message.showQuestionMessage("确定移除扫描信息?", + + removeScan(item) { + this.$refs.message.showQuestionMessage("确定移除物料的所有扫描信息?", res => { if (res) { - item.scaned = false item.handleQty = null - this.$forceUpdate() - this.$emit('remove', item) + item.subList.forEach(lst => { + lst.scaned = false; + lst.handleQty = null; + lst.packList.forEach(pack => { + pack.scaned = false; + pack.handleQty = null; + }) + }) + // this.$forceUpdate() + // this.$emit('remove', item) } }); }, + + // remove(item) { + // this.$refs.message.showQuestionMessage("确定移除扫描信息?", + // res => { + // if (res) { + // item.scaned = false + // item.handleQty = null + // this.$forceUpdate() + // this.$emit('remove', item) + // } + // }); + // }, confirm(qty) { this.editItem.handleQty = qty; this.$emit('updateData') }, - updateData(){ + updateData() { this.$emit('updateData') } } From a1c0a8f9deabb7910091b87adbe2f6f788ca504e Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Mon, 29 Jul 2024 15:13:04 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/issue/record/issueRecord.vue | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/pages/issue/record/issueRecord.vue b/src/pages/issue/record/issueRecord.vue index f59e58a0..4d85fe74 100644 --- a/src/pages/issue/record/issueRecord.vue +++ b/src/pages/issue/record/issueRecord.vue @@ -115,7 +115,7 @@ import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue' import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' - + import balance from '@/mycomponents/balance/balance.vue' export default { components: { winScanButton, @@ -124,7 +124,8 @@ comBlankView, recordComDetailCard, recordDetailCard, - winComScanBalance + winComScanBalance, + balance }, data() { return { @@ -137,7 +138,7 @@ toLocationAreaTypeList: [], inInventoryStatus: "", //目标入库库存状态 outInventoryStatus: "", //来源出库库存状态 - businessType: {}, + businessType: null, showToLoaction: true, recommendLocationList: [], //推荐库位列表 fromWarehouseCode: '', //来源仓库 @@ -513,14 +514,6 @@ closeScanMessage() { this.scanPopupGetFocus(); }, - 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 => { From 2948094bbe6209d629ab1ab1ec6dddb5c341f5f3 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Mon, 29 Jul 2024 16:22:25 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.hella13 | 2 +- .env.hella14 | 2 +- .env.hella8 | 2 +- .env.hella9 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.env.hella13 b/.env.hella13 index 996ada60..9a603299 100644 --- a/.env.hella13 +++ b/.env.hella13 @@ -5,7 +5,7 @@ VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api VITE_TENANT='[{"text":"长春1379","value":1}]' # 是否是测试环境 -VITE_isDevelopment=true +VITE_isDevelopment=false # 积木报表请求路径 VITE_JMREPORT_BASE_URL='http://172.21.32.13:90' diff --git a/.env.hella14 b/.env.hella14 index d98ea7b5..91cea3ff 100644 --- a/.env.hella14 +++ b/.env.hella14 @@ -5,7 +5,7 @@ VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api VITE_TENANT='[{"text":"长春1379","value":1}]' # 是否是测试环境 -VITE_isDevelopment=false +VITE_isDevelopment=true # 积木报表请求路径 VITE_JMREPORT_BASE_URL='http://172.21.32.14:90' diff --git a/.env.hella8 b/.env.hella8 index b7e0f7c8..f6803774 100644 --- a/.env.hella8 +++ b/.env.hella8 @@ -5,7 +5,7 @@ VITE_BASE_URL_IMAGE=http://172.22.32.8:81/admin-api VITE_TENANT='[{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' # 是否是测试环境 -VITE_isDevelopment=true +VITE_isDevelopment=false # 积木报表请求路径 diff --git a/.env.hella9 b/.env.hella9 index 1f71bb53..fc674a67 100644 --- a/.env.hella9 +++ b/.env.hella9 @@ -5,7 +5,7 @@ VITE_BASE_URL_IMAGE=http://172.22.32.9:81/admin-api VITE_TENANT='[{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' # 是否是测试环境 -VITE_isDevelopment=false +VITE_isDevelopment=true # 积木报表请求路径 VITE_JMREPORT_BASE_URL='http://172.22.32.9:90' From c22abb2f8d021b95a43f6980941154ccc9edd8fa Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Tue, 30 Jul 2024 11:05:30 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A0=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E6=8A=A5=E5=B7=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/fg/coms/comNoReceiptPopup.vue | 483 +++++++++++++++++++++ src/pages/fg/receiptNoPlan.vue | 533 +++++++++++++++++++++++- 2 files changed, 1002 insertions(+), 14 deletions(-) create mode 100644 src/pages/fg/coms/comNoReceiptPopup.vue diff --git a/src/pages/fg/coms/comNoReceiptPopup.vue b/src/pages/fg/coms/comNoReceiptPopup.vue new file mode 100644 index 00000000..81811ad3 --- /dev/null +++ b/src/pages/fg/coms/comNoReceiptPopup.vue @@ -0,0 +1,483 @@ + + + + + \ No newline at end of file diff --git a/src/pages/fg/receiptNoPlan.vue b/src/pages/fg/receiptNoPlan.vue index a1d60e90..21f978b4 100644 --- a/src/pages/fg/receiptNoPlan.vue +++ b/src/pages/fg/receiptNoPlan.vue @@ -1,37 +1,542 @@ - \ No newline at end of file From d3d7a4db9b68ad4e2c74c4687ce3f2d3966211f0 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Tue, 30 Jul 2024 11:29:17 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=AE=8C=E5=B7=A5=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/fg/coms/comNoReceiptPopup.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/fg/coms/comNoReceiptPopup.vue b/src/pages/fg/coms/comNoReceiptPopup.vue index 81811ad3..af3997f1 100644 --- a/src/pages/fg/coms/comNoReceiptPopup.vue +++ b/src/pages/fg/coms/comNoReceiptPopup.vue @@ -56,7 +56,7 @@ + > From f8cbd6cfad771b944f7693d611e8f2c3bb2babd5 Mon Sep 17 00:00:00 2001 From: niexiting <85552560@qq.com> Date: Tue, 30 Jul 2024 11:34:41 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E5=90=8E=E6=B8=85=E9=99=A4=E6=8E=A8=E8=8D=90=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/issue/record/issueRecord.vue | 1 + src/pages/repleinsh/record/repleinshRecord.vue | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/issue/record/issueRecord.vue b/src/pages/issue/record/issueRecord.vue index 4d85fe74..9236e084 100644 --- a/src/pages/issue/record/issueRecord.vue +++ b/src/pages/issue/record/issueRecord.vue @@ -518,6 +518,7 @@ showCommitSuccessMessage(hint) { this.$refs.comMessage.showSuccessMessage(hint, res => { this.clearData(); + this.openScanPopup(); }) }, diff --git a/src/pages/repleinsh/record/repleinshRecord.vue b/src/pages/repleinsh/record/repleinshRecord.vue index 1b850b09..7cd3b6c2 100644 --- a/src/pages/repleinsh/record/repleinshRecord.vue +++ b/src/pages/repleinsh/record/repleinshRecord.vue @@ -9,7 +9,7 @@ @@ -542,6 +542,7 @@ showCommitSuccessMessage(hint) { this.$refs.comMessage.showSuccessMessage(hint, res => { this.clear(); + this.openScanPopup(); }) }, @@ -552,6 +553,7 @@ this.detailSource = []; this.toLocationCode = ""; this.itemCode = "" + this.recommendList = []; } } } From bb35c271451b1a74983ce87a20175ced1e8b0b11 Mon Sep 17 00:00:00 2001 From: niexiting <85552560@qq.com> Date: Tue, 30 Jul 2024 13:16:28 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E5=90=8E=E7=9A=84=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchaseReceipt/job/receiptDetail.vue | 57 ++++++++++++------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/src/pages/purchaseReceipt/job/receiptDetail.vue b/src/pages/purchaseReceipt/job/receiptDetail.vue index 85b1ce64..8972ea93 100644 --- a/src/pages/purchaseReceipt/job/receiptDetail.vue +++ b/src/pages/purchaseReceipt/job/receiptDetail.vue @@ -14,9 +14,9 @@ @change="switchChange"> - + - + @@ -44,8 +44,7 @@ + @getLocation='scanLocationCode' :locationAreaTypeList="toLocationAreaTypeList"> @@ -143,8 +142,8 @@ operation: '', scanMessage: '', status: '', - switchCode:"", - isCheckLocation: 'purchaseReceiptLocationCodeValidate',//校验收货库位 + switchCode: "", + isCheckLocation: 'purchaseReceiptLocationCodeValidate', //校验收货库位 reasonText: "", }; }, @@ -155,7 +154,7 @@ this.scanMessage = option.scanMessage; this.operation = option.operation; this.status = option.status; - this.switchCode = "purchasereceiptPrintPDA"//pda打印 + this.switchCode = "purchasereceiptPrintPDA" //pda打印 }, @@ -249,10 +248,10 @@ } that.isAllReceived = false; //如果箱码扫描自动扫描,ASN不自动扫描 - if(this.scanMessage){ + if (this.scanMessage) { this.$refs.scanPopup.simulateScan(this.scanMessage); } - + } else { that.showMessage('列表数据为0'); } @@ -265,7 +264,6 @@ getScanResult(result) { - try { var itemCode = result.label.itemCode; var detail = this.detailSource.find(r => r.itemCode == itemCode); @@ -284,10 +282,11 @@ } else { itemDetail.forEach(item => { item.scaned = true; + itemDetail.scaneDate = new Date(); item.handleQty = item.qty; item.toLocationCode = this.toLocationCode; }) - this.detailSource[0].subList.sort(compareAsc('scaned')); //按扫描信息排序 + this.detailSource[0].subList.sort(compareAsc('scaneDate')); //按扫描信息排序 calcHandleQty(this.detailSource); this.continueScan() this.$forceUpdate() @@ -306,9 +305,13 @@ batch); if (itemDetail == undefined) { var isExit; - for (let subItem of detail.subList) { + let subItem; + let index = -1; + for (subItem of detail.subList) { var item; - for (let pack of subItem.packList) { + for (var i = 0; i < subItem.packList.length; i++) { + let pack = subItem.packList[i]; + index = i; if (pack.packingNumber == packingNumber && pack.batch == batch) { item = pack; @@ -316,18 +319,26 @@ break; } } - if (item != undefined) { - subItem.scaned = true - subItem.handleQty = 0; - item = undefined - } + // for (let pack of subItem.packList) { + // if (pack.packingNumber == packingNumber && + // pack.batch == batch) { + // item = pack; + // isExit = pack; + // break; + // } + // } + // if (item != undefined) { + // subItem.scaned = true + // subItem.handleQty = 0; + // item = undefined + // } } if (isExit == undefined) { this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中") } else { - if ( isExit.scaned) { - this.showMessage("箱码【" + packingNumber + "】已经扫描") + if (isExit.scaned) { + this.showMessage("箱码【" + packingNumber + "】已经扫描"); } else { isExit.scaned = true isExit.handleQty = Number(result.label.qty); @@ -349,12 +360,14 @@ this.showMessage("箱码【" + packingNumber + "】已经扫描") } else { itemDetail.scaned = true; - this.detailSource[0].subList.sort(compareAsc('scaned')); //按扫描信息排序 + itemDetail.scaneDate = new Date(); + this.detailSource[0].subList.sort(compareAsc('scaneDate')); //按扫描信息排序 itemDetail.handleQty = Number(result.label.qty); itemDetail.toLocationCode = this.toLocationCode; itemDetail.labelQty = Number(result.label.qty); itemDetail.packList.forEach(pac => { pac.scaned = true + itemDetail.scaneDate = new Date(); pac.handleQty = Number(pac.qty); pac.toLocationCode = this.toLocationCode; }) @@ -445,7 +458,7 @@ }, reject() { - if(!this.reasonText){ + if (!this.reasonText) { this.showMessage("请输入拒收原因") return; } From d3d6259971b1b00586577557cee201037dc8f6bf Mon Sep 17 00:00:00 2001 From: niexiting <85552560@qq.com> Date: Tue, 30 Jul 2024 14:58:19 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=89=AB=E6=8F=8F=E5=90=8E=E5=B0=86?= =?UTF-8?q?=E6=89=AB=E6=8F=8F=E4=BF=A1=E6=81=AF=E7=BD=AE=E9=A1=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 12 +-- src/common/detail.js | 54 ++++++------- src/manifest.json | 4 +- .../purchaseReceipt/job/receiptDetail.vue | 77 ++++++++----------- 4 files changed, 67 insertions(+), 80 deletions(-) diff --git a/.env.development b/.env.development index a4608106..a216fad1 100644 --- a/.env.development +++ b/.env.development @@ -1,11 +1,11 @@ -#VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api -#VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/api/admin-api - -VITE_BASE_URL=http://172.21.32.14:81/api/admin-api VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api - # 租户配置 VITE_TENANT='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' +VITE_BASE_URL=http://172.21.32.14:81/api/admin-api +VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api + +# 租户配置 +VITE_TENANT='[{"text":"长春1379","value":1}]' # 是否是测试环境 VITE_isDevelopment=true # 积木报表请求路径 -VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25310' +VITE_JMREPORT_BASE_URL='http://172.21.32.14:90' diff --git a/src/common/detail.js b/src/common/detail.js index f9d6fe8a..b6ed44a3 100644 --- a/src/common/detail.js +++ b/src/common/detail.js @@ -34,8 +34,9 @@ export function getTreeDataSource(dataList) { items.forEach(r => r.subList.forEach(s => { s.packList = childList.filter(c => c.parentPackingNumber == s.packingNumber) - s.packList.forEach(pac=>{ - pac.scaned=false; + s.packList.forEach(pac => { + pac.scaned = false; + pac.scanDate = new Date(); }) }) ) @@ -45,23 +46,23 @@ export function getTreeDataSource(dataList) { } export function getDataSource(subList) { - let items = []; - subList.forEach(detail => { - var item = items.find(r => - r.itemCode == detail.itemCode) - if (item == undefined) { - item = createItemInfo(detail); - let newDetail = createDetailInfo(detail); // - item.subList.push(newDetail); - items.push(item) - } else { - item.qty = calc.add(item.qty, detail.qty) - let newDetail = createDetailInfo(detail); // - item.subList.push(newDetail); - } - }) - return items; - } + let items = []; + subList.forEach(detail => { + var item = items.find(r => + r.itemCode == detail.itemCode) + if (item == undefined) { + item = createItemInfo(detail); + let newDetail = createDetailInfo(detail); // + item.subList.push(newDetail); + items.push(item) + } else { + item.qty = calc.add(item.qty, detail.qty) + let newDetail = createDetailInfo(detail); // + item.subList.push(newDetail); + } + }) + return items; +} export function createItemInfo(detail) { let item = { @@ -79,6 +80,7 @@ export function createItemInfo(detail) { export function createDetailInfo(data) { data.scaned = false; + data.scanDate = new Date(); let detail = data; detail.packList = []; return detail; @@ -104,8 +106,8 @@ export function calcHandleQty(detailSource) { item.handleQty = new Decimal(0).toNumber(); item.qty = new Decimal(0).toNumber(); for (let detail of item.subList) { - if (detail != undefined ) { - if(detail.scaned){ + if (detail != undefined) { + if (detail.scaned) { item.handleQty = calc.add(item.handleQty, detail.handleQty); } item.qty = calc.add(item.qty, detail.qty); @@ -117,14 +119,14 @@ export function calcHandleQty(detailSource) { export function calcTreeHandleQty(detailSource) { for (let item of detailSource) { item.handleQty = new Decimal(0).toNumber(); - + for (let detail of item.subList) { if (detail != undefined && detail.scaned) { - if(detail.packList.length>0){ + if (detail.packList.length > 0) { detail.handleQty = new Decimal(0).toNumber(); - for (let pack of detail.packList){ - if(pack!=undefined&&pack.scaned){ - detail.handleQty = calc.add(detail.handleQty, pack.handleQty); + for (let pack of detail.packList) { + if (pack != undefined && pack.scaned) { + detail.handleQty = calc.add(detail.handleQty, pack.handleQty); } } } diff --git a/src/manifest.json b/src/manifest.json index 56fe8079..eb25cc47 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,8 +2,8 @@ "name" : "wms", "appid" : "__UNI__C9CF4BF", "description" : "", - "versionName" : "1.0.28", - "versionCode" : 28, + "versionName" : "1.0.37", + "versionCode" : 37, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { diff --git a/src/pages/purchaseReceipt/job/receiptDetail.vue b/src/pages/purchaseReceipt/job/receiptDetail.vue index 8972ea93..b662dc70 100644 --- a/src/pages/purchaseReceipt/job/receiptDetail.vue +++ b/src/pages/purchaseReceipt/job/receiptDetail.vue @@ -78,7 +78,7 @@ goHome, getCurrDateTime, getPackingNumberAndBatch, - compareAsc, + compareDesc, navigateBack, getSwitchInfoByCode } from '@/common/basic.js'; @@ -282,18 +282,19 @@ } else { itemDetail.forEach(item => { item.scaned = true; - itemDetail.scaneDate = new Date(); + itemDetail.scanDate = new Date(); item.handleQty = item.qty; item.toLocationCode = this.toLocationCode; }) - this.detailSource[0].subList.sort(compareAsc('scaneDate')); //按扫描信息排序 calcHandleQty(this.detailSource); + this.detailSource[0].subList.sort(compareDesc('scanDate')); //按扫描信息排序 this.continueScan() this.$forceUpdate() } } } else if (result.label.labelType == "PurchaseLabel") { - var packingNumber = result.label.packingNumber; + var packingNumber = result.package.number; + var parentpackingNumber = result.package.parentNumber; var batch = result.label.batch; var qty = result.label.qty; var detail = this.detailSource.find(r => r.itemCode == itemCode); @@ -304,51 +305,35 @@ var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch == batch); if (itemDetail == undefined) { - var isExit; - let subItem; - let index = -1; - for (subItem of detail.subList) { - var item; - for (var i = 0; i < subItem.packList.length; i++) { - let pack = subItem.packList[i]; - index = i; - if (pack.packingNumber == packingNumber && - pack.batch == batch) { - item = pack; - isExit = pack; - break; - } - } - // for (let pack of subItem.packList) { - // if (pack.packingNumber == packingNumber && - // pack.batch == batch) { - // item = pack; - // isExit = pack; - // break; - // } - // } - // if (item != undefined) { - // subItem.scaned = true - // subItem.handleQty = 0; - // item = undefined - // } - } + itemDetail = detail.subList.find(r => r.packingNumber == parentpackingNumber && r.batch == + batch); - if (isExit == undefined) { + if (itemDetail == undefined) { this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中") } else { - if (isExit.scaned) { - this.showMessage("箱码【" + packingNumber + "】已经扫描"); + var pack = itemDetail.packList.find(p => p.packingNumber == packingNumber && + p.batch == batch) + if (pack == undefined) { + this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中") } else { - isExit.scaned = true - isExit.handleQty = Number(result.label.qty); - isExit.toLocationCode = this.toLocationCode; - isExit.labelQty = Number(result.label.qty); + if (pack.scaned) { + pack.scanDate = new Date(); + this.showMessage("箱码【" + packingNumber + "】已经扫描"); + } else { + pack.scaned = true + pack.scanDate = new Date(); + pack.handleQty = Number(result.label.qty); + pack.toLocationCode = this.toLocationCode; + pack.labelQty = Number(result.label.qty); + } } + calcTreeHandleQty(this.detailSource); + itemDetail.packList.sort(compareDesc('scanDate')); //按扫描信息排序 + this.$forceUpdate() } - calcTreeHandleQty(this.detailSource); - this.$forceUpdate() + } else { + //扫描的是外包装,将包装集合全部扫描 var scanedLength = 0; itemDetail.packList.forEach(res => { if (res.scaned) { @@ -357,23 +342,23 @@ }) if (itemDetail.scaned && scanedLength == itemDetail .packList.length) { + isExit.scanDate = new Date(); this.showMessage("箱码【" + packingNumber + "】已经扫描") } else { itemDetail.scaned = true; - itemDetail.scaneDate = new Date(); - this.detailSource[0].subList.sort(compareAsc('scaneDate')); //按扫描信息排序 + itemDetail.scanDate = new Date(); itemDetail.handleQty = Number(result.label.qty); itemDetail.toLocationCode = this.toLocationCode; itemDetail.labelQty = Number(result.label.qty); itemDetail.packList.forEach(pac => { pac.scaned = true - itemDetail.scaneDate = new Date(); + pac.scanDate = new Date(); pac.handleQty = Number(pac.qty); pac.toLocationCode = this.toLocationCode; }) calcTreeHandleQty(this.detailSource); - var test = this.detailSource + this.detailSource[0].subList.sort(compareDesc('scanDate')); //按扫描信息排序 this.continueScan() this.$forceUpdate() }