diff --git a/src/mycomponents/scan/winCheckFgLabel.vue b/src/mycomponents/scan/winCheckFgLabel.vue index f4e38ac5..832789b7 100644 --- a/src/mycomponents/scan/winCheckFgLabel.vue +++ b/src/mycomponents/scan/winCheckFgLabel.vue @@ -102,18 +102,17 @@ methods: { //直接扫描 openScanPopupForType(customerCode) { - this.customerCode = customerCode; - if (this.fromLocationCode != '') { - this.packGetFocus(); - } else { - this.locationGetFocus(); - } this.fromInventoryStatuses = getDirectoryItemArray(this.businessType.outInventoryStatuses) this.inventoryStatus = getDirectoryItemArray(this.businessType.outInventoryStatuses); //出库库存状态 this.fromLocationAreaTypeList = getDirectoryItemArray(this.businessType.fromLocationAreaTypeList); //出库库区 + this.$refs.popup.open('bottom') setTimeout(res => { - this.$refs.popup.open('bottom') + if (this.fromLocationCode != '') { + this.packGetFocus(); + } else { + this.locationGetFocus(); + } }, 500) }, @@ -121,21 +120,24 @@ openScanPopupForJob(fromLocationCode, fromLocationList, jobContent) { this.fromLocationCode = fromLocationCode; this.fromLocationList = fromLocationList; - if (fromLocationCode != '') { - this.packGetFocus(); - } else { - if (this.fromLocationList.length == 0) { - this.locationGetFocus(); - } else { - this.fromLocationCode = this.fromLocationList[0]; - } - } - setTimeout(res => { - this.$refs.popup.open('bottom') - }, 500) + this.fromInventoryStatuses = getDirectoryItemArray(jobContent.outInventoryStatuses) this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //出库库存状态; //出库库存状态 this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); //出库库存状态 + this.$refs.popup.open('bottom') + setTimeout(res => { + if (this.fromLocationCode != '') { + this.packGetFocus(); + } else { + if (this.fromLocationList.length == 0) { + this.locationGetFocus(); + } else { + this.fromLocationCode = this.fromLocationList[0]; + this.packGetFocus(); + } + } + + }, 500) }, closeScanPopup(content) { diff --git a/src/mycomponents/scan/winComScan.vue b/src/mycomponents/scan/winComScan.vue index 12066256..fc2c00ee 100644 --- a/src/mycomponents/scan/winComScan.vue +++ b/src/mycomponents/scan/winComScan.vue @@ -4,11 +4,15 @@ - - - + - + @@ -73,10 +77,10 @@ type: Boolean, default: true }, - boxFocus: { - type: Boolean, - default: true - }, + // boxFocus: { + // type: Boolean, + // default: true + // }, isShowHistory: { type: Boolean, default: true @@ -100,41 +104,7 @@ } }, mounted() { - this.boxfocus =true; - // uni.hideKeyboard(); - - // #ifdef H5 - // if (document.querySelector('textarea') != null) { - // document.querySelector('textarea').setAttribute('inputmode', 'none') - // } - // #endif - // this.hide() - // #ifdef APP-PLUS - // - // this.hide() - // uni.onKeyboardHeightChange(res => { - // console.log(res.height) - // if(res.height>0){ - // // uni.hideKeyboard(); - // plus.key.hideSoftKeybord(); - // } - // }) - // - // uni.onWindowResize((res) => { - // plus.key.hideSoftKeybord() - // }) - // plus.key.hideSoftKeybord(); - // setInterval(function(){ - // plus.key.hideSoftKeybord(); - // // uni.hideKeyboard();//隐藏软键盘 - // // plus.key.hideSoftKeybord(); - // },60); - // #endif - - // if (this.$el.querySelector('textarea') != null) { - // this.$el.querySelector('textarea').setAttribute('inputmode', 'none') - // } }, watch: { placeholder() { @@ -169,6 +139,7 @@ }, clearScanValue() { this.scanMsg = '' + this.cursorIndex =0 this.getfocus(); }, clickScanMsg() { @@ -186,10 +157,10 @@ if (index >= 0) { // that.scanMsg = 'HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q50'; setTimeout(() => { - that.losefocus(); + that.losefocus(); let content = uni.$u.trim(that.scanMsg) if (content == "") { - that.getfocus(); + // that.getfocus(); this.$refs.comMessage.showErrorMessage("扫描内容为空,请重新扫描", res => { if (res) { that.scanMsg = "" @@ -212,6 +183,7 @@ that.$emit("getResult", scanResult); } else { that.clear(); + that.losefocus(); this.$refs.comMessage.showErrorMessage(scanResult.message, res => { if (res) { that.getfocus(); @@ -222,20 +194,25 @@ }, 500); } }, + + handleFocus(){ + }, + + handleBlur(){ + // setTimeout(res=>{ + // uni.hideKeyboard(); + // },200) + }, getfocus() { let that = this; this.$nextTick(r => { - console.log("获取焦点") that.boxfocus = true; }); - // this.hide() }, losefocus() { let that = this; this.$nextTick(r => { - console.log("失去焦点") that.boxfocus = false; - uni.hideKeyboard(); }); }, clear() { @@ -289,7 +266,7 @@ diff --git a/src/mycomponents/scan/winComScanBalance.vue b/src/mycomponents/scan/winComScanBalance.vue index eeb54da6..148baaf9 100644 --- a/src/mycomponents/scan/winComScanBalance.vue +++ b/src/mycomponents/scan/winComScanBalance.vue @@ -118,6 +118,9 @@ this.toLocationAreaTypeList = getDirectoryItemArray(businessType.inAreaTypes) this.itemTypesList = getDirectoryItemArray(businessType.itemTypes) this.$refs.popup.open('bottom') + setTimeout(res=>{ + this.getfocus() + },500) }, getScanResult(result) { diff --git a/src/mycomponents/scan/winComScanBalanceLocation.vue b/src/mycomponents/scan/winComScanBalanceLocation.vue index 188bd60e..0dfdc271 100644 --- a/src/mycomponents/scan/winComScanBalanceLocation.vue +++ b/src/mycomponents/scan/winComScanBalanceLocation.vue @@ -145,28 +145,31 @@ this.fromLocationAreaTypeList = getDirectoryItemArray(businessType.outAreaTypes) this.itemTypesList = getDirectoryItemArray(businessType.itemTypes) this.$refs.popup.open('bottom') + setTimeout(res=>{ + this.packGetFocus() + },500) }, openScanPopupForJob(fromLocationCode, fromLocationList, jobContent){ this.fromLocationCode = fromLocationCode; this.fromLocationList = fromLocationList; - if (fromLocationCode != '') { - this.packGetFocus(); - } else { - if (this.fromLocationList.length == 0) { - this.locationGetFocus(); - } else { - this.fromLocationCode = this.fromLocationList[0]; - } - } - - setTimeout(res => { - this.$refs.popup.open('bottom') - }, 500) this.fromInventoryStatuses = getDirectoryItemArray(jobContent.outInventoryStatuses) this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //出库库存状态; //出库库存状态 this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); //出库库存状态 + this.$refs.popup.open('bottom') + setTimeout(res => { + if (this.fromLocationCode != '') { + this.packGetFocus(); + } else { + if (this.fromLocationList.length == 0) { + this.locationGetFocus(); + } else { + this.fromLocationCode = this.fromLocationList[0]; + this.packGetFocus(); + } + } + }, 500) }, //模拟扫描 @@ -294,6 +297,7 @@ }) }, showErrorMessage(message) { + this.packLoseFocus(); this.$refs.comMessage.showErrorMessage(message, res => { if (res) { if(this.$refs.comscan){ diff --git a/src/mycomponents/scan/winComScanFg.vue b/src/mycomponents/scan/winComScanFg.vue index 531c5a36..b8772969 100644 --- a/src/mycomponents/scan/winComScanFg.vue +++ b/src/mycomponents/scan/winComScanFg.vue @@ -6,12 +6,14 @@ + style="margin-left: 5px;width: 90%;" + :focus="boxfocus" :placeholder="placeholderValue" + @focus="handleFocus" + @input="handelScanMsg" :cursor="cursorIndex"> - + @@ -103,13 +105,11 @@ } }, mounted() { - this.boxfocus = true; - // uni.hideKeyboard(); // #ifdef H5 - if (document.querySelector('textarea') != null) { - document.querySelector('textarea').setAttribute('inputmode', 'none') - } + // if (document.querySelector('textarea') != null) { + // document.querySelector('textarea').setAttribute('inputmode', 'none') + // } // #endif // this.hide() // #ifdef APP-PLUS @@ -125,20 +125,6 @@ this.placeholderValue = '请扫描' + this.placeholder; }, methods: { - - hide() { - // #ifdef APP-PLUS - // 只是解决软键盘的闪现 - var interval = setInterval(function() { - uni.hideKeyboard(); //隐藏软键盘 - console.log('刷新') - }, 5); - setTimeout(() => { - clearInterval(interval); - console.log('停止刷新') - }, 1000); - // #endif - }, setItemCodeSimulate(itemCode, scanMsg) { this.itemCode = itemCode; this.scanMsg = scanMsg; @@ -154,6 +140,7 @@ this.scanMsg = val }, clearScanValue() { + this.cursorIndex=0, this.scanMsg = '' this.getfocus(); }, @@ -171,7 +158,6 @@ let content = uni.$u.trim(that.scanMsg) // let content = that.scanMsg; if (content == "") { - that.getfocus(); this.$refs.comMessage.showErrorMessage("扫描内容为空,请重新扫描", res => { if (res) { that.scanMsg = "" @@ -235,6 +221,7 @@ that.$emit("getResult", scanResult); } } catch (error) { + that.losefocus(); this.$refs.comMessage.showErrorMessage(error.message, res => { if (res) { that.getfocus(); @@ -243,6 +230,7 @@ } }).catch(error => { + that.losefocus(); this.$refs.comMessage.showErrorMessage(error, res => { if (res) { that.scanMsg = "" @@ -268,6 +256,11 @@ that.boxfocus = false; }); }, + // handleBlur(){ + // setTimeout(res=>{ + // uni.hideKeyboard(); + // },200) + // }, clear() { this.cursorIndex = 0; this.scanMsg = '' diff --git a/src/mycomponents/scan/winScanAsnNumber.vue b/src/mycomponents/scan/winScanAsnNumber.vue index 100a1c68..02ac8ca5 100644 --- a/src/mycomponents/scan/winScanAsnNumber.vue +++ b/src/mycomponents/scan/winScanAsnNumber.vue @@ -55,8 +55,9 @@ }, methods: { openScanPopup() { + this.$refs.popup.open('bottom') setTimeout(res => { - this.$refs.popup.open('bottom') + this.getfocus('bottom') }, 500) }, closeScanPopup() { diff --git a/src/mycomponents/scan/winScanContainer.vue b/src/mycomponents/scan/winScanContainer.vue index d7323344..5ec28c5c 100644 --- a/src/mycomponents/scan/winScanContainer.vue +++ b/src/mycomponents/scan/winScanContainer.vue @@ -54,8 +54,9 @@ }, methods: { openScanPopup() { + this.$refs.popup.open('bottom') setTimeout(res => { - this.$refs.popup.open('bottom') + this.getfocus() }, 500) }, closeScanPopup() { diff --git a/src/mycomponents/scan/winScanFgLabel.vue b/src/mycomponents/scan/winScanFgLabel.vue index 552d3b0e..8d953201 100644 --- a/src/mycomponents/scan/winScanFgLabel.vue +++ b/src/mycomponents/scan/winScanFgLabel.vue @@ -60,13 +60,13 @@ this.$refs.comscansimulate.clickScanMsg(); }, openScanPopup(itemCode) { + this.$refs.popup.open('bottom') setTimeout(res => { - this.$refs.popup.open('bottom') setTimeout(re=>{ this.$refs.comscan.setItemCode(itemCode) },500) - - }, 200) + this.getfocus() + }, 500) }, closeScanPopup() { @@ -91,13 +91,13 @@ }, getfocus() { - if (this.$refs.comscan != undefined) { + if (this.$refs.comscan ) { this.$refs.comscan.getfocus(); } }, losefocus() { - if (this.$refs.comscan != undefined) { + if (this.$refs.comscan ) { this.$refs.comscan.losefocus(); } }, diff --git a/src/mycomponents/scan/winScanItem.vue b/src/mycomponents/scan/winScanItem.vue index aee8b8d7..9b2a6abd 100644 --- a/src/mycomponents/scan/winScanItem.vue +++ b/src/mycomponents/scan/winScanItem.vue @@ -76,8 +76,10 @@ }, methods: { openScanPopup() { + this.$refs.popup.open('bottom') + var that =this; setTimeout(res => { - this.$refs.popup.open('bottom') + that.getfocus() }, 500) }, closeScanPopup() { diff --git a/src/mycomponents/scan/winScanJobNumber.vue b/src/mycomponents/scan/winScanJobNumber.vue index e12dfbfe..5f7355f2 100644 --- a/src/mycomponents/scan/winScanJobNumber.vue +++ b/src/mycomponents/scan/winScanJobNumber.vue @@ -61,8 +61,9 @@ }, methods: { openScanPopup() { + this.$refs.popup.open('bottom') setTimeout(res => { - this.$refs.popup.open('bottom') + this.getfocus() }, 500) }, closeScanPopup() { @@ -72,7 +73,7 @@ this.$refs.popup.close() }, getfocus() { - if (this.isShow) { + if (this.$refs.scan) { this.$refs.scan.getfocus() } }, diff --git a/src/mycomponents/scan/winScanLocation.vue b/src/mycomponents/scan/winScanLocation.vue index 70f3aeea..0f4c0144 100644 --- a/src/mycomponents/scan/winScanLocation.vue +++ b/src/mycomponents/scan/winScanLocation.vue @@ -65,8 +65,9 @@ }, methods: { openScanPopup() { + this.$refs.popup.open('bottom') setTimeout(res => { - this.$refs.popup.open('bottom') + this.getfocus() }, 500) }, openScanPopupSimulate(location) { diff --git a/src/mycomponents/scan/winScanPack.vue b/src/mycomponents/scan/winScanPack.vue index 4fa855f5..7da05b49 100644 --- a/src/mycomponents/scan/winScanPack.vue +++ b/src/mycomponents/scan/winScanPack.vue @@ -70,9 +70,10 @@ }) }, openScanPopup() { + this.$refs.popup.open('bottom') setTimeout(res => { - this.$refs.popup.open('bottom') - }, 200) + this.getfocus() + }, 500) }, closeScanPopup() { @@ -103,13 +104,13 @@ }, getfocus() { - if (this.$refs.comscan != undefined) { + if (this.$refs.comscan) { this.$refs.comscan.getfocus(); } }, losefocus() { - if (this.$refs.comscan != undefined) { + if (this.$refs.comscan) { this.$refs.comscan.losefocus(); } }, diff --git a/src/mycomponents/scan/winScanPackAndCont.vue b/src/mycomponents/scan/winScanPackAndCont.vue index e71b2eaf..01941270 100644 --- a/src/mycomponents/scan/winScanPackAndCont.vue +++ b/src/mycomponents/scan/winScanPackAndCont.vue @@ -61,8 +61,9 @@ }, methods: { openScanPopup() { + this.$refs.popup.open('bottom') setTimeout(res => { - this.$refs.popup.open('bottom') + this.getfocus() }, 500) }, diff --git a/src/mycomponents/scan/winScanPackAndLocation.vue b/src/mycomponents/scan/winScanPackAndLocation.vue index 91c712b1..e958c8d4 100644 --- a/src/mycomponents/scan/winScanPackAndLocation.vue +++ b/src/mycomponents/scan/winScanPackAndLocation.vue @@ -152,43 +152,44 @@ }, //直接扫描 openScanPopupForType(fromLocationCode, businessType) { - this.businessType = businessType; this.fromLocationCode = fromLocationCode; - if (fromLocationCode != '') { - this.packGetFocus(); - } else { - this.locationGetFocus(); - } + this.fromInventoryStatuses = getDirectoryItemArray(this.businessType.outInventoryStatuses) this.inventoryStatus = getDirectoryItemArray(this.businessType.outInventoryStatuses); //出库库存状态 this.fromLocationAreaTypeList = getDirectoryItemArray(this.businessType.outAreaTypes); //出库库区 - if (!this.show) { - setTimeout(res => { - this.$refs.popup.open('bottom') - }, 500) - } + this.$refs.popup.open('bottom') + setTimeout(res => { + if (fromLocationCode != '') { + this.packGetFocus(); + } else { + this.locationGetFocus(); + } + }, 500) }, //在任务中扫描 openScanPopupForJob(fromLocationCode, fromLocationList, jobContent) { this.fromLocationCode = fromLocationCode; this.fromLocationList = fromLocationList; - if (fromLocationCode != '') { - this.packGetFocus(); - } else { - if (this.fromLocationList.length == 0) { - this.locationGetFocus(); - } else { - this.fromLocationCode = this.fromLocationList[0]; - } - } - setTimeout(res => { - this.$refs.popup.open('bottom') - }, 500) this.fromInventoryStatuses = getDirectoryItemArray(jobContent.outInventoryStatuses) this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //出库库存状态; //出库库存状态 this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); //出库库存状态 + this.$refs.popup.open('bottom') + + setTimeout(res => { + if (this.fromLocationCode != '') { + this.packGetFocus(); + } else { + if (this.fromLocationList.length == 0) { + this.locationGetFocus(); + } else { + this.fromLocationCode = this.fromLocationList[0]; + this.packGetFocus(); + } + } + }, 500) + }, //模拟扫描 openScanPopupForJobSimulate(fromLocationCode, fromLocationList, jobContent, scanMessage) { @@ -417,7 +418,7 @@ balance: datas, fromLocationCode: this.fromLocationCode, } - this.packGetFocus(); + // this.packGetFocus(); this.$emit("getResult", data); this.$emit("getCountScanResult", data); }, @@ -433,18 +434,18 @@ balance: item, fromLocationCode: this.fromLocationCode, } - this.packGetFocus(); + // this.packGetFocus(); this.$emit("getResult", data); }, packGetFocus() { - if (this.$refs.comscan != undefined) { + if (this.$refs.comscan) { this.$refs.comscan.getfocus(); } }, packLoseFocus() { - if (this.$refs.comscan != undefined) { + if (this.$refs.comscan) { this.$refs.comscan.losefocus(); } }, diff --git a/src/mycomponents/scan/winScanPackAndLocationNoBalance.vue b/src/mycomponents/scan/winScanPackAndLocationNoBalance.vue index f43c2bb1..c1f8c477 100644 --- a/src/mycomponents/scan/winScanPackAndLocationNoBalance.vue +++ b/src/mycomponents/scan/winScanPackAndLocationNoBalance.vue @@ -131,16 +131,16 @@ openScanPopupForType(fromLocationCode, businessType) { this.businessType = businessType; this.fromLocationCode = fromLocationCode; - if (fromLocationCode != '') { - this.packGetFocus(); - } else { - this.locationGetFocus(); - } this.fromInventoryStatuses = getDirectoryItemArray(this.businessType.outInventoryStatuses) this.inventoryStatus = getDirectoryItemArray(this.businessType.outInventoryStatuses); //出库库存状态 this.fromLocationTypeArray = getDirectoryItemArray(this.businessType.outLocationTypes); //出库库存状态 + this.$refs.popup.open('bottom') setTimeout(res => { - this.$refs.popup.open('bottom') + if (fromLocationCode != '') { + this.packGetFocus(); + } else { + this.locationGetFocus(); + } }, 500) }, @@ -148,21 +148,23 @@ openScanPopupForJob(fromLocationCode, fromLocationList, jobContent) { this.fromLocationCode = fromLocationCode; this.fromLocationList = fromLocationList; - if (fromLocationCode != '') { - this.packGetFocus(); - } else { - if (this.fromLocationList.length == 0) { - this.locationGetFocus(); - } else { - this.fromLocationCode = this.fromLocationList[0]; - } - } - setTimeout(res => { - this.$refs.popup.open('bottom') - }, 500) + this.fromInventoryStatuses = getDirectoryItemArray(jobContent.outInventoryStatuses) this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //出库库存状态; //出库库存状态 this.fromLocationTypeArray = getDirectoryItemArray(jobContent.fromLocationTypes); //出库库存状态 + this.$refs.popup.open('bottom') + setTimeout(res => { + if (fromLocationCode != '') { + this.packGetFocus(); + } else { + if (this.fromLocationList.length == 0) { + this.locationGetFocus(); + } else { + this.fromLocationCode = this.fromLocationList[0]; + this.packGetFocus(); + } + } + }, 500) }, closeScanPopup(content) { diff --git a/src/mycomponents/scan/winScanPackAndPosition.vue b/src/mycomponents/scan/winScanPackAndPosition.vue index 1ee6edc6..266ba324 100644 --- a/src/mycomponents/scan/winScanPackAndPosition.vue +++ b/src/mycomponents/scan/winScanPackAndPosition.vue @@ -105,23 +105,23 @@ this.showErrorMessage(error) }) } - + this.$refs.popup.open('bottom') setTimeout(res => { - this.$refs.popup.open('bottom') + this.getfocus() }, 500) }, - - initData(){ + + initData() { this.positionInfo = "请选择位置"; this.positionList = []; this.productionLineCode = ''; this.rawLocationCode = ""; this.fgLocationCode = ""; this.workshopCode = ""; - this.workStationCode =""; + this.workStationCode = ""; this.workShopName = ""; - this.productionLineName=""; - this.workStationName=""; + this.productionLineName = ""; + this.workStationName = ""; this.show = false; this.isEditPosition = true }, @@ -223,4 +223,4 @@ height: auto; max-height: 300rpx; } - + \ No newline at end of file diff --git a/src/mycomponents/scan/winScanPackJob.vue b/src/mycomponents/scan/winScanPackJob.vue index eb53f519..c9db3744 100644 --- a/src/mycomponents/scan/winScanPackJob.vue +++ b/src/mycomponents/scan/winScanPackJob.vue @@ -71,6 +71,9 @@ // 弹出 openScanPopup(){ this.$refs.popup.open('bottom') + setTimeout(res=>{ + this.packGetFocus() + },500) }, // 关闭 closeScanPopup(content) { @@ -83,13 +86,13 @@ this.$emit("getResult", result); }, packGetFocus() { - if (this.$refs.comscan != undefined) { + if (this.$refs.comscan) { this.$refs.comscan.getfocus(); } }, packLoseFocus() { - if (this.$refs.comscan != undefined) { + if (this.$refs.comscan) { this.$refs.comscan.losefocus(); } }, diff --git a/src/mycomponents/scan/winScanPackLevel.vue b/src/mycomponents/scan/winScanPackLevel.vue index 6c78f008..07dd2bcd 100644 --- a/src/mycomponents/scan/winScanPackLevel.vue +++ b/src/mycomponents/scan/winScanPackLevel.vue @@ -96,9 +96,10 @@ }) }, openScanPopup() { + this.$refs.popup.open('bottom') setTimeout(res => { - this.$refs.popup.open('bottom') - }, 200) + this.getfocus(); + }, 500) }, closeScanPopup() { @@ -130,13 +131,13 @@ }, getfocus() { - if (this.$refs.comscan != undefined) { + if (this.$refs.comscan) { this.$refs.comscan.getfocus(); } }, losefocus() { - if (this.$refs.comscan != undefined) { + if (this.$refs.comscan) { this.$refs.comscan.losefocus(); } }, diff --git a/src/mycomponents/scan/winScanPackage.vue b/src/mycomponents/scan/winScanPackage.vue index ffb26638..e751e5f4 100644 --- a/src/mycomponents/scan/winScanPackage.vue +++ b/src/mycomponents/scan/winScanPackage.vue @@ -67,18 +67,19 @@ this.$refs.comscansimulate.clickScanMsg(); }, openScanPopup() { + this.$refs.popup.open('bottom') setTimeout(res => { - this.$refs.popup.open('bottom') - }, 200) + this.getfocus() + }, 500) }, openScanPopupByBusinessType(businessType) { + this.$refs.popup.open('bottom') setTimeout(res => { - this.$refs.popup.open('bottom') + this.getfocus() this.businessType = businessType; - - }, 200) + }, 500) }, @@ -223,13 +224,13 @@ }, getfocus() { - if (this.$refs.comscan != undefined) { + if (this.$refs.comscan) { this.$refs.comscan.getfocus(); } }, losefocus() { - if (this.$refs.comscan != undefined) { + if (this.$refs.comscan ) { this.$refs.comscan.losefocus(); } }, @@ -240,9 +241,10 @@ this.show = e.show }, showErrorMessage(message) { + this.losefocus() this.$refs.comMessage.showErrorMessage(message, res => { if (res) { - + this.getfocus(); } }); }, diff --git a/src/pages.json b/src/pages.json index 265152ee..b697869a 100644 --- a/src/pages.json +++ b/src/pages.json @@ -2297,7 +2297,8 @@ // "fontSize": "58rpx" // }] // }, - "softinputMode": "adjustPan" //adjustResize + //手机软键盘升起不让其将页面头部上推 + "softinputMode": "adjustResize" //adjustResize }, "tabBar": { "color": "#000000", diff --git a/src/pages/count/job/fuzzyCountDetail.vue b/src/pages/count/job/fuzzyCountDetail.vue index addbf80e..ad1a4642 100644 --- a/src/pages/count/job/fuzzyCountDetail.vue +++ b/src/pages/count/job/fuzzyCountDetail.vue @@ -433,10 +433,12 @@ }, remove(item, index) { + this.scanPopupLoseFocus(); this.showQuestionMessage("是否要移除扫描信息?", res => { if (res) { this.detailSource.splice(index, 1) } + this.scanPopupGetFocus(); }); }, @@ -489,6 +491,7 @@ showMessage(message) { + this.scanPopupLoseFocus(); this.$refs.comMessage.showMessage(message, res => { if (res) { this.afterCloseMessage() @@ -496,6 +499,7 @@ }); }, showErrorMessage(message) { + this.scanPopupLoseFocus(); this.$refs.comMessage.showErrorMessage(message, res => { if (res) { this.afterCloseMessage() diff --git a/src/pages/deliver/coms/comScanDeliverPack.vue b/src/pages/deliver/coms/comScanDeliverPack.vue index 5592f322..27c5ce1c 100644 --- a/src/pages/deliver/coms/comScanDeliverPack.vue +++ b/src/pages/deliver/coms/comScanDeliverPack.vue @@ -184,8 +184,9 @@ this.initData(); this.positionInfo = this.jobContent.workShopCode + "-" + this.jobContent.subList[0].productionLineCode + "-" + this.jobContent.subList[0].workStationCode + this.$refs.popup.open('bottom') setTimeout(res => { - this.$refs.popup.open('bottom') + this.getfocus(); }, 500) }, diff --git a/src/pages/inventoryMove/coms/comMoveRecord.vue b/src/pages/inventoryMove/coms/comMoveRecord.vue index a0da6804..8c38f935 100644 --- a/src/pages/inventoryMove/coms/comMoveRecord.vue +++ b/src/pages/inventoryMove/coms/comMoveRecord.vue @@ -300,6 +300,9 @@ }, showErrorMessage(message) { + if(this.$refs.scanPopup){ + this.$refs.scanPopup.packLoseFocus() + } this.$refs.comMessage.showErrorMessage(message, res => { if (res) { diff --git a/src/pages/issue/coms/comScanIssuePack.vue b/src/pages/issue/coms/comScanIssuePack.vue index 3f266f6b..67204f8a 100644 --- a/src/pages/issue/coms/comScanIssuePack.vue +++ b/src/pages/issue/coms/comScanIssuePack.vue @@ -213,8 +213,9 @@ this.initData(); // this.positionInfo = this.jobContent.workShopCode + "-" + this.jobContent.subList[0].productionLineCode + // "-" + this.jobContent.subList[0].workStationCode + this.$refs.popup.open('bottom') setTimeout(res => { - this.$refs.popup.open('bottom') + this.getfocus(); }, 500) }, @@ -315,7 +316,10 @@ "状态 [" + status + "] \n" + "库区 [" + areaType + "] \n" + "未查找到库存余额" - this.showErrorMessage(hint) + this.showErrorMessage(hint, + res => { + that.getfocus(); + }) } else if (res.data.length == 1) { result.balance = res.data[0] @@ -332,11 +336,16 @@ uni.hideLoading() }).catch(error => { uni.hideLoading() - this.showErrorMessage(error) + this.showErrorMessage(error, + res => { + that.getfocus(); + }) }) } } catch (e) { - this.showErrorMessage(e.stack) + this.showErrorMessage(e.stack,res => { + that.getfocus(); + }) uni.hideLoading(); } }, diff --git a/src/pages/issue/job/issueDetail.vue b/src/pages/issue/job/issueDetail.vue index 541e4808..2bfd64cd 100644 --- a/src/pages/issue/job/issueDetail.vue +++ b/src/pages/issue/job/issueDetail.vue @@ -481,6 +481,8 @@ '】不一致,是否继续提交', res => { if (res) { this.submit(); + }else { + this.scanPopupGetFocus() } }); } @@ -489,8 +491,8 @@ }, scanPopupGetFocus() { - if (this.$refs.scanPopup != undefined) { - this.$refs.scanPopup.getfocus(); + if (this.$refs.comScanIssuePack) { + this.$refs.comScanIssuePack.getfocus(); } }, diff --git a/src/pages/issue/record/directIssue.vue b/src/pages/issue/record/directIssue.vue index 2a784cbe..7d44bfd7 100644 --- a/src/pages/issue/record/directIssue.vue +++ b/src/pages/issue/record/directIssue.vue @@ -256,8 +256,13 @@ }, showErrorMessage(message) { + if (this.$refs.scanPopup) { + this.$refs.scanPopup.losefocus(); + } this.$refs.comMessage.showErrorMessage(message, res => { - if (res) {} + if (res) { + this.scanPopupGetFocus() + } }); }, diff --git a/src/pages/issue/request/issueScanRequest.vue b/src/pages/issue/request/issueScanRequest.vue index 33ad2b6c..d0b0d057 100644 --- a/src/pages/issue/request/issueScanRequest.vue +++ b/src/pages/issue/request/issueScanRequest.vue @@ -151,6 +151,9 @@ this.$refs.scanPopup.closeScanPopup(); }, showErrorMessage(message) { + if (this.$refs.scanPopup) { + this.$refs.scanPopup.losefocus(); + } this.$refs.comMessage.showErrorMessage(message, res => { if (res) { this.scanPopupGetFocus() @@ -158,7 +161,7 @@ }); }, scanPopupGetFocus() { - if (this.$refs.scanPopup != undefined) { + if (this.$refs.scanPopup) { this.$refs.scanPopup.getfocus(); } }, diff --git a/src/pages/package/coms/comScanPackagePack.vue b/src/pages/package/coms/comScanPackagePack.vue index d6b8b098..34278165 100644 --- a/src/pages/package/coms/comScanPackagePack.vue +++ b/src/pages/package/coms/comScanPackagePack.vue @@ -171,6 +171,7 @@ import { getDirectoryItemArray } from '@/common/directory'; let lot = result.label.batch; let item = that.toLocation.Items.find(r => r.itemCode == itemCode); if (item == undefined) { + this.packLoseFocus() that.showErrorMessage('未查找到物料【' + itemCode + '】的翻包明细', res => { that.packGetFocus(); diff --git a/src/pages/productPutaway/job/productPutawayJob.vue b/src/pages/productPutaway/job/productPutawayJob.vue index b901b688..25541856 100644 --- a/src/pages/productPutaway/job/productPutawayJob.vue +++ b/src/pages/productPutaway/job/productPutawayJob.vue @@ -357,8 +357,14 @@ }, showMessage(message) { + if(this.$refs.scanPopup){ + this.$refs.scanPopup.packLoseFocus() + } this.$refs.comMessage.showErrorMessage(message, res => { if (res) { + if(this.$refs.scanPopup){ + this.$refs.scanPopup.packLoseFocus() + } } }); diff --git a/src/pages/productPutaway/record/productPutawayRecord.vue b/src/pages/productPutaway/record/productPutawayRecord.vue index bb40a81b..1c98771d 100644 --- a/src/pages/productPutaway/record/productPutawayRecord.vue +++ b/src/pages/productPutaway/record/productPutawayRecord.vue @@ -232,7 +232,10 @@ }, showErrorMessage(message) { - this.$refs.comMessage.showErrorMessage(message, res => {}); + this.scanPopupLoseFocus(); + this.$refs.comMessage.showErrorMessage(message, res => { + this.scanPopupGetFocus(); + }); }, calcHandleQty() { calcHandleQty(this.detailSource); @@ -274,6 +277,12 @@ this.$refs.scanPopup.getfocus(); } }, + + scanPopupLoseFocus() { + if (this.$refs.scanPopup != undefined) { + this.$refs.scanPopup.losefocus(); + } + }, scanLocationCode(location, code) { this.toLocationCode = code diff --git a/src/pages/productReceipt/job/ccProductReceiptJob.vue b/src/pages/productReceipt/job/ccProductReceiptJob.vue index e79c2565..a9e11e68 100644 --- a/src/pages/productReceipt/job/ccProductReceiptJob.vue +++ b/src/pages/productReceipt/job/ccProductReceiptJob.vue @@ -322,9 +322,14 @@ }, showMessage(message) { + if(this.$refs.scanPopup){ + this.$refs.scanPopup.packLoseFocus() + } this.$refs.comMessage.showErrorMessage(message, res => { if (res) { - + if(this.$refs.scanPopup){ + this.$refs.scanPopup.packGetFocus() + } } }); }, diff --git a/src/pages/productReceipt/job/productReceiptJob.vue b/src/pages/productReceipt/job/productReceiptJob.vue index 3bf276b4..baf01cda 100644 --- a/src/pages/productReceipt/job/productReceiptJob.vue +++ b/src/pages/productReceipt/job/productReceiptJob.vue @@ -312,9 +312,14 @@ }, showMessage(message) { + if(this.$refs.scanPopup){ + this.$refs.scanPopup.packLoseFocus() + } this.$refs.comMessage.showErrorMessage(message, res => { if (res) { - + if(this.$refs.scanPopup){ + this.$refs.scanPopup.packGetFocus() + } } }); }, diff --git a/src/pages/productRecycle/job/productRecycleJobDetail.vue b/src/pages/productRecycle/job/productRecycleJobDetail.vue index a6530486..8908d9fa 100644 --- a/src/pages/productRecycle/job/productRecycleJobDetail.vue +++ b/src/pages/productRecycle/job/productRecycleJobDetail.vue @@ -442,6 +442,7 @@ }, showMessage(message) { + this.scanPopupLoseFocus(); this.$refs.comMessage.showMessage(message, res => { if (res) { this.scanPopupGetFocus() @@ -450,6 +451,7 @@ }, showErrorMessage(message) { + this.scanPopupLoseFocus(); this.$refs.comMessage.showErrorMessage(message, res => { if (res) { this.scanPopupGetFocus() @@ -463,6 +465,8 @@ this.$refs.comMessage.showQuestionMessage(message, res => { if (res) { callback(res); + }else { + this.scanPopupGetFocus() } }); }) diff --git a/src/pages/productionReceipt/job/productionReceiptJob.vue b/src/pages/productionReceipt/job/productionReceiptJob.vue index c529f434..c92ec8f5 100644 --- a/src/pages/productionReceipt/job/productionReceiptJob.vue +++ b/src/pages/productionReceipt/job/productionReceiptJob.vue @@ -347,9 +347,14 @@ }, showMessage(message) { + if(this.$refs.scanPopup){ + this.$refs.scanPopup.packLoseFocus() + } this.$refs.comMessage.showErrorMessage(message, res => { if (res) { - + if(this.$refs.scanPopup){ + this.$refs.scanPopup.packGetFocus() + } } }); }, diff --git a/src/pages/productionReturn/coms/comScanReturnPack.vue b/src/pages/productionReturn/coms/comScanReturnPack.vue index 290b934d..69862044 100644 --- a/src/pages/productionReturn/coms/comScanReturnPack.vue +++ b/src/pages/productionReturn/coms/comScanReturnPack.vue @@ -159,8 +159,6 @@ this.scanOptions = getDetailEditRemoveOption(); }, methods: { - - openScanPopup(content, jobcontent) { this.issueRecord = []; this.dataContent = content; @@ -168,8 +166,9 @@ this.initData(); // this.positionInfo = this.jobContent.workShopCode + "-" + this.jobContent.subList[0].productionLineCode + // "-" + this.jobContent.subList[0].workStationCode + this.$refs.popup.open('bottom') setTimeout(res => { - this.$refs.popup.open('bottom') + that.getfocus(); }, 500) }, diff --git a/src/pages/purchaseReceipt/job/receiptDetail.vue b/src/pages/purchaseReceipt/job/receiptDetail.vue index ba9aa9c6..fa506e5a 100644 --- a/src/pages/purchaseReceipt/job/receiptDetail.vue +++ b/src/pages/purchaseReceipt/job/receiptDetail.vue @@ -373,7 +373,7 @@ }) if (itemDetail.scaned && scanedLength == itemDetail .packList.length) { - isExit.scanDate = new Date(); + itemDetail.scanDate = new Date(); this.showMessage("箱码【" + packingNumber + "】已经扫描") } else { itemDetail.scaned = true; @@ -712,6 +712,9 @@ showMessage(message) { + if(this.$refs.scanPopup){ + this.$refs.scanPopup.losefocus(); + } setTimeout(r => { this.$refs.comMessage.showMessage(message, res => { if (res) { @@ -722,6 +725,9 @@ }, showErrorMessage(message) { + if(this.$refs.scanPopup){ + this.$refs.scanPopup.losefocus(); + } setTimeout(r => { this.$refs.comMessage.showErrorMessage(message, res => { if (res) { diff --git a/src/pages/purchaseReceipt/job/receiptJob.vue b/src/pages/purchaseReceipt/job/receiptJob.vue index 4a43391a..3f610ed2 100644 --- a/src/pages/purchaseReceipt/job/receiptJob.vue +++ b/src/pages/purchaseReceipt/job/receiptJob.vue @@ -20,7 +20,7 @@ - + @@ -78,7 +78,7 @@ status: '1,2', //待处理 、进行中 detailOptions: [], detailGiveupOptions: [], - scanMessage:"" + scanMessage: "" }; }, @@ -95,7 +95,7 @@ scanTitle: { type: String, default: '箱标签' - }, + }, title: { type: String, default: '' @@ -185,11 +185,11 @@ column: "status", action: "in", value: this.status - }) - filters.push({ - column: "accept_user_id", - action: "==", - value: this.$store.state.user.id + }) + filters.push({ + column: "accept_user_id", + action: "==", + value: this.$store.state.user.id }) var params = { @@ -205,7 +205,7 @@ var list = res.data.list; this.totalCount = res.data.total - updateTitle(this.title+"(" + this.totalCount + ")"); + updateTitle(this.title + "(" + this.totalCount + ")"); this.loadingType = "loadmore"; if (list == null || list.length == 0) { this.loadingType = "nomore"; @@ -292,7 +292,7 @@ url: './receiptDetail?id=' + item.masterId + '&status=' + item.status + '&operation=' + this .operation + '&scanMessage=' + scanMessage }); - this.scanMessage="" + this.scanMessage = "" }, showItemList(itemList) { @@ -350,12 +350,14 @@ }, showMessage(message) { + if (this.$refs.scanPopup) { + this.$refs.scanPopup.packLoseFocus() + } this.$refs.comMessage.showErrorMessage(message, res => { if (res) { - - if(this.$refs.scanPopup){ - this.$refs.scanPopup.packGetFocus() - } + if (this.$refs.scanPopup) { + this.$refs.scanPopup.packGetFocus() + } } }); @@ -363,20 +365,20 @@ openScanPopup() { this.$refs.scanPopup.openScanPopup(); }, - selectItem(item,isScanedASN=false) { - - this.$refs.scanPopup.closeScanPopup(); - if(isScanedASN){ - this.openJobDetail(item) - }else{ - this.openJobDetail(item, this.scanMessage); + selectItem(item, isScanedASN = false) { + + this.$refs.scanPopup.closeScanPopup(); + if (isScanedASN) { + this.openJobDetail(item) + } else { + this.openJobDetail(item, this.scanMessage); } - + }, - getScanResult(result) { + getScanResult(result) { try { - this.scanMessage="" + this.scanMessage = "" let filters = [] if (result.label.barType == "BarCode") { // ASN单号 @@ -384,17 +386,17 @@ column: "asn_number", action: "==", value: result.label.code - },{ - column: "status", - action: "in", - value: '1,2', + }, { + column: "status", + action: "in", + value: '1,2', }] } else { filters = [{ - column: "packingNumber", - action: "in", - value: result.package.number + "," + result.package.parentNumber - }, + column: "packingNumber", + action: "in", + value: result.package.number + "," + result.package.parentNumber + }, { column: "batch", action: "==", @@ -409,11 +411,11 @@ column: "itemCode", action: "==", value: result.label.itemCode - }, - { - column: "status", - action: "in", - value: '1,2', + }, + { + column: "status", + action: "in", + value: '1,2', }, { column: "accept_user_id", @@ -432,7 +434,7 @@ pageNo: 1, pageSize: 100, }).then(res => { - this.scanMessage =result.scanMessage + this.scanMessage = result.scanMessage let resultList = res.data.list; if (resultList.length > 0) { resultList.forEach(item => { @@ -448,15 +450,15 @@ console.log('list', list) if (list.length > 1) { - this.$refs.jobList.openList(list,result.scanMessage.indexOf('ASN')>-1) + this.$refs.jobList.openList(list, result.scanMessage.indexOf('ASN') > -1) } else { - this.selectItem(list[0],result.scanMessage.indexOf('ASN')>-1) + this.selectItem(list[0], result.scanMessage.indexOf('ASN') > -1) } } else { - this.showMessage("未查找到任务\n"+"扫描["+result.scanMessage+"]") + this.showMessage("未查找到任务\n" + "扫描[" + result.scanMessage + "]") } }).catch(error => { - this.showMessage(error+"\n扫描["+result.scanMessage+"]") + this.showMessage(error + "\n扫描[" + result.scanMessage + "]") }) } catch (e) { diff --git a/src/pages/purchaseReturn/job/returnDetail.vue b/src/pages/purchaseReturn/job/returnDetail.vue index 09cb8434..11708552 100644 --- a/src/pages/purchaseReturn/job/returnDetail.vue +++ b/src/pages/purchaseReturn/job/returnDetail.vue @@ -458,15 +458,21 @@ }, closeScanPopup() { - this.$refs.scanPopup.closeScanPopup(); + if(this.$refs.scanPopup){ + this.$refs.scanPopup.closeScanPopup(); + } }, scanPopupGetFocus() { - this.$refs.scanPopup.packGetFocus(); + if(this.$refs.scanPopup){ + this.$refs.scanPopup.packGetFocus(); + } }, scanPopupLoseFocus() { - this.$refs.scanPopup.packLoseFocus(); + if(this.$refs.scanPopup){ + this.$refs.scanPopup.packLoseFocus(); + } }, openDetail(item) { @@ -474,6 +480,7 @@ }, showMessage(message) { + this.scanPopupLoseFocus(); this.$refs.comMessage.showMessage(message, res => { if (res) { this.scanPopupGetFocus() @@ -482,6 +489,7 @@ }, showErrorMessage(message) { + this.scanPopupLoseFocus(); this.$refs.comMessage.showErrorMessage(message, res => { if (res) { this.scanPopupGetFocus() diff --git a/src/pages/purchaseReturn/record/returnRecord.vue b/src/pages/purchaseReturn/record/returnRecord.vue index fea85dee..06a41339 100644 --- a/src/pages/purchaseReturn/record/returnRecord.vue +++ b/src/pages/purchaseReturn/record/returnRecord.vue @@ -211,6 +211,7 @@ } } calcHandleQty(this.detailSource); + this.scanPopupGetFocus() }, updateData() { diff --git a/src/pages/putaway/job/putawayDetail.vue b/src/pages/putaway/job/putawayDetail.vue index 494f8686..a9d9fbe2 100644 --- a/src/pages/putaway/job/putawayDetail.vue +++ b/src/pages/putaway/job/putawayDetail.vue @@ -1,14 +1,14 @@