获取焦点优化

This commit is contained in:
2024-05-13 17:09:27 +08:00
parent b0b6916585
commit d2736c625d
8 changed files with 33 additions and 11 deletions

View File

@@ -18,8 +18,8 @@
</view> </view>
<view class="filter_input_wraper"> <view class="filter_input_wraper">
<search-box <search-box
ref="scanChild"
v-model="val2" v-model="val2"
:focused="true"
@handleChange="handleChange" @handleChange="handleChange"
/> />
</view> </view>
@@ -112,6 +112,9 @@
created () { created () {
this._queryRawFoilList() this._queryRawFoilList()
}, },
mounted () {
this.$refs.scanChild.handleFocus()
},
methods: { methods: {
searchList () { searchList () {
this.pkId = '' this.pkId = ''

View File

@@ -8,7 +8,7 @@
<span class="filter_label">木箱</span> <span class="filter_label">木箱</span>
</view> </view>
<view class="filter_input_wraper"> <view class="filter_input_wraper">
<search-box v-model="val1" :focused="true" @handleChange="handleChange1" <search-box ref="scanChild" v-model="val1" @handleChange="handleChange1"
/> />
</view> </view>
</view> </view>
@@ -44,6 +44,9 @@
disabled1: false disabled1: false
}; };
}, },
mounted () {
this.$refs.scanChild.handleFocus()
},
methods: { methods: {
handleChange1 (e) { handleChange1 (e) {
}, },

View File

@@ -20,8 +20,8 @@
</view> </view>
<view class="filter_input_wraper"> <view class="filter_input_wraper">
<search-box <search-box
ref="scanChild"
v-model="val2" v-model="val2"
:focused="true"
@handleChange="handleChange" @handleChange="handleChange"
/> />
</view> </view>
@@ -126,6 +126,9 @@
created () { created () {
// this._queryRawFoilList() // this._queryRawFoilList()
}, },
mounted () {
this.$refs.scanChild.handleFocus()
},
methods: { methods: {
searchList () { searchList () {
this.pkId = '' this.pkId = ''

View File

@@ -9,8 +9,8 @@
</view> </view>
<view class="filter_input_wraper"> <view class="filter_input_wraper">
<search-box <search-box
ref="scanChild"
v-model="val1" v-model="val1"
:focused="true"
@handleChange="handleChange" @handleChange="handleChange"
/> />
</view> </view>
@@ -77,6 +77,9 @@
disabled2: false disabled2: false
}; };
}, },
mounted () {
this.$refs.scanChild.handleFocus()
},
methods: { methods: {
handleChange (e) { handleChange (e) {
this._customerInfo(e) this._customerInfo(e)

View File

@@ -8,7 +8,7 @@
<span class="filter_label">木箱</span> <span class="filter_label">木箱</span>
</view> </view>
<view class="filter_input_wraper"> <view class="filter_input_wraper">
<search-box v-model="val1" :focused="true" @handleChange="handleChange1" <search-box ref="scanChild" v-model="val1" @handleChange="handleChange1"
/> />
</view> </view>
</view> </view>
@@ -44,6 +44,9 @@
disabled1: false disabled1: false
}; };
}, },
mounted () {
this.$refs.scanChild.handleFocus()
},
methods: { methods: {
handleChange1 (e) { handleChange1 (e) {
}, },

View File

@@ -8,7 +8,7 @@
<span class="filter_label">木箱</span> <span class="filter_label">木箱</span>
</view> </view>
<view class="filter_input_wraper"> <view class="filter_input_wraper">
<search-box v-model="val1" :focused="true" @handleChange="handleChange1" <search-box ref="scanChild" v-model="val1" @handleChange="handleChange1"
/> />
</view> </view>
</view> </view>
@@ -95,6 +95,9 @@
created () { created () {
this._stivtQuery(this.val1, this.val2) this._stivtQuery(this.val1, this.val2)
}, },
mounted () {
this.$refs.scanChild.handleFocus()
},
methods: { methods: {
handleChange1 (e) { handleChange1 (e) {
this._stivtQuery(e, this.val2) this._stivtQuery(e, this.val2)

View File

@@ -8,7 +8,7 @@
<span class="filter_label">木箱</span> <span class="filter_label">木箱</span>
</view> </view>
<view class="filter_input_wraper"> <view class="filter_input_wraper">
<search-box v-model="val1" :focused="true" @handleChange="handleChange1" <search-box ref="scanChild" v-model="val1" @handleChange="handleChange1"
/> />
</view> </view>
</view> </view>
@@ -84,6 +84,9 @@
this._virtualbillQuery(this.val1, this.val2) this._virtualbillQuery(this.val1, this.val2)
this._virtualbillType() this._virtualbillType()
}, },
mounted () {
this.$refs.scanChild.handleFocus()
},
methods: { methods: {
handleChange1 (e) { handleChange1 (e) {
this._virtualbillQuery(e, this.val2) this._virtualbillQuery(e, this.val2)

View File

@@ -9,7 +9,7 @@
</view> </view>
<view class="filter_input_wraper"> <view class="filter_input_wraper">
<!-- <search-box v-model="val1" :focused="true" @handleChange="handleChange1" --> <!-- <search-box v-model="val1" :focused="true" @handleChange="handleChange1" -->
<search-box v-model="val1" :focused="focusedStatus" @handleChange="handleChange1" <search-box ref="scanChild" v-model="val1" @handleChange="handleChange1"
/> />
</view> </view>
</view> </view>
@@ -77,7 +77,6 @@
}, },
data() { data() {
return { return {
focusedStatus: true,
val1: '', val1: '',
val2: '', val2: '',
billCode: '', billCode: '',
@@ -90,6 +89,9 @@
this.billCode = option.billcode this.billCode = option.billcode
this._virtualivtQuery() this._virtualivtQuery()
}, },
mounted () {
this.$refs.scanChild.handleFocus()
},
methods: { methods: {
handleChange1 (e) { handleChange1 (e) {
this._virtualivtQuery() this._virtualivtQuery()
@@ -109,7 +111,6 @@
this.net_weight_num = res.net_weight_num this.net_weight_num = res.net_weight_num
}, },
async _virtualoutConfirm () { async _virtualoutConfirm () {
this.focusedStatus = false
if (!this.dataList.length) { if (!this.dataList.length) {
return return
} }
@@ -124,7 +125,7 @@
title: res.message, title: res.message,
icon: 'none' icon: 'none'
}) })
this.focusedStatus = true this.$refs.scanChild.handleFocus()
} catch (e) { } catch (e) {
this.disabled1 = false this.disabled1 = false
} }