From 0474bea600b73ee35b9ce0aac5b65ff720492d37 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期五, 12 十二月 2025 13:57:58 +0800
Subject: [PATCH] 提交
---
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/EmptyTrayInbound.vue | 68 +++++++++++++++++++++++++++++++---
1 files changed, 62 insertions(+), 6 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/EmptyTrayInbound.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/EmptyTrayInbound.vue"
index d80b08e..7105202 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/EmptyTrayInbound.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/EmptyTrayInbound.vue"
@@ -11,7 +11,7 @@
<el-form-item label="鎵樼洏鏉$爜:">
<el-input v-model="form.palletCode" placeholder="璇锋壂鎻�/杈撳叆鎵樼洏鏉$爜" @keyup.enter="submit" @keyup.13="submit"
- clearable maxlength="50" @paste="handlePaste" @input="handleInput" />
+ clearable maxlength="50" @paste="handlePaste" @input="handleInput" ref="boxCodeInput" />
</el-form-item>
</el-form>
</template>
@@ -47,6 +47,9 @@
open() {
this.show = true
this.getData();
+ this.$nextTick(() => {
+ this.focusInput()
+ })
},
async getData() {
@@ -61,6 +64,7 @@
async submit() {
if (!this.form.palletCode) {
this.$message.warning('璇疯緭鍏ユ墭鐩樻潯鐮�')
+ this.focusInput()
return
}
@@ -81,14 +85,20 @@
)
if (status) {
- this.$message.success("缁勭洏鎴愬姛")
- this.show = false
- this.$emit('refresh')
+ this.$message.success("缁勭洏鎴愬姛");
+ // 娓呯┖杈撳叆妗嗘暟鎹�
+ this.form.palletCode = '';
+ // 鑱氱劍骞堕�変腑杈撳叆妗�
+ this.focusAndSelectInput();
} else {
- this.$message.error(message || '鎿嶄綔澶辫触')
+ this.$message.error(message || '鎿嶄綔澶辫触');
+ // 澶辫触鏃朵笉娓呯悊鏁版嵁锛屼絾鑱氱劍骞堕�変腑杈撳叆妗嗭紝鏂逛究淇敼
+ this.focusAndSelectInput();
}
} catch (error) {
- this.$message.error('璇锋眰寮傚父')
+ this.$message.error('璇锋眰寮傚父');
+ // 寮傚父鏃朵篃涓嶆竻鐞嗘暟鎹�
+ this.focusAndSelectInput();
}
},
@@ -101,6 +111,52 @@
handlePaste(e) {
// 绮樿创鏃惰嚜鍔ㄦ彁浜�
setTimeout(this.submit, 100)
+ },
+
+ // 鑱氱劍骞堕�変腑杈撳叆妗�
+ focusAndSelectInput() {
+ this.$nextTick(() => {
+ setTimeout(() => {
+ const inputRef = this.$refs.boxCodeInput;
+ if (inputRef) {
+ // Element Plus/Element UI 鐨勫鐞嗘柟寮�
+ const inputEl = inputRef.$el ? inputRef.$el.querySelector('input') : inputRef;
+ if (inputEl) {
+ inputEl.focus();
+ inputEl.select();
+ }
+ }
+ }, 100);
+ });
+ },
+
+ // 鍙仛鐒﹁緭鍏ユ锛堜笉娓呯┖鏁版嵁锛�
+ focusInput() {
+ this.$nextTick(() => {
+ const inputRef = this.$refs.boxCodeInput;
+ if (inputRef) {
+ const inputEl = inputRef.$el ? inputRef.$el.querySelector('input') : inputRef;
+ inputEl?.focus();
+ }
+ });
+ },
+
+ // 娓呯┖琛ㄥ崟鏁版嵁
+ clearForm() {
+ this.form.palletCode = '';
+ // 涓嶆竻绌� locationType锛屼繚鎸佸尯鍩熼�夋嫨
+ }
+ },
+ watch: {
+ show(val) {
+ if (val) {
+ this.$nextTick(() => {
+ this.focusInput()
+ })
+ } else {
+ // 鍏抽棴寮圭獥鏃舵竻绌鸿〃鍗�
+ this.clearForm();
+ }
}
}
}
--
Gitblit v1.9.3