入库木箱扫码优化

This commit is contained in:
2024-05-13 16:41:17 +08:00
parent 199bc7185e
commit b0b6916585
7 changed files with 83 additions and 330 deletions

View File

@@ -8,9 +8,11 @@
<span class="filter_label">木箱</span>
</view>
<view class="filter_input_wraper">
<search-box-mx :focused="focused" @inputDel="inputDel" @inputScan="inputScan" @toPhone="toPhone">
<input type="text" class="scan_input" v-model="val1" :focus="focused" @input="onKeyInput" @focus="onFocus" @blur="onBlur">
</search-box-mx>
<search-box-mx
ref="scanChild"
v-model="val1"
@handleChange="handleChange"
/>
</view>
</view>
<view class="filter_item">
@@ -97,14 +99,14 @@
options1: [],
index1: '',
dataList: [],
disabled: false,
focused: true
disabled: false
};
},
created () {
this._getStorSect()
},
mounted () {
this.$refs.scanChild.handleFocus()
setTimeout(() => {
uni.hideKeyboard()
}, 500)
@@ -125,7 +127,6 @@
},
/** 初始化查询 */
async _boxQuery (e) {
console.log(11)
let res = await boxQuery(e, '3')
this.dataList = [...res.data]
},
@@ -152,39 +153,7 @@
this.disabled = false
}
},
onKeyInput (event) {
var value = event.detail.value
value=value.replace(/[^\w\.\/]/ig,'')
if (value.length !== 14) {
this.$nextTick(() => {
this.val1 = ''
})
uni.hideKeyboard()
return
}
uni.hideKeyboard()
this._boxQuery(this.val1)
},
onFocus () {
this.focused = true
setTimeout(() => {
uni.hideKeyboard()
}, 300)
},
onBlur () {
this.focused = false
},
inputDel () {
this.val1 = ''
},
inputScan () {
this.focused = true
setTimeout(() => {
uni.hideKeyboard()
}, 300)
},
toPhone (e) {
this.val1 = e
handleChange (e) {
this._boxQuery(this.val1)
}
}