From 03843e32a68600f47d16ce38cfcaf2bf479d8984 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Mon, 8 Jul 2024 19:59:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=AB=E6=8F=8F=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mycomponents/scan/winComScan.vue | 5 ++++- src/mycomponents/scan/winComScanBalance.vue | 8 +++++++- src/mycomponents/scan/winScanLocation.vue | 2 +- src/mycomponents/scan/winScanPackJob.vue | 2 +- src/pages/purchaseReceipt/job/receiptDetail.vue | 14 ++------------ src/pages/purchaseReceipt/job/receiptJob.vue | 7 ++++--- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/mycomponents/scan/winComScan.vue b/src/mycomponents/scan/winComScan.vue index 481aa733..03bfeeaf 100644 --- a/src/mycomponents/scan/winComScan.vue +++ b/src/mycomponents/scan/winComScan.vue @@ -6,7 +6,7 @@ @@ -225,6 +225,7 @@ getfocus() { let that = this; this.$nextTick(r => { + console.log("获取焦点") that.boxfocus = true; }); // this.hide() @@ -232,7 +233,9 @@ losefocus() { let that = this; this.$nextTick(r => { + console.log("失去焦点") that.boxfocus = false; + uni.hideKeyboard(); }); }, clear() { diff --git a/src/mycomponents/scan/winComScanBalance.vue b/src/mycomponents/scan/winComScanBalance.vue index cef8d67c..7a3e012d 100644 --- a/src/mycomponents/scan/winComScanBalance.vue +++ b/src/mycomponents/scan/winComScanBalance.vue @@ -116,6 +116,10 @@ getScanResult(result) { this.resultData = result; + if(!result.package){ + this.showErrorMessage(result.label.code+"包装信息为空") + return; + } this.getItemCodeType(result.package.itemCode,callBack=>{ this.queryBalance(this.resultData) }) @@ -192,7 +196,9 @@ showErrorMessage(message) { this.$refs.comMessage.showErrorMessage(message, res => { if (res) { - + if(this.$refs.comscan){ + this.$refs.comscan.getfocus() + } } }); }, diff --git a/src/mycomponents/scan/winScanLocation.vue b/src/mycomponents/scan/winScanLocation.vue index a43cc3be..66531474 100644 --- a/src/mycomponents/scan/winScanLocation.vue +++ b/src/mycomponents/scan/winScanLocation.vue @@ -13,7 +13,7 @@ + :isShowHistory="isShowHistory" headerType=""> diff --git a/src/mycomponents/scan/winScanPackJob.vue b/src/mycomponents/scan/winScanPackJob.vue index e0b66aad..47cba583 100644 --- a/src/mycomponents/scan/winScanPackJob.vue +++ b/src/mycomponents/scan/winScanPackJob.vue @@ -70,11 +70,11 @@ methods: { // 弹出 openScanPopup(){ - this.$refs.popup.open('bottom') }, // 关闭 closeScanPopup(content) { + this.$refs.comscan.losefocus() this.$refs.popup.close(); this.$emit("close", ''); }, diff --git a/src/pages/purchaseReceipt/job/receiptDetail.vue b/src/pages/purchaseReceipt/job/receiptDetail.vue index 8da07968..8bcf8898 100644 --- a/src/pages/purchaseReceipt/job/receiptDetail.vue +++ b/src/pages/purchaseReceipt/job/receiptDetail.vue @@ -14,9 +14,9 @@ @change="switchChange"> - + - + @@ -677,7 +677,6 @@ showMessage(message) { setTimeout(r => { - this.scanPopupLoseFocus(); this.$refs.comMessage.showMessage(message, res => { if (res) { this.scanPopupGetFocus() @@ -688,7 +687,6 @@ showErrorMessage(message) { setTimeout(r => { - this.scanPopupLoseFocus(); this.$refs.comMessage.showErrorMessage(message, res => { if (res) { this.scanPopupGetFocus() @@ -711,15 +709,7 @@ } }, - scanPopupLoseFocus() { - if (this.$refs.scanPopup != undefined) { - this.$refs.scanPopup.losefocus(); - } - }, - - showCommitSuccessMessage(hint) { - this.$refs.comMessage.showSuccessMessage(hint, res => { navigateBack(1) }) diff --git a/src/pages/purchaseReceipt/job/receiptJob.vue b/src/pages/purchaseReceipt/job/receiptJob.vue index 8fbb2fd6..6ceb2c02 100644 --- a/src/pages/purchaseReceipt/job/receiptJob.vue +++ b/src/pages/purchaseReceipt/job/receiptJob.vue @@ -341,7 +341,10 @@ showMessage(message) { this.$refs.comMessage.showErrorMessage(message, res => { if (res) { - + + if(this.$refs.scanPopup){ + this.$refs.scanPopup.packGetFocus() + } } }); @@ -361,8 +364,6 @@ }, getScanResult(result) { - - try { let filters = []