Commit bc7ee194 by wusiyi

feat: 盘点扫码完光标回到输入框

parent cf91cfb9
...@@ -951,6 +951,7 @@ ...@@ -951,6 +951,7 @@
</ElDialog> </ElDialog>
<ElDialog v-model="scanDialogVisible" width="800px" title="盘点"> <ElDialog v-model="scanDialogVisible" width="800px" title="盘点">
<el-input <el-input
ref="scanInputRef"
v-model="scanInput" v-model="scanInput"
placeholder="请输入备货单号" placeholder="请输入备货单号"
style="width: 90%" style="width: 90%"
...@@ -2062,6 +2063,7 @@ const scan = async () => { ...@@ -2062,6 +2063,7 @@ const scan = async () => {
} finally { } finally {
loading.close() loading.close()
scanInput.value = '' scanInput.value = ''
scanInputRef.value?.focus()
} }
} }
/** /**
...@@ -2069,13 +2071,12 @@ const scan = async () => { ...@@ -2069,13 +2071,12 @@ const scan = async () => {
*/ */
const searchFormRef = ref() const searchFormRef = ref()
const searchBtnRef = ref() const searchBtnRef = ref()
const scanInputRef = ref<InstanceType<typeof ElInput>>()
useEnterKeyTrigger({ useEnterKeyTrigger({
formRef: searchFormRef, formRef: searchFormRef,
btnRef: searchBtnRef, btnRef: searchBtnRef,
callback: (event: KeyboardEvent) => { callback: () => {
console.log('回车键被按下', event)
search() search()
}, },
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment