From 91ead18d0e92b6e1ed916c5159f3431bf2071a56 Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期五, 12 十二月 2025 13:59:40 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu

---
 项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/EmptyTrayInbound.vue |  169 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 169 insertions(+), 0 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"
new file mode 100644
index 0000000..7105202
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/EmptyTrayInbound.vue"
@@ -0,0 +1,169 @@
+<template>
+    <vol-box v-model="show" title="绌烘墭鍏ュ簱" :width="800" :height="1200">
+        <template #content>
+            <el-form ref="form" :model="form" label-width="90px">
+                <el-form-item label="鍏ュ簱鍖哄煙:">
+                    <el-select v-model="form.locationType" placeholder="璇烽�夋嫨鍏ュ簱鍖哄煙">
+                        <el-option v-for="item in locationTypes" :key="item.locationType" :label="item.locationTypeDesc"
+                            :value="item.locationType" />
+                    </el-select>
+                </el-form-item>
+
+                <el-form-item label="鎵樼洏鏉$爜:">
+                    <el-input v-model="form.palletCode" placeholder="璇锋壂鎻�/杈撳叆鎵樼洏鏉$爜" @keyup.enter="submit" @keyup.13="submit"
+                        clearable maxlength="50" @paste="handlePaste" @input="handleInput" ref="boxCodeInput" />
+                </el-form-item>
+            </el-form>
+        </template>
+
+        <template #footer>
+            <div class="dialog-footer">
+                <el-button type="primary" @click="submit">纭</el-button>
+                <el-button @click="show = false">鍏抽棴</el-button>
+            </div>
+        </template>
+    </vol-box>
+</template>
+  
+<script>
+import VolBox from '@/components/basic/VolBox.vue'
+
+export default {
+    components: { VolBox },
+    props: {
+        value: { type: Boolean, default: false }
+    },
+    data() {
+        return {
+            show: false,
+            form: {
+                palletCode: '',
+                locationType: ''
+            },
+            locationTypes: []
+        }
+    },
+    methods: {
+        open() {
+            this.show = true
+            this.getData();
+            this.$nextTick(() => {
+                this.focusInput()
+            })
+        },
+
+        async getData() {
+            try {
+                const { data } = await this.http.post("api/LocationInfo/GetLocationTypes")
+                this.locationTypes = data
+            } catch (e) {
+                this.$message.error('鑾峰彇鍖哄煙绫诲瀷澶辫触')
+            }
+        },
+
+        async submit() {
+            if (!this.form.palletCode) {
+                this.$message.warning('璇疯緭鍏ユ墭鐩樻潯鐮�')
+                this.focusInput()
+                return
+            }
+
+            if (!this.form.locationType) {
+                this.$message.warning('璇烽�夋嫨鍏ュ簱鍖哄煙')
+                return
+            }
+
+            try {
+                let param = {
+                    WarehouseCode: this.form.locationType,
+                    PalletCode: this.form.palletCode
+                }
+
+                const { status, message } = await this.http.post(
+                    `/api/InboundOrder/EmptyMaterielGroup`,
+                    param
+                )
+
+                if (status) {
+                    this.$message.success("缁勭洏鎴愬姛");
+                    // 娓呯┖杈撳叆妗嗘暟鎹�
+                    this.form.palletCode = '';
+                    // 鑱氱劍骞堕�変腑杈撳叆妗�
+                    this.focusAndSelectInput();
+                } else {
+                    this.$message.error(message || '鎿嶄綔澶辫触');
+                    // 澶辫触鏃朵笉娓呯悊鏁版嵁锛屼絾鑱氱劍骞堕�変腑杈撳叆妗嗭紝鏂逛究淇敼
+                    this.focusAndSelectInput();
+                }
+            } catch (error) {
+                this.$message.error('璇锋眰寮傚父');
+                // 寮傚父鏃朵篃涓嶆竻鐞嗘暟鎹�
+                this.focusAndSelectInput();
+            }
+        },
+
+        // 鎵弿鏋紭鍖栧鐞�
+        handleInput(value) {
+            // 杩囨护闈炴暟瀛楀拰鏉$爜甯哥敤瀛楃
+            this.form.palletCode = value.replace(/[^a-zA-Z0-9\-]/g, '')
+        },
+
+        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();
+            }
+        }
+    }
+}
+</script>
+  
+<style scoped>
+.dialog-footer {
+    text-align: right;
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3