Browse Source

优化扫描框 2024/7/8 19:59:20

pull/1/head
张立 8 months ago
parent
commit
5e3a333c90
  1. 3
      src/mycomponents/scan/winComScan.vue
  2. 7
      src/mycomponents/scan/winComScanBalance.vue
  3. 2
      src/mycomponents/scan/winScanLocation.vue
  4. 1
      src/mycomponents/scan/winScanPackJob.vue
  5. 3
      src/pages/purchaseReceipt/job/receiptJob.vue

3
src/mycomponents/scan/winComScan.vue

@ -4,7 +4,7 @@
<view class="pop_tab"> <view class="pop_tab">
<view class="tab_info"> <view class="tab_info">
<view class="conbox"> <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" @input="handelScanMsg" :cursor="cursorIndex"></textarea> <textarea inputmode="none" v-model="scanMsg" trim="all" maxlength="1000" style="margin-left: 5px; width: 90%" :focus="boxfocus" :placeholder="placeholderValue" @input="handelScanMsg" :cursor="cursorIndex"></textarea>
</view> </view>
<view class="uni-flex uni-row space-between u-col-center"> <view class="uni-flex uni-row space-between u-col-center">
@ -180,6 +180,7 @@ const getfocus = () => {
const losefocus = () => { const losefocus = () => {
nextTick((r) => { nextTick((r) => {
boxfocus.value = false boxfocus.value = false
uni.hideKeyboard()
}) })
} }
const clear = () => { const clear = () => {

7
src/mycomponents/scan/winComScanBalance.vue

@ -95,6 +95,10 @@ export default {
getScanResult(result) { getScanResult(result) {
this.resultData = result this.resultData = result
if (!result.package) {
this.showErrorMessage(`${result.label.code}包装信息为空`)
return
}
this.getItemCodeType(result.package.itemCode, (callBack) => { this.getItemCodeType(result.package.itemCode, (callBack) => {
this.queryBalance(this.resultData) this.queryBalance(this.resultData)
}) })
@ -167,6 +171,9 @@ export default {
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, (res) => { this.$refs.comMessage.showErrorMessage(message, (res) => {
if (res) { if (res) {
if (this.$refs.comscan) {
this.$refs.comscan.getfocus()
}
} }
}) })
}, },

2
src/mycomponents/scan/winScanLocation.vue

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

1
src/mycomponents/scan/winScanPackJob.vue

@ -50,6 +50,7 @@ const openScanPopup = () => {
// //
const closeScanPopup = (content) => { const closeScanPopup = (content) => {
show.value = false show.value = false
comscan.value.losefocus()
emit('close', '') emit('close', '')
} }
// //

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

@ -265,6 +265,9 @@ const switchChangeWait = (state, jobStatus) => {
const showMessage = (message) => { const showMessage = (message) => {
comMessageRef.value.showErrorMessage(message, (res) => { comMessageRef.value.showErrorMessage(message, (res) => {
if (res) { if (res) {
if (scanPopup.value) {
scanPopup.value.packGetFocus()
}
} }
}) })
} }

Loading…
Cancel
Save