Browse Source

优化扫描框

hella_online_20240829
lijuncheng 5 months ago
parent
commit
03843e32a6
  1. 5
      src/mycomponents/scan/winComScan.vue
  2. 8
      src/mycomponents/scan/winComScanBalance.vue
  3. 2
      src/mycomponents/scan/winScanLocation.vue
  4. 2
      src/mycomponents/scan/winScanPackJob.vue
  5. 10
      src/pages/purchaseReceipt/job/receiptDetail.vue
  6. 5
      src/pages/purchaseReceipt/job/receiptJob.vue

5
src/mycomponents/scan/winComScan.vue

@ -6,7 +6,7 @@
<view class="tab_info">
<view class="conbox">
<textarea inputmode="none" v-model="scanMsg" trim="all" maxlength="1000" style="margin-left: 5px;width: 90%;"
:focus="boxfocus" :placeholder="placeholderValue" @focus="getfocus" @blur="losefocus"
:focus="boxfocus" :placeholder="placeholderValue"
@input="handelScanMsg" :cursor="cursorIndex" ></textarea>
</view>
@ -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() {

8
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()
}
}
});
},

2
src/mycomponents/scan/winScanLocation.vue

@ -13,7 +13,7 @@
<view class="">
<view class="">
<win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="true"
:boxFocus="true" :isShowHistory="isShowHistory" headerType="">
:isShowHistory="isShowHistory" headerType="">
</win-com-scan>
</view>
</view>

2
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", '');
},

10
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -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)
})

5
src/pages/purchaseReceipt/job/receiptJob.vue

@ -342,6 +342,9 @@
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
if(this.$refs.scanPopup){
this.$refs.scanPopup.packGetFocus()
}
}
});
@ -362,8 +365,6 @@
},
getScanResult(result) {
try {
let filters = []
if (result.label.barType == "BarCode") {

Loading…
Cancel
Save