Browse Source

优化扫描

lijuncheng0816
lijuncheng 3 months ago
parent
commit
1395fb7523
  1. 49
      src/mycomponents/scan/winComScan.vue
  2. 4
      src/pages/package/coms/comScanPackagePack.vue

49
src/mycomponents/scan/winComScan.vue

@ -4,15 +4,11 @@
<view>
<view class="pop_tab">
<view class="tab_info">
<view class="conbox" >
<textarea
v-model="scanMsg" trim="all" maxlength="1000" style="margin-left: 5px;width: 90%;"
:placeholder="placeholderValue"
:focus="boxfocus"
@blur="handleBlur"
@focus="handleFocus"
@input="handelScanMsg" :cursor="cursorIndex" ></textarea>
</view>
<view class="conbox">
<textarea v-model="scanMsg" trim="all" maxlength="1000" style="margin-left: 5px;width: 90%;"
:placeholder="placeholderValue" :focus="boxfocus" @blur="handleBlur" @focus="handleFocus"
@input="handelScanMsg" ></textarea>
</view>
<view class="uni-flex uni-row space-between u-col-center">
<!-- <view class="paizhao" @click="scanQRCode()" v-if="true">
@ -20,7 +16,7 @@
</view> -->
<view class="uni-flex">
<button class="clean_scan_btn" @touchend.prevent="clearScanValue()">清空</button>
<button class="clean_scan_btn" @touchend.prevent="clearScanValue()">清空</button>
<button class="scan_btn" @click="clickScanMsg()">扫描</button>
</view>
</view>
@ -37,8 +33,7 @@
</view>
</view>
<u-line class='line_color' style='padding-top: 10rpx;padding-bottom: 20rpx;'></u-line>
<scroll-view scroll-y="true" class="scroll-view" v-if="expand"
style="height: 70px;">
<scroll-view scroll-y="true" class="scroll-view" v-if="expand" style="height: 70px;">
<view class="uni-flex u-col" v-for="(item,index) in scanList">
<view style="width: 100%;max-height: 100px;">
<view class="uni-flex u-row space-between u-col-center" @click="showItem(item)">
@ -59,7 +54,7 @@
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script >
<script>
import {
getLabelInfo
} from '../../common/label.js';
@ -139,7 +134,7 @@
},
clearScanValue() {
this.scanMsg = ''
this.cursorIndex =0
// this.cursorIndex = 0
this.getfocus();
},
clickScanMsg() {
@ -153,11 +148,13 @@
// mask: true
// })
let that = this;
let index = that.scanMsg.indexOf('\n');
if (index >= 0) {
// if(index==-1){
// that.scanMsg =that.scanMsg + "\n";
// }
if (that.scanMsg.includes('\n')) {
// 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();
@ -176,7 +173,7 @@
getLabelInfo(content, this.headerType, callback => {
// uni.hideLoading();
let scanResult = callback;
scanResult.scanMessage=content
scanResult.scanMessage = content
if (scanResult.success) {
that.clear();
// that.getfocus();//
@ -191,14 +188,13 @@
})
}
});
}, 500);
}, 200);
}
},
handleFocus(){
},
handleFocus() {},
handleBlur(){
handleBlur() {
// setTimeout(res=>{
// uni.hideKeyboard();
// },200)
@ -216,14 +212,13 @@
});
},
clear() {
if(this.clearResult)
{
this.cursorIndex = 0;
this.scanMsg = ''
if (this.clearResult) {
this.scanMsg = ""
// this.cursorIndex = 0;
}
},
iconClick(type) {
this.$emit("clearResult", this.scanMsgk);
this.$emit("clearResult", this.scanMsg);
},
expands() {
this.expand = !this.expand;

4
src/pages/package/coms/comScanPackagePack.vue

@ -353,8 +353,10 @@ import { getDirectoryItemArray } from '@/common/directory';
let record = this.creatRecord(label, balance, packageInfo);
batch.Records.push(record);
this.calcBatchHandleQty(batch);
this.packGetFocus();
this.$emit('refresh');
setTimeout(res=>{
this.packGetFocus();
},100)
},
swipeClick(e, item, index) {

Loading…
Cancel
Save