From 0b84af0415c00bdc82d537f0408cb974e7d31586 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期六, 22 十一月 2025 08:49:34 +0800
Subject: [PATCH] 提交

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Allocate/AllocateOrderController.cs |   21 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_DTO/Allocate/AllocateDto.cs                               |    9 
 项目代码/WIDESEA_WMSClient/src/router/viewGird.js                                                    |   11 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IBasicService/IInvokeMESService.cs                        |    2 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs                 |  197 ++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WIDESEA_TaskInfoService.csproj            |    1 
 项目代码/WIDESEA_WMSClient/src/views/inbound/allocateinboundOrder.vue                                |  397 +++++++++++
 项目代码/WIDESEA_WMSClient/src/views/outbound/allocateoutboundOrder.vue                              |  443 +++++++++++++
 项目代码/WIDESEA_WMSClient/src/extension/inbound/allocateinboundOrder.js                             |  456 +++++++++++++
 项目代码/WIDESEA_WMSClient/src/extension/outbound/allocateoutboundOrder.js                           |  374 +++++++++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs                            |   53 +
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs                          |   38 +
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs                       |    2 
 13 files changed, 1,960 insertions(+), 44 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/allocateinboundOrder.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/allocateinboundOrder.js"
new file mode 100644
index 0000000..0ec3d7d
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/allocateinboundOrder.js"
@@ -0,0 +1,456 @@
+
+//姝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锛岃В鍐虫彁绀烘棤鍙嶅簲
+
+let extension = {
+    components: {
+      //鏌ヨ鐣岄潰鎵╁睍缁勪欢
+      gridHeader: '',
+      gridBody: '',
+      gridFooter: '',
+      //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
+      modelHeader: '',
+      modelBody: '',
+      modelFooter: ''
+    },
+    tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
+    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.inboundOrderNo);
+        }
+      },
+      {
+                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() {  
+      },
+      onInited() {
+        
+        //妗嗘灦鍒濆鍖栭厤缃悗
+        //濡傛灉瑕侀厤缃槑缁嗚〃,鍦ㄦ鏂规硶鎿嶄綔
+        //this.detailOptions.columns.forEach(column=>{ });
+      },
+      searchBefore(param) {
+        //鐣岄潰鏌ヨ鍓�,鍙互缁檖aram.wheres娣诲姞鏌ヨ鍙傛暟
+        //杩斿洖false锛屽垯涓嶄細鎵ц鏌ヨ
+        let wheres = [{
+            'name': 'orderType',
+            'value': '115',
+            'displayType': 'text'}];
+   
+
+          param.wheres.push(...wheres);
+    //   this.searchFormFields.orderType=[115]
+        return true;
+      },
+      searchAfter(result) {
+        //鏌ヨ鍚庯紝result杩斿洖鐨勬煡璇㈡暟鎹�,鍙互鍦ㄦ樉绀哄埌琛ㄦ牸鍓嶅鐞嗚〃鏍肩殑鍊�
+        return true;
+      },
+      addBefore(formData) {
+        //鏂板缓淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛紝鍙互缁欑粰琛ㄥ崟璁剧疆鍊硷紝鑷繁杈撳嚭鐪媐ormData鐨勫��
+        return true;
+      },
+      updateBefore(formData) {
+        //缂栬緫淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛ㄣ�佸垹闄よ鐨処d
+        return true;
+      },
+      rowClick({ row, column, event }) {
+        //鏌ヨ鐣岄潰鐐瑰嚮琛屼簨浠�
+        this.$refs.table.$refs.table.toggleRowSelection(row); //鍗曞嚮琛屾椂閫変腑褰撳墠琛�;
+      },
+      modelOpenAfter(row) {
+        //鐐瑰嚮缂栬緫銆佹柊寤烘寜閽脊鍑烘鍚庯紝鍙互鍦ㄦ澶勫啓閫昏緫锛屽锛屼粠鍚庡彴鑾峰彇鏁版嵁
+        //(1)鍒ゆ柇鏄紪杈戣繕鏄柊寤烘搷浣滐細 this.currentAction=='Add';
+        //(2)缁欏脊鍑烘璁剧疆榛樿鍊�
+        //(3)this.editFormFields.瀛楁='xxx';
+        //濡傛灉闇�瑕佺粰涓嬫媺妗嗚缃粯璁ゅ�硷紝璇烽亶鍘唗his.editFormOptions鎵惧埌瀛楁閰嶇疆瀵瑰簲data灞炴�х殑key鍊�
+        //鐪嬩笉鎳傚氨鎶婅緭鍑虹湅锛歝onsole.log(this.editFormOptions)
+      }
+    }
+  };
+  export default extension;
+  
\ 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/outbound/allocateoutboundOrder.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/allocateoutboundOrder.js"
new file mode 100644
index 0000000..487648b
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/allocateoutboundOrder.js"
@@ -0,0 +1,374 @@
+
+//姝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';
+
+import gridBody from './extend/outOrderDetail.vue'
+let extension = {
+    components: {
+      //鏌ヨ鐣岄潰鎵╁睍缁勪欢
+      gridHeader: '',
+      gridBody: gridBody,
+      gridFooter: '',
+      //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
+      modelHeader: '',
+      modelBody: '',
+      modelFooter: ''
+    },
+    tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
+    buttons: { view: [
+       /* {
+        name: '鍑哄簱',
+        type: 'primary',
+        value: '鍑哄簱',
+        onClick: function () { // 淇锛氱敤ElMessage鏇夸唬this.$message
+          const selectedRows = this.$refs.table.getSelected();
+          if (selectedRows.length === 0) {
+            ElMessage.warning('璇峰厛閫夋嫨瑕佺敓鎴愪换鍔$殑琛�');
+            return;
+          }
+          if (selectedRows.length > 1) {
+            ElMessage.warning('鍙兘閫夋嫨涓�琛�');
+            return;
+          }
+    
+
+          // 鎵�鏈夋牎楠岄�氳繃锛岃Е鍙戜富缁勪欢鎵撳紑鍑哄簱寮圭獥
+          console.log('鎵�鏈夋牎楠岄�氳繃锛岃Е鍙憃penOutboundDialog浜嬩欢锛屽崟鎹暟鎹細', selectedRows[0]);
+         
+          this.$emit('openOutboundDialog', {
+            transNo: selectedRows[0].transNo,       // 鍑哄簱鍗曠紪鍙�
+            createDate: selectedRows[0].createDate || new Date().toLocaleDateString()  // 鍑哄簱鏃ユ湡
+          });
+        }
+      }, */
+      {
+  name: '绌烘墭鐩樺嚭搴�',
+  type: 'primary',
+  value: '绌烘墭鐩樺嚭搴�',
+  onClick: function () {
+    
+   
+    const platformOptions = Array.from({ length: 1 }, (_, i) => {
+      const num = 1;
+      return { label: `绔欏彴${num}`, value: `1-2` };
+    });
+
+    const quantityOptions = Array.from({ length: 6 }, (_, i) => ({
+      label: (i + 1).toString(), 
+      value: i + 1 
+    }));
+
+    const warehouseOptions = 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鏍煎紡
+          warehouseOptions.value = data.map(item => ({
+            label: item.locationTypeDesc,
+            value: item.locationType  
+          }));
+        } else {
+          ElMessage.error('鑾峰彇鍖哄煙鍒楄〃澶辫触');
+          warehouseOptions.value = [];
+        }
+      } catch (err) {
+        ElMessage.error('鍖哄煙鏁版嵁璇锋眰寮傚父锛岃绋嶅悗閲嶈瘯');
+        warehouseOptions.value = [];
+      } finally {
+        isLoadingWarehouses.value = false;
+      }
+    };
+
+    const mountNode = document.createElement('div');
+    document.body.appendChild(mountNode);
+
+    
+    const formData = reactive({
+      warehouseCode:'',
+      palletCode: '',
+      selectedPlatform: platformOptions[0].value,
+      quantity:1 
+    });
+
+    const vnode = createVNode(ElDialog, {
+      title: '绌烘墭鐩樺嚭搴�',
+      width: '500px', 
+      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);
+        }
+      },
+      style: {
+        padding: '20px 0', 
+        borderRadius: '8px' 
+      }
+    }, {
+      default: () => h(ElForm, {
+        model: formData,
+        rules: {
+          warehouseCode:[
+            { required: true, message: '璇烽�夋嫨鍖哄煙', trigger: ['change', 'blur'] }
+          ],
+          palletCode: [
+            { type: 'string', message: '鏂欑鍙峰繀椤讳负瀛楃涓�', trigger: 'blur' }
+          ],
+          selectedPlatform: [
+            { required: true, message: '璇烽�夋嫨鍑哄簱绔欏彴', trigger: 'change' }
+          ],
+          quantity:[
+            { required: true, message: '璇烽�夋嫨绌虹鏁伴噺', trigger: 'change'}
+          ]                       
+        },
+        ref: 'batchOutForm',
+        labelWidth: '100px', 
+        style: {
+          padding: '0 30px', 
+        }
+       }, 
+       [
+      //   h(ElFormItem, {
+      //     label: '浠撳簱鍖哄煙',
+      //     prop: 'warehouseCode',
+      //     style: {
+      //       marginBottom: '24px' 
+      //     }
+      //   }, [
+      //     h(ElSelect, {
+      //       placeholder: '璇烽�夋嫨浠撳簱鍖哄煙',
+      //       modelValue: formData.warehouseCode,
+      //       'onUpdate:modelValue': (val) => {
+      //         formData.warehouseCode = val;
+      //       },
+      //       style: {
+      //         width: '100%',
+      //         height: '40px', 
+      //         borderRadius: '4px',
+      //         borderColor: '#dcdfe6'
+      //       }
+      //     }, warehouseOptions.value.map(platform => 
+      //       h(ElOption, { label: platform.label, value: platform.value })
+      //     ))
+      //   ]),
+        h(ElFormItem, {
+          label: '鍑哄簱绔欏彴',
+          prop: 'selectedPlatform',
+          style: {
+            marginBottom: '24px' 
+          }
+        }, [
+          h(ElSelect, {
+            placeholder: '璇烽�夋嫨鍑哄簱绔欏彴',
+            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(ElFormItem,{
+      //     label:'鍑哄簱鏁伴噺',
+      //     prop:'quantity',
+      //     style:{
+      //       marginBottom:'24px'
+      //     }
+      //   },[h(ElSelect,{
+      //     placeholder:'璇烽�夋嫨绌虹鏁伴噺',
+      //     modelValue:formData.quantity,
+      //     'onUpdate:modelValue':(val)=>{
+      //       formData.quantity=val;
+      //     },
+      //     style:{
+      //       width:'100%',
+      //       height:'40px',
+      //       borderRadius:'4px',
+      //       borderColor:'#dcdfe6'
+      //     },
+      //     filterable:false
+      //   },
+      //   quantityOptions.map(option=>
+      //     h(ElOption,{
+      //       label:option.label,
+      //       value:option.value
+      //     })
+      //   )
+      // )]),                                 
+        h(ElFormItem, {
+          label: '鏂欑鍙�',
+          prop: 'palletCode',
+          style: {
+            marginBottom: '16px' 
+          }
+        }, [
+          h(ElInput, {
+            type: 'text',
+            placeholder: '鍙�夎緭鍏ユ枡绠卞彿锛屼笉濉垯鑷姩鍒嗛厤绌烘枡绠�',
+            modelValue: formData.palletCode,
+            'onUpdate:modelValue': (val) => {
+              formData.palletCode = val;
+            },
+            style: {
+              width: '100%',
+              height: '40px', 
+              borderRadius: '4px',
+              borderColor: '#dcdfe6'
+            },
+            attrs: {
+              placeholderStyle: 'color: #909399;' 
+            }
+          })
+        ]),
+        
+        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.batchOutForm;
+              try {
+                await formRef.validate();
+              } catch (err) {
+                return;
+              }
+
+              http.post('/api/Task/PalletOutboundTask?palletCode='+formData.palletCode+'&endStation='+formData.selectedPlatform, {
+                
+              }).then(({ data, status, message }) => {
+                if (status) {
+
+                  ElMessage.success(`鍑哄簱鎴愬姛`);
+                  this.refresh();
+                  render(null, mountNode);
+                  document.body.removeChild(mountNode);
+                } else {
+                  ElMessage.error(message || data?.message || '鍑哄簱澶辫触');
+                }
+              }).catch(() => {
+                ElMessage.error('璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯');
+              });
+            },
+            style: {
+              borderRadius: '4px',
+              padding: '8px 20px' 
+            }
+          }, '纭畾')
+        ])
+      ])
+    });
+
+    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) => {
+            const table = this.$refs.table.$refs.table;
+            if(table){
+              table.clearSelection();
+              table.toggleRowSelection(row,true);
+            }
+              const rowId =row.id;
+              console.log(rowId);
+              this.$refs.gridBody.open(row);
+          }
+      });
+      },
+      onInited() {
+        //妗嗘灦鍒濆鍖栭厤缃悗
+        //濡傛灉瑕侀厤缃槑缁嗚〃,鍦ㄦ鏂规硶鎿嶄綔
+        //this.detailOptions.columns.forEach(column=>{ });
+      },
+      searchBefore(param) {
+        //鐣岄潰鏌ヨ鍓�,鍙互缁檖aram.wheres娣诲姞鏌ヨ鍙傛暟
+        //杩斿洖false锛屽垯涓嶄細鎵ц鏌ヨ
+       //   this.searchFormFields.orderType=[215]
+
+        let wheres = [{
+            'name': 'orderType',
+            'value': '215',
+            'displayType': 'text'}];
+   
+
+          param.wheres.push(...wheres);
+        return true;
+      },
+      searchAfter(result) {
+        //鏌ヨ鍚庯紝result杩斿洖鐨勬煡璇㈡暟鎹�,鍙互鍦ㄦ樉绀哄埌琛ㄦ牸鍓嶅鐞嗚〃鏍肩殑鍊�
+        return true;
+      },
+      addBefore(formData) {
+        //鏂板缓淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛紝鍙互缁欑粰琛ㄥ崟璁剧疆鍊硷紝鑷繁杈撳嚭鐪媐ormData鐨勫��
+        return true;
+      },
+      updateBefore(formData) {
+        //缂栬緫淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛ㄣ�佸垹闄よ鐨処d
+        return true;
+      },
+      rowClick({ row, column, event }) {
+        //鏌ヨ鐣岄潰鐐瑰嚮琛屼簨浠�
+        this.$refs.table.$refs.table.toggleRowSelection(row); //鍗曞嚮琛屾椂閫変腑褰撳墠琛�;
+      },
+      modelOpenAfter(row) {
+        //鐐瑰嚮缂栬緫銆佹柊寤烘寜閽脊鍑烘鍚庯紝鍙互鍦ㄦ澶勫啓閫昏緫锛屽锛屼粠鍚庡彴鑾峰彇鏁版嵁
+        //(1)鍒ゆ柇鏄紪杈戣繕鏄柊寤烘搷浣滐細 this.currentAction=='Add';
+        //(2)缁欏脊鍑烘璁剧疆榛樿鍊�
+        //(3)this.editFormFields.瀛楁='xxx';
+        //濡傛灉闇�瑕佺粰涓嬫媺妗嗚缃粯璁ゅ�硷紝璇烽亶鍘唗his.editFormOptions鎵惧埌瀛楁閰嶇疆瀵瑰簲data灞炴�х殑key鍊�
+        //鐪嬩笉鎳傚氨鎶婅緭鍑虹湅锛歝onsole.log(this.editFormOptions)
+      }
+    }
+  };
+  export default extension;
+  
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/router/viewGird.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/router/viewGird.js"
index 854c4d1..5ee8694 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/router/viewGird.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/router/viewGird.js"
@@ -191,7 +191,16 @@
     path: '/materielToMes',
     name: 'Dt_MaterielToMes',
     component: () => import('@/views/inbound/Dt_MaterielToMes.vue')
-  }, 
+  }, {
+    path:'/allocateinboundOrder', 
+    name: 'allocateinboundOrder',
+    component: () => import('@/views/inbound/allocateinboundOrder.vue')
+
+  },{
+    path:'allocateoutboundOrder',
+    name: 'allocateoutboundOrder',
+    component: () => import('@/views/outbound/allocateoutboundOrder.vue') 
+  },
   {
     path: '/allocateOrder',
     name: 'Dt_AllocateOrder',
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/allocateinboundOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/allocateinboundOrder.vue"
new file mode 100644
index 0000000..8fbef36
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/allocateinboundOrder.vue"
@@ -0,0 +1,397 @@
+
+<template>
+  <view-grid
+    ref="grid"
+    @openPalletDialog="handleOpenPalletDialog"
+    :columns="columns"
+    :detail="detail"
+    :editFormFields="editFormFields"
+    :editFormOptions="editFormOptions"
+    :searchFormFields="searchFormFields"
+    :searchFormOptions="searchFormOptions"
+    :table="table"
+    :extend="extend"
+  >
+  </view-grid>
+      <!-- 2. 缁勭洏寮圭獥锛氱‘淇漰rops鍜屼簨浠剁粦瀹氭纭� -->
+    <PalletDialog
+      v-model:visible="palletVisible"  
+      :docNo="currentPalletDocNo"     
+      @back-success="handlePalletBackSuccess"  
+    ></PalletDialog>
+
+</template>
+    <script>
+import extend from "@/extension/inbound/allocateinboundOrder.js";
+import ViewGrid from '@/components/basic/ViewGrid/ViewGrid.vue'; 
+import { ref, defineComponent } from "vue";
+import PalletDialog from "@/extension/inbound/extend/Pallet.vue";
+export default defineComponent({
+   components: {
+    // 鍏抽敭淇2锛氱粍浠舵敞鍐屽悕涓庢ā鏉挎爣绛惧悕閫傞厤锛坘ebab-case瀵瑰簲view-grid锛�
+    viewGrid: ViewGrid,  // 娉ㄥ唽涓簁ebab-case锛屾ā鏉跨敤<view-grid>
+    PalletDialog      // 娉ㄥ唽缁勭洏寮圭獥
+ 
+  },
+  setup() {
+    const table = ref({
+      key: "id",
+      footer: "Foots",
+      cnName: "璋冩嫧鍗�(鏅轰粨璋冨閮ㄤ粨搴�)",
+      name: "inboundOrder",
+      url: "/InboundOrder/",
+      sortName: "id",
+    });
+    const editFormFields = ref({
+      orderType: "",
+      inboundOrderNo: "",
+      upperOrderNo: "",
+      remark: "",
+    });
+    const editFormOptions = ref([
+      [
+        {
+          title: "鍗曟嵁绫诲瀷",
+          required: true,
+          field: "orderType",
+          type: "select",
+          dataKey: "inOrderType",
+          data: [],
+        },
+        {
+          field: "inboundOrderNo",
+          title: "鍗曟嵁缂栧彿",
+          type: "string",
+        },
+        {
+          title: "涓婃父鍗曟嵁缂栧彿",
+          field: "upperOrderNo",
+          type: "string",
+        },
+        {
+          title: "澶囨敞",
+          field: "remark",
+          type: "textarea",
+        },
+      ],
+    ]);
+    const searchFormFields = ref({
+      inboundOrderNo: "",
+      upperOrderNo: "",
+      orderType: "115",
+      orderStatus: "",
+      createType: "",
+      creater: "",
+      createDate: "",
+    });
+    const searchFormOptions = ref([
+      [
+        { title: "鍗曟嵁缂栧彿", field: "inboundOrderNo", type: "like" },
+        { title: "涓婃父鍗曟嵁缂栧彿", field: "upperOrderNo", type: "like" },
+        {
+          title: "鍗曟嵁绫诲瀷",
+          field: "orderType",
+          type: "select",
+          dataKey: "inOrderType",
+          data: [],
+        },
+        {
+          title: "鍗曟嵁鐘舵��",
+          field: "orderStatus",
+          type: "select",
+          dataKey: "inboundState",
+          data: [],
+        },
+      ],
+      [
+        {
+          title: "鍒涘缓鏂瑰紡",
+          field: "createType",
+          type: "select",
+          dataKey: "createType",
+          data: [],
+        },
+        { title: "鍒涘缓鑰�", field: "creater", type: "like" },
+        { title: "鍒涘缓鏃堕棿", field: "createDate", type: "datetime" },
+      ],
+    ]);
+    const columns = ref([
+      {
+        field: "id",
+        title: "Id",
+        type: "int",
+        width: 90,
+        hidden: true,
+        readonly: true,
+        require: true,
+        align: "left",
+      },
+      {
+        field: "inboundOrderNo",
+        title: "鍗曟嵁缂栧彿",
+        type: "string",
+        width: 120,
+        align: "left",
+        link: true,
+      },
+      {
+        field: "upperOrderNo",
+        title: "涓婃父鍗曟嵁缂栧彿",
+        type: "string",
+        width: 150,
+        align: "left",
+      },
+      {
+        field: "orderType",
+        title: "鍗曟嵁绫诲瀷",
+        type: "string",
+        width: 150,
+        align: "left",
+        bind: { key: "inOrderType", data: [] },
+      },
+      {
+        field: "businessType",
+        title: "涓氬姟绫诲瀷",
+        type: "string",
+        width: 150,
+        align: "left",
+        bind: { key: "businessType", data: [] },
+      },
+      {
+        field: "orderStatus",
+        title: "鍗曟嵁鐘舵��",
+        type: "decimal",
+        width: 90,
+        align: "left",
+        bind: { key: "inboundState", data: [] },
+      },
+      {
+        field: "createType",
+        title: "鍒涘缓鏂瑰紡",
+        type: "string",
+        width: 120,
+        align: "left",
+        bind: { key: "createType", data: [] },
+      },
+      {
+        field: "factoryArea",
+        title: "鍘傚尯",
+        type: "string",
+        width: 120,
+        align: "left"
+      },
+      {
+        field: "creater",
+        title: "鍒涘缓浜�",
+        type: "string",
+        width: 90,
+        align: "left",
+      },
+      {
+        field: "createDate",
+        title: "鍒涘缓鏃堕棿",
+        type: "datetime",
+        width: 160,
+        align: "left",
+      },
+      {
+        field: "modifier",
+        title: "淇敼浜�",
+        type: "string",
+        width: 100,
+        align: "left",
+      },
+      {
+        field: "modifyDate",
+        title: "淇敼鏃堕棿",
+        type: "datetime",
+        width: 160,
+        align: "left",
+      },
+      {
+        field: "remark",
+        title: "澶囨敞",
+        type: "string",
+        width: 100,
+        align: "left",
+      },
+    ]);
+    const detail = ref({
+      cnName: "璋冩嫧鍗曟槑缁�",
+      table: "InboundOrderDetail",
+      columns: [
+        {
+          field: "id",
+          title: "Id",
+          type: "int",
+          width: 90,
+          hidden: true,
+          readonly: true,
+          require: true,
+          align: "left",
+        },
+        {
+          field: "orderId",
+          title: "璋冩嫧鍗曚富閿�",
+          type: "string",
+          width: 90,
+          align: "left",
+          hidden: true,
+        },
+        {
+          field: "materielCode",
+          title: "鐗╂枡缂栧彿",
+          type: "select",
+          width: 150,
+          align: "left",
+          edit: { type: "" },
+          required: true,
+        },
+        {
+          field: "materielCode",
+          title: "鐗╂枡鍚嶇О",
+          type: "string",
+          width: 100,
+          align: "left",
+          bind: { key: "MaterielNames", data: [] },
+        },
+        {
+          field: "batchNo",
+          title: "鎵规鍙�",
+          type: "decimal",
+          width: 90,
+          align: "left",
+          edit: { type: "" },
+          required: true,
+        },
+        {
+          field: "supplyCode",
+          title: "渚涘簲鍟嗙紪鍙�",
+          type: "decimal",
+          width: 90,
+          align: "left",
+          edit: { type: "" },
+          required: true,
+        },
+        {
+          field: "warehouseCode",
+          title: "浠撳簱鍙�",
+          type: "decimal",
+          width: 90,
+          align: "left",
+          required: true
+        },
+        {
+          field: "barcode",
+          title: "鏉$爜",
+          type: "decimal",
+          width: 90,
+          align: "left",
+          edit: { type: "" },
+          required: true,
+        },
+        {
+          field: "orderQuantity",
+          title: "鍗曟嵁鏁伴噺",
+          type: "decimal",
+          width: 90,
+          align: "left",
+          edit: { type: "number" },
+          required: true,
+        },
+        {
+          field: "receiptQuantity",
+          title: "缁勭洏鏁伴噺",
+          type: "int",
+          width: 120,
+          align: "left",
+        },
+        {
+          field: "overInQuantity",
+          title: "涓婃灦鏁伴噺",
+          type: "string",
+          width: 200,
+          align: "left",
+        },
+        {
+          field: "orderDetailStatus",
+          title: "璁㈠崟鏄庣粏鐘舵��",
+          type: "string",
+          width: 180,
+          align: "left",
+          bind: { key: "orderDetailStatusEnum", data: [] },
+        },
+        {
+          field: "creater",
+          title: "鍒涘缓浜�",
+          type: "string",
+          width: 90,
+          align: "left",
+        },
+        {
+          field: "createDate",
+          title: "鍒涘缓鏃堕棿",
+          type: "datetime",
+          width: 160,
+          align: "left",
+        },
+        {
+          field: "modifier",
+          title: "淇敼浜�",
+          type: "string",
+          width: 100,
+          align: "left",
+        },
+        {
+          field: "modifyDate",
+          title: "淇敼鏃堕棿",
+          type: "datetime",
+          width: 160,
+          align: "left",
+        },
+        {
+          field: "remark",
+          title: "澶囨敞",
+          type: "string",
+          width: 100,
+          align: "left",
+        },
+      ],
+      sortName: "id",
+      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,
+      editFormFields,
+      editFormOptions,
+      searchFormFields,
+      searchFormOptions,
+      columns,
+      detail,
+       // 缁勭洏寮圭獥鐩稿叧
+      PalletDialog,    // 寮圭獥缁勪欢锛堟棤闇�杩斿洖锛屾敞鍐屽嵆鍙紝浣嗗彉閲忛渶杩斿洖锛�
+      palletVisible,
+      currentPalletDocNo,
+      handleOpenPalletDialog,
+      handlePalletBackSuccess
+    };
+  },
+});
+</script>
+    
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/allocateoutboundOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/allocateoutboundOrder.vue"
new file mode 100644
index 0000000..46ae5a5
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/allocateoutboundOrder.vue"
@@ -0,0 +1,443 @@
+
+<template>
+  <view-grid
+    ref="grid"
+        @openOutboundDialog="handleOpenOutboundDialog"  
+    :columns="columns"
+    :detail="detail"
+    :editFormFields="editFormFields"
+    :editFormOptions="editFormOptions"
+    :searchFormFields="searchFormFields"
+    :searchFormOptions="searchFormOptions"
+    :table="table"
+    :extend="extend"
+  >
+  </view-grid>
+      <!-- 鍑哄簱鎿嶄綔寮圭獥 -->
+    <OutboundDialog
+      v-model:visible="outboundVisible"  
+      :selected-document="selectedOutboundDocument"  
+      @outbound-success="handleOutboundSuccess"  
+    ></OutboundDialog>
+</template>
+    <script>
+import extend from "@/extension/outbound/allocateoutboundOrder.js";
+import ViewGrid from '@/components/basic/ViewGrid/ViewGrid.vue'; 
+import { ref, defineComponent } from "vue";
+import { ElMessage } from "element-plus";
+import OutboundDialog from "@/extension/outbound/extend/OutBound.vue";  // 寮曞叆鍑哄簱寮圭獥缁勪欢
+ 
+
+export default defineComponent({
+   components: {
+    // 鍏抽敭淇2锛氱粍浠舵敞鍐屽悕涓庢ā鏉挎爣绛惧悕閫傞厤锛坘ebab-case瀵瑰簲view-grid锛�
+    viewGrid: ViewGrid,  // 娉ㄥ唽涓簁ebab-case锛屾ā鏉跨敤<view-grid>
+    OutboundDialog  // 娉ㄥ唽鍑哄簱寮圭獥缁勪欢
+  },
+  setup() {
+    const table = ref({
+      key: "id",
+      footer: "Foots",
+      cnName: "璋冩嫧鍗�(澶栭儴浠撳簱璋冩櫤浠�)",
+      name: "outboundOrder",
+      url: "/OutboundOrder/",
+      sortName: "id",
+    });
+    const editFormFields = ref({
+      orderType: "",
+      orderNo:"",
+      upperOrderNo: "",
+      orderStatus: "",
+      remark: "",
+      warehouseId:""
+    });
+    const editFormOptions = ref([
+      [
+        {
+          title: "鍗曟嵁绫诲瀷",
+          required: true,
+          field: "orderType",
+          type: "select",
+          dataKey: "outOrderType",
+          data: [],
+        },
+        {
+        field: "orderNo",
+        title: "鍗曟嵁缂栧彿",
+        type: "string",
+        readonly:true
+      },
+        {
+          title: "涓婃父鍗曟嵁缂栧彿",
+          field: "upperOrderNo",
+          type: "string",
+        },
+        {
+          title: "鍗曟嵁鐘舵��",
+          field: "orderStatus",
+          type: "select",
+          dataKey: "inboundState",
+          data: [],
+          readonly: true,
+        },
+        {
+          title: "浠撳簱",
+          field: "warehouseId",
+          type: "select",
+          dataKey: "warehouses",
+          data: [],
+          required: true,
+        },
+        {
+          title: "澶囨敞",
+          field: "remark",
+          type: "textarea",
+        },
+      ],
+    ]);
+    const searchFormFields = ref({
+      orderNo: "",
+      upperOrderNo: "",
+      orderType: "215",
+      orderStatus: "",
+      createType: "",
+      creater: "",
+      createDate: "",
+    });
+    const searchFormOptions = ref([
+      [
+        { title: "鍗曟嵁缂栧彿", field: "orderNo", type: "like" },
+        { title: "涓婃父鍗曟嵁缂栧彿", field: "upperOrderNo", type: "like" },
+        {
+          title: "鍗曟嵁绫诲瀷",
+          field: "orderType",
+          type: "select",
+          dataKey: "outOrderType",
+          data: [],
+        },
+        {
+          title: "鍗曟嵁鐘舵��",
+          field: "orderStatus",
+          type: "select",
+          dataKey: "outboundStatusEnum",
+          data: [],
+        },
+      ],
+      [
+        {
+          title: "鍒涘缓鏂瑰紡",
+          field: "createType",
+          type: "select",
+          dataKey: "createType",
+          data: [],
+        },
+        { title: "鍒涘缓鑰�", field: "creater", type: "like" },
+        { title: "鍒涘缓鏃堕棿", field: "createDate", type: "datetime" },
+      ],
+    ]);
+    const columns = ref([
+      {
+        field: "id",
+        title: "Id",
+        type: "int",
+        width: 90,
+        hidden: true,
+        readonly: true,
+        require: true,
+        align: "left",
+      },
+      {
+        field: "orderNo",
+        title: "鍗曟嵁缂栧彿",
+        type: "string",
+        width: 160,
+        align: "left",
+        // link: true,
+      },
+      {
+        field: "upperOrderNo",
+        title: "涓婃父鍗曟嵁缂栧彿",
+        type: "string",
+        width: 160,
+        align: "left",
+      },
+      {
+        field: "orderType",
+        title: "鍗曟嵁绫诲瀷",
+        type: "string",
+        width: 150,
+        align: "left",
+        bind: { key: "outOrderType", data: [] },
+      },
+      {
+        field: "businessType",
+        title: "涓氬姟绫诲瀷",
+        type: "string",
+        width: 150,
+        align: "left",
+        bind: { key: "businessType", data: [] },
+      },
+      {
+        field: "orderStatus",
+        title: "鍗曟嵁鐘舵��",
+        type: "decimal",
+        width: 90,
+        align: "left",
+        bind: { key: "outboundStatusEnum", data: [] },
+      },
+      {
+        field: "createType",
+        title: "鍒涘缓鏂瑰紡",
+        type: "string",
+        width: 120,
+        align: "left",
+        bind: { key: "createType", data: [] },
+      },
+      {
+        field: "factoryArea",
+        title: "鍘傚尯",
+        type: "string",
+        width: 120,
+        align: "left"
+      },
+      {
+        field: "departmentCode",
+        title: "淇敼鏃堕棿",
+        type: "string",
+        width: 120,
+        align: "left",
+        hidden:true
+      },
+      {
+        field: "departmentName",
+        title: "閮ㄩ棬鍚嶇О",
+        type: "string",
+        width: 160,
+        align: "left",
+      },
+      {
+        field: "creater",
+        title: "鍒涘缓浜�",
+        type: "string",
+        width: 90,
+        align: "left",
+      },
+      {
+        field: "createDate",
+        title: "鍒涘缓鏃堕棿",
+        type: "datetime",
+        width: 160,
+        align: "left",
+      },
+      {
+        field: "modifier",
+        title: "淇敼浜�",
+        type: "string",
+        width: 100,
+        align: "left",
+      },
+      {
+        field: "modifyDate",
+        title: "淇敼鏃堕棿",
+        type: "datetime",
+        width: 160,
+        align: "left",
+      },
+      {
+        field: "remark",
+        title: "澶囨敞",
+        type: "string",
+        width: 100,
+        align: "left",
+      },
+    ]);
+    const detail = ref({
+      cnName: "璋冩嫧鏄庣粏鍗�",
+      table: "OnboundOrderDetail",
+      columns: [
+        {
+          field: "id",
+          title: "Id",
+          type: "int",
+          width: 90,
+          hidden: true,
+          readonly: true,
+          require: true,
+          align: "left",
+        },
+        {
+          field: "orderId",
+          title: "璋冩嫧鍗曚富閿�",
+          type: "string",
+          width: 90,
+          align: "left",
+          hidden: true,
+        },
+        {
+          field: "materielCode",
+          title: "鐗╂枡缂栧彿",
+          type: "string",
+          width: 150,
+          align: "left",
+          edit: { type: "string" },
+          required: true,
+        },
+        {
+          field: "materielName",
+          title: "鐗╂枡鍚嶇О",
+          type: "string",
+          width: 150,
+          align: "left",
+          edit: { type: "string" },
+        },
+        {
+          field: "batchNo",
+          title: "鎵规鍙�",
+          type: "decimal",
+          width: 90,
+          align: "left",
+          edit: { type: "string" },
+          required: true,
+        },
+        {
+          field: "supplyCode",
+          title: "渚涘簲鍟嗙紪鍙�",
+          type: "string",
+          width: 90,
+          align: "left",
+          edit: { type: "string" },
+          required: true,
+        },
+        {
+          field: "orderQuantity",
+          title: "鍗曟嵁鏁伴噺",
+          type: "string",
+          width: 90,
+          align: "left",
+          edit: { type: "number" },
+          required: true,
+        },
+        {
+          field: "rowNo",
+          title: "琛屽彿",
+          type: "string",
+          width: 90,
+          align: "left",
+          edit: { type: "number" },
+          required: true,
+        },
+        {
+          field: "lockQuantity",
+          title: "閿佸畾鏁伴噺",
+          type: "int",
+          width: 120,
+          align: "left",
+        },
+        {
+          field: "overOutQuantity",
+          title: "宸插嚭鏁伴噺",
+          type: "string",
+          width: 200,
+          align: "left",
+        },
+        {
+          field: "orderDetailStatus",
+          title: "璁㈠崟鏄庣粏鐘舵��",
+          type: "string",
+          width: 180,
+          align: "left",
+          bind: { key: "orderDetailStatusEnum", data: [] },
+        },
+        {
+          field: "creater",
+          title: "鍒涘缓浜�",
+          type: "string",
+          width: 90,
+          align: "left",
+        },
+        {
+          field: "createDate",
+          title: "鍒涘缓鏃堕棿",
+          type: "datetime",
+          width: 160,
+          align: "left",
+        },
+        {
+          field: "modifier",
+          title: "淇敼浜�",
+          type: "string",
+          width: 100,
+          align: "left",
+        },
+        {
+          field: "modifyDate",
+          title: "淇敼鏃堕棿",
+          type: "datetime",
+          width: 160,
+          align: "left",
+        },
+        {
+          field: "remark",
+          title: "澶囨敞",
+          type: "string",
+          width: 100,
+          align: "left",
+        },
+      ],
+      sortName: "id",
+      key: "id",
+    });
+      // 璋冩嫧寮圭獥鐩稿叧
+    const outboundVisible = ref(false);
+    const selectedOutboundDocument = ref({});  // 瀛樺偍閫変腑鐨勮皟鎷ㄥ崟鏁版嵁
+
+    // 鎵撳紑璋冩嫧寮圭獥锛堜粠鎵╁睍閰嶇疆鐨勬寜閽簨浠惰Е鍙戯級
+    const handleOpenOutboundDialog = (docData) => {
+      selectedOutboundDocument.value = docData;  // 淇濆瓨閫変腑鐨勫崟鎹暟鎹�
+      outboundVisible.value = true;  // 鏄剧ず寮圭獥
+    };
+
+    // 璋冩嫧鎴愬姛鍚庣殑鍥炶皟
+    const handleOutboundSuccess = (docNo) => {
+      ElMessage.success(`鍗曟嵁 ${docNo} 璋冩嫧鎴愬姛`);
+      gridRef.value?.refresh();  // 鍒锋柊琛ㄦ牸鏁版嵁
+    };
+
+    // 鍒濆鍖栨墿灞曢厤缃細涓鸿皟鎷ㄦ寜閽坊鍔犱簨浠惰Е鍙戦�昏緫
+    const initExtension = () => {
+      // 鎵惧埌"璋冩嫧"鎸夐挳骞剁粦瀹氭墦寮�寮圭獥鐨勯�昏緫
+      const outboundBtn = extend.buttons.view.find(btn => btn.name === '鍑哄簱');
+      if (outboundBtn) {
+        const originalOnClick = outboundBtn.onClick;
+        outboundBtn.onClick = function() {
+          // 鍏堟墽琛屽師鏈夋牎楠岄�昏緫
+          const selectedRows = this.$refs.table.getSelected();
+          if (selectedRows.length === 1) {
+            // 鏍¢獙閫氳繃鍚庯紝瑙﹀彂涓荤粍浠剁殑鍑哄簱寮圭獥浜嬩欢
+            this.$emit('openOutboundDialog', selectedRows[0]);
+          } else {
+            // 鍘熸湁閫昏緫宸插鐞嗘彁绀猴紝鏃犻渶閲嶅
+            originalOnClick.call(this);
+          }
+        };
+      }
+    };
+    return {
+      table,
+      extend,
+      editFormFields,
+      editFormOptions,
+      searchFormFields,
+      searchFormOptions,
+      columns,
+      detail,
+       // 鍑哄簱鐩稿叧
+      outboundVisible,
+      selectedOutboundDocument,
+      handleOpenOutboundDialog,
+      handleOutboundSuccess 
+    };
+  },
+});
+</script>
+    
\ No newline at end of file
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_BasicService/InvokeMESService.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_BasicService/InvokeMESService.cs"
index 87d60cc..9d98d85 100644
--- "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_BasicService/InvokeMESService.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_BasicService/InvokeMESService.cs"
@@ -12,6 +12,7 @@
 using System.Threading.Tasks;
 using WIDESEA_Core;
 using WIDESEA_Core.BaseRepository;
+using WIDESEA_DTO.Allocate;
 using WIDESEA_DTO.Basic;
 using WIDESEA_DTO.Inbound;
 using WIDESEA_DTO.Outbound;
@@ -41,6 +42,12 @@
             _inboundOrderRepository = inboundOrderRepository;
         }
 
+        /// <summary>
+        /// 鍏ュ簱鍙嶉
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        /// <exception cref="HttpRequestException"></exception>
         public async Task<ResponseModel> FeedbackInbound(FeedbackInboundRequestModel model)
         {
             string json =JsonConvert.SerializeObject(model, new JsonSerializerSettings
@@ -63,7 +70,13 @@
 
             return JsonConvert.DeserializeObject<ResponseModel>(body);
         }
-
+             
+        /// <summary>
+        /// 鍑哄簱鍙嶉
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        /// <exception cref="HttpRequestException"></exception>
         public async Task<ResponseModel> FeedbackOutbound(FeedbackOutboundRequestModel model)
         {
             string json = JsonConvert.SerializeObject(model, new JsonSerializerSettings
@@ -90,6 +103,29 @@
             return JsonConvert.DeserializeObject<ResponseModel>(body);
         }
 
+        public async Task<ResponseModel> FeedbackAllocate(AllocateDto model)
+        {
+            string json = JsonConvert.SerializeObject(model, new JsonSerializerSettings
+            {
+                ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()
+            });
+            var content = new StringContent(json, Encoding.UTF8, "application/json");
+            var _client = _httpClientFactory.CreateClient("MESUrl");
+            _client.DefaultRequestHeaders.Clear();
+            _client.DefaultRequestHeaders.Add("Accept", "application/json");
+            _logger.LogInformation("InvokeMESService  FeedbackAllocate :  " + json);
+            var response = await _client.PostAsync("AldAllocationOperation/AllocationOperation", content);
+            string body = await response.Content.ReadAsStringAsync();
+            _logger.LogInformation("InvokeMESService  FeedbackAllocate  body:  " + body);
+            if (!response.IsSuccessStatusCode)
+            {
+
+                throw new HttpRequestException(body);
+            }
+
+            return JsonConvert.DeserializeObject<ResponseModel>(body);
+        }
+
         public async Task<ResponseModel> NewMaterielToMes(MaterielToMesDTO model)
         {
             string json = JsonConvert.SerializeObject(model, new JsonSerializerSettings
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_Common/StockEnum/StockStatusEmun.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_Common/StockEnum/StockStatusEmun.cs"
index 5321f46..d10b600 100644
--- "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_Common/StockEnum/StockStatusEmun.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_Common/StockEnum/StockStatusEmun.cs"
@@ -58,7 +58,7 @@
 
         [Description("鍏ュ簱纭")]
         鍏ュ簱纭 = 3,
-
+    
         [Description("鍏ュ簱瀹屾垚")]
         鍏ュ簱瀹屾垚 = 6,
 
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_DTO/Allocate/AllocateDto.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_DTO/Allocate/AllocateDto.cs"
index d81c4d1..e823023 100644
--- "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_DTO/Allocate/AllocateDto.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_DTO/Allocate/AllocateDto.cs"
@@ -25,7 +25,7 @@
         /// 璇锋眰鏃堕棿
         /// </summary>
         [JsonProperty("reqTime")]
-        public DateTime ReqTime { get; set; }
+        public string ReqTime { get; set; }
 
         /// <summary>
         /// 璁㈠崟缂栧彿
@@ -39,6 +39,10 @@
         [JsonProperty("business_type")]
         public string BusinessType { get; set; }
 
+        public string fromWarehouse { get; set; }
+
+        public string toWarehouse { get; set; }
+
         /// <summary>
         /// 鏄惁鍒嗘壒
         /// </summary>
@@ -51,6 +55,9 @@
         [JsonProperty("factoryArea")]
         public string FactoryArea { get; set; }
 
+        [JsonProperty("operator")]
+        public string Operator { get; set; }
+
         /// <summary>
         /// 鎿嶄綔绫诲瀷
         /// </summary>
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_IBasicService/IInvokeMESService.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_IBasicService/IInvokeMESService.cs"
index ddbb348..e52066e 100644
--- "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_IBasicService/IInvokeMESService.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_IBasicService/IInvokeMESService.cs"
@@ -4,6 +4,7 @@
 using System.Text;
 using System.Threading.Tasks;
 using WIDESEA_Core;
+using WIDESEA_DTO.Allocate;
 using WIDESEA_DTO.Basic;
 using WIDESEA_DTO.Inbound;
 using WIDESEA_DTO.Outbound;
@@ -16,6 +17,7 @@
 
         Task<ResponseModel> FeedbackOutbound(FeedbackOutboundRequestModel model);
 
+        Task<ResponseModel> FeedbackAllocate(AllocateDto model);
         Task<string> GetToken(String username, string password);
 
         Task<ResponseModel> NewMaterielToMes(MaterielToMesDTO model);
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_OutboundService/OutboundPickingService.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_OutboundService/OutboundPickingService.cs"
index a33a17c..b1b0548 100644
--- "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_OutboundService/OutboundPickingService.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_OutboundService/OutboundPickingService.cs"
@@ -148,7 +148,13 @@
         }
 
         #region 鏍稿績涓氬姟娴佺▼
-
+        /// <summary>
+        /// 鎷i��
+        /// </summary>
+        /// <param name="orderNo"></param>
+        /// <param name="palletCode"></param>
+        /// <param name="barcode"></param>
+        /// <returns></returns>
         public async Task<WebResponseContent> ConfirmPicking(string orderNo, string palletCode, string barcode)
         {
             try
@@ -189,11 +195,21 @@
                 return WebResponseContent.Instance.Error($"鎷i�夌‘璁ゅけ璐ワ細{ex.Message}");
             }
         }
-
+        /// <summary>
+        /// 鍙栨秷鎷i��
+        /// </summary>
+        /// <param name="orderNo"></param>
+        /// <param name="palletCode"></param>
+        /// <param name="barcode"></param>
+        /// <returns></returns>
         public async Task<WebResponseContent> CancelPicking(string orderNo, string palletCode, string barcode)
         {
             try
             {
+                if (await IsPalletReturned(palletCode))
+                {
+                    return WebResponseContent.Instance.Error($"鎵樼洏{palletCode}宸茬粡鍥炲簱锛屼笉鑳藉彇娑堝垎鎷�");
+                }
                 _unitOfWorkManage.BeginTran();
 
                 // 1. 鍓嶇疆楠岃瘉
@@ -217,7 +233,13 @@
                 return WebResponseContent.Instance.Error($"鍙栨秷鍒嗘嫞澶辫触锛歿ex.Message}");
             }
         }
-
+        /// <summary>
+        /// 鍥炲簱
+        /// </summary>
+        /// <param name="orderNo"></param>
+        /// <param name="palletCode"></param>
+        /// <param name="reason"></param>
+        /// <returns></returns>
         public async Task<WebResponseContent> ReturnRemaining(string orderNo, string palletCode, string reason)
         {
             try
@@ -229,8 +251,7 @@
                     return WebResponseContent.Instance.Error("璁㈠崟鍙峰拰鎵樼洏鐮佷笉鑳戒负绌�");
 
                 // 2. 鑾峰彇搴撳瓨鍜屼换鍔′俊鎭�
-                var stockInfo = await _stockInfoService.Db.Queryable<Dt_StockInfo>()
-                    .FirstAsync(x => x.PalletCode == palletCode);
+                var stockInfo = await _stockInfoService.Db.Queryable<Dt_StockInfo>().FirstAsync(x => x.PalletCode == palletCode);
 
                 if (stockInfo == null)
                     return WebResponseContent.Instance.Error($"鏈壘鍒版墭鐩� {palletCode} 瀵瑰簲鐨勫簱瀛樹俊鎭�");
@@ -242,7 +263,7 @@
                 // 3. 鍒嗘瀽闇�瑕佸洖搴撶殑璐х墿
                 var returnAnalysis = await AnalyzeReturnItems(orderNo, palletCode, stockInfo.Id);
                 if (!returnAnalysis.HasItemsToReturn)
-                    return await HandleNoReturnItems(orderNo, palletCode);
+                    return await HandleNoReturnItems(orderNo, palletCode,task);
 
                 // 4. 鎵ц鍥炲簱鎿嶄綔
                 await ExecuteReturnOperations(orderNo, palletCode, stockInfo, task, returnAnalysis);
@@ -301,7 +322,8 @@
 
             // 6. 鑾峰彇搴撳瓨鏄庣粏
             var stockDetail = await _stockInfoDetailService.Db.Queryable<Dt_StockInfoDetail>()
-                .Where(x => x.Barcode == barcode && x.StockId == lockInfo.StockId)
+                .Where(x => x.Barcode == barcode && x.StockId == lockInfo.StockId &&
+                   x.Status != StockStatusEmun.鍏ュ簱纭.ObjToInt())
                 .FirstAsync();
 
             if (stockDetail == null)
@@ -333,18 +355,13 @@
                            it.Status == (int)OutLockStockStatusEnum.鍑哄簱涓� &&
                            it.PalletCode == palletCode &&
                            it.CurrentBarcode == barcode &&
-                           it.AssignQuantity > it.PickedQty)
-                .FirstAsync();
+                           it.AssignQuantity > it.PickedQty).FirstAsync();
 
             if (lockInfo == null)
             {
                 // 鏌ユ壘鍚屼竴璁㈠崟涓嬬殑璁板綍
                 lockInfo = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
-                    .Where(it => it.OrderNo == orderNo &&
-                               it.CurrentBarcode == barcode &&
-                               it.Status == (int)OutLockStockStatusEnum.鍑哄簱涓� &&
-                               it.AssignQuantity > it.PickedQty)
-                    .FirstAsync();
+                    .Where(it => it.OrderNo == orderNo &&  it.CurrentBarcode == barcode && it.Status == (int)OutLockStockStatusEnum.鍑哄簱涓� && it.AssignQuantity > it.PickedQty).FirstAsync();
 
                 if (lockInfo == null)
                 {
@@ -352,8 +369,7 @@
                     var completedLockInfo = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
                         .Where(it => it.CurrentBarcode == barcode &&
                                    (it.Status == (int)OutLockStockStatusEnum.鎷i�夊畬鎴� ||
-                                    it.PickedQty >= it.AssignQuantity))
-                        .FirstAsync();
+                                    it.PickedQty >= it.AssignQuantity)).FirstAsync();
 
                     if (completedLockInfo != null)
                         throw new Exception($"鏉$爜{barcode}宸茬粡瀹屾垚鍒嗘嫞锛屼笉鑳介噸澶嶅垎鎷�");
@@ -596,6 +612,20 @@
             if (lockInfo.Status != (int)OutLockStockStatusEnum.鎷i�夊畬鎴�)
                 return ValidationResult<(Dt_PickingRecord, Dt_OutStockLockInfo, Dt_OutboundOrderDetail)>.Error("褰撳墠鐘舵�佷笉鍏佽鍙栨秷鍒嗘嫞");
 
+            var stockDetail = await _stockInfoDetailService.Db.Queryable<Dt_StockInfoDetail>()
+       .Where(it => it.Barcode == barcode && it.StockId == pickingRecord.StockId)
+       .FirstAsync();
+
+            if (stockDetail != null)
+            {
+                // 妫�鏌ュ簱瀛樼姸鎬� - 濡傛灉鐘舵�佹槸鍏ュ簱纭鎴栧叆搴撳畬鎴愶紝璇存槑宸茬粡鍥炲簱
+                if (stockDetail.Status == StockStatusEmun.鍏ュ簱纭.ObjToInt() ||
+                    stockDetail.Status == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt())
+                {
+                    return ValidationResult<(Dt_PickingRecord, Dt_OutStockLockInfo, Dt_OutboundOrderDetail)>.Error($"鏉$爜{barcode}宸茬粡鍥炲簱锛屼笉鑳藉彇娑堝垎鎷�");
+                }
+            }
+
             // 妫�鏌ヨ鍗曠姸鎬�
             var order = await _outboundOrderService.Db.Queryable<Dt_OutboundOrder>()
                 .Where(x => x.OrderNo == orderNo)
@@ -613,13 +643,54 @@
 
             return ValidationResult<(Dt_PickingRecord, Dt_OutStockLockInfo, Dt_OutboundOrderDetail)>.Success((pickingRecord, lockInfo, orderDetail));
         }
+        /// <summary>
+        /// 妫�鏌ユ潯鐮佹槸鍚﹀凡缁忓洖搴�
+        /// </summary>
+        private async Task<bool> IsBarcodeReturned(string barcode, int stockId)
+        {
+            var stockDetail = await _stockInfoDetailService.Db.Queryable<Dt_StockInfoDetail>()
+                .Where(it => it.Barcode == barcode && it.StockId == stockId)
+                .FirstAsync();
 
+            if (stockDetail == null)
+                return false;
+
+            // 濡傛灉鐘舵�佹槸鍏ュ簱纭鎴栧叆搴撳畬鎴愶紝璇存槑宸茬粡鍥炲簱
+            return stockDetail.Status == StockStatusEmun.鍏ュ簱纭.ObjToInt() ||
+                   stockDetail.Status == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
+        }
+
+        /// <summary>
+        /// 妫�鏌ラ攣瀹氫俊鎭搴旂殑鏉$爜鏄惁宸茬粡鍥炲簱
+        /// </summary>
+        private async Task<bool> IsLockInfoReturned(Dt_OutStockLockInfo lockInfo)
+        {
+            var stockDetail = await _stockInfoDetailService.Db.Queryable<Dt_StockInfoDetail>()
+                .Where(it => it.Barcode == lockInfo.CurrentBarcode && it.StockId == lockInfo.StockId)
+                .FirstAsync();
+
+            if (stockDetail == null)
+                return false;
+
+            return stockDetail.Status == StockStatusEmun.鍏ュ簱纭.ObjToInt() ||
+                   stockDetail.Status == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
+        }
         private async Task ExecuteCancelLogic(Dt_OutStockLockInfo lockInfo, Dt_PickingRecord pickingRecord,
             Dt_OutboundOrderDetail orderDetail, string orderNo)
         {
             decimal cancelQty = pickingRecord.PickQuantity;
 
-            // 1. 妫�鏌ュ彇娑堝悗鏁伴噺涓嶄細涓鸿礋鏁�
+            var currentStockDetail = await _stockInfoDetailService.Db.Queryable<Dt_StockInfoDetail>()
+        .Where(it => it.Barcode == pickingRecord.Barcode && it.StockId == pickingRecord.StockId)
+        .FirstAsync();
+
+            if (currentStockDetail != null &&
+                (currentStockDetail.Status == StockStatusEmun.鍏ュ簱纭.ObjToInt() ||
+                 currentStockDetail.Status == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt()))
+            {
+                throw new Exception($"鏉$爜{pickingRecord.Barcode}宸茬粡鍥炲簱锛屾棤娉曞彇娑堝垎鎷�");
+            }
+            //   妫�鏌ュ彇娑堝悗鏁伴噺涓嶄細涓鸿礋鏁�
             decimal newOverOutQuantity = orderDetail.OverOutQuantity - cancelQty;
             decimal newPickedQty = orderDetail.PickedQty - cancelQty;
 
@@ -628,7 +699,7 @@
                 throw new Exception($"鍙栨秷鍒嗘嫞灏嗗鑷存暟鎹紓甯革細宸插嚭搴搟newOverOutQuantity}锛屽凡鎷i�墈newPickedQty}");
             }
 
-            // 2. 澶勭悊涓嶅悓绫诲瀷鐨勫彇娑�
+            //  澶勭悊涓嶅悓绫诲瀷鐨勫彇娑�
             if (lockInfo.IsSplitted == 1 && lockInfo.ParentLockId.HasValue)
             {
                 await HandleSplitBarcodeCancel(lockInfo, pickingRecord, cancelQty);
@@ -638,15 +709,15 @@
                 await HandleNormalBarcodeCancel(lockInfo, pickingRecord, cancelQty);
             }
 
-            // 3. 鏇存柊璁㈠崟鏄庣粏
+            // 鏇存柊璁㈠崟鏄庣粏
             await UpdateOrderDetailOnCancel(pickingRecord.OrderDetailId, cancelQty);
 
-            // 4. 鍒犻櫎鎷i�夎褰�
+            //  鍒犻櫎鎷i�夎褰�
             await Db.Deleteable<Dt_PickingRecord>()
                 .Where(x => x.Id == pickingRecord.Id)
                 .ExecuteCommandAsync();
 
-            // 5. 閲嶆柊妫�鏌ヨ鍗曠姸鎬�
+            //  閲嶆柊妫�鏌ヨ鍗曠姸鎬�
             await UpdateOrderStatusForReturn(orderNo);
         }
 
@@ -660,6 +731,14 @@
             if (parentLockInfo == null)
                 throw new Exception("鏈壘鍒扮埗閿佸畾淇℃伅锛屾棤娉曞彇娑堟媶鍖呭垎鎷�");
 
+            if (await IsLockInfoReturned(parentLockInfo))
+            {
+                throw new Exception($"鐖舵潯鐮亄parentLockInfo.CurrentBarcode}宸茬粡鍥炲簱锛屾棤娉曞彇娑堟媶鍖呭垎鎷�");
+            }
+            if (await IsLockInfoReturned(lockInfo))
+            {
+                throw new Exception($"鎷嗗寘鏉$爜{lockInfo.CurrentBarcode}宸茬粡鍥炲簱锛屾棤娉曞彇娑堟媶鍖呭垎鎷�");
+            }
             // 鎭㈠鐖堕攣瀹氫俊鎭殑鍒嗛厤鏁伴噺
             parentLockInfo.AssignQuantity += cancelQty;
             await _outStockLockInfoService.Db.Updateable(parentLockInfo).ExecuteCommandAsync();
@@ -695,6 +774,10 @@
 
         private async Task HandleNormalBarcodeCancel(Dt_OutStockLockInfo lockInfo, Dt_PickingRecord pickingRecord, decimal cancelQty)
         {
+            if (await IsLockInfoReturned(lockInfo))
+            {
+                throw new Exception($"鏉$爜{lockInfo.CurrentBarcode}宸茬粡鍥炲簱锛屾棤娉曞彇娑堝垎鎷�");
+            }
             // 鎭㈠閿佸畾淇℃伅
             lockInfo.PickedQty -= cancelQty;
             if (lockInfo.PickedQty < 0) lockInfo.PickedQty = 0;
@@ -750,7 +833,22 @@
             return await _stockInfoService.Db.Queryable<Dt_StockInfo>()
                 .FirstAsync(x => x.PalletCode == palletCode);
         }
+        /// <summary>
+        /// 妫�鏌ユ暣涓墭鐩樻槸鍚﹀凡缁忓洖搴�
+        /// </summary>
+        private async Task<bool> IsPalletReturned(string palletCode)
+        {
+            var stockInfo = await _stockInfoService.Db.Queryable<Dt_StockInfo>()
+                .Where(x => x.PalletCode == palletCode)
+                .FirstAsync();
 
+            if (stockInfo == null)
+                return false;
+
+            // 濡傛灉鎵樼洏鐘舵�佹槸鍏ュ簱纭鎴栧叆搴撳畬鎴愶紝璇存槑宸茬粡鍥炲簱
+            return stockInfo.StockStatus == StockStatusEmun.鍏ュ簱纭.ObjToInt() ||
+                   stockInfo.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
+        }
         private async Task<Dt_Task> GetCurrentTask(string orderNo, string palletCode)
         {
             // 鍏堝皾璇曢�氳繃璁㈠崟鍙峰拰鎵樼洏鍙锋煡鎵句换鍔�
@@ -805,7 +903,7 @@
 
             // 鎯呭喌3锛氭鏌ユ媶鍖呰褰�
             var splitRecords = await _splitPackageService.Db.Queryable<Dt_SplitPackageRecord>()
-                .Where(it => it.OrderNo == orderNo && it.PalletCode == palletCode && !it.IsReverted)
+                .Where(it => it.OrderNo == orderNo && it.PalletCode == palletCode && !it.IsReverted && it.Status != (int)SplitPackageStatusEnum.宸插洖搴�)
                 .ToListAsync();
 
             if (splitRecords.Any())
@@ -860,7 +958,7 @@
             return totalQty;
         }
 
-        private async Task<WebResponseContent> HandleNoReturnItems(string orderNo, string palletCode)
+        private async Task<WebResponseContent> HandleNoReturnItems(string orderNo, string palletCode,Dt_Task originalTask)
         {
             // 妫�鏌ユ槸鍚︽墍鏈夎揣鐗╅兘宸叉嫞閫夊畬鎴�
             var allPicked = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
@@ -869,12 +967,18 @@
 
             if (allPicked)
             {
+                // 鍒犻櫎鍘熷鍑哄簱浠诲姟
+                await _taskRepository.Db.Deleteable(originalTask).ExecuteCommandAsync();
                 return WebResponseContent.Instance.OK("鎵�鏈夎揣鐗╁凡鎷i�夊畬鎴愶紝鎵樼洏涓虹┖");
             }
             else
             {
+                // 鍒犻櫎鍘熷鍑哄簱浠诲姟
+                await _taskRepository.Db.Deleteable(originalTask).ExecuteCommandAsync();
                 return WebResponseContent.Instance.Error("娌℃湁闇�瑕佸洖搴撶殑鍓╀綑璐х墿");
             }
+            //绌烘墭鐩樺浣曞鐞�  杩樻湁涓�涓嚭搴撲换鍔¤澶勭悊銆�
+         
         }
 
         private async Task ExecuteReturnOperations(string orderNo, string palletCode, Dt_StockInfo stockInfo,
@@ -932,7 +1036,7 @@
                 {
                     // 鎭㈠搴撳瓨鐘舵��
                     stockDetail.OutboundQuantity = Math.Max(0, stockDetail.OutboundQuantity - returnQty);
-                    stockDetail.Status = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
+                    stockDetail.Status = StockStatusEmun.鍏ュ簱纭.ObjToInt();
                     await _stockInfoDetailService.Db.Updateable(stockDetail).ExecuteCommandAsync();
                 }
                 else
@@ -949,7 +1053,7 @@
                         OutboundQuantity = 0,
                         Barcode = lockInfo.CurrentBarcode,
                         InboundOrderRowNo = "",
-                        Status = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt(),
+                        Status = StockStatusEmun.鍏ュ簱纭.ObjToInt(),
                         SupplyCode = lockInfo.SupplyCode,
                         WarehouseCode = lockInfo.WarehouseCode,
                         Unit = lockInfo.Unit,
@@ -997,7 +1101,7 @@
             {
                 // 鎭㈠搴撳瓨鐘舵��
                 stockGood.OutboundQuantity = 0;
-                stockGood.Status = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
+                stockGood.Status = StockStatusEmun.鍏ュ簱纭.ObjToInt();
 
                 await _stockInfoDetailService.Db.Updateable(stockGood).ExecuteCommandAsync();
             }
@@ -1018,10 +1122,17 @@
         private async Task UpdateStockInfoStatus(Dt_StockInfo stockInfo)
         {
             // 鏇存柊搴撳瓨涓昏〃鐘舵��
-            stockInfo.StockStatus = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
+            stockInfo.StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt();
             await _stockInfoService.Db.Updateable(stockInfo).ExecuteCommandAsync();
         }
-
+        /// <summary>
+        /// 鍒涘缓鍥炲簱浠诲姟
+        /// </summary>
+        /// <param name="orderNo"></param>
+        /// <param name="palletCode"></param>
+        /// <param name="originalTask"></param>
+        /// <param name="analysis"></param>
+        /// <returns></returns>
         private async Task CreateReturnTaskAndHandleESS(string orderNo, string palletCode, Dt_Task originalTask, ReturnAnalysisResult analysis)
         {
             var firstLocation = await _locationInfoService.Db.Queryable<Dt_LocationInfo>()
@@ -1056,7 +1167,14 @@
             // 缁� ESS 鍙戦�佹祦鍔ㄤ俊鍙峰拰鍒涘缓浠诲姟
             await SendESSCommands(palletCode, targetAddress, returnTask);
         }
-
+        /// <summary>
+        /// 缁橢SS涓嬩换鍔�
+        /// </summary>
+        /// <param name="palletCode"></param>
+        /// <param name="targetAddress"></param>
+        /// <param name="returnTask"></param>
+        /// <returns></returns>
+        /// <exception cref="Exception"></exception>
         private async Task SendESSCommands(string palletCode, string targetAddress, Dt_Task returnTask)
         {
             try
@@ -1385,15 +1503,30 @@
 
         private WebResponseContent CreatePickingResponse(PickingResult result, string adjustedReason)
         {
+            //if (result.SplitResults.Any())
+            //{
+            //    var responseData = new { SplitResults = result.SplitResults, AdjustedReason = "" };
+            //    if (!string.IsNullOrEmpty(adjustedReason))
+            //    {
+            //        responseData = new { SplitResults = result.SplitResults, AdjustedReason = adjustedReason };
+            //    }
+            //    return WebResponseContent.Instance.OK("鎷i�夌‘璁ゆ垚鍔燂紝宸茶嚜鍔ㄦ媶鍖�", responseData);
+            //}
+
+            //if (!string.IsNullOrEmpty(adjustedReason))
+            //{
+            //    return WebResponseContent.Instance.OK($"鎷i�夌‘璁ゆ垚鍔燂紙{adjustedReason}锛�");
+            //}
+
+            //return WebResponseContent.Instance.OK("鎷i�夌‘璁ゆ垚鍔�");
+
             if (result.SplitResults.Any())
             {
-
                 return WebResponseContent.Instance.OK("鎷i�夌‘璁ゆ垚鍔燂紝宸茶嚜鍔ㄦ媶鍖�", new { SplitResults = result.SplitResults });
             }
-
             return WebResponseContent.Instance.OK("鎷i�夌‘璁ゆ垚鍔�", new { SplitResults = new List<SplitResult>() });
         }
-
+ 
         #endregion
     }
 
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_TaskInfoService/TaskService.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_TaskInfoService/TaskService.cs"
index c2f09f0..f3e6e0a 100644
--- "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_TaskInfoService/TaskService.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_TaskInfoService/TaskService.cs"
@@ -38,9 +38,11 @@
 using WIDESEA_Core.BaseServices;
 using WIDESEA_Core.Enums;
 using WIDESEA_Core.Helper;
+using WIDESEA_DTO.Allocate;
 using WIDESEA_DTO.Basic;
 using WIDESEA_DTO.Inbound;
 using WIDESEA_DTO.Task;
+using WIDESEA_IAllocateService;
 using WIDESEA_IBasicService;
 using WIDESEA_IInboundService;
 using WIDESEA_IOutboundService;
@@ -69,7 +71,7 @@
         private readonly IESSApiService _eSSApiService;
         private readonly IStockService _stockService;
         private readonly IRecordService _recordService;
-
+        private readonly IAllocateService _allocateService;
         private readonly IInvokeMESService _invokeMESService;
         public IRepository<Dt_Task> Repository => BaseDal;
 
@@ -90,7 +92,7 @@
 
         public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList();
 
-        public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService) : base(BaseDal)
+        public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService, IAllocateService allocateService) : base(BaseDal)
         {
             _mapper = mapper;
             _unitOfWorkManage = unitOfWorkManage;
@@ -107,6 +109,7 @@
             _outboundOrderDetailService = outboundOrderDetailService;
             _invokeMESService = invokeMESService;
             _outStockLockInfoService = outStockLockInfoService;
+            _allocateService = allocateService;
         }
 
 
@@ -250,7 +253,53 @@
                 {
                     if (inboundOrder.OrderType == InOrderTypeEnum.Allocat.ObjToInt())//璋冩嫧鍏ュ簱
                     {
+                        if (inboundOrder != null && inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt())
+                        {
+                            var allocate = _allocateService.Repository.QueryData(x => x.OrderNo == inboundOrder.InboundOrderNo).First();
+                            var feedmodel = new AllocateDto
+                            {
+                                ReqCode = Guid.NewGuid().ToString(),
+                                ReqTime = DateTime.Now.ToString(),
+                                BusinessType = "2",
+                                FactoryArea = inboundOrder.FactoryArea,
+                                OperationType = 1,
+                                Operator = inboundOrder.Operator,
+                                OrderNo = inboundOrder.UpperOrderNo,
+                                fromWarehouse = allocate?.FromWarehouse??"",
+                                toWarehouse = allocate?.ToWarehouse??"",
+                                Details = new List<AllocateDtoDetail>()
 
+                            };
+
+                            var groupedData = inboundOrder.Details.GroupBy(item => new { item.MaterielCode, item.SupplyCode, item.BatchNo, item.lineNo, item.BarcodeUnit, item.WarehouseCode })
+                               .Select(group => new AllocateDtoDetail
+                               {
+                                   MaterialCode = group.Key.MaterielCode,
+                                   LineNo = group.Key.lineNo,
+                                   WarehouseCode = group.Key.WarehouseCode,
+                                   Qty = group.Sum(x => x.BarcodeQty),
+                                   // warehouseCode= "1072",
+                                   Unit = group.Key.BarcodeUnit,
+                                   Barcodes = group.Select(row => new BarcodeInfo
+                                   {
+                                       Barcode = row.Barcode,
+                                       Qty = row.BarcodeQty,
+                                       BatchNo = row.BatchNo,
+                                       SupplyCode = row.SupplyCode,
+                                       Unit = row.Unit
+                                   }).ToList()
+                               }).ToList();
+                            feedmodel.Details = groupedData;
+
+                            var result = await _invokeMESService.FeedbackAllocate(feedmodel);
+                            if (result != null && result.code == 200)
+                            {
+                                _inboundOrderService.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 })
+                                .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
+                                _inboundOrderDetailService.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 })
+                                .Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand();
+                            }
+                        }
                     }
                     else if (inboundOrder.OrderType == InOrderTypeEnum.ReCheck.ObjToInt()) //閲嶆鍏ュ簱
                     {
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_TaskInfoService/WIDESEA_TaskInfoService.csproj" "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_TaskInfoService/WIDESEA_TaskInfoService.csproj"
index 5272e9b..51b297d 100644
--- "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_TaskInfoService/WIDESEA_TaskInfoService.csproj"
+++ "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_TaskInfoService/WIDESEA_TaskInfoService.csproj"
@@ -7,6 +7,7 @@
   </PropertyGroup>
 
   <ItemGroup>
+    <ProjectReference Include="..\WIDESEA_IAllocateService\WIDESEA_IAllocateService.csproj" />
     <ProjectReference Include="..\WIDESEA_IBasicService\WIDESEA_IBasicService.csproj" />
     <ProjectReference Include="..\WIDESEA_IInboundService\WIDESEA_IInboundService.csproj" />
     <ProjectReference Include="..\WIDESEA_IOutboundService\WIDESEA_IOutboundService.csproj" />
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/AllocateOrderController.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/AllocateOrderController.cs"
index 3a4607a..31f6001 100644
--- "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/AllocateOrderController.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/AllocateOrderController.cs"
@@ -3,6 +3,7 @@
 using System.Data.Common;
 using System.Diagnostics.Eventing.Reader;
 using System.Threading.Tasks;
+using WIDESEA_Common.AllocateEnum;
 using WIDESEA_Core;
 using WIDESEA_Core.Attributes;
 using WIDESEA_Core.BaseController;
@@ -36,15 +37,23 @@
             {
                 OrderNo = model.OrderNo,
                 UpperOrderNo = model.OrderNo,
-                BusinessType=model.BusinessType,
-                FactoryArea=model.FactoryArea,
-                IsBatch=model.IsBatch,
+                BusinessType = model.BusinessType,
+                FactoryArea = model.FactoryArea,
+                IsBatch = model.IsBatch,
                 CreateType = model.OperationType,
-                Details = new List<Dt_AllocateOrderDetail>() 
+                FromWarehouse=model.fromWarehouse,
+                ToWarehouse=model.toWarehouse,                
+                Details = new List<Dt_AllocateOrderDetail>()
             };
+            Enum.TryParse<BusinessTypeEnum>(allocateOrder.BusinessType, out var businessType);
+
 
             foreach (var detailDto in model.Details)
             {
+                if (businessType == BusinessTypeEnum.鏅轰粨璋冨閮ㄤ粨搴� && (detailDto.Barcodes == null || !detailDto.Barcodes.Any()))
+                {
+                    return WebResponseContent.Instance.Error($"鏉$爜涓嶈兘涓虹┖");
+                }
                 if (detailDto.Barcodes != null && detailDto.Barcodes.Any())
                 {
                     foreach (var barcodeDto in detailDto.Barcodes)
@@ -55,7 +64,7 @@
                             MaterielCode = detailDto.MaterialCode,
                             LineNo = detailDto.LineNo,
                             OrderQuantity = detailDto.Qty,
-                            SupplyCode= barcodeDto.SupplyCode,
+                            SupplyCode = barcodeDto.SupplyCode,
                             Unit = detailDto.Unit,
                             Barcode = barcodeDto.Barcode,
                             BatchNo = barcodeDto.BatchNo,
@@ -79,7 +88,7 @@
                 }
                 allocateOrder.Details.AddRange(allocateOrder.Details);
             }
-            var content =await Service.ReceiveAllocateOrder(allocateOrder, model.OperationType);
+            var content = await Service.ReceiveAllocateOrder(allocateOrder, model.OperationType);
 
             if (content.Status) return WebResponseContent.Instance.OK(200);
             else return WebResponseContent.Instance.Error(content.Message);

--
Gitblit v1.9.3