获取焦点优化

This commit is contained in:
2024-05-13 17:17:05 +08:00
parent bf3721c786
commit 93d5342ca1

View File

@@ -8,7 +8,7 @@
<span class="filter_label">木箱</span>
</view>
<view class="filter_input_wraper">
<search-box v-model="val1" :focused="focusedStatus" @handleChange="handleChange1"
<search-box ref="scanChild" v-model="val1" @handleChange="handleChange1"
/>
</view>
</view>
@@ -65,7 +65,6 @@
},
data() {
return {
focusedStatus: true,
val1: '',
billCode: '',
dataList: [],
@@ -76,6 +75,9 @@
this.billCode = option.billcode
this._stivtDtlQuery()
},
mounted () {
this.$refs.scanChild.handleFocus()
},
methods: {
handleChange1 (e) {
this._stivtDtlQuery()
@@ -90,24 +92,12 @@
url: '/pages/WarehouseManage/ProdDeliveryDtl?boxno=' + code + '&billcode=' + this.billCode
})
},
// handleTest () {
// this.focusedStatus = false
// this.val1 = ''
// setTimeout(()=>{
// uni.showToast({
// title: 'toast',
// icon: 'none'
// })
// this.focusedStatus = true
// },3000)
// },
/** 初始化查询 */
async _stivtDtlQuery () {
let res = await stivtDtlQuery(this.val1, this.billCode)
this.dataList = [...res.data]
},
async _stoutConfirm () {
this.focusedStatus = false
this.disabled1 = true
try {
let res = await stoutConfirm(this.val1)
@@ -118,7 +108,7 @@
title: res.message,
icon: 'none'
})
this.focusedStatus = true
this.$refs.scanChild.handleFocus()
} catch (e) {
this.disabled1 = false
}