From 0ea40a1592de878592b2872b9c3005014233a136 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期一, 08 十二月 2025 21:24:11 +0800
Subject: [PATCH] 提交

---
 项目代码/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js |  271 +++++++++++++++++++++++++++++-------------------------
 1 files changed, 145 insertions(+), 126 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 328cdbf..cf21535 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,140 +44,159 @@
           this.$emit('openPalletDialog', targetRow.inboundOrderNo);
         }
       },
-      {
-        name: '鎾ら攢缁勭洏',
-        type: 'primary',
-        value: '鎾ら攢缁勭洏',
-        onClick: function () {
-          console.log('鎾ら攢缁勭洏鎸夐挳琚偣鍑�');
-          const mountNode = document.createElement('div');
-          document.body.appendChild(mountNode);
+     {
+                name: '鎾ら攢缁勭洏',
+                type: 'primary',
+                value: '鎾ら攢缁勭洏',
+                onClick: function () {
+                    console.log('鎾ら攢缁勭洏鎸夐挳琚偣鍑�');
+                    const mountNode = document.createElement('div');
+                    document.body.appendChild(mountNode);
 
-          // 鍝嶅簲寮忚〃鍗曟暟鎹細鎵樼洏鍙凤紙蹇呭~锛�
-          const formData = reactive({
-            palletCode: '' // 鎵樼洏鍙疯緭鍏ユ
-          });
+                    // 鍝嶅簲寮忚〃鍗曟暟鎹細鎵樼洏鍙凤紙蹇呭~锛�
+                    const formData = reactive({
+                        palletCode: '', // 鎵樼洏鍙疯緭鍏ユ
+                        barcode:''
+                    });
 
-          // 鎻愪氦琛ㄥ崟鐨勭粺涓�閫昏緫
-          const submitForm = async () => {
-            const formRef = vnode.component.refs.cancelPalletForm;
-            try {
-              // 鎵ц琛ㄥ崟鏍¢獙锛堟墭鐩樺彿蹇呭~锛�
-              await formRef.validate();
-            } catch (err) {
-              ElMessage.warning('璇疯緭鍏ユ湁鏁堢殑鎵樼洏鍙�');
-              return;
-            }
+                    // 鎻愪氦琛ㄥ崟鐨勭粺涓�閫昏緫
+                    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());
+                        // 鍙戣捣鎾ら攢缁勭洏璇锋眰
+                        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(response.message);
+                                console.log(response.message)
+                                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 { 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);
+                    };
 
-          // 閫変腑杈撳叆妗嗘枃鏈紙鏂逛究閲嶆柊杈撳叆锛�
-          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涓婁笅鏂�
+                                }, '纭鎾ら攢')
+                            ])
+                        ])
+                    });
 
-          // 鍒涘缓瀵硅瘽妗哣Node
-          const vnode = createVNode(ElDialog, {
-            title: '鎾ら攢缁勭洏',
-            width: '400px',
-            modelValue: true,
-            appendToBody: true,
-            onOpened: () => {
-              // 瀵硅瘽妗嗘墦寮�鍚庤嚜鍔ㄨ仛鐒﹁緭鍏ユ
-              setTimeout(() => {
-                const inputRef = vnode.component.refs.palletCodeInput;
-                inputRef?.focus();
-              }, 100);
+                    vnode.appContext = this.$.appContext;
+                    render(vnode, mountNode);
+                }
             },
-            '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',

--
Gitblit v1.9.3