From a398fdbf89abe025da0649fb7c5685762733e52a Mon Sep 17 00:00:00 2001 From: "juncheng.li" Date: Wed, 26 Jul 2023 11:40:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=98=E7=82=B9=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=95=B0=E9=87=8F=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fe/PDA/common/pdabasic.css | 2 +- fe/PDA/pages/task/count_detail.vue | 68 ++++++++++++++++++++---------- 2 files changed, 46 insertions(+), 24 deletions(-) diff --git a/fe/PDA/common/pdabasic.css b/fe/PDA/common/pdabasic.css index 1f6f6861c..7aa21b6f7 100644 --- a/fe/PDA/common/pdabasic.css +++ b/fe/PDA/common/pdabasic.css @@ -167,7 +167,7 @@ .scroll-detail { overflow: hidden; padding-bottom: 60px; - height: 480px; + height: 100%; /* 没有高度不可以回到顶部 */ /* background-color: #ffffff; */ } diff --git a/fe/PDA/pages/task/count_detail.vue b/fe/PDA/pages/task/count_detail.vue index f3b1822b4..446b251a5 100644 --- a/fe/PDA/pages/task/count_detail.vue +++ b/fe/PDA/pages/task/count_detail.vue @@ -9,7 +9,7 @@ :newCount="newCount" :location="location"> - + @@ -212,7 +212,7 @@ statusArray: [], allStatusArray: [], ipage: 1, - iSize: 50, + iSize: 20, // array: [{ // text: '待检', // value: 1 @@ -328,7 +328,6 @@ getCountJobDetail(params) .then(async res => { that.datacontent = res; - if (res.details != null) { res.details.forEach(r => { r.scaned = false @@ -433,28 +432,49 @@ this.calcScanCount(); }, - addNewDetail(result) { + async addNewDetail(result) { if (this.location == null) { this.showMessage('未查找到库位信息,不可以添加为任务明细'); return; } - showConfirmMsg('扫描的库存在任务中不存在,是否要添加为任务明细?', async confirm => { - if (confirm) { - let balanceItem = await this.getBalanceAsync(result); - let detail = this.creatDetail(result); - if (balanceItem != null) { - this.setDetailByBalance(detail, balanceItem); - } else { - this.setDetailNoBalance(detail, result) - } - this.details.unshift(detail); - this.calcAllCount(); - this.calcScanCount(); - this.$forceUpdate(); - } else { - this.scanPopupGetfocus(); + let balanceItem = await this.getBalanceAsync(result); + let detail = this.creatDetail(result); + if (balanceItem == null||balanceItem == undefined) { + setTimeout(res=>{ + showConfirmMsg('扫描的库存在任务中不存在,是否要添加为任务明细?', async confirm => { + if (confirm) { + this.setDetailNoBalance(detail, result) + this.allDetails.unshift(detail); + this.details.unshift(detail); + this.calcAllCount(); + this.calcScanCount(); + this.$forceUpdate(); + } else { + this.scanPopupGetfocus(); + } + }); + },100) + + } else { + if(balanceItem.locationCode!=this.location.code){ + this.showMessage("箱码【"+result.data.code+"】在库位【"+balanceItem.locationCode+"】不在库位【"+this.location.code+ "】不可以添加为任务明细"); + }else { + setTimeout(res=>{ + showConfirmMsg('扫描的库存在任务中不存在,是否要添加为任务明细?', async confirm => { + if (confirm) { + this.setDetailByBalance(detail, balanceItem); + this.allDetails.unshift(detail); + this.details.unshift(detail); + this.calcAllCount(); + this.calcScanCount(); + this.$forceUpdate(); + } else { + this.scanPopupGetfocus(); + } + }); + },100) } - }); + } }, async getBalanceAsync(result) { @@ -521,6 +541,7 @@ setDetailByBalance(detail, balanceItem) { detail.InventoryLocationCode = balanceItem.locationCode; + detail.inventoryQty = balanceItem.qty; detail.countQty = balanceItem.qty; detail.status = balanceItem.status; return detail; @@ -528,6 +549,7 @@ setDetailNoBalance(detail, result) { detail.InventoryLocationCode = ""; + detail.inventoryQty = 0; detail.countQty = result.data.qty; detail.status = 2; return detail; @@ -677,12 +699,12 @@ }, calcAllCount() { - this.allCount = this.details.length; - this.newCount = this.details.filter(r => r.isNew).length; + this.allCount = this.allDetails.length; + this.newCount = this.allDetails.filter(r => r.isNew).length; }, calcScanCount() { - this.scanCount = this.details.filter(r => r.scaned === true).length; + this.scanCount = this.allDetails.filter(r => r.scaned === true).length; }, bindPickerChange(e, item) {