From 1331e9edaf52ec0820dd1c7efc605127aa3a2c36 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期三, 26 十一月 2025 20:29:28 +0800
Subject: [PATCH] 提交

---
 项目代码/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js |  151 +++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 143 insertions(+), 8 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js"
index 51aa666..5cc22c5 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js"
@@ -44,6 +44,140 @@
         }
       },
       {
+                name: '鎾ら攢缁勭洏',
+                type: 'primary',
+                value: '鎾ら攢缁勭洏',
+                onClick: function () {
+                    console.log('鎾ら攢缁勭洏鎸夐挳琚偣鍑�');
+                    const mountNode = document.createElement('div');
+                    document.body.appendChild(mountNode);
+
+                    // 鍝嶅簲寮忚〃鍗曟暟鎹細鎵樼洏鍙凤紙蹇呭~锛�
+                    const formData = reactive({
+                        palletCode: '' // 鎵樼洏鍙疯緭鍏ユ
+                    });
+
+                    // 鎻愪氦琛ㄥ崟鐨勭粺涓�閫昏緫
+                    const submitForm = async () => {
+                        const formRef = vnode.component.refs.cancelPalletForm;
+                        try {
+                            // 鎵ц琛ㄥ崟鏍¢獙锛堟墭鐩樺彿蹇呭~锛�
+                            await formRef.validate();
+                        } catch (err) {
+                            ElMessage.warning('璇疯緭鍏ユ湁鏁堢殑鎵樼洏鍙�');
+                            return;
+                        }
+
+                        // 鍙戣捣鎾ら攢缁勭洏璇锋眰
+                        try {
+                            //console.log('鍙戣捣鎾ら攢缁勭洏璇锋眰锛屾墭鐩樺彿锛�', formData.palletCode.trim());
+                            const response = await http.post('/api/InboundOrder/UndoPalletGroup?palletCode='+formData.palletCode.trim());
+                              
+
+                            const { status, message, data } = response;
+                            if (status) {
+                                ElMessage.success(`鎾ら攢缁勭洏鎴愬姛锛屾墭鐩樺彿锛�${formData.palletCode.trim()}`);
+                                this.refresh(); // 鎴愬姛鍚庡埛鏂板垪琛�
+                                // 鍏抽棴瀵硅瘽妗�
+                                render(null, mountNode);
+                                document.body.removeChild(mountNode);
+                            } else {
+                                console.log('鎾ら攢缁勭洏澶辫触锛屽悗绔彁绀猴細', message);
+                                ElMessage.error(message || data?.message || '鎾ら攢缁勭洏澶辫触');
+                                selectPalletCodeInput(); // 閫変腑杈撳叆妗嗘柟渚块噸鏂拌緭鍏�
+                            }
+                        } catch (error) {
+                            console.error('鎾ら攢缁勭洏璇锋眰寮傚父锛�', error);
+                            ElMessage.error('缃戠粶寮傚父鎴栨帴鍙i敊璇紝璇风◢鍚庨噸璇�');
+                            selectPalletCodeInput();
+                        }
+                    };
+
+                    // 閫変腑杈撳叆妗嗘枃鏈紙鏂逛究閲嶆柊杈撳叆锛�
+                    const selectPalletCodeInput = () => {
+                        setTimeout(() => {
+                            const inputRef = vnode.component.refs.palletCodeInput;
+                            if (inputRef) {
+                                const targetInput = inputRef.$el?.querySelector('input') || inputRef;
+                                targetInput?.focus();
+                                targetInput?.select();
+                            }
+                        }, 100);
+                    };
+
+                    // 鍒涘缓瀵硅瘽妗哣Node
+                    const vnode = createVNode(ElDialog, {
+                        title: '鎾ら攢缁勭洏',
+                        width: '400px',
+                        modelValue: true,
+                        appendToBody: true,
+                        onOpened: () => {
+                            // 瀵硅瘽妗嗘墦寮�鍚庤嚜鍔ㄨ仛鐒﹁緭鍏ユ
+                            setTimeout(() => {
+                                const inputRef = vnode.component.refs.palletCodeInput;
+                                inputRef?.focus();
+                            }, 100);
+                        },
+                        'onUpdate:modelValue': (isVisible) => {
+                            if (!isVisible) {
+                                render(null, mountNode);
+                                document.body.removeChild(mountNode);
+                            }
+                        }
+                    }, {
+                        default: () => h(ElForm, {
+                            model: formData,
+                            rules: {
+                                palletCode: [
+                                    { required: true, message: '璇疯緭鍏ユ墭鐩樺彿', trigger: ['blur', 'enter'] },
+                                    { min: 1, max: 50, message: '鎵樼洏鍙烽暱搴︿笉鑳借秴杩�50涓瓧绗�', trigger: ['blur', 'input'] }
+                                ]
+                            },
+                            ref: 'cancelPalletForm'
+                        }, [
+                            // 鎵樼洏鍙疯緭鍏ラ」
+                            h(ElFormItem, { label: '鎵樼洏鍙�', prop: 'palletCode', required: true }, [
+                                h(ElInput, {
+                                    type: 'text',
+                                    modelValue: formData.palletCode,
+                                    'onUpdate:modelValue': (val) => {
+                                        formData.palletCode = val;
+                                    },
+                                    ref: 'palletCodeInput',
+                                    placeholder: '鎵爜杈撳叆鎴栨墜鍔ㄨ緭鍏ユ墭鐩樺彿',
+                                    maxLength: 50,
+                                    // 鐩戝惉鍥炶溅浜嬩欢锛堟壂鐮佹灙榛樿浼氬彂閫佸洖杞︼級
+                                    onKeydown: (e) => {
+                                        if (e.key === 'Enter') {
+                                            e.preventDefault();
+                                            submitForm();
+                                        }
+                                    }
+                                })
+                            ]),
+                            // 搴曢儴鎸夐挳鍖�
+                            h('div', { style: { textAlign: 'right', marginTop: '16px' } }, [
+                                h(ElButton, {
+                                    type: 'text',
+                                    onClick: () => {
+                                        render(null, mountNode);
+                                        document.body.removeChild(mountNode);
+                                        ElMessage.info('鍙栨秷鎾ら攢缁勭洏');
+                                    }
+                                }, '鍙栨秷'),
+                                h(ElButton, {
+                                    type: 'primary',
+                                    onClick: submitForm.bind(this) // 缁戝畾this涓婁笅鏂�
+                                }, '纭鎾ら攢')
+                            ])
+                        ])
+                    });
+
+                    vnode.appContext = this.$.appContext;
+                    render(vnode, mountNode);
+                }
+            },
+      {
   name: '鍒嗘壒鍏ュ簱',
   type: 'primary',
   value: '鍒嗘壒鍏ュ簱',
@@ -113,19 +247,19 @@
     const getWarehouseList = async () => {
       isLoadingWarehouses.value = true;
       try {
-        const { data, status } = await http.post('/api/Warehouse/GetWarehouseTypes'); 
+        const { data, status } = await http.post('/api/LocationInfo/GetLocationTypes'); 
         if (status && Array.isArray(data)) {
           // 鏍煎紡鍖栦粨搴撻�夐」锛氶�傞厤ElSelect鐨刲abel-value鏍煎紡
           warehouses.value = data.map(item => ({
-            label: item.warehouseTypeDesc,
-            value: item.warehouseType  
+            label: item.locationTypeDesc,
+            value: item.locationType  
           }));
         } else {
-          ElMessage.error('鑾峰彇浠撳簱鍒楄〃澶辫触');
+          ElMessage.error('鑾峰彇鍖哄煙鍒楄〃澶辫触');
           warehouses.value = [];
         }
       } catch (err) {
-        ElMessage.error('浠撳簱鏁版嵁璇锋眰寮傚父锛岃绋嶅悗閲嶈瘯');
+        ElMessage.error('鍖哄煙鏁版嵁璇锋眰寮傚父锛岃绋嶅悗閲嶈瘯');
         warehouses.value = [];
       } finally {
         isLoadingWarehouses.value = false;
@@ -202,19 +336,19 @@
             { required: true, message: '璇疯緭鍏ユ枡绠辩爜', trigger: ['blur', 'enter'] }
           ],
           warehouseCode:[
-            { required: true, message: '璇烽�夋嫨浠撳簱', trigger: ['change', 'blur'] }
+            { required: true, message: '璇烽�夋嫨鍖哄煙', trigger: ['change', 'blur'] }
           ]
         },
         ref: 'batchInForm'
       }, [
         //浠撳簱鏁版嵁
-        h(ElFormItem, { label: '浠撳簱', prop: 'warehouseCode', required: true }, [
+        h(ElFormItem, { label: '鍖哄煙', prop: 'warehouseCode', required: true }, [
           h(ElSelect, {
             modelValue: formData.warehouseCode,
             'onUpdate:modelValue': (val) => {
               formData.warehouseCode = val;
             },
-            placeholder: '璇烽�夋嫨鍏ュ簱浠撳簱',
+            placeholder: '璇烽�夋嫨鍏ュ簱鍖哄煙',
             filterable: true, // 鏀寔鎼滅储浠撳簱
             loading: isLoadingWarehouses.value, // 鍔犺浇鐘舵��
             style: { width: '100%' }
@@ -281,6 +415,7 @@
       searchBefore(param) {
         //鐣岄潰鏌ヨ鍓�,鍙互缁檖aram.wheres娣诲姞鏌ヨ鍙傛暟
         //杩斿洖false锛屽垯涓嶄細鎵ц鏌ヨ
+       this.searchFormFields.orderType=[0]
         return true;
       },
       searchAfter(result) {

--
Gitblit v1.9.3