From f227c21ba8e0001ea7cffa70aa66ade08bb72c70 Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期四, 20 十一月 2025 18:29:17 +0800
Subject: [PATCH] 代码提交

---
 项目代码/WIDESEA_WMSClient/src/extension/inbound/Dt_AllocateOrder.js                                       |  411 ++++++++
 项目代码/WIDESEA_WMSClient/package.json                                                                    |    2 
 项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/AllocatedPallet.vue                                | 1331 ++++++++++++++++++++++++++
 项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/StockSelect.vue                                    |  353 ++++++
 项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/allocateOrderDetail.vue                            |  573 +++++++++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Allocate/AllocateOrderDetailController.cs |   19 
 项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/SelectedStock.vue                                  |  241 ++++
 项目代码/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue                                          |   53 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateDetailService.cs                        |   51 +
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IAllocateService/IAllocateDetailService.cs                      |   16 
 10 files changed, 3,032 insertions(+), 18 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/package.json" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/package.json"
index de53b45..e81efa4 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/package.json"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/package.json"
@@ -3,7 +3,7 @@
   "version": "0.1.0",
   "private": true,
   "scripts": {
-    "server": "vue-cli-service serve",
+    "serve": "vue-cli-service serve",
     "build": "vue-cli-service build",
     "test:unit": "vue-cli-service test:unit",
     "lint": "vue-cli-service lint"
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/Dt_AllocateOrder.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/Dt_AllocateOrder.js"
index 24e1d94..061bb6b 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/Dt_AllocateOrder.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/Dt_AllocateOrder.js"
@@ -1,11 +1,14 @@
 
 //姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
-
+import http from '@/api/http.js'
+import { h,createVNode, render,reactive,ref  } from 'vue';
+import { ElDialog , ElForm, ElFormItem, ElInput, ElButton, ElMessage ,ElSelect ,ElOption } from 'element-plus'; // 寮曞叆ElMessage锛岃В鍐虫彁绀烘棤鍙嶅簲
+import gridBody from './extend/allocateOrderDetail.vue'
 let extension = {
     components: {
       //鏌ヨ鐣岄潰鎵╁睍缁勪欢
       gridHeader: '',
-      gridBody: '',
+      gridBody: gridBody,
       gridFooter: '',
       //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
       modelHeader: '',
@@ -13,12 +16,414 @@
       modelFooter: ''
     },
     tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
-    buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
+    buttons: { view: [
+       {
+        name: '缁勭洏',
+        type: 'primary',
+        value: '缁勭洏',
+        onClick: function () { // 淇1锛氱Щ闄ゆ棤鐢╮ow鍙傛暟锛屽姞鏃ュ織璋冭瘯
+          console.log('缁勭洏鎸夐挳琚偣鍑伙紝寮�濮嬫牎楠�');
+          const selectedRows = this.$refs.table.getSelected();
+
+          // 鏍¢獙1锛氭槸鍚﹂�変腑琛�
+          if (selectedRows.length === 0) {
+            console.log('鏍¢獙涓嶉�氳繃锛氭湭閫変腑浠讳綍鍗曟嵁');
+            ElMessage.warning('璇烽�夋嫨涓�鏉″崟鎹�');
+            return;
+          }
+          // 鏍¢獙2锛氭槸鍚﹂�変腑鍗曡
+          if (selectedRows.length > 1) {
+            console.log('鏍¢獙涓嶉�氳繃锛氶�変腑澶氳鍗曟嵁');
+            ElMessage.warning('鍙兘閫夋嫨涓�鏉″崟鎹�');
+            return;
+          }
+
+          const targetRow = selectedRows[0];
+     
+          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: '' // 鎵樼洏鍙疯緭鍏ユ
+                    });
+
+                    // 鎻愪氦琛ㄥ崟鐨勭粺涓�閫昏緫
+                    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/CancelPalletGroup', {
+                                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: '鍒嗘壒鍏ュ簱',
+  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(`鍒嗘壒鍏ュ簱鎴愬姛锛佸叡澶勭悊${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: '',
+      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() {  
+        this.columns.push({
+        field: '鎿嶄綔',
+        title: '鎿嶄綔',
+        width: 90,
+        fixed: 'right',
+        align: 'center',
+        formatter: (row) => {
+          return (
+            '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">鏌ョ湅鏄庣粏</i>'
+          );
+        },
+        click: (row) => {
+          this.$refs.gridBody.open(row);
+        }
+      });
       },
       onInited() {
+        
         //妗嗘灦鍒濆鍖栭厤缃悗
         //濡傛灉瑕侀厤缃槑缁嗚〃,鍦ㄦ鏂规硶鎿嶄綔
         //this.detailOptions.columns.forEach(column=>{ });
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/AllocatedPallet.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/AllocatedPallet.vue"
new file mode 100644
index 0000000..b976153
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/AllocatedPallet.vue"
@@ -0,0 +1,1331 @@
+<template>
+   <vol-box
+    v-model="groupPalletVisible"
+    :title="'缁勭洏鎿嶄綔 - 鍗曟嵁鍙凤細' + currentDocNo"
+    :height="1000"  
+    :width="1100"   
+    :padding="20"  
+    :modal="true"   
+  
+     @open="handleDialogOpen"
+    @close="handleDialogClose"
+  >
+  <div class="barcode-scanner-container">
+      
+      <!-- 浠撳簱閫夋嫨 - 绱у噾甯冨眬 -->
+      <div class="location-section compact">
+        <el-form :model="form" :rules="rules" ref="locationForm" class="compact-form">
+          <el-form-item label="浠撳簱" prop="warehouseType" class="location-select compact-item">
+            <el-select
+              v-model="form.warehouseType"
+              placeholder="璇烽�夋嫨浠撳簱"
+              clearable
+              filterable
+              @change="handleWarehouseChange"
+              style="width: 100%"
+              :loading="warehouseLoading"
+              size="medium"
+            >
+              <el-option
+                v-for="item in warehouseTypes"
+                :key="item.warehouseType"
+                :label="item.warehouseTypeDesc"
+                :value="item.warehouseType"
+              />
+            </el-select>
+          </el-form-item>
+        </el-form>
+      </div>
+
+      <!-- 浠撳簱鍖哄煙閫夋嫨 - 绱у噾甯冨眬 -->
+      <div class="location-section compact">
+        <el-form :model="form" :rules="rules" ref="locationForm" class="compact-form">
+          <el-form-item label="浠撳簱鍖哄煙" prop="locationType" class="location-select compact-item">
+            <el-select
+              v-model="form.locationType"
+              placeholder="璇峰厛閫夋嫨浠撳簱"
+              clearable
+              filterable
+              @change="handleLocationChange"
+              style="width: 100%"
+              :loading="locationLoading"
+              size="medium"
+            >
+              <el-option
+                v-for="item in locationTypes"
+                :key="item.locationType"
+                :label="item.locationTypeDesc"
+                :value="item.locationType"
+              />
+            </el-select>
+          </el-form-item>
+        </el-form>
+      </div>
+      
+      <!-- 鎵樼洏淇℃伅鏄剧ず - 绱у噾甯冨眬 -->
+      <div class="tray-info compact" v-if="trayBarcode">
+        <i class="el-icon-s-management"></i> 褰撳墠鏂欑: {{ trayBarcode }}
+        <span class="location-info" v-if="form.warehouseType">
+          | 浠撳簱: {{ currentWarehouseName  }}
+        </span>
+        <span class="location-info" v-if="form.locationType">
+          | 浠撳簱鍖哄煙: {{ currentLocationDesc }}
+        </span>
+      </div>
+      
+      <!-- 鎵爜鍖哄煙 - 绱у噾甯冨眬 -->
+      <div class="input-section compact">
+        <el-card shadow="hover" class="compact-card">
+          <div slot="header" class="compact-header">
+            <span><i class="el-icon-scanner"></i> 鎵爜鍖哄煙</span>
+            <span class="scan-status">
+              <span class="scan-indicator"></span>
+              {{ form.locationType && form.warehouseType ? '鎵爜灏辩华' : '璇峰厛閫夋嫨浠撳簱鍜屼粨搴撳尯鍩�' }}
+            </span>
+          </div>
+          
+          <!-- 鎵樼洏鏉$爜杈撳叆 -->
+          <div class="input-wrapper custom-input-group compact-input">
+            <div class="input-label">鏂欑鐮�</div>
+            <el-input
+              ref="trayInput"
+              v-model="trayBarcode"
+              placeholder="璇锋壂鎻忔垨杈撳叆鏂欑鐮佸悗鎸夊洖杞﹂敭"
+              clearable
+              :disabled="!form.locationType || !form.warehouseType"
+              @keyup.enter.native="handleTraySubmit"
+              @clear="handleTrayClear"
+              @input="handleTrayInput"
+              class="custom-input"
+              size="medium"
+            >
+              <template slot="append">
+                <el-button 
+                  @click="handleTraySubmit"
+                  type="primary"
+                  icon="el-icon-position"
+                  :disabled="!form.locationType || !trayBarcode || !form.warehouseType"
+                  size="medium"
+                >
+                  纭
+                </el-button>
+              </template>
+            </el-input>
+          </div>
+          
+          <!-- 鐗╂枡鏉$爜杈撳叆 -->
+          <div class="input-wrapper custom-input-group compact-input">
+            <div class="input-label">鐗╂枡鏉$爜</div>
+            <el-input
+              ref="barcodeInput"
+              v-model="barcode"
+              placeholder="璇锋壂鎻忔垨杈撳叆鐗╂枡鏉$爜鍚庢寜鍥炶溅閿�"
+              clearable
+              :disabled="!form.locationType || !trayBarcode || !form.warehouseType"
+              @keyup.enter.native="handleBarcodeSubmit"
+              @clear="handleClear"
+              @input="handleBarcodeInput"
+              class="custom-input"
+              size="medium"
+            >
+              <template slot="append">
+                <el-button 
+                  :loading="loading" 
+                  @click="handleBarcodeSubmit"
+                  type="primary"
+                  icon="el-icon-search"
+                  :disabled="!form.locationType || !trayBarcode || !barcode || !from.warehouseType"
+                  size="medium"
+                >
+                  {{ loading ? '鏌ヨ涓�...' : '鏌ヨ' }}
+                </el-button>
+              </template>
+            </el-input>
+          </div>
+          
+          <div class="input-tips compact-tips">
+            <p>鎻愮ず锛氳鍏堥�夋嫨浠撳簱 鈫� 閫夋嫨浠撳簱鍖哄煙 鈫� 杈撳叆鏂欑鐮� 鈫� 杈撳叆鐗╂枡鏉$爜</p>
+            <p v-if="!form.warehouseType" class="warning-text">鈿狅笍 璇峰厛閫夋嫨浠撳簱</p>
+            <p v-if="!form.locationType && !form.warehouseType" class="warning-text">鈿狅笍 璇峰厛閫夋嫨浠撳簱鍖哄煙</p>
+            <p v-if="form.warehouseType && form.locationType && !trayBarcode" class="warning-text">鈿狅笍 璇峰厛杈撳叆鏂欑鐮�</p>
+          </div>
+        
+        </el-card>
+      </div>
+
+      <!-- 鍔犺浇鐘舵�� -->
+      <div v-if="loading" class="loading compact">
+        <el-progress :percentage="100" status="success" :show-text="false" />
+        <p>姝e湪鏌ヨ鐗╂枡淇℃伅...</p>
+      </div>
+
+      <!-- 閿欒鎻愮ず -->
+      <div v-if="error" class="error-message compact">
+        <el-alert
+          :title="error"
+          type="error"
+          show-icon
+          closable
+          @close="error = ''"
+        />
+      </div>
+
+      <!-- 鐗╂枡鍒楄〃 - 鍥哄畾楂樺害甯︽粴鍔ㄦ潯 -->
+      <div class="material-list compact">
+        <el-card shadow="hover" class="compact-card">
+          <div slot="header" class="compact-header">
+            <span><i class="el-icon-tickets"></i> 缁勭洏鏁版嵁</span>
+            <span class="list-actions">
+              <el-tag type="primary" size="small">鍏� {{ materials.length }} 鏉�</el-tag>
+              <el-tag type="primary" size="small">鏈粍鐩� {{ totalStockCount }}</el-tag>
+              <el-tag type="primary" size="small">鏈叆搴撴暟閲� {{ totalStockSum }}{{ uniqueUnit }}</el-tag>
+              <el-tag v-if="trayBarcode" type="success" size="small">鎵樼洏: {{ trayBarcode }}</el-tag>
+              <el-tag v-if="form.warehouseType" type="info" size="small">浠撳簱: {{ currentWarehouseName }}</el-tag>
+              <el-tag v-if="form.locationType" type="info" size="small">鍖哄煙: {{ currentLocationDesc }}</el-tag>
+            </span>
+          </div>
+          
+          <div v-if="materials.length === 0" class="empty-state compact">
+            <i class="el-icon-document"></i>
+            <p v-if="!form.warehouseType">璇峰厛閫夋嫨浠撳簱</p>
+            <p v-if="!form.locationType">璇峰厛閫夋嫨浠撳簱鍖哄煙</p>
+            <p v-else-if="!trayBarcode">璇峰厛杈撳叆鏂欑鏉$爜</p>
+            <p v-else>鏆傛棤鐗╂枡鏁版嵁锛岃鎵弿鎴栬緭鍏ョ墿鏂欐潯鐮�</p>
+          </div>
+          
+          <div class="table-container" v-else>
+            <el-table
+              :data="materials"
+              stripe
+              style="width: 100%"
+              height="100%"
+              size="small"
+            >
+              <el-table-column type="index" label="搴忓彿" width="60" align="center"></el-table-column>
+              <el-table-column prop="barcode" label="鏉$爜" min-width="140" show-overflow-tooltip></el-table-column>
+              <el-table-column prop="materielCode" label="鐗╂枡缂栫爜" min-width="150" show-overflow-tooltip></el-table-column>
+              <el-table-column prop="batchNo" label="鎵规" min-width="150" show-overflow-tooltip></el-table-column>
+              <el-table-column prop="stockQuantity" label="鏁伴噺" min-width="130" align="right"></el-table-column>
+              <el-table-column prop="unit" label="鍗曚綅" width="80" align="center"></el-table-column>
+              <el-table-column prop="supplyCode" label="渚涘簲鍟�" min-width="130" show-overflow-tooltip></el-table-column>
+              <el-table-column prop="warehouseType" label="浠撳簱" min-width="120" show-overflow-tooltip></el-table-column>
+            </el-table>
+          </div>
+        </el-card>
+      </div>
+    </div>
+ 
+   <!--      <div slot="footer" class="dialog-footer">
+      <el-button @click="handleCancel">鍙栨秷</el-button>
+      <el-button type="primary" @click="handleConfirm">纭</el-button>
+    </div> -->
+    </vol-box>
+</template>
+<script>
+import http from '@/api/http.js';
+import VolBox from '@/components/basic/VolBox.vue';
+import VolForm from '@/components/basic/VolForm.vue';
+import VolTable from '@/components/basic/VolTable.vue';
+import { ElLoading, ElMessage,ElMessageBox  } from 'element-plus';
+import { ref, onMounted, onUnmounted } from 'vue'
+import InboundOrder from '../../../views/inbound/inboundOrder.vue';
+import { th } from 'element-plus/es/locales.mjs';
+
+export default {
+  name: 'BarcodeScanner',
+  components: { VolBox, VolForm, VolTable },
+  props: {
+    docNo: { type: String, required: true, default: '' },
+    visible: { type: Boolean, required: true, default: false }
+  },
+
+  data() {
+    return {
+        palletVisible: this.visible,
+         trayBarcode: '',
+          barcode: '',
+          materials: [],
+          loading: false,
+          error: '',
+          debugMode: false,
+          currentFocus: 'warehouse',
+          
+          // 鎵爜鏋浉鍏冲彉閲�
+          scanCode: '',
+          lastKeyTime: null,
+          isManualInput: false,
+          isScanning: false,
+          scanTimer: null,
+          manualInputTimer: null,
+          scanTarget: 'tray', // 褰撳墠鎵爜鐩爣: tray 鎴� material
+
+          // 搴撳瓨缁熻鐩稿叧鍙橀噺
+          totalStockSum: 0,  
+          totalStockCount: 0,
+          uniqueUnit: '',
+          sumLoading: false,
+          sumError: '',
+        // 浠撳簱鐩稿叧鍙橀噺
+          warehouseTypes: [], 
+          warehouseLoading: false, 
+        // 浠撳簱鍖哄煙鐩稿叧鍙橀噺
+        locationTypes: [],
+        locationLoading: false,
+        form: {
+            warehouseType: null,
+            locationType: null
+        },
+    rules: {
+      locationType: [
+        { 
+          validator: this.validateLocationType, 
+          trigger: 'change' 
+        }
+      ],
+      warehouseType: [
+          { 
+            massage:'璇烽�夋嫨浠撳簱',
+            trigger: 'change'
+          }
+        ]
+      }
+    }
+  },
+  computed: {
+    groupPalletVisible: {
+      get() { return this.visible; },
+      set(newVal) { this.$emit('update:visible', newVal); }
+    },
+    currentDocNo() { return this.docNo; },
+        // 褰撳墠閫夋嫨鐨勪粨搴撳悕绉�
+    currentWarehouseName() {
+      const warehouse = this.warehouseTypes.find(item => item.warehouseType === this.form.warehouseType);
+      return warehouse ? warehouse.warehouseTypeDesc : '';
+    },
+        // 褰撳墠閫夋嫨鐨勪粨搴撳尯鍩熸弿杩�
+    currentLocationDesc() {
+        const location = this.locationTypes.find(item => item.locationType === this.form.locationType)
+        return location ? location.locationTypeDesc : ''
+    }
+  },
+  watch: {
+    visible(newVal, oldVal) {
+    this.palletVisible = newVal;
+    
+    // 褰撲粠 false 鍙樹负 true 鏃讹紝琛ㄧず寮规鎵撳紑
+    if (newVal === true && oldVal === false) {
+      console.log('寮规鎵撳紑锛岄噸缃暟鎹�');
+      this.resetData();
+      this.$nextTick(() => {
+        setTimeout(() => {
+         // this.focusTrayInput();
+          this.initwarehouseTypes(); // 鍒濆鍖栦粨搴�
+          this.initLocationTypes(); // 鍒濆鍖栦粨搴撳尯鍩�
+          this.fetchStockStatistics(); // 鍔犺浇缁熻鏁版嵁
+        }, 300);
+      });
+    }
+    
+    // 褰撲粠 true 鍙樹负 false 鏃讹紝琛ㄧず寮规鍏抽棴
+    if (newVal === false && oldVal === true) {
+      console.log('寮规鍏抽棴锛岄噸缃暟鎹�');
+      this.resetData();
+    }
+  },
+  palletVisible(newVal) {
+    this.$emit('update:visible', newVal);
+  },
+    docNo(newVal) {
+      if (newVal) {
+        this.palletForm = { palletCode: '', barcode: '' };
+        this.backData = [];
+        this.$refs.palletForm?.reset();
+        this.fetchStockStatistics(); // 鍗曟嵁鍙峰彉浜嗭紝鍒锋柊缁熻
+      }
+    }
+  },
+  'form.warehouseType'(newVal) {
+      if (newVal) {
+        this.form.locationType = null; 
+      } else {
+        this.locationTypes = []; 
+      }
+    },
+
+ mounted() {
+ 
+        // 娣诲姞鍏ㄥ眬閿洏鐩戝惉
+        document.addEventListener('keypress', this.handleKeyPress);
+        
+        // 浣跨敤setTimeout纭繚DOM瀹屽叏娓叉煋鍚庡啀鑱氱劍
+        setTimeout(() => {
+         // this.focusTrayInput();
+                  this.focusLocationSelect();
+        }, 300);
+      },
+      beforeDestroy() {
+        // 娓呯悊浜嬩欢鐩戝惉
+        document.removeEventListener('keypress', this.handleKeyPress);
+         this.clearAllTimers();
+      },
+      methods: {
+         /**
+   * 鑷畾涔変粨搴撳尯鍩熼獙璇�
+   * 鍏佽鍊间负0锛屽洜涓�0鏄悎娉曠殑locationType
+   */
+  validateLocationType(rule, value, callback) {
+    // 妫�鏌ュ�兼槸鍚︿负null銆乽ndefined鎴栫┖瀛楃涓诧紝浣嗗厑璁告暟瀛�0
+    if (!this.form.warehouseType) {
+      callback(new Error('璇峰厛閫夋嫨浠撳簱'));
+    } else if (value === null || value === undefined || value === '') {
+      callback(new Error('璇烽�夋嫨浠撳簱鍖哄煙'));
+    } else {
+      callback();
+    }
+  },
+         /**
+         * 鍒濆鍖栦粨搴撳尯鍩熸暟鎹�
+         */
+        async initLocationTypes() {
+            this.locationLoading = true;
+            this.error = '';
+            
+            try {
+                const response = await http.post('/api/LocationInfo/GetLocationTypes');
+                
+                if (response.status && Array.isArray(response.data)) {
+                    this.locationTypes = response.data;
+                    if (this.locationTypes.length === 0) {
+                        this.error = '鏈幏鍙栧埌浠撳簱鍖哄煙鏁版嵁';
+                    } else {
+                        // 濡傛灉鏈夐粯璁ゅ尯鍩燂紝鍙互鍦ㄨ繖閲岃缃�
+                        // this.form.locationType = this.locationTypes[0].locationType;
+                    }
+                } else {
+                    this.error = '鑾峰彇浠撳簱鍖哄煙鏁版嵁澶辫触';
+                }
+            } catch (error) {
+                console.error('鑾峰彇浠撳簱鍖哄煙澶辫触:', error);
+                this.error = `鑾峰彇浠撳簱鍖哄煙澶辫触: ${error.message || '缃戠粶閿欒'}`;
+            } finally {
+                this.locationLoading = false;
+            }
+        },
+
+        /**
+         * 鍒濆鍖栦粨搴撴暟鎹�
+         */
+        async initwarehouseTypes() {
+            this.warehouseLoading = true;
+            this.error = '';
+            
+            try {
+                const response = await http.post('/api/Warehouse/GetwarehouseTypes');
+                
+                if (response.status && Array.isArray(response.data)) {
+                    this.warehouseTypes = response.data;
+                    if (this.warehouseTypes.length === 0) {
+                        this.error = '鏈幏鍙栧埌浠撳簱鏁版嵁';
+                    } else {
+                        // 濡傛灉鏈夐粯璁ゅ尯鍩燂紝鍙互鍦ㄨ繖閲岃缃�
+                        // this.form.locationType = this.locationTypes[0].locationType;
+                    }
+                } else {
+                    this.error = '鑾峰彇浠撳簱鏁版嵁澶辫触';
+                }
+            } catch (error) {
+                console.error('鑾峰彇浠撳簱澶辫触:', error);
+                this.error = `鑾峰彇浠撳簱澶辫触: ${error.message || '缃戠粶閿欒'}`;
+            } finally {
+                this.warehouseLoading = false;
+            }
+        },
+
+
+ /**
+ * 浠撳簱鍖哄煙鍙樻洿澶勭悊
+ */
+handleLocationChange(value) {
+ console.log('閫夋嫨浠撳簱鍖哄煙:', value, '绫诲瀷:', typeof value, this.currentLocationDesc);
+  
+    // 绔嬪嵆娓呴櫎閿欒淇℃伅
+    this.error = '';
+    
+    // 鎵嬪姩瑙﹀彂琛ㄥ崟楠岃瘉鏇存柊
+    this.$nextTick(() => {
+      if (this.$refs.locationForm) {
+        // 娓呴櫎璇ュ瓧娈电殑楠岃瘉鐘舵�侊紝鐒跺悗閲嶆柊楠岃瘉
+        this.$refs.locationForm.clearValidate('locationType');
+        
+        // 鐭殏寤惰繜鍚庨噸鏂伴獙璇侊紝纭繚DOM宸叉洿鏂�
+        setTimeout(() => {
+          this.$refs.locationForm.validateField('locationType', (errorMsg) => {
+            if (!errorMsg && (value === 0 || value)) {
+              console.log('浠撳簱鍖哄煙楠岃瘉閫氳繃:', value);
+              // 鍖哄煙閫夋嫨鍚庯紝鑷姩鑱氱劍鍒版墭鐩樿緭鍏ユ
+              this.focusLocationSelect();
+            }
+          });
+        }, 100);
+    }
+  });
+},
+
+/**
+ * 浠撳簱鍙樻洿澶勭悊
+ */
+handleWarehouseChange(value) {
+ console.log('閫夋嫨浠撳簱:', value, '绫诲瀷:', typeof value, this.currentWarehouseName);
+  
+    // 绔嬪嵆娓呴櫎閿欒淇℃伅
+    this.error = '';
+    
+    // 鎵嬪姩瑙﹀彂琛ㄥ崟楠岃瘉鏇存柊
+    this.$nextTick(() => {
+      if (this.$refs.locationForm) {
+        // 娓呴櫎璇ュ瓧娈电殑楠岃瘉鐘舵�侊紝鐒跺悗閲嶆柊楠岃瘉
+        this.$refs.locationForm.clearValidate('warehouseType');
+        
+        // 鐭殏寤惰繜鍚庨噸鏂伴獙璇侊紝纭繚DOM宸叉洿鏂�
+        setTimeout(() => {
+          this.$refs.locationForm.validateField('warehouseType', (errorMsg) => {
+            if (!errorMsg && (value === 0 || value)) {
+              console.log('浠撳簱楠岃瘉閫氳繃:', value);
+              this.focusLocationSelect();
+            }
+          });
+        }, 100);
+    }
+  });
+},
+        
+    async fetchStockStatistics() {
+      // 鍗曟嵁鍙蜂负绌烘椂涓嶆煡璇�
+      if (!this.docNo) {
+        this.sumError = '鍗曟嵁鍙蜂负绌猴紝鏃犳硶缁熻';
+        return;
+      }
+
+      this.sumLoading = true;
+      this.sumError = '';
+      try {
+        // 璋冪敤鍚庣缁熻鎺ュ彛锛堟浛鎹负浣犵殑瀹為檯鎺ュ彛璺緞锛�
+        const response = await http.post('/api/InboundOrder/UnPalletQuantity?orderNo='+this.docNo, {
+          
+        });
+
+        // 缁戝畾鏁版嵁锛堝尮閰� PalletSumQuantityDTO 缁撴瀯锛�
+        if (response.data) {
+          this.totalStockSum = response.data.stockSumQuantity || 0; // 鎬诲簱瀛樻暟閲�
+          this.totalStockCount = response.data.stockCount || 0;     // 鎬诲簱瀛樿褰曟暟
+          this.uniqueUnit = response.data.uniqueUnit || '';               // 璁¢噺鍗曚綅
+        }
+      } catch (err) {
+        this.sumError = '缁熻鍔犺浇澶辫触';
+        this.totalStockSum = 0;
+        this.totalStockCount = 0;
+        console.error('搴撳瓨缁熻鏌ヨ寮傚父锛�', err);
+      } finally {
+        this.sumLoading = false;
+      }
+    },
+/**
+ * 琛ㄥ崟楠岃瘉
+ */
+async validateForm() {
+  return new Promise((resolve) => {
+    if (!this.$refs.locationForm) {
+      this.error = '琛ㄥ崟鏈垵濮嬪寲';
+      this.$message.warning('璇峰厛閫夋嫨浠撳簱鍖哄煙');
+      resolve(false);
+      return;
+    }
+
+    this.$refs.locationForm.validate((valid) => {
+      if (valid) {
+        this.error = '';
+        resolve(true);
+      } else {
+        // 鎵嬪姩妫�鏌ocationType锛屾纭鐞嗗�间负0鐨勬儏鍐�
+        if(!this.from.warehouseType){
+          this.error='璇峰厛閫夋嫨浠撳簱';
+        }
+        else if(this.form.locationType === null || this.form.locationType === undefined || this.form.locationType === '') {
+          this.error = '璇峰厛閫夋嫨浠撳簱鍖哄煙';
+          //this.$message.warning('璇峰厛閫夋嫨浠撳簱鍖哄煙');
+        } else {
+          // 濡傛灉鍊煎瓨鍦紙鍖呮嫭0锛夛紝浣嗛獙璇佷笉閫氳繃锛屽彲鑳芥槸鍏朵粬楠岃瘉閿欒
+          this.error = '璇锋鏌ヨ〃鍗曞~鍐欐槸鍚︽纭�';
+        }
+        resolve(false);
+      }
+    });
+  });
+},
+       focusWarehouseSelect() {
+            if (this.$refs.locationForm) {
+                const selectEl = this.$el.querySelector('.location-select:first-child .el-input__inner');
+                if (selectEl) {
+                    selectEl.focus();
+                    this.currentFocus = 'warehouse';
+                }
+            }
+        },
+        // 鑱氱劍鍒颁粨搴撳尯鍩熼�夋嫨
+        focusLocationSelect() {
+            if (this.$refs.locationForm) {
+                const selectEl = this.$el.querySelector('.location-select:nth-child(2) .el-input__inner');
+                if (selectEl) {
+                    selectEl.focus();
+                    this.currentFocus = 'location';
+                }
+            }
+        },
+        // 鑱氱劍鍒版墭鐩樿緭鍏ユ
+        focusTrayInput() {
+            if (this.$refs.trayInput && this.$refs.trayInput.$el) {
+                const inputEl = this.$refs.trayInput.$el.querySelector('input');
+                if (inputEl) {
+                    inputEl.focus();
+                    this.currentFocus = 'tray';
+                    this.scanTarget = 'tray';
+                }
+            }
+        },
+        
+        // 鑱氱劍鍒扮墿鏂欒緭鍏ユ
+        focusBarcodeInput() {
+            if (this.$refs.barcodeInput && this.$refs.barcodeInput.$el) {
+                const inputEl = this.$refs.barcodeInput.$el.querySelector('input');
+                if (inputEl) {
+                    inputEl.focus();
+                    this.currentFocus = 'material';
+                    this.scanTarget = 'material';
+                }
+            }
+        },
+         // 閲嶇疆鎵�鏈夋暟鎹�
+    resetData() {
+      console.log('閲嶇疆寮规鏁版嵁');
+      this.trayBarcode = '';
+      this.barcode = '';
+      this.materials = [];
+      this.loading = false;
+      this.error = '';
+      this.scanCode = '';
+      this.lastKeyTime = null;
+      this.isManualInput = false;
+      this.isScanning = false;
+      this.currentFocus = 'warehouse';
+      this.scanTarget = 'tray';
+      this.clearAllTimers();
+      this.totalStockSum = 0;
+      this.totalStockCount = 0;
+      this.sumLoading = false;
+      this.sumError = '';
+        this.form={
+          warehouseType:null,
+          locationType:null
+        }
+      this.warehouseTypes=[];
+      this.locationTypes=[];  
+          // 娓呴櫎琛ㄥ崟楠岃瘉鐘舵��
+  this.$nextTick(() => {
+    if (this.$refs.locationForm) {
+      this.$refs.locationForm.clearValidate();
+    }
+  });
+    },
+    
+    // 娓呴櫎鎵�鏈夎鏃跺櫒
+    clearAllTimers() {
+      if (this.manualInputTimer) {
+        clearTimeout(this.manualInputTimer);
+        this.manualInputTimer = null;
+      }
+      if (this.scanTimer) {
+        clearTimeout(this.scanTimer);
+        this.scanTimer = null;
+      }
+    },
+    
+    // 寮规鎵撳紑鏃堕噸缃暟鎹�
+    handleDialogOpen() {
+      console.log('寮规鎵撳紑锛岄噸缃暟鎹�');
+      this.resetData();
+      // 浣跨敤setTimeout纭繚DOM瀹屽叏娓叉煋鍚庡啀鑱氱劍
+      this.$nextTick(() => {
+        setTimeout(() => {
+            this.initwarehouseTypes();
+            this.initLocationTypes(); // 鍒濆鍖栦粨搴撳尯鍩�
+             // 纭繚琛ㄥ崟寮曠敤瀛樺湪鍚庡啀鑱氱劍
+      if (this.$refs.locationForm) {
+        this.focusWarehouseSelect();
+      } else {
+        // 濡傛灉琛ㄥ崟寮曠敤杩樹笉瀛樺湪锛岀◢鍚庨噸璇�
+        setTimeout(() => {
+          this.focusWarehouseSelect();
+        }, 500);
+      }
+        }, 300);
+      });
+    },
+    
+    // 寮规鍏抽棴鏃堕噸缃暟鎹�
+    handleDialogClose() {
+      console.log('寮规鍏抽棴锛岄噸缃暟鎹�');
+      this.resetData();
+    },
+    
+    // 鍙栨秷鎸夐挳
+    handleCancel() {
+      this.palletVisible = false;
+    },
+    
+    // 纭鎸夐挳
+   async  handleConfirm() {
+           if (!await this.validateForm()) return;
+
+      if (this.materials.length === 0) {
+        this.$message.warning('璇疯嚦灏戞坊鍔犱竴涓墿鏂�');
+        return;
+      }
+      
+      if (!this.trayBarcode) {
+        this.$message.warning('璇疯緭鍏ユ墭鐩樻潯鐮�');
+        return;
+      }
+      
+      const result = {
+        warehouseType:this.form.warehouseType,
+        warehouseName:this.currentWarehouseName,
+        locationType: this.form.locationType,
+        locationDesc: this.currentLocationDesc,
+        trayBarcode: this.trayBarcode,
+        materials: this.materials,
+        docNo: this.docNo
+      };
+      
+      // 瑙﹀彂鐖剁粍浠剁殑 back-success 浜嬩欢
+      this.$emit('back-success', result);
+      this.palletVisible = false;
+    },
+    // 澶勭悊鎵樼洏杈撳叆
+        handleTrayInput() {
+            // 鏍囪涓烘墜鍔ㄨ緭鍏ユā寮�
+            this.isManualInput = true;
+            this.isScanning = false;
+            
+            // 娓呴櫎涔嬪墠鐨勮鏃跺櫒
+            if (this.manualInputTimer) {
+                clearTimeout(this.manualInputTimer);
+            }
+            
+            // 璁剧疆璁℃椂鍣紝濡傛灉涓�娈垫椂闂村唴娌℃湁杈撳叆锛屽垯閲嶇疆涓烘壂鐮佹ā寮�
+            this.manualInputTimer = setTimeout(() => {
+                this.isManualInput = false;
+            }, 1000);
+        },
+        
+        // 澶勭悊鐗╂枡杈撳叆
+        handleBarcodeInput() {
+            // 鏍囪涓烘墜鍔ㄨ緭鍏ユā寮�
+            this.isManualInput = true;
+            this.isScanning = false;
+            
+            // 娓呴櫎涔嬪墠鐨勮鏃跺櫒
+            if (this.manualInputTimer) {
+                clearTimeout(this.manualInputTimer);
+            }
+            
+            // 璁剧疆璁℃椂鍣紝濡傛灉涓�娈垫椂闂村唴娌℃湁杈撳叆锛屽垯閲嶇疆涓烘壂鐮佹ā寮�
+            this.manualInputTimer = setTimeout(() => {
+                this.isManualInput = false;
+            }, 1000);
+        },      
+                 
+       // 澶勭悊鎵樼洏鏉$爜鎻愪氦
+async handleTraySubmit() {
+  // 鍏堢洿鎺ユ鏌ocationType锛岄伩鍏嶈〃鍗曢獙璇佺殑寮傛闂
+  if (!this.form.warehouseType) {
+    this.error = '璇峰厛閫夋嫨浠撳簱';
+    return;
+  }
+  if (!this.form.locationType) {
+    this.error = '璇峰厛閫夋嫨浠撳簱鍖哄煙';
+    //this.$message.warning('璇峰厛閫夋嫨浠撳簱鍖哄煙');
+    return;
+  }
+  
+  // 鐒跺悗鍐嶈繘琛屽畬鏁寸殑琛ㄥ崟楠岃瘉
+  if (!await this.validateForm()) return;
+  
+  const currentTrayBarcode = this.trayBarcode.trim();
+  
+  if (!currentTrayBarcode) {
+    this.error = '璇疯緭鍏ユ垨鎵弿鎵樼洏鏉$爜';
+    return;
+  }
+
+  this.error = '';
+  
+  // 璁剧疆鎵樼洏鏉$爜鍚庯紝鑷姩鑱氱劍鍒扮墿鏂欒緭鍏ユ
+  this.focusBarcodeInput();
+  
+  this.$message({
+    message: `鎵樼洏鏉$爜宸茶缃�: ${currentTrayBarcode}`,
+    type: 'success',
+    duration: 2000
+  });
+},
+        
+        // 娓呴櫎鎵樼洏
+        clearTray() {
+          this.trayBarcode = '';
+          this.materials = [];
+          this.focusTrayInput();
+          this.$message({
+            message: '鎵樼洏鏉$爜宸叉竻闄�',
+            type: 'info',
+            duration: 2000
+          });
+        },
+        
+        // 娓呯┖鎵樼洏杈撳叆
+        handleTrayClear() {
+          this.error = '';
+        },
+        
+        // 娓呯┖杈撳叆
+        handleClear() {
+          this.error = '';
+          this.scanCode = '';
+          this.isManualInput = false;
+          this.isScanning = false;
+        },
+        
+        // 澶勭悊鐗╂枡鏉$爜鎻愪氦
+        async handleBarcodeSubmit() {
+                    if (!await this.validateForm()) return;
+          const currentBarcode = this.barcode.trim();
+          
+          if (!this.trayBarcode) {
+            this.error = '璇峰厛杈撳叆鎵樼洏鏉$爜';
+            this.focusTrayInput();
+            return;
+          }
+          
+          if (!currentBarcode) {
+            this.error = '璇疯緭鍏ユ垨鎵弿鐗╂枡鏉$爜';
+            return;
+          }
+
+          this.error = '';
+          this.loading = true;
+
+          try { 
+            // 璋冪敤API鏌ヨ鐗╂枡淇℃伅
+            const materialData = await this.fetchMaterialData(currentBarcode);
+                  if (!materialData  || materialData.length === 0) {
+        
+         
+          return;
+         }
+            // 妫�鏌ユ槸鍚﹀凡瀛樺湪鐩稿悓鐗╂枡缂栫爜鐨勮褰�
+            const exists = this.materials.some(item => 
+                 item.barcode === this.trayBarcode
+            );
+            console.log('API:',materialData)
+            if (exists) {
+              this.$message({
+                message: '璇ユ潯鐮佸凡瀛樺湪褰撳墠鎵樼洏鐨勫垪琛ㄤ腑',
+                type: 'warning',
+                duration: 2000
+              });
+            } else {
+
+                materialData.forEach(item => {
+    
+          // 濡傛灉涓嶅瓨鍦紝娣诲姞鏂扮墿鏂�
+          this.materials.push({
+            ...item, 
+             trayCode: this.trayBarcode,
+               locationType: this.form.locationType,
+                            locationDesc: this.currentLocationDesc,
+               scanTime: this.formatTime(new Date())
+          });
+        });
+            
+        
+ 
+              
+              this.$message({
+                message: `鎴愬姛娣诲姞鏉$爜: ${currentBarcode}`,
+                type: 'success',
+                duration: 2000
+              });
+         
+            this.fetchStockStatistics(); 
+            // 娓呯┖鐗╂枡杈撳叆妗嗗苟淇濇寔鑱氱劍
+            this.barcode = '';
+            this.scanCode = ''; // 娓呯┖鎵爜缂撳瓨
+            this.isScanning = false;
+            
+            setTimeout(() => {
+              this.focusBarcodeInput();
+            }, 100);
+          }
+          } catch (err) {
+            this.error = err.message || '鏌ヨ鏉$爜淇℃伅澶辫触锛岃閲嶈瘯';
+          } finally {
+            this.loading = false;
+          }
+        },
+        
+        // API璇锋眰 - 鏇挎崲涓哄疄闄呯殑API璋冪敤
+      async  fetchMaterialData(barcode) {
+         try {
+        const response = await http.post('/api/InboundOrder/BarcodeMaterielGroup', 
+           {
+            palletCode: this.trayBarcode,
+            orderNo: this.docNo,
+            barcodes: barcode,
+            locationTypeDesc:  this.currentLocationDesc,
+            locationType: this.form.locationType, // 娣诲姞浠撳簱鍖哄煙淇℃伅
+            warehouseType:this.form.warehouseType
+          } 
+        );
+        
+      
+        let materialData;
+        
+        if (typeof response.data === 'string') {
+      
+          try {
+            materialData = JSON.parse(response.data);
+          } catch (e) {
+        
+          }
+        } else {
+          // 濡傛灉杩斿洖鐨勬槸JSON瀵硅薄锛岀洿鎺ヤ娇鐢�
+          materialData = response.data;
+        }
+ if(!response.status){
+   this.error = response.message || '鏌ヨ鏉$爜淇℃伅澶辫触锛岃閲嶈瘯';
+ }
+
+        return  materialData;
+        
+      } catch (error) {
+        console.error('API璋冪敤澶辫触:', error);
+        
+ 
+      }
+        },
+        
+        // 澶勭悊鎵爜鏋緭鍏�
+        handleKeyPress(event) {
+          // 濡傛灉鏄墜鍔ㄨ緭鍏ユā寮忥紝涓嶅鐞嗘壂鐮佹灙閫昏緫
+          if (this.isManualInput) {
+            return;
+          }
+          
+          const key = event.key;
+          const currentTime = new Date().getTime();
+          
+          // 蹇界暐鐩存帴鎸変笅鐨勫洖杞﹂敭锛堢敱handleBarcodeSubmit澶勭悊锛�
+          if (key === 'Enter') {
+            if (this.scanCode.length > 0) {
+              // 闃绘榛樿鍥炶溅琛屼负锛岄伩鍏嶈〃鍗曟彁浜�
+              event.preventDefault();
+              
+              // 鎵爜瀹屾垚锛岃嚜鍔ㄨЕ鍙戞煡璇�
+              this.isScanning = false;
+              
+              // 鏍规嵁褰撳墠鎵爜鐩爣璁剧疆鐩稿簲鐨勮緭鍏ユ鍊�
+              if (this.scanTarget === 'tray') {
+                this.trayBarcode = this.scanCode;
+                this.handleTraySubmit();
+              } else if (this.scanTarget === 'material') {
+                this.barcode = this.scanCode;
+                this.handleBarcodeSubmit();
+              }
+            }
+            this.scanCode = '';
+            this.lastKeyTime = null;
+            return;
+          }
+          
+          // 鏋勫缓鎵爜鍐呭锛堝揩閫熻繛缁緭鍏ヨ涓烘壂鐮侊級
+          if (this.lastKeyTime && currentTime - this.lastKeyTime < 50) {
+            this.scanCode += key;
+            this.isScanning = true;
+          } else {
+            this.scanCode = key;
+            this.isScanning = true;
+          }
+          
+          // 璁剧疆璁℃椂鍣紝濡傛灉涓�娈垫椂闂村唴娌℃湁杈撳叆锛屽垯閲嶇疆鎵弿鐘舵��
+          if (this.scanTimer) {
+            clearTimeout(this.scanTimer);
+          }
+          this.scanTimer = setTimeout(() => {
+            this.isScanning = false;
+          }, 100);
+          
+          this.lastKeyTime = currentTime;
+        },
+        
+        // 鍒犻櫎鐗╂枡
+        removeMaterial(index) {
+          this.$confirm('纭畾瑕佸垹闄よ繖鏉$墿鏂欒褰曞悧?', '鎻愮ず', {
+            confirmButtonText: '纭畾',
+            cancelButtonText: '鍙栨秷',
+            type: 'warning'
+          }).then(() => {
+            this.materials.splice(index, 1);
+            this.$message({
+              type: 'success',
+              message: '鍒犻櫎鎴愬姛!'
+            });
+            this.fetchStockStatistics(); 
+
+          }).catch(() => {
+            // 鍙栨秷鍒犻櫎
+          });
+        },
+        
+        // 娓呯┖鎵�鏈夌墿鏂�
+        clearAllMaterials() {
+          if (this.materials.length === 0) return;
+          
+          this.$confirm('纭畾瑕佹竻绌烘墍鏈夌墿鏂欒褰曞悧?', '鎻愮ず', {
+            confirmButtonText: '纭畾',
+            cancelButtonText: '鍙栨秷',
+            type: 'warning'
+          }).then(() => {
+            this.materials = [];
+            this.$message({
+              type: 'success',
+              message: '宸叉竻绌烘墍鏈夎褰�!'
+            });
+          }).catch(() => {
+            // 鍙栨秷娓呯┖
+          });
+        },
+        
+        // 鏍煎紡鍖栨椂闂�
+        formatTime(date) {
+          const year = date.getFullYear();
+          const month = String(date.getMonth() + 1).padStart(2, '0');
+          const day = String(date.getDate()).padStart(2, '0');
+          const hours = String(date.getHours()).padStart(2, '0');
+          const minutes = String(date.getMinutes()).padStart(2, '0');
+          const seconds = String(date.getSeconds()).padStart(2, '0');
+          
+          return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+        }
+      }
+}
+</script>
+
+<style scoped>
+    .barcode-scanner-container {
+      max-width: 1200px;
+      margin: 0 auto;
+      padding: 10px;
+      display: flex;
+      flex-direction: column;
+      height: 100%;
+      gap: 8px;
+    }
+    
+    /* 绱у噾甯冨眬鏍峰紡 */
+    .compact {
+      margin-bottom: 0;
+    }
+    
+    .compact-form {
+      margin-bottom: 0;
+    }
+    
+    .compact-item {
+      margin-bottom: 0;
+    }
+    
+    .compact-card {
+      margin-bottom: 0;
+    }
+    
+    .compact-card >>> .el-card__body {
+      padding: 12px;
+    }
+    
+    .compact-header {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      padding: 0 !important;
+    }
+    
+    .compact-header >>> .el-card__header {
+      padding: 8px 12px;
+    }
+    
+    .compact-input {
+      margin: 8px 0;
+    }
+    
+    .compact-tips {
+      margin-top: 8px;
+      font-size: 11px;
+    }
+    
+    /* 浠撳簱鍖哄煙閫夋嫨 - 绱у噾 */
+    .location-section.compact {
+      margin-bottom: 8px;
+    }
+    
+    .location-section.compact >>> .el-form-item {
+      margin-bottom: 0;
+    }
+    
+    /* 鎵樼洏淇℃伅 - 绱у噾 */
+    .tray-info.compact {
+      padding: 6px 10px;
+      margin-bottom: 8px;
+      font-size: 13px;
+    }
+    
+    /* 鎵爜鍖哄煙 - 绱у噾 */
+    .input-section.compact {
+      margin-bottom: 8px;
+      flex-shrink: 0;
+    }
+    
+    /* 鐗╂枡鍒楄〃 - 鍥哄畾楂樺害甯︽粴鍔� */
+    .material-list.compact {
+      flex: 1;
+      min-height: 0; /* 閲嶈锛氬厑璁竑lex瀛愰」鏀剁缉 */
+      display: flex;
+      flex-direction: column;
+    }
+    
+    .material-list.compact >>> .el-card {
+      display: flex;
+      flex-direction: column;
+      height: 100%;
+    }
+    
+    .material-list.compact >>> .el-card__body {
+      flex: 1;
+      display: flex;
+      flex-direction: column;
+      padding: 0;
+      min-height: 0;
+    }
+    
+    .table-container {
+      flex: 1;
+      min-height: 0;
+      overflow: hidden;
+    }
+    
+    .material-list.compact >>> .el-table {
+      flex: 1;
+    }
+    
+    .material-list.compact >>> .el-table__body-wrapper {
+      overflow-y: auto;
+    }
+    
+    /* 绱у噾鐨勭┖鐘舵�� */
+    .empty-state.compact {
+      padding: 20px 0;
+      flex: 1;
+      display: flex;
+      flex-direction: column;
+      justify-content: center;
+      align-items: center;
+    }
+    
+    .empty-state.compact i {
+      font-size: 36px;
+      margin-bottom: 8px;
+    }
+    
+    .empty-state.compact p {
+      font-size: 13px;
+    }
+    
+    /* 鍏朵粬鍘熸湁鏍峰紡璋冩暣 */
+    .page-title {
+      text-align: center;
+      margin-bottom: 15px;
+    }
+    
+    .scan-status {
+      font-size: 12px;
+      color: #67C23A;
+    }
+    
+    .scan-indicator {
+      display: inline-block;
+      width: 8px;
+      height: 8px;
+      border-radius: 50%;
+      background-color: #67C23A;
+      margin-right: 5px;
+      animation: pulse 1.5s infinite;
+    }
+    
+    @keyframes pulse {
+      0% { opacity: 1; }
+      50% { opacity: 0.4; }
+      100% { opacity: 1; }
+    }
+    
+    .input-wrapper {
+      position: relative;
+    }
+    
+    .input-tips {
+      margin-top: 6px;
+      color: #909399;
+    }
+    
+    .warning-text {
+        color: #E6A23C;
+        font-weight: bold;
+    }
+    
+    .loading.compact {
+      text-align: center;
+      margin: 10px 0;
+      padding: 5px;
+    }
+    
+    .loading.compact p {
+      margin-top: 5px;
+      color: #409EFF;
+      font-size: 12px;
+    }
+    
+    .error-message.compact {
+      margin: 5px 0;
+    }
+    
+    .error-message.compact >>> .el-alert {
+      padding: 6px 12px;
+    }
+    
+    .list-actions {
+      display: flex;
+      align-items: center;
+      gap: 4px;
+    }
+    
+    .list-actions >>> .el-tag {
+      height: 24px;
+      line-height: 22px;
+      padding: 0 6px;
+    }
+    
+    .clear-all-btn {
+      margin-left: 8px;
+    }
+    
+    .material-code {
+      font-family: 'Courier New', monospace;
+      font-weight: bold;
+      color: #409EFF;
+    }
+    
+    .location-info {
+        color: #606266;
+        font-weight: normal;
+    }
+    
+    .debug-info {
+      background: #f5f7fa;
+      padding: 8px;
+      border-radius: 4px;
+      margin-top: 8px;
+      font-size: 11px;
+      color: #909399;
+    }
+    
+    .small-button {
+      padding: 6px 8px;
+      font-size: 11px;
+    }
+
+    /* 杈撳叆妗嗙粍鏍峰紡璋冩暣 */
+    .custom-input-group {
+      display: flex;
+      align-items: center;
+      width: 100%;
+      margin: 8px 0;
+      border: 1px solid #DCDFE6;
+      border-radius: 4px;
+      overflow: hidden;
+      background: #fff;
+    }
+
+    .input-label {
+      padding: 0 12px;
+      background: #F5F7FA;
+      border-right: 1px solid #DCDFE6;
+      color: #606266;
+      font-size: 13px;
+      white-space: nowrap;
+      height: 36px;
+      line-height: 36px;
+      flex-shrink: 0;
+      min-width: 70px;
+      text-align: center;
+    }
+
+    .input-container {
+      display: flex;
+      flex: 1;
+      align-items: center;
+    }
+
+    .custom-input {
+      flex: 1;
+    }
+
+    .custom-input >>> .el-input__inner {
+      border: none;
+      border-radius: 0;
+      height: 36px;
+      line-height: 36px;
+      font-size: 13px;
+    }
+    
+    /* 鍝嶅簲寮忚皟鏁� */
+    @media (max-width: 768px) {
+      .barcode-scanner-container {
+        padding: 5px;
+      }
+      
+      .custom-input-group {
+        flex-direction: column;
+        border: none;
+      }
+      
+      .input-label {
+        width: 100%;
+        border-right: none;
+        border-bottom: 1px solid #DCDFE6;
+        margin-bottom: 5px;
+      }
+      
+      .input-container {
+        width: 100%;
+        border: 1px solid #DCDFE6;
+        border-radius: 4px;
+      }
+    }
+</style>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/SelectedStock.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/SelectedStock.vue"
new file mode 100644
index 0000000..acfbc12
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/SelectedStock.vue"
@@ -0,0 +1,241 @@
+<template>
+  <div>
+    <vol-box
+      v-model="showDetialBox"
+      :lazy="true"
+      width="75%"
+      :padding="15"
+      title="鍑哄簱璇︽儏"
+    >
+      <div class="box-head">
+        <el-alert :closable="false" style="width: 100%">
+          <el-row>
+            <el-col :span="24">
+              <span class="less-style">鐗╂枡鍚嶇О锛� {{ row.materielName }} </span>
+              <el-divider direction="vertical"></el-divider>
+              <span class="less-style">鐗╂枡缂栧彿锛� {{ row.materielCode }} </span>
+              <el-divider direction="vertical"></el-divider>
+              <span class="less-style"
+                >闇�姹傛暟閲忥細 {{ row.orderQuantity }}
+              </span>
+              <el-divider direction="vertical"></el-divider>
+              <span class="less-style"
+                >宸插垎閰嶆暟閲忥細 {{ row.lockQuantity }}
+              </span>
+            </el-col>
+          </el-row>
+        </el-alert>
+      </div>
+      <div class="box-table" style="margin-top: 1%">
+        <el-table
+          ref="singleTable"
+          :data="tableData"
+          style="width: 100%; height: 100%"
+          highlight-current-row
+          height="500px"
+        >
+          >
+          <el-table-column
+            label="搴忓彿"
+            type="index"
+            fixed="left"
+            width="55"
+            align="center"
+          ></el-table-column>
+          <el-table-column
+            v-for="(item, index) in tableColumns.filter((x) => !x.hidden)"
+            :key="index"
+            :prop="item.prop"
+            :label="item.title"
+            :width="item.width"
+            align="center"
+          >
+            <template #default="scoped" v-if="item.type == 'icon'">
+              <el-tooltip
+                class="item"
+                effect="dark"
+                :content="item.title"
+                placement="bottom"
+                ><el-button
+                  type="text"
+                  @click="tableButtonClick(scoped.row, item)"
+                  ><i :class="item.icon" style="font-size: 22px"></i></el-button
+              ></el-tooltip>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <template #footer>
+        <!-- <el-button type="primary" size="small" @click="submit">纭</el-button> -->
+        <el-button type="danger" size="small" @click="showDetialBox = false"
+          >鍏抽棴</el-button
+        >
+      </template>
+    </vol-box>
+  </div>
+</template>
+    <script>
+import VolBox from "@/components/basic/VolBox.vue";
+export default {
+  components: { VolBox },
+  data() {
+    return {
+      row: null,
+      showDetialBox: false,
+      tableData: [],
+      tableColumns: [
+        {
+          prop: "id",
+          title: "涓婚敭",
+          type: "string",
+          width: 150,
+          hidden: true,
+        },
+        {
+          prop: "orderNo",
+          title: "鍗曟嵁缂栧彿",
+          type: "string",
+          width: 150,
+        },
+        {
+          prop: "orderDetailId",
+          title: "鍗曟嵁鏄庣粏涓婚敭",
+          type: "string",
+          width: 150,
+          hidden: true,
+        },
+        {
+          prop: "orderType",
+          title: "鍗曟嵁绫诲瀷",
+          type: "string",
+          width: 90,
+        },
+        {
+          prop: "batchNo",
+          title: "鎵规鍙�",
+          type: "string",
+          width: 120,
+        },
+        {
+          prop: "materielCode",
+          title: "鐗╂枡缂栧彿",
+          type: "string",
+          width: 150,
+        },
+        {
+          prop: "materielName",
+          title: "鐗╂枡鍚嶇О",
+          type: "string",
+          width: 150,
+        },
+        {
+          prop: "stockId",
+          title: "搴撳瓨涓婚敭",
+          type: "string",
+          width: 150,
+          hidden: true,
+        },
+        {
+          prop: "originalQuantity",
+          title: "鍘熷搴撳瓨閲�",
+          type: "string",
+          width: 100,
+        },
+        {
+          prop: "assignQuantity",
+          title: "鍒嗛厤鍑哄簱閲�",
+          type: "string",
+          width: 100,
+        },
+        {
+          prop: "palletCode",
+          title: "鎵樼洏缂栧彿",
+          type: "string",
+          width: 150,
+        },
+        {
+          prop: "locationCode",
+          title: "璐т綅缂栧彿",
+          type: "string",
+          width: 180,
+        },
+        {
+          prop: "status",
+          title: "鐘舵��",
+          type: "string",
+        },
+      ],
+    };
+  },
+  methods: {
+    open(row) {
+      this.row = row;
+      this.showDetialBox = true;
+      this.getData();
+    },
+    getData() {
+      this.http
+        .post(
+          "api/OutStockLockInfo/GetByOrderDetailId?orderDetailId=" +
+            this.row.id,
+          null,
+          "鏌ヨ涓�"
+        )
+        .then((x) => {
+          
+          var label=[
+              { label: '宸插垎閰�', value: 0 },
+              { label: '鍑哄簱涓�', value: 1 },
+              { label: '鍑哄簱瀹屾垚', value: 2 },
+              { label: '鎷i�夊畬鎴�', value: 3 },
+              { label: '鎾ら攢', value: 99 }
+          ]
+          this.tableData=x.map((i) => ({
+            ...i,
+            status:label.find((j) => j.value === i.status).label
+          }))
+        });
+    },
+  },
+};
+</script>
+  <style scoped>
+.less-style {
+  color: black;
+}
+.equle-style {
+  color: green;
+}
+.more-style {
+  color: red;
+}
+</style>
+  
+  <style>
+.text-button:hover {
+  background-color: #f0f9eb !important;
+}
+.el-table .warning-row {
+  background: oldlace;
+}
+.box-table .el-table tbody tr:hover > td {
+  background-color: #d8e0d4 !important;
+  /* color: #ffffff; */
+}
+
+.box-table .el-table tbody tr.current-row > td {
+  background-color: #f0f9eb !important;
+  /* color: #ffffff; */
+}
+
+.el-table .success-row {
+  background: #f0f9eb;
+}
+
+.box-table .el-table {
+  border: 1px solid #ebeef5;
+}
+.box-head .el-alert__content {
+  width: 100%;
+}
+</style>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/StockSelect.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/StockSelect.vue"
new file mode 100644
index 0000000..1b7e249
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/StockSelect.vue"
@@ -0,0 +1,353 @@
+<template>
+  <div>
+    <vol-box
+      v-model="showDetialBox"
+      :lazy="true"
+      width="60%"
+      :padding="15"
+      title="鎸囧畾搴撳瓨"
+    >
+      <div class="box-head">
+        <el-alert :closable="false" style="width: 100%">
+          <el-row>
+            <el-col :span="16">
+              <span class="less-style">鐗╂枡鍚嶇О锛� {{ row.materielName }} </span>
+              <el-divider direction="vertical"></el-divider>
+              <span class="less-style">鐗╂枡缂栧彿锛� {{ row.materielCode }} </span>
+              <el-divider direction="vertical"></el-divider>
+              <span class="less-style">闇�姹傛暟閲忥細 {{ row.orderQuantity }} </span>
+              <el-divider direction="vertical"></el-divider>
+              <span :class="selectionClass">宸查�夋暟閲忥細 {{ selectionSum }} </span>
+            </el-col>
+            <el-col :span="8">
+              <el-link
+                type="primary"
+                size="small"
+                style="float: right; height: 20px; margin-right: 10px"
+                @click="getData"
+                >鍒锋柊</el-link
+              >
+              <el-link
+                type="primary"
+                size="small"
+                style="float: right; height: 20px; margin-right: 10px"
+                @click="openOutboundDialog"
+                >鐩存帴鍑哄簱</el-link
+              >
+            </el-col>
+          </el-row>
+        </el-alert>
+      </div>
+      <div class="box-table" style="margin-top: 1%">
+        <el-table
+          ref="singleTable"
+          :data="tableData"
+          style="width: 100%; height: 100%"
+          highlight-current-row
+          @row-click="handleRowClick"
+          height="500px"
+          @selection-change="handleSelectionChange"
+        >
+          <el-table-column type="selection" width="55"> </el-table-column>
+          <el-table-column
+            label="搴忓彿"
+            type="index"
+            fixed="left"
+            width="55"
+            align="center"
+          ></el-table-column>
+          <el-table-column
+            v-for="(item, index) in tableColumns.filter((x) => !x.hidden)"
+            :key="index"
+            :prop="item.prop"
+            :label="item.title"
+            :width="item.width"
+            align="center"
+          >
+            <template #default="scoped" v-if="item.type == 'icon'">
+              <el-tooltip
+                class="item"
+                effect="dark"
+                :content="item.title"
+                placement="bottom"
+                ><el-button
+                  type="text"
+                  @click="tableButtonClick(scoped.row, item)"
+                  ><i :class="item.icon" style="font-size: 22px"></i></el-button
+              ></el-tooltip>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <template #footer>
+        <el-button type="danger" size="small" @click="showDetialBox = false"
+          >鍏抽棴</el-button
+        >
+      </template>
+    </vol-box>
+
+    <!-- 鍑哄簱绔欏彴閫夋嫨寮圭獥锛堥潤鎬佹ā鏉垮疄鐜帮級 -->
+    <el-dialog
+      v-model="showOutboundDialog"
+      title="鍑哄簱鎿嶄綔 - 閫夋嫨鍑哄簱绔欏彴"
+      width="500px"
+      :append-to-body="true"
+    >
+      <el-form
+        :model="outboundForm"
+        :rules="outboundRules"
+        ref="outboundFormRef"
+        label-width="100px"
+        style="padding: 0 20px"
+      >
+        <el-form-item label="鍑哄簱绔欏彴" prop="selectedPlatform" style="margin-bottom: 24px">
+          <el-select
+            v-model="outboundForm.selectedPlatform"
+            placeholder="璇烽�夋嫨鍑哄簱绔欏彴锛�3-12锛�"
+            style="width: 100%; height: 40px"
+          >
+            <el-option
+              v-for="platform in platformOptions"
+              :key="platform.value"
+              :label="platform.label"
+              :value="platform.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <el-button @click="showOutboundDialog = false" style="margin-right: 8px">鍙栨秷</el-button>
+        <el-button type="primary" @click="confirmOutbound">纭畾鍑哄簱</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import VolBox from "@/components/basic/VolBox.vue";
+import { ElMessage } from "element-plus";
+
+export default {
+  components: { VolBox },
+  data() {
+    return {
+      row: null,
+      showDetialBox: false,
+      tableData: [],
+      tableColumns: [
+        { prop: "materielCode", title: "鐗╂枡缂栧彿", type: "string", width: 150 },
+        { prop: "materielName", title: "鐗╂枡鍚嶇О", type: "string", width: 150 },
+        { prop: "palletCode", title: "鎵樼洏缂栧彿", type: "string", width: 150 },
+        { prop: "locationCode", title: "璐т綅缂栧彿", type: "string", width: 180 },
+        { prop: "useableQuantity", title: "鍙敤鏁伴噺", type: "string" },
+      ],
+      selection: [],
+      selectionSum: 0,
+      selectionClass: "less-style",
+      originalQuantity: 0,
+
+      // 鍑哄簱寮圭獥鐩稿叧鏁版嵁
+      showOutboundDialog: false,
+      outboundForm: { selectedPlatform: "" }, // 琛ㄥ崟缁戝畾鏁版嵁
+      outboundRules: {
+        selectedPlatform: [
+          { required: true, message: "璇烽�夋嫨鍑哄簱绔欏彴", trigger: "change" },
+        ],
+      },
+      platformOptions: [
+        { label: "绔欏彴2", value: "2-1" },
+        { label: "绔欏彴3", value: "3-1" },
+      ],
+    };
+  },
+  methods: {
+    open(row) {
+      this.row = row;
+      this.showDetialBox = true;
+      this.getData();
+      this.updateSelectionClass(); // 鍒濆鍖栧凡閫夋暟閲忔牱寮�
+    },
+
+    lockStock() {
+      this.http
+        .post(
+          "api/OutboundOrderDetail/LockOutboundStock?id=" + this.row.id,
+          this.selection,
+          "鏁版嵁澶勭悊涓�"
+        )
+        .then((x) => {
+          if (!x.status) return ElMessage.error(x.message);
+          ElMessage.success("鎿嶄綔鎴愬姛");
+          this.showDetialBox = false;
+          this.$emit("parentCall", ($vue) => {
+            $vue.getData();
+          });
+        });
+    },
+
+    // 鎵撳紑鍑哄簱寮圭獥
+    openOutboundDialog() {
+      if (this.selection.length === 0) {
+        return ElMessage.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
+      }
+      // 閲嶇疆琛ㄥ崟閬垮厤娈嬬暀鍊�
+      this.outboundForm.selectedPlatform = "";
+      this.showOutboundDialog = true;
+    },
+
+    // 纭鍑哄簱鎿嶄綔
+    confirmOutbound() {
+      this.$refs.outboundFormRef.validate((valid) => {
+        if (!valid) return;
+
+
+        // 鏋勯�犺姹傚弬鏁�
+        const keys = this.selection.map((item) => item.id);
+        const requestParams = {
+          taskIds: keys,
+          outboundPlatform: this.outboundForm.selectedPlatform,
+        };
+          console.log(this.selection)
+        // 璋冪敤鍑哄簱鎺ュ彛
+        this.http
+          .post("api/Task/GenerateOutboundTasks", requestParams, "鏁版嵁澶勭悊涓�")
+          .then((x) => {
+            if (!x.status) return ElMessage.error(x.message);
+
+            ElMessage.success("鎿嶄綔鎴愬姛");
+            this.showOutboundDialog = false;
+            this.showDetialBox = false;
+            this.$emit("parentCall", ($vue) => {
+              $vue.getData();
+            });
+          })
+          .catch((error) => {
+            console.error("鍑哄簱璇锋眰澶辫触:", error);
+            ElMessage.error("璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯");
+          });
+      });
+    },
+
+    // 鍥哄畾鏌ヨ绔嬪簱搴撳瓨
+    getData() {
+      const url = "api/StockInfo/GetStockSelectViews?materielCode=";
+      this.http
+        .post(
+          url + this.row.materielCode + "&orderId=" + this.row.orderId,
+          null,
+          "鏌ヨ涓�"
+        )
+        .then((x) => {
+          this.tableData = x;
+          // 鍒锋柊鍚庢竻绌轰箣鍓嶇殑閫夋嫨鍜岃鏁�
+          this.clearSelection();
+          this.selectionSum = 0;
+          this.originalQuantity = 0;
+          this.updateSelectionClass();
+        });
+    },
+
+    revokeAssign() {
+      this.http
+        .post(
+          "api/OutboundOrderDetail/RevokeLockOutboundStock?id=" + this.row.id,
+          null,
+          "鏁版嵁澶勭悊涓�"
+        )
+        .then((x) => {
+          if (!x.status) return ElMessage.error(x.message);
+          ElMessage.success("鎿嶄綔鎴愬姛");
+          this.showDetialBox = false;
+          this.$emit("parentCall", ($vue) => {
+            $vue.getData();
+          });
+        });
+    },
+
+    handleSelectionChange(val) {
+      this.selection = val;
+      // 璁$畻宸查�夋暟閲忥紙杞暟瀛楅伩鍏嶅瓧绗︿覆鎷兼帴锛�
+      this.selectionSum = val.reduce(
+        (acc, curr) => acc + Number(curr.useableQuantity || 0),
+        0
+      ) + this.originalQuantity;
+      this.updateSelectionClass();
+    },
+
+    // 鏇存柊宸查�夋暟閲忔牱寮�
+    updateSelectionClass() {
+      if (!this.row) return;
+      if (this.selectionSum === this.row.orderQuantity) {
+        this.selectionClass = "equle-style";
+      } else if (this.selectionSum < this.row.orderQuantity) {
+        this.selectionClass = "less-style";
+      } else {
+        this.selectionClass = "more-style";
+      }
+    },
+
+    toggleSelection(rows) {
+      rows ? rows.forEach((row) => this.$refs.singleTable.toggleRowSelection(row)) : this.clearSelection();
+    },
+
+    clearSelection() {
+      if (this.$refs.singleTable) {
+        this.$refs.singleTable.clearSelection();
+      }
+    },
+
+    handleRowClick(row) {
+      this.$refs.singleTable.toggleRowSelection(row);
+    },
+
+    // 鍥炬爣鎸夐挳鐐瑰嚮鍗犱綅鏂规硶锛堝彲鏍规嵁闇�姹傛墿灞曪級
+    tableButtonClick(row, item) {
+      console.log("鍥炬爣鎸夐挳鐐瑰嚮锛�", item.title, row);
+    },
+  },
+};
+</script>
+
+<style scoped>
+.less-style {
+  color: black;
+}
+
+.equle-style {
+  color: green;
+}
+
+.more-style {
+  color: red;
+}
+</style>
+
+<style>
+.text-button:hover {
+  background-color: #f0f9eb !important;
+}
+
+.el-table .warning-row {
+  background: oldlace;
+}
+
+.box-table .el-table tbody tr:hover > td {
+  background-color: #d8e0d4 !important;
+}
+
+.box-table .el-table tbody tr.current-row > td {
+  background-color: #f0f9eb !important;
+}
+
+.el-table .success-row {
+  background: #f0f9eb;
+}
+
+.box-table .el-table {
+  border: 1px solid #ebeef5;
+}
+
+.box-head .el-alert__content {
+  width: 100%;
+}
+</style>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/allocateOrderDetail.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/allocateOrderDetail.vue"
new file mode 100644
index 0000000..148e7f4
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/allocateOrderDetail.vue"
@@ -0,0 +1,573 @@
+<template>
+  <div>
+    <vol-box
+      v-model="showDetialBox"
+      :lazy="true"
+      width="75%"
+      title="鍗曟嵁鏄庣粏淇℃伅"
+    >
+      <div class="box-head">
+        <el-alert :closable="false" style="width: 100%">
+          <el-row>
+            <el-col :span="16">
+              <span>宸查�変腑 {{ selection.length }} 椤�</span>
+            </el-col>
+            <el-col :span="8">
+          <!--     <el-link
+                type="primary"
+                size="small"
+                style="float: right; height: 20px"
+                @click="lockstocks"
+                >閿佸畾搴撳瓨</el-link> -->
+
+              <el-link
+                type="primary"
+                size="small"
+                style="float: right; height: 20px"
+                @click="handleOpenPicking"
+                >鎷i��</el-link>
+                 
+              <el-link
+                type="primary"
+                size="small"
+                style="float: right; height: 20px; margin-right: 10px"
+                @click="outbound"
+                >鐩存帴鍑哄簱</el-link
+              >
+              <el-link
+                type="primary"
+                size="small"
+                style="float: right; height: 20px; margin-right: 10px"
+                @click="getData"
+                >鍒锋柊</el-link
+              ></el-col
+            >
+          </el-row>
+        </el-alert>
+      </div>
+      <div class="box-table" style="margin-top: 1%">
+        <el-table
+          ref="singleTable"
+          :data="tableData"
+          style="width: 100%; height: 100%"
+          highlight-current-row
+          @current-change="handleCurrentChange"
+          height="500px"
+          @row-click="handleRowClick"
+          @selection-change="handleSelectionChange"
+        >
+          <el-table-column type="selection" width="55"> </el-table-column>
+          <el-table-column
+            label="搴忓彿"
+            type="index"
+            fixed="left"
+            width="55"
+            align="center"
+          ></el-table-column>
+          <el-table-column
+            v-for="(item, index) in tableColumns.filter((x) => !x.hidden)"
+            :key="index"
+            :prop="item.prop"
+            :label="item.title"
+            :width="item.width"
+            align="center"
+          >
+            <template #default="scoped">
+              <div v-if="item.type == 'icon'">
+                <el-tooltip
+                  class="item"
+                  effect="dark"
+                  :content="item.title"
+                  placement="bottom"
+                  ><el-link
+                    type="primary"
+                    :disabled="getButtonEnable(item.prop, scoped.row)"
+                    @click="tableButtonClick(scoped.row, item)"
+                    ><i :class="item.icon" style="font-size: 22px"></i></el-link
+                ></el-tooltip>
+              </div>
+
+              <div v-else-if="item.type == 'tag'">
+                <el-tag size="small">
+                  {{ getDictionary(scoped.row, item) }}
+                </el-tag>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </vol-box>
+    <stock-select ref="child" @parentCall="parentCall"></stock-select>
+    <selected-stock
+      ref="selectedStock"
+      @parentCall="parentCall"
+    ></selected-stock>
+  </div>
+</template>
+<script>
+import VolBox from "@/components/basic/VolBox.vue";
+import VolForm from "@/components/basic/VolForm.vue";
+import StockSelect from "./StockSelect.vue";
+import SelectedStock from "./SelectedStock.vue";
+import { h,createVNode, render,reactive  } from 'vue';
+import { ElDialog , ElForm, ElFormItem, ElSelect,ElOption, ElButton, ElMessage } from 'element-plus';
+export default {
+  components: { VolBox, VolForm, StockSelect, SelectedStock },
+  data() {
+    return {
+      row: null,
+      showDetialBox: false,
+      flag: false,
+      currentRow: null,
+      selection: [],
+      tableData: [],
+      tableColumns: [
+        {
+          prop: "id",
+          title: "Id",
+          type: "int",
+          width: 90,
+          hidden: true,
+        },
+        {
+          prop: "orderId",
+          title: "鍑哄簱鍗曚富閿�",
+          type: "string",
+          width: 90,
+          hidden: true,
+        },
+        {
+          prop: "materielCode",
+          title: "鐗╂枡缂栧彿",
+          type: "string",
+          width: 150,
+        },
+        {
+          prop: "materielName",
+          title: "鐗╂枡鍚嶇О",
+          type: "string",
+          width: 150,
+        },
+        {
+          prop: "batchNo",
+          title: "鎵规鍙�",
+          type: "string",
+          width: 90,
+        },
+        {
+          prop: "supplyCode",
+          title: "渚涘簲鍟嗙紪鍙�",
+          type: "string",
+          width: 150,
+        },
+        {
+          prop: "orderQuantity",
+          title: "鍗曟嵁鏁伴噺",
+          type: "string",
+          width: 90,
+        },
+        {
+          prop: "lockQuantity",
+          title: "閿佸畾鏁伴噺",
+          type: "int",
+          width: 90,
+        },
+        {
+          prop: "overOutQuantity",
+          title: "宸插嚭鏁伴噺",
+          type: "string",
+          width: 90,
+        },
+        {
+          prop: "unit",
+          title: "鍗曚綅",
+          type: "string",
+          width: 90,
+        },
+        {
+          prop: "orderDetailStatus",
+          title: "璁㈠崟鏄庣粏鐘舵��",
+          type: "tag",
+          width: 180,
+          bindKey: "orderDetailStatusEnum",
+        },
+        {
+          prop: "assignStock",
+          title: "鎸囧畾搴撳瓨",
+          type: "icon",
+          width: 90,
+          icon: "el-icon-s-grid",
+        },
+        {
+          prop: "viewDetail",
+          title: "鍑哄簱璇︾粏",
+          type: "icon",
+          width: 90,
+          icon: "el-icon-s-operation",
+        },
+        {
+          prop: "creater",
+          title: "鍒涘缓浜�",
+          type: "string",
+          width: 90,
+        },
+        {
+          prop: "createDate",
+          title: "鍒涘缓鏃堕棿",
+          type: "datetime",
+          width: 160,
+        },
+        {
+          prop: "modifier",
+          title: "淇敼浜�",
+          type: "string",
+          width: 100,
+        },
+        {
+          prop: "modifyDate",
+          title: "淇敼鏃堕棿",
+          type: "datetime",
+          width: 160,
+        },
+        {
+          prop: "remark",
+          title: "澶囨敞",
+          type: "string",
+        },
+      ],
+      paginations: {
+        sort: "id",
+        order: "desc",
+        Foots: "",
+        total: 0,
+        // 2020.08.29澧炲姞鑷畾涔夊垎椤垫潯澶у皬
+        sizes: [30, 60, 100, 120],
+        size: 30, // 榛樿鍒嗛〉澶у皬
+        Wheres: [],
+        page: 1,
+        rows: 30,
+      },
+      searchFormOptions: [
+        [
+          {
+            title: "鍗曟嵁缂栧彿",
+            field: "allocation_code",
+            type: "like",
+          },
+          {
+            title: "鍗曟嵁绫诲瀷",
+            field: "allocation_type",
+            type: "select",
+            dataKey: "OrderType",
+            data: [],
+          },
+          {
+            title: "鍗曟嵁鐘舵��",
+            field: "allocation_state",
+            type: "select",
+            dataKey: "OrderState",
+            data: [],
+          },
+        ],
+      ],
+      searchFormFields: {
+        allocation_code: "",
+        allocation_type: "",
+        allocation_state: "",
+      },
+      dictionaryList: null,
+    };
+  },
+  methods: {
+    open(row) {
+      this.row = row;
+      this.showDetialBox = true;
+      this.getDictionaryData();
+      this.getData();
+    },
+    getData() {
+      var wheres = [{ name: "orderId", value: this.row.id }];
+      var param = {
+        page: this.paginations.page,
+        rows: this.paginations.rows,
+        sort: this.paginations.sort,
+        order: this.paginations.order,
+        wheres: JSON.stringify(wheres), // 鏌ヨ鏉′欢锛屾牸寮忎负[{ name: "瀛楁", value: "xx" }]
+      };
+      this.http
+        .post("api/AllocateOrderDetail/GetPageData", param, "鏌ヨ涓�")
+        .then((x) => {
+          this.tableData = x.rows;
+        });
+    },
+    tableButtonClick(row, column) {
+      if (column.prop == "assignStock") {
+        this.$refs.child.open(row);
+      } else {
+        //鐐瑰嚮鎵撳紑鍑哄簱璇︽儏
+        this.$refs.selectedStock.open(row);
+      }
+    },
+    lockstocks() {
+      if (this.selection.length === 0) {
+        return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
+      }
+      var keys = this.selection.map((item) => item.id); // 鑾峰彇閫変腑琛岀殑id
+      this.http
+        .post("api/AllocateOrderDetail/LockOutboundStocks", keys, "鏁版嵁澶勭悊涓�")
+        .then((x) => {
+          if (!x.status) return this.$message.error(x.message);
+          this.$message.success("鎿嶄綔鎴愬姛");
+          this.showDetialBox = false;
+          this.$emit("parentCall", ($vue) => {
+            $vue.getData();
+          });
+        });
+    },
+    // 鎵撳紑鎷i�夐〉闈�
+   handleOpenPicking() {
+      this.$router.push({
+        path: '/outbound/picking',
+        query: { orderId: this.row.id ,orderNo:this.row.orderNo}
+      })
+    },
+    outbound() {
+      if (this.selection.length === 0) {
+        return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
+      }
+      const platformOptions = [{label:'绔欏彴2',value:'2-1'},{label:'绔欏彴3',value:'3-1'}];
+      const mountNode = document.createElement('div');
+      document.body.appendChild(mountNode);
+
+      // 2. 琛ㄥ崟鏁版嵁锛堥粯璁ら�変腑绔欏彴3锛�
+      const formData = reactive({
+        selectedPlatform: platformOptions[0].value // 榛樿缁戝畾銆岀珯鍙�3銆嶇殑value
+      });
+
+      // 3. 鍔ㄦ�佸垱寤哄脊绐楃粍浠�
+      const vnode = createVNode(ElDialog, {
+        title: '鍑哄簱鎿嶄綔 - 閫夋嫨鍑哄簱绔欏彴',
+        width: '500px',
+        modelValue: true,
+        appendToBody: true,
+        'onUpdate:modelValue': (isVisible) => {
+          if (!isVisible) {
+            render(null, mountNode);
+            document.body.removeChild(mountNode);
+          }
+        }, 
+        style: {
+          padding: '20px 0',
+          borderRadius: '8px'
+        }
+      }, {
+        default: () => h(ElForm, {
+          model: formData,
+          rules: {
+            selectedPlatform: [
+              { required: true, message: '璇烽�夋嫨鍑哄簱绔欏彴', trigger: 'change' }
+            ]
+          },
+          ref: 'outboundForm',
+          labelWidth: '100px',
+          style: {
+            padding: '0 30px'
+          }
+        }, [
+          // 鍑哄簱绔欏彴閫夋嫨椤癸紙鏍稿績琛ㄥ崟椤癸級
+          h(ElFormItem, {
+            label: '鍑哄簱绔欏彴',
+            prop: 'selectedPlatform',
+            style: {
+              marginBottom: '24px'
+            }
+          }, [
+            h(ElSelect, {
+              placeholder: '璇烽�夋嫨鍑哄簱绔欏彴锛�3-12锛�',
+              modelValue: formData.selectedPlatform,
+              'onUpdate:modelValue': (val) => {
+                formData.selectedPlatform = val;
+              },
+              style: {
+                width: '100%',
+                height: '40px',
+                borderRadius: '4px',
+                borderColor: '#dcdfe6'
+              }
+            }, platformOptions.map(platform => 
+              h(ElOption, { label: platform.label, value: platform.value })
+            ))
+          ]),
+          // 搴曢儴鎸夐挳鍖�
+          h('div', {
+            style: {
+              textAlign: 'right',
+              marginTop: '8px',
+              paddingRight: '4px'
+            }
+          }, [
+            h(ElButton, {
+              type: 'text',
+              onClick: () => {
+                render(null, mountNode);
+                document.body.removeChild(mountNode);
+                ElMessage.info('鍙栨秷鍑哄簱鎿嶄綔');
+              },
+              style: {
+                marginRight: '8px',
+                color: '#606266'
+              }
+            }, '鍙栨秷'),
+            h(ElButton, {
+              type: 'primary',
+              onClick: async () => {
+                const formRef = vnode.component.refs.outboundForm;
+                try {
+                  // 琛ㄥ崟鏍¢獙
+                  await formRef.validate();
+                } catch (err) {
+                  return;
+                }
+
+                // 4. 鏋勯�犺姹傚弬鏁帮紙閫変腑鍗曟嵁ID + 閫夋嫨鐨勫嚭搴撶珯鍙帮級
+                const keys = this.selection.map((item) => item.id);
+                const requestParams = {
+                  taskIds: keys,
+                  outboundPlatform: formData.selectedPlatform // 鍑哄簱绔欏彴
+                };
+
+                // 5. 璋冪敤鍑哄簱鎺ュ彛
+                this.http
+                  .post("api/Task/GenerateOutboundTasks", requestParams, "鏁版嵁澶勭悊涓�")
+                  .then((x) => {
+                    if (!x.status) return ElMessage.error(x.message);
+                    
+                    ElMessage.success("鎿嶄綔鎴愬姛");
+                    this.showDetialBox = false; // 鍏抽棴璇︽儏妗�
+                    this.$emit("parentCall", ($vue) => {
+                      $vue.getData(); // 閫氱煡鐖剁粍浠跺埛鏂�
+                    });
+                    // 鍏抽棴寮圭獥
+                    render(null, mountNode);
+                    document.body.removeChild(mountNode);
+                  })
+                  .catch(() => {
+                    ElMessage.error('璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯');
+                  });
+              },
+              style: {
+                borderRadius: '4px',
+                padding: '8px 20px'
+              }
+            }, '纭畾鍑哄簱')
+          ])
+        ])
+      });
+
+      // 缁戝畾app涓婁笅鏂囷紝纭繚El缁勪欢姝e父宸ヤ綔
+      vnode.appContext = this.$.appContext;
+      render(vnode, mountNode);
+    },
+    setCurrent(row) {
+      this.$refs.singleTable.setCurrentRow(row);
+    },
+    handleCurrentChange(val) {
+      this.currentRow = val;
+    },
+    getButtonEnable(propName, row) {
+      if (propName == "assignStock") {
+        if (
+          row.orderDetailStatus !== 0 &&
+          row.orderDetailStatus !== 60 &&
+          row.orderDetailStatus !== 70 &&
+          row.orderDetailStatus !== 80
+        ) {
+          return true;
+        } else {
+          return false;
+        }
+      }
+      return false;
+    },
+    parentCall(fun) {
+      if (typeof fun != "function") {
+        return console.log("鎵╁睍缁勪欢闇�瑕佷紶鍏ヤ竴涓洖璋冩柟娉曟墠鑳借幏鍙栫埗绾ue瀵硅薄");
+      }
+      fun(this);
+    },
+    handleRowClick(row) {
+      this.$refs.singleTable.toggleRowSelection(row);
+    },
+    handleSelectionChange(val) {
+      this.selection = val;
+    },
+    getDictionaryData() {
+      if (this.dictionaryList) {
+        return;
+      }
+      var param = [];
+      this.tableColumns.forEach((x) => {
+        if (x.type == "tag" && x.bindKey != "") {
+          param.push(x.bindKey);
+        }
+      });
+      this.http
+        .post("api/Sys_Dictionary/GetVueDictionary", param, "鏌ヨ涓�")
+        .then((x) => {
+          if (x.length > 0) {
+            this.dictionaryList = x;
+          }
+        });
+    },
+    getDictionary(row, column) {
+      if (this.dictionaryList) {
+        var item = this.dictionaryList.find((x) => x.dicNo == column.bindKey);
+        if (item) {
+          var dicItem = item.data.find((x) => x.key == row[column.prop]);
+          console.log(dicItem);
+          if (dicItem) {
+            return dicItem.value;
+          } else {
+            return row[column.prop];
+          }
+        } else {
+          return row[column.prop];
+        }
+      }
+    },
+  },
+};
+</script>
+<style scoped>
+.text-button {
+  border: 0px;
+}
+</style>
+
+<style>
+.text-button:hover {
+  background-color: #f0f9eb !important;
+}
+
+.el-table .warning-row {
+  background: oldlace;
+}
+
+.box-table .el-table tbody tr:hover > td {
+  background-color: #d8e0d4 !important;
+  /* color: #ffffff; */
+}
+
+.box-table .el-table tbody tr.current-row > td {
+  background-color: #f0f9eb !important;
+  /* color: #ffffff; */
+}
+
+.el-table .success-row {
+  background: #f0f9eb;
+}
+
+.box-table .el-table {
+  border: 1px solid #ebeef5;
+}
+</style>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue"
index 38f1779..fc0542e 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue"
@@ -1,6 +1,7 @@
 <template>
   <view-grid
-    ref="gridRef"
+    ref="grid"
+    @openPalletDialog="handleOpenPalletDialog"
     :columns="columns"
     :detail="detail"
     :editFormFields="editFormFields"
@@ -11,25 +12,33 @@
     :extend="extend"
   >
   </view-grid>
+      <!-- 2. 缁勭洏寮圭獥锛氱‘淇漰rops鍜屼簨浠剁粦瀹氭纭� -->
+    <PalletDialog
+      v-model:visible="palletVisible"  
+      :docNo="currentPalletDocNo"     
+      @back-success="handlePalletBackSuccess"  
+    ></PalletDialog>
+
 </template>
-
-<script>
-import extend from "@/extension/inbound/Dt_AllocateOrder.js"; 
-import ViewGrid from '@/components/basic/ViewGrid/ViewGrid.vue';
+    <script>
+import extend from "@/extension/inbound/Dt_AllocateOrder.js";
+import ViewGrid from '@/components/basic/ViewGrid/ViewGrid.vue'; 
 import { ref, defineComponent } from "vue";
-
+import PalletDialog from "@/extension/inbound/extend/AllocatedPallet.vue";
 export default defineComponent({
-  components: {
-    viewGrid: ViewGrid,
-    PalletDialog
+   components: {
+    // 鍏抽敭淇2锛氱粍浠舵敞鍐屽悕涓庢ā鏉挎爣绛惧悕閫傞厤锛坘ebab-case瀵瑰簲view-grid锛�
+    viewGrid: ViewGrid,  // 娉ㄥ唽涓簁ebab-case锛屾ā鏉跨敤<view-grid>
+    PalletDialog      // 娉ㄥ唽缁勭洏寮圭獥
+ 
   },
   setup() {
     const table = ref({
       key: "id",
       footer: "Foots",
       cnName: "璋冩嫧鍗�",
-      name: "allocateOrder",
-      url: "/allocateOrder/",
+      name: "Dt_AllocateOrder",
+      url: "/AllocateOrder/",
       sortName: "id",
     });
 
@@ -455,6 +464,21 @@
       key: "id",
     });
 
+    // 6. 缁勭洏寮圭獥鑱斿姩锛堟墍鏈夊彉閲忓繀椤昏繑鍥烇級
+    const palletVisible = ref(false);
+    const currentPalletDocNo = ref("");
+
+    const handleOpenPalletDialog = (docNo) => {
+      console.log('涓荤粍浠舵敹鍒扮粍鐩樹簨浠讹紝鍗曟嵁鍙凤細', docNo);
+      currentPalletDocNo.value = docNo;
+      palletVisible.value = true;
+    };
+
+    const handlePalletBackSuccess = () => {
+      console.log('缁勭洏鍥炰紶鎴愬姛锛屽埛鏂拌〃鏍�');
+      grid.value?.refresh();  // 姝ゆ椂gridRef宸叉寕杞斤紝鍙皟鐢ㄦ柟娉�
+    };
+
     return {
       table,
       extend,
@@ -463,12 +487,13 @@
       searchFormFields,
       searchFormOptions,
       columns,
-      detail, 
+      detail,
+       // 缁勭洏寮圭獥鐩稿叧
+      PalletDialog,    // 寮圭獥缁勪欢锛堟棤闇�杩斿洖锛屾敞鍐屽嵆鍙紝浣嗗彉閲忛渶杩斿洖锛�
       palletVisible,
       currentPalletDocNo,
       handleOpenPalletDialog,
-      handlePalletBackSuccess,
-      gridRef
+      handlePalletBackSuccess
     };
   },
 });
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateDetailService.cs"
new file mode 100644
index 0000000..16ac24f
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateDetailService.cs"
@@ -0,0 +1,51 @@
+锘縰sing SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_Core.Helper;
+using WIDESEA_IAllocateService;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_AllocateService
+{
+    public class AllocateDetailService : ServiceBase<Dt_AllocateOrderDetail, IRepository<Dt_AllocateOrderDetail>>, IAllocateDetailService
+    {
+        public AllocateDetailService(IRepository<Dt_AllocateOrderDetail> BaseDal) : base(BaseDal)
+        {
+        }
+
+        IRepository<Dt_AllocateOrderDetail> IAllocateDetailService.Repository => BaseDal;
+
+        public override PageGridData<Dt_AllocateOrderDetail> GetPageData(PageDataOptions options)
+        {
+
+            ISugarQueryable<Dt_AllocateOrderDetail> sugarQueryable1 = BaseDal.Db.Queryable<Dt_AllocateOrderDetail>();
+            if (!string.IsNullOrEmpty(options.Wheres))
+            {
+
+                List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>();
+                int totalCount = 0;
+                if (searchParametersList.Count > 0)
+                {
+                    {
+                        SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_AllocateOrderDetail.OrderId).FirstLetterToLower());
+                        if (searchParameters != null)
+                        {
+                            sugarQueryable1 = sugarQueryable1.Where(x => x.OrderId == searchParameters.Value.ObjToInt());
+                            var dataList = sugarQueryable1.ToPageList(options.Page, options.Rows, ref totalCount);
+                            return new PageGridData<Dt_AllocateOrderDetail>(totalCount, dataList);
+                        }
+                    }
+
+
+                }
+            }
+            return new PageGridData<Dt_AllocateOrderDetail>();
+        }
+    }
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IAllocateService/IAllocateDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IAllocateService/IAllocateDetailService.cs"
new file mode 100644
index 0000000..0d40c4b
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IAllocateService/IAllocateDetailService.cs"
@@ -0,0 +1,16 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_IAllocateService
+{
+    public interface IAllocateDetailService : IService<Dt_AllocateOrderDetail>
+    {
+        IRepository<Dt_AllocateOrderDetail> Repository { get; }
+    }
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Allocate/AllocateOrderDetailController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Allocate/AllocateOrderDetailController.cs"
new file mode 100644
index 0000000..7f0c236
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Allocate/AllocateOrderDetailController.cs"
@@ -0,0 +1,19 @@
+锘縰sing Microsoft.AspNetCore.Mvc;
+using WIDESEA_Core.BaseController;
+using WIDESEA_IAllocateService;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_WMSServer.Controllers.Allocate
+{
+    /// <summary>
+    /// 璋冩嫧鍗曟槑缁�
+    /// </summary>
+    [Route("api/AllocateOrderDetail")]
+    [ApiController]
+    public class AllocateOrderDetailController : ApiBaseController<IAllocateDetailService, Dt_AllocateOrderDetail>
+    {
+        public AllocateOrderDetailController(IAllocateDetailService service) : base(service)
+        {
+        }
+    }
+}

--
Gitblit v1.9.3