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/inboundOrder.js |  663 +++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 470 insertions(+), 193 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 e6758f8..335d0cf 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"
@@ -1,23 +1,23 @@
-
 //姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
 import http from '@/api/http.js'
-import { h,createVNode, render,reactive  } from 'vue';
-import { ElDialog , ElForm, ElFormItem, ElInput, ElButton, ElMessage } from 'element-plus'; // 寮曞叆ElMessage锛岃В鍐虫彁绀烘棤鍙嶅簲
-
+import { h, createVNode, render, reactive, ref } from 'vue';
+import { ElDialog, ElForm, ElFormItem, ElInput, ElButton, ElMessage, ElSelect, ElOption } from 'element-plus'; // 寮曞叆ElMessage锛岃В鍐虫彁绀烘棤鍙嶅簲
+import gridHeader from './extend/EmptyTrayInbound.vue'
 let extension = {
-    components: {
-      //鏌ヨ鐣岄潰鎵╁睍缁勪欢
-      gridHeader: '',
-      gridBody: '',
-      gridFooter: '',
-      //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
-      modelHeader: '',
-      modelBody: '',
-      modelFooter: ''
-    },
-    tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
-    buttons: { view: [
-       {
+  components: {
+    //鏌ヨ鐣岄潰鎵╁睍缁勪欢
+    gridHeader: gridHeader,
+    gridBody: '',
+    gridFooter: '',
+    //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
+    modelHeader: '',
+    modelBody: '',
+    modelFooter: ''
+  },
+  tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
+  buttons: {
+    view: [
+      {
         name: '缁勭洏',
         type: 'primary',
         value: '缁勭洏',
@@ -39,192 +39,469 @@
           }
 
           const targetRow = selectedRows[0];
-     
+
           this.$emit('openPalletDialog', targetRow.inboundOrderNo);
         }
       },
       {
-  name: '鍒嗘壒鍏ュ簱',
-  type: 'primary',
-  value: '鍒嗘壒鍏ュ簱',
-  onClick: async function () { 
-    console.log('鍒嗘壒鍏ュ簱鎸夐挳琚偣鍑伙紝寮�濮嬫牎楠�');
-    const selectedRows = this.$refs.table.getSelected();
+        name: '鎾ら攢缁勭洏',
+        type: 'primary',
+        value: '鎾ら攢缁勭洏',
+        onClick: function () {
+          console.log('鎾ら攢缁勭洏鎸夐挳琚偣鍑�');
+          const mountNode = document.createElement('div');
+          document.body.appendChild(mountNode);
 
-    // 鏍¢獙1锛氭槸鍚﹂�変腑琛岋紙鑷冲皯閫夋嫨涓�鏉★級
-    if (selectedRows.length === 0) {
-      console.log('鏍¢獙涓嶉�氳繃锛氭湭閫変腑浠讳綍鍗曟嵁');
-      ElMessage.warning('璇烽�夋嫨鑷冲皯涓�鏉″崟鎹�');
-      return;
-    }
+          // 鍝嶅簲寮忚〃鍗曟暟鎹細鎵樼洏鍙凤紙蹇呭~锛�
+          const formData = reactive({
+            palletCode: '', // 鎵樼洏鍙疯緭鍏ユ
+            barcode: ''
+          });
 
-    // 鏀堕泦鎵�鏈夐�変腑鍗曟嵁鐨勭紪鍙凤紙杩囨护鏃犲崟鎹彿鐨勫紓甯歌锛�
-    const inboundOrderNos = selectedRows
-      .filter(row => row.inboundOrderNo)
-      .map(row => row.inboundOrderNo);
-
-    // 鏍¢獙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敊璇紝璇风◢鍚庨噸璇�');
-    }
-  }
-},
-     {
-  name: '绌烘墭鐩樺叆搴�',
-  type: 'primary',
-  value: '绌烘墭鐩樺叆搴�',
-  
-  onClick: function () {
-    const mountNode = document.createElement('div');
-    document.body.appendChild(mountNode);
-
-    // 鍝嶅簲寮忚〃鍗曟暟鎹細鏂欑鐮佹敼涓哄彲閫夊~锛堝垵濮嬬┖瀛楃涓诧級
-    const formData = reactive({ 
-      boxCode: '' // 鏂欑鐮侊紙string绫诲瀷锛屽彲绌猴級
-    });
-
-    const vnode = createVNode(ElDialog, {
-      title: '绌烘墭鐩樺叆搴�',
-      width: '400px',
-      modelValue: true,
-      appendToBody: true,
-      'onUpdate:modelValue': (isVisible) => {
-        if (!isVisible) {
-          render(null, mountNode);
-          document.body.removeChild(mountNode);
-        }
-      }
-    }, {
-      default: () => h(ElForm, {
-        model: formData,
-        rules: {
-          // 鏂欑鐮佹牎楠岋細浠呬繚鐣欏瓧绗︿覆绫诲瀷锛岀Щ闄ゅ繀濉姹傦紙绌哄�煎彲閫氳繃锛�
-          boxCode: [
-            { required: true, message: '璇疯緭鍏ユ枡绠辩爜', trigger: 'blur' },
-            { type: 'string', message: '鏂欑鐮佸繀椤讳负瀛楃涓�', trigger: 'blur' }
-          ]
-        },
-        ref: 'batchInForm'
-      }, [
-        // 鏂欑鐮佽緭鍏ラ」锛堝彲閫夊~锛�
-        h(ElFormItem, { label: '鏂欑鐮�', prop: 'boxCode',required:true }, [
-          h(ElInput, {
-            type: 'text',
-            modelValue: formData.boxCode,
-            'onUpdate:modelValue': (val) => {
-              formData.boxCode = val;
+          // 鎻愪氦琛ㄥ崟鐨勭粺涓�閫昏緫
+          const submitForm = async () => {
+            const formRef = vnode.component.refs.cancelPalletForm;
+            try {
+              // 鎵ц琛ㄥ崟鏍¢獙锛堟墭鐩樺彿蹇呭~锛�
+              await formRef.validate();
+            } catch (err) {
+              ElMessage.warning('璇疯緭鍏ユ湁鏁堢殑鎵樼洏鍙�');
+              return;
             }
-          })
-        ]),
-        // 搴曢儴鎸夐挳鍖猴紙淇濇寔涓嶅彉锛�
-        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: async () => {
-              const formRef = vnode.component.refs.batchInForm;
-              try {
-                await formRef.validate(); // 绌哄�煎彲閫氳繃鏍¢獙
-              } catch (err) {
-                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(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(); // 閫変腑杈撳叆妗嗘柟渚块噸鏂拌緭鍏�
               }
-
-              // 鍏ュ簱鎺ュ彛鎻愪氦锛氭枡绠辩爜涓虹┖鏃朵紶閫掔┖瀛楃涓诧紝鍚庣闇�鏀寔璇ュ瓧娈靛彲閫�
-              http.post('/api/InboundOrder/EmptyMaterielGroup', {
-                palletCode: formData.boxCode // 鍙┖锛氱敤鎴疯緭鍏ユ垨绌哄瓧绗︿覆
-              }).then(({ data, status, message }) => {
-                if (status) {
-                  ElMessage.success(`鍏ュ簱鎴愬姛${formData.boxCode ? '锛屾枡绠辩爜锛�' + formData.boxCode : ''}`);
-                  this.refresh();
-                  render(null, mountNode);
-                  document.body.removeChild(mountNode);
-                } else {
-                  ElMessage.error(message || data?.message || '鍏ュ簱澶辫触');
-                }
-              }).catch(() => {
-                ElMessage.error('璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯');
-              });
+            } catch (error) {
+              console.error('鎾ら攢缁勭洏璇锋眰寮傚父锛�', error);
+              ElMessage.error('缃戠粶寮傚父鎴栨帴鍙i敊璇紝璇风◢鍚庨噸璇�');
+              selectPalletCodeInput();
             }
-          }, '纭畾')
-        ])
-      ])
-    });
+          };
 
-    vnode.appContext = this.$.appContext;
-    render(vnode, mountNode);
-  }
-}
-    ], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
-    methods: {
-       //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
-      onInit() {  
+          // 閫変腑杈撳叆妗嗘枃鏈紙鏂逛究閲嶆柊杈撳叆锛�
+          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);
+        }
       },
-      onInited() {
-        
-        //妗嗘灦鍒濆鍖栭厤缃悗
-        //濡傛灉瑕侀厤缃槑缁嗚〃,鍦ㄦ鏂规硶鎿嶄綔
-        //this.detailOptions.columns.forEach(column=>{ });
+      {
+        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.inboundOrderNo)
+            .map(row => row.inboundOrderNo);
+
+          // 鏍¢獙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(`鍒嗘壒鍏ュ簱鎴愬姛锛乣);
+              this.refresh(); // 鍏ュ簱鎴愬姛鍚庡埛鏂板垪琛紙澶嶇敤鍘熸湁閫昏緫锛�
+            } else {
+              console.log('鍒嗘壒鍏ュ簱澶辫触锛屽悗绔彁绀猴細', message);
+              ElMessage.error(message || data?.message || '鍒嗘壒鍏ュ簱澶辫触');
+            }
+          } catch (error) {
+            console.error('鍒嗘壒鍏ュ簱璇锋眰寮傚父锛�', error);
+            ElMessage.error('缃戠粶寮傚父鎴栨帴鍙i敊璇紝璇风◢鍚庨噸璇�');
+          }
+        }
       },
-      searchBefore(param) {
-        //鐣岄潰鏌ヨ鍓�,鍙互缁檖aram.wheres娣诲姞鏌ヨ鍙傛暟
-        //杩斿洖false锛屽垯涓嶄細鎵ц鏌ヨ
-        return true;
-      },
-      searchAfter(result) {
-        //鏌ヨ鍚庯紝result杩斿洖鐨勬煡璇㈡暟鎹�,鍙互鍦ㄦ樉绀哄埌琛ㄦ牸鍓嶅鐞嗚〃鏍肩殑鍊�
-        return true;
-      },
-      addBefore(formData) {
-        //鏂板缓淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛紝鍙互缁欑粰琛ㄥ崟璁剧疆鍊硷紝鑷繁杈撳嚭鐪媐ormData鐨勫��
-        return true;
-      },
-      updateBefore(formData) {
-        //缂栬緫淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛ㄣ�佸垹闄よ鐨処d
-        return true;
-      },
-      rowClick({ row, column, event }) {
-        //鏌ヨ鐣岄潰鐐瑰嚮琛屼簨浠�
-        this.$refs.table.$refs.table.toggleRowSelection(row); //鍗曞嚮琛屾椂閫変腑褰撳墠琛�;
-      },
-      modelOpenAfter(row) {
-        //鐐瑰嚮缂栬緫銆佹柊寤烘寜閽脊鍑烘鍚庯紝鍙互鍦ㄦ澶勫啓閫昏緫锛屽锛屼粠鍚庡彴鑾峰彇鏁版嵁
-        //(1)鍒ゆ柇鏄紪杈戣繕鏄柊寤烘搷浣滐細 this.currentAction=='Add';
-        //(2)缁欏脊鍑烘璁剧疆榛樿鍊�
-        //(3)this.editFormFields.瀛楁='xxx';
-        //濡傛灉闇�瑕佺粰涓嬫媺妗嗚缃粯璁ゅ�硷紝璇烽亶鍘唗his.editFormOptions鎵惧埌瀛楁閰嶇疆瀵瑰簲data灞炴�х殑key鍊�
-        //鐪嬩笉鎳傚氨鎶婅緭鍑虹湅锛歝onsole.log(this.editFormOptions)
-      }
+      // {
+      //   name: '绌烘墭鐩樺叆搴�',
+      //   type: 'primary',
+      //   value: '绌烘墭鐩樺叆搴�',
+
+      //   onClick: function () {
+      //     const mountNode = document.createElement('div');
+      //     document.body.appendChild(mountNode);
+
+      //     // 鍝嶅簲寮忚〃鍗曟暟鎹細鏂欑鐮侊紙蹇呭~锛屾壂鐮佹灙/鎵嬪姩杈撳叆锛�
+      //     const formData = reactive({
+      //       boxCode: '',
+      //       warehouseCode: ''
+      //     });
+
+      //     const warehouses = ref([]);
+      //     const isLoadingWarehouses = ref(false);
+
+      //     const getWarehouseList = async () => {
+      //       isLoadingWarehouses.value = true;
+      //       try {
+      //         const { data, status } = await http.post('/api/LocationInfo/GetLocationTypes');
+      //         if (status && Array.isArray(data)) {
+      //           // 鏍煎紡鍖栦粨搴撻�夐」锛氶�傞厤ElSelect鐨刲abel-value鏍煎紡
+      //           warehouses.value = data.map(item => ({
+      //             label: item.locationTypeDesc,
+      //             value: item.locationType
+      //           }));
+      //         } else {
+      //           ElMessage.error('鑾峰彇鍖哄煙鍒楄〃澶辫触');
+      //           warehouses.value = [];
+      //         }
+      //       } catch (err) {
+      //         ElMessage.error('鍖哄煙鏁版嵁璇锋眰寮傚父锛岃绋嶅悗閲嶈瘯');
+      //         warehouses.value = [];
+      //       } finally {
+      //         isLoadingWarehouses.value = false;
+      //       }
+      //     };
+
+      //     // 鎻愪氦琛ㄥ崟鐨勭粺涓�閫昏緫锛堜緵鍥炶溅瑙﹀彂鍜屾寜閽偣鍑诲叡鐢級
+      //     const submitForm = async () => {
+      //       const formRef = vnode.component.refs.batchInForm;
+      //       try {
+      //         // 鎵ц琛ㄥ崟鏍¢獙锛堟枡绠辩爜蹇呭~锛�
+      //         await formRef.validate();
+      //       } catch (err) {
+      //         ElMessage.warning('璇疯緭鍏ユ湁鏁堢殑鏂欑鐮�');
+      //         return;
+      //       }
+
+
+      //       http.post('/api/InboundOrder/EmptyMaterielGroup', {
+      //         palletCode: formData.boxCode.trim(),
+      //         warehouseCode: formData.warehouseCode
+      //       }).then(({ data, status, message }) => {
+      //         if (status) {
+      //           ElMessage.success(`鍏ュ簱鎴愬姛锛屾枡绠辩爜锛�${formData.boxCode.trim()}`);
+      //           this.refresh();
+      //           formData.boxCode = '';
+
+      //           setTimeout(() => {
+      //             const inputRef = vnode.component.refs.boxCodeInput;
+      //             inputRef?.focus();
+      //           }, 100);
+      //         } else {
+      //           ElMessage.error(message || data?.message || '鍏ュ簱澶辫触');
+      //           selectBoxCodeInput();
+      //         }
+      //       }).catch(() => {
+      //         ElMessage.error('璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯');
+      //         selectBoxCodeInput();
+      //       });
+      //     };
+
+      //     const selectBoxCodeInput = () => {
+      //       setTimeout(() => {
+      //         const inputRef = vnode.component.refs.boxCodeInput;
+      //         if (inputRef) {
+      //           const targetInput = inputRef.$el?.querySelector('input') || inputRef;
+      //           targetInput?.focus();
+      //           targetInput?.select();
+      //         }
+      //       }, 100);
+      //     }
+      //     const vnode = createVNode(ElDialog, {
+      //       title: '绌烘墭鐩樺叆搴�',
+      //       width: '400px',
+      //       modelValue: true,
+      //       appendToBody: true,
+
+      //       onOpened: async () => {
+      //         await getWarehouseList();
+      //         const inputRef = vnode.component.refs.boxCodeInput;
+      //         inputRef?.focus();
+      //       },
+      //       'onUpdate:modelValue': (isVisible) => {
+      //         if (!isVisible) {
+      //           render(null, mountNode);
+      //           document.body.removeChild(mountNode);
+      //         }
+      //       }
+      //     }, {
+      //       default: () => h(ElForm, {
+      //         model: formData,
+      //         rules: {
+      //           boxCode: [
+      //             { required: true, message: '璇疯緭鍏ユ枡绠辩爜', trigger: ['blur', 'enter'] }
+      //           ],
+      //           warehouseCode: [
+      //             { required: true, message: '璇烽�夋嫨鍖哄煙', trigger: ['change', 'blur'] }
+      //           ]
+      //         },
+      //         ref: 'batchInForm'
+      //       }, [
+      //         //浠撳簱鏁版嵁
+      //         h(ElFormItem, { label: '鍖哄煙', prop: 'warehouseCode', required: true }, [
+      //           h(ElSelect, {
+      //             modelValue: formData.warehouseCode,
+      //             'onUpdate:modelValue': (val) => {
+      //               formData.warehouseCode = val;
+      //             },
+      //             placeholder: '璇烽�夋嫨鍏ュ簱鍖哄煙',
+      //             filterable: true, // 鏀寔鎼滅储浠撳簱
+      //             loading: isLoadingWarehouses.value, // 鍔犺浇鐘舵��
+      //             style: { width: '100%' }
+      //           }, [
+      //             // 娓叉煋浠撳簱涓嬫媺閫夐」
+      //             warehouses.value.map(item => h(ElOption, {
+      //               label: item.label,
+      //               value: item.value
+      //             }))
+      //           ])
+      //         ]),
+      //         // 鏂欑鐮佽緭鍏ラ」锛堟敮鎸佽仛鐒︺�佸洖杞︽彁浜わ級
+      //         h(ElFormItem, { label: '鏂欑鐮�', prop: 'boxCode', required: true }, [
+      //           h(ElInput, {
+      //             type: 'text',
+      //             modelValue: formData.boxCode,
+      //             'onUpdate:modelValue': (val) => {
+      //               formData.boxCode = val;
+      //             },
+      //             ref: 'boxCodeInput',
+      //             placeholder: '鎵爜杈撳叆鎴栨墜鍔ㄨ緭鍏ユ枡绠辩爜',
+      //             // 鐩戝惉鍥炶溅浜嬩欢锛堟壂鐮佹灙榛樿浼氬彂閫佸洖杞︼級
+      //             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
+      //           }, '纭畾')
+      //         ])
+      //       ])
+      //     });
+
+      //     vnode.appContext = this.$.appContext;
+      //     render(vnode, mountNode);
+      //   }
+      // }
+    ], box: [], detail: []
+  },
+  methods: {
+    //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
+    onInit() {
+      var EmptyTrayInboundBtn = this.buttons.find(x => x.value == "EmptyTrayInbound");
+        if (EmptyTrayInboundBtn != null) {
+          EmptyTrayInboundBtn.onClick = () => {
+               this.$refs.gridHeader.open();
+            }
+        }
+
+
+      this.columns.forEach(column => {
+        if (column.field === 'orderStatistics') {
+          column.formatter = (row) => {
+            // 鏍¢獙details鏄惁瀛樺湪涓旀湁鏁版嵁
+            if (row.details && row.details.length > 0) {
+              //鎸塵aterielCode鍒嗙粍缁熻orderQuantity鎬诲拰
+              const materielSumMap = row.details.reduce((acc, item) => {
+                const materielCode = item.materielCode || '鏈煡鐗╂枡';
+                const quantity = Number(item.orderQuantity) || 0;
+                acc[materielCode] = (acc[materielCode] || 0) + quantity;
+                return acc;
+              }, {});
+
+              //姣忎釜鐗╂枡椤圭敓鎴愮嫭绔媎iv锛岃法琛屾樉绀�
+              const displayItems = Object.entries(materielSumMap).map(([code, total]) => {
+                return `<div style="line-height: 1.5; white-space: normal;">${code}锛�${total}涓�</div>`;
+              });
+              const displayContent = displayItems.join('');
+              return `<div style="color: #F56C6C; white-space: normal; word-break: break-all;">${displayContent}</div>`;
+            } else {
+              return '<span style="color: #F56C6C">鏃犲叆搴撴槑缁�</span>';
+            }
+          };
+        }
+      });
+    },
+    onInited() {
+
+      //妗嗘灦鍒濆鍖栭厤缃悗
+      //濡傛灉瑕侀厤缃槑缁嗚〃,鍦ㄦ鏂规硶鎿嶄綔
+      //this.detailOptions.columns.forEach(column=>{ });
+    },
+    searchBefore(param) {
+      //鐣岄潰鏌ヨ鍓�,鍙互缁檖aram.wheres娣诲姞鏌ヨ鍙傛暟
+      //杩斿洖false锛屽垯涓嶄細鎵ц鏌ヨ
+      // this.searchFormFields.orderType=[0]
+      let wheres = [{
+        'name': 'orderType',
+        'value': '0',
+        'displayType': 'text'
+      }];
+
+
+      param.wheres.push(...wheres);
+      return true;
+    },
+    searchAfter(result) {
+      return true;
+    },
+    addBefore(formData) {
+      //鏂板缓淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛紝鍙互缁欑粰琛ㄥ崟璁剧疆鍊硷紝鑷繁杈撳嚭鐪媐ormData鐨勫��
+      return true;
+    },
+    updateBefore(formData) {
+      //缂栬緫淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛ㄣ�佸垹闄よ鐨処d
+      return true;
+    },
+    rowClick({ row, column, event }) {
+      //鏌ヨ鐣岄潰鐐瑰嚮琛屼簨浠�
+      this.$refs.table.$refs.table.toggleRowSelection(row); //鍗曞嚮琛屾椂閫変腑褰撳墠琛�;
+    },
+    modelOpenAfter(row) {
+      //鐐瑰嚮缂栬緫銆佹柊寤烘寜閽脊鍑烘鍚庯紝鍙互鍦ㄦ澶勫啓閫昏緫锛屽锛屼粠鍚庡彴鑾峰彇鏁版嵁
+      //(1)鍒ゆ柇鏄紪杈戣繕鏄柊寤烘搷浣滐細 this.currentAction=='Add';
+      //(2)缁欏脊鍑烘璁剧疆榛樿鍊�
+      //(3)this.editFormFields.瀛楁='xxx';
+      //濡傛灉闇�瑕佺粰涓嬫媺妗嗚缃粯璁ゅ�硷紝璇烽亶鍘唗his.editFormOptions鎵惧埌瀛楁閰嶇疆瀵瑰簲data灞炴�х殑key鍊�
+      //鐪嬩笉鎳傚氨鎶婅緭鍑虹湅锛歝onsole.log(this.editFormOptions)
     }
-  };
-  export default extension;
-  
\ No newline at end of file
+  }
+};
+export default extension;
\ No newline at end of file

--
Gitblit v1.9.3