From d741e7a7ad7de5045e5c6b6145d9da1783cadecd Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期二, 13 一月 2026 09:55:03 +0800
Subject: [PATCH] Merge branch 'htq20251215' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu into htq20251215

---
 项目代码/WIDESEA_WMSClient/src/extension/inbound/allocateinboundOrder.js |  273 ++++++++++++++----------------------------------------
 1 files changed, 71 insertions(+), 202 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/allocateinboundOrder.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/allocateinboundOrder.js"
index 3a6458b..2e7a4ed 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/allocateinboundOrder.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/allocateinboundOrder.js"
@@ -5,12 +5,13 @@
 import { ElDialog , ElForm, ElFormItem, ElInput, ElButton, ElMessage ,ElSelect ,ElOption } from 'element-plus'; // 寮曞叆ElMessage锛岃В鍐虫彁绀烘棤鍙嶅簲
 import gridBody from '../inbound/extend/Pallet.vue'
 import gridHeader from './extend/EmptyTrayInbound.vue'
+import gridFooter from "./extend/UndoPalletGroup.vue";
 let extension = {
     components: {
       //鏌ヨ鐣岄潰鎵╁睍缁勪欢
       gridHeader: gridHeader,
       gridBody: gridBody,
-      gridFooter: '',
+      gridFooter: gridFooter,
       //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
       modelHeader: '',
       modelBody: '',
@@ -44,207 +45,8 @@
       //     this.$emit('openPalletDialog', targetRow.orderNo);
       //   }
       // },
-      {
-                name: '鎾ら攢缁勭洏',
-                type: 'primary',
-                value: '鎾ら攢缁勭洏',
-                onClick: function () {
-                    console.log('鎾ら攢缁勭洏鎸夐挳琚偣鍑�');
-                    const mountNode = document.createElement('div');
-                    document.body.appendChild(mountNode);
-
-                    // 鍝嶅簲寮忚〃鍗曟暟鎹細鎵樼洏鍙凤紙蹇呭~锛�
-                    const formData = reactive({
-                        palletCode: '', // 鎵樼洏鍙疯緭鍏ユ
-                        barcode:''
-                    });
-
-                    // 鎻愪氦琛ㄥ崟鐨勭粺涓�閫昏緫
-                    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()+'&barcode='+formData.barcode.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(ElFormItem,{label: '鏉$爜', prop: 'barcode'},[
-                              h(ElInput, {
-                                type: 'text',
-                                modelValue: formData.barcode,
-                                'onUpdate:modelValue': (val) => {
-                                    formData.barcode = val;
-                                },
-                                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: '鍒嗘壒鍏ュ簱',
-  onClick: async function () { 
-    console.log('鍒嗘壒鍏ュ簱鎸夐挳琚偣鍑伙紝寮�濮嬫牎楠�');
-    const selectedRows = this.$refs.table.getSelected();
-
-    // 鏍¢獙1锛氭槸鍚﹂�変腑琛岋紙鑷冲皯閫夋嫨涓�鏉★級
-    if (selectedRows.length === 0) {
-      console.log('鏍¢獙涓嶉�氳繃锛氭湭閫変腑浠讳綍鍗曟嵁');
-      ElMessage.warning('璇烽�夋嫨鑷冲皯涓�鏉″崟鎹�');
-      return;
-    }
-
-    // 鏀堕泦鎵�鏈夐�変腑鍗曟嵁鐨勭紪鍙凤紙杩囨护鏃犲崟鎹彿鐨勫紓甯歌锛�
-    const inboundOrderNos = selectedRows
-      .filter(row => row.orderNo)
-      .map(row => row.orderNo);
-
-    // 鏍¢獙2锛氭槸鍚︽湁鏈夋晥鍗曟嵁鍙�
-    if (inboundOrderNos.length === 0) {
-      console.log('鏍¢獙涓嶉�氳繃锛氶�変腑鍗曟嵁鏃犳湁鏁堢紪鍙�');
-      ElMessage.warning('閫変腑鐨勫崟鎹腑鏃犳湁鏁堢紪鍙凤紝璇烽噸鏂伴�夋嫨');
-      return;
-    }
-
-    try {
-      console.log('鍙戣捣鍒嗘壒鍏ュ簱璇锋眰锛屽弬鏁帮細', { inboundOrderNos});
-      const response = await http.post('/api/InboundOrder/BatchOrderFeedbackToMes', {
-        orderNos: inboundOrderNos, 
-        inout:1
-      });
-
-      const { status, message, data } = response;
-      if (status) {
-        console.log('鍒嗘壒鍏ュ簱鎴愬姛锛屽悗绔繑鍥烇細', data);
-        ElMessage.success(`鍒嗘壒鍏ュ簱鎴愬姛锛佸叡澶勭悊${inboundOrderNos.length}鏉″崟鎹甡);
-        this.refresh(); // 鍏ュ簱鎴愬姛鍚庡埛鏂板垪琛紙澶嶇敤鍘熸湁閫昏緫锛�
-      } else {
-        console.log('鍒嗘壒鍏ュ簱澶辫触锛屽悗绔彁绀猴細', message);
-        ElMessage.error(message || data?.message || '鍒嗘壒鍏ュ簱澶辫触');
-      }
-    } catch (error) {
-      console.error('鍒嗘壒鍏ュ簱璇锋眰寮傚父锛�', error);
-      ElMessage.error('缃戠粶寮傚父鎴栨帴鍙i敊璇紝璇风◢鍚庨噸璇�');
-    }
-  }
-},], box: [], detail: [] }, 
+      
+], box: [], detail: [] }, 
     methods: {
        //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
       onInit() {  
@@ -260,6 +62,73 @@
                this.$refs.gridHeader.open();
             }
         }
+
+        var UndoPalletGroupBtn = this.buttons.find(
+        (x) => x.value == "UndoPalletGroup"
+      );
+      if (UndoPalletGroupBtn != null) {
+        UndoPalletGroupBtn.onClick = () => {
+          this.$refs.gridFooter.open();
+        };
+      }
+
+      var BatchInOrderFeedbackToMesBtn = this.buttons.find(
+        (x) => x.value == "BatchInOrderFeedbackToMes"
+      );
+      if (BatchInOrderFeedbackToMesBtn != null) {
+        BatchInOrderFeedbackToMesBtn.onClick = () => {
+          var rows = this.$refs.table.getSelected();
+          // 鏍¢獙鏄惁鏈夐�変腑鏁版嵁
+          if (!rows || rows.length === 0) {
+            return this.$Message.error("璇峰厛閫夋嫨闇�瑕佸鐞嗙殑鍗曟嵁");
+          }
+          if (rows.length > 1) {
+            return this.$Message.error("璇烽�夋嫨涓�鏉℃暟鎹�");
+          }
+          this.http.post(`api/Inbound/BatchInOrderFeedbackToMes?id=${rows[0].id}`, {}, "鏁版嵁澶勭悊涓�...")
+            .then((x) => {
+              if (x.status) {
+                this.$Message.success(x.message);
+                this.refresh();
+              } else {
+                return this.$Message.error(x.message);
+              }
+            })
+            .catch((error) => {
+              // 澧炲姞寮傚父鎹曡幏锛屽鐞嗙綉缁滈敊璇瓑鎯呭喌
+              //_this.$Message.error('璇锋眰澶辫触锛�' + (error.message || '鏈煡閿欒'));
+            });
+        };
+      }
+
+      var CloseOrderBtn = this.buttons.find(
+        (x) => x.value == "CloseOrder"
+      );
+      if (CloseOrderBtn != null) {
+        CloseOrderBtn.onClick = () => {
+          var rows = this.$refs.table.getSelected();
+          // 鏍¢獙鏄惁鏈夐�変腑鏁版嵁
+          if (!rows || rows.length === 0) {
+            return this.$Message.error("璇峰厛閫夋嫨闇�瑕佸叧闂殑鍗曟嵁");
+          }
+          if (rows.length > 1) {
+            return this.$Message.error("璇烽�夋嫨涓�鏉″崟鎹�");
+          }
+          this.http.post(`api/InboundOrder/HandCloseOrder?orderIds=${rows[0].orderNo}`, {}, "鏁版嵁澶勭悊涓�...")
+            .then((x) => {
+              if (x.status) {
+                this.$Message.success(x.message);
+                this.refresh();
+              } else {
+                return this.$Message.error(x.message);
+              }
+            })
+            .catch((error) => {
+              // 澧炲姞寮傚父鎹曡幏锛屽鐞嗙綉缁滈敊璇瓑鎯呭喌
+              //_this.$Message.error('璇锋眰澶辫触锛�' + (error.message || '鏈煡閿欒'));
+            });
+        };
+      }
       },
       onInited() {
         

--
Gitblit v1.9.3