From ca4a0e7ffc11dc6f4c19b75f625444b06768ea15 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期三, 12 十一月 2025 08:51:30 +0800
Subject: [PATCH] 提交

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs              |    9 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs                         |   94 +--
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/WarehouseController.cs                 |   35 +
 项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue                                            |  821 ++++++++++++++++++++++---------
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_WarehouseArea.cs                             |   24 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundPickingService.cs                        |    2 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderController.cs          |    2 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/SemanticSymbols.db-shm |    0 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundLockInfo.cs                       |    2 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs                              |    3 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutStockLockInfoService.cs                       |    5 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_BasicService/WarehouseService.cs                                   |   36 +
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs                           |    2 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrder.cs                          |    3 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundPickingController.cs        |    9 
 项目代码/WIDESEA_WMSClient/src/views/outbound/PickingConfirm.vue                                              |  190 +++++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IBasicService/IWarehouseService.cs                                 |    3 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs                          |   41 +
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_DTO/Outbound/OutboundOrderGetDTO.cs                                |    2 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_LocationInfo.cs                              |   29 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_BasicService/LocationInfoService.cs                                |   12 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/CodeChunks.db-shm      |    0 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IStockService/IStockInfoService.cs                                 |    3 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder.cs                            |    2 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_DTO/Basic/SupplierDTO.cs                                           |   13 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs                      |   79 ++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs                              |    2 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs                                   |   29 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_DTO/Basic/LocationGroupDTO.cs                                      |   10 
 29 files changed, 1,094 insertions(+), 368 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
index 33c3072..0f66ddb 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
@@ -12,50 +12,72 @@
   >
   <div class="barcode-scanner-container">
       
-      <!-- 鎵樼洏淇℃伅鏄剧ず -->
-      <div class="tray-info" v-if="trayBarcode">
-        <i class="el-icon-s-management"></i> 褰撳墠鏂欑: {{ trayBarcode }}
-       <!--  <el-button 
-          class="small-button"
-          type="text" 
-          @click="clearTray"
-          style="float: right;"
-        >
-          娓呴櫎鎵樼洏
-        </el-button> -->
+      <!-- 浠撳簱鍖哄煙閫夋嫨 - 绱у噾甯冨眬 -->
+      <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="input-section">
-        <el-card shadow="hover">
-          <div slot="header">
-            <span><i class="el-icon-scanner"></i> </span>
+      <!-- 鎵樼洏淇℃伅鏄剧ず - 绱у噾甯冨眬 -->
+      <div class="tray-info compact" v-if="trayBarcode">
+        <i class="el-icon-s-management"></i> 褰撳墠鏂欑: {{ trayBarcode }}
+        <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>鎵爜灏辩华
+              <span class="scan-indicator"></span>
+              {{ form.locationType ? '鎵爜灏辩华' : '璇峰厛閫夋嫨浠撳簱鍖哄煙' }}
             </span>
           </div>
           
           <!-- 鎵樼洏鏉$爜杈撳叆 -->
-          <div class="input-wrapper custom-input-group">
-    <div class="input-label">鏂欑鐮�</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"
               @keyup.enter.native="handleTraySubmit"
               @clear="handleTrayClear"
               @input="handleTrayInput"
-                 class="custom-input"
+              class="custom-input"
+              size="medium"
             >
-              <template slot="prepend">
-                <span> 鏂欑鐮�</span>
-              </template>
               <template slot="append">
                 <el-button 
                   @click="handleTraySubmit"
                   type="primary"
                   icon="el-icon-position"
+                  :disabled="!form.locationType || !trayBarcode"
+                  size="medium"
                 >
                   纭
                 </el-button>
@@ -64,29 +86,28 @@
           </div>
           
           <!-- 鐗╂枡鏉$爜杈撳叆 -->
-          <div class="input-wrapper custom-input-group">
+          <div class="input-wrapper custom-input-group compact-input">
             <div class="input-label">鐗╂枡鏉$爜</div>
             <el-input
               ref="barcodeInput"
               v-model="barcode"
               placeholder="璇锋壂鎻忔垨杈撳叆鐗╂枡鏉$爜鍚庢寜鍥炶溅閿�"
               clearable
-              :disabled="!trayBarcode"
+              :disabled="!form.locationType || !trayBarcode"
               @keyup.enter.native="handleBarcodeSubmit"
               @clear="handleClear"
               @input="handleBarcodeInput"
-                    class="custom-input"
+              class="custom-input"
+              size="medium"
             >
-              <template slot="prepend">
-                <span>鐗╂枡鏉$爜</span>
-              </template>
               <template slot="append">
                 <el-button 
                   :loading="loading" 
                   @click="handleBarcodeSubmit"
                   type="primary"
                   icon="el-icon-search"
-                  :disabled="!trayBarcode"
+                  :disabled="!form.locationType || !trayBarcode || !barcode"
+                  size="medium"
                 >
                   {{ loading ? '鏌ヨ涓�...' : '鏌ヨ' }}
                 </el-button>
@@ -94,22 +115,23 @@
             </el-input>
           </div>
           
-          <div class="input-tips">
-            <p>鎻愮ず锛氬厛杈撳叆鏂欑鐮侊紝鐒跺悗杈撳叆鐗╂枡鏉$爜</p>
-       
+          <div class="input-tips compact-tips">
+            <p>鎻愮ず锛氳鍏堥�夋嫨浠撳簱鍖哄煙锛岀劧鍚庤緭鍏ユ枡绠辩爜锛屾渶鍚庤緭鍏ョ墿鏂欐潯鐮�</p>
+            <p v-if="!form.locationType" class="warning-text">鈿狅笍 璇峰厛閫夋嫨浠撳簱鍖哄煙</p>
+            <p v-if="form.locationType && !trayBarcode" class="warning-text">鈿狅笍 璇峰厛杈撳叆鏂欑鐮�</p>
           </div>
         
         </el-card>
       </div>
 
       <!-- 鍔犺浇鐘舵�� -->
-      <div v-if="loading" class="loading">
+      <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">
+      <div v-if="error" class="error-message compact">
         <el-alert
           :title="error"
           type="error"
@@ -119,68 +141,45 @@
         />
       </div>
 
-      <!-- 鐗╂枡鍒楄〃 -->
-      <div class="material-list">
-        <el-card shadow="hover">
-          <div slot="header">
+      <!-- 鐗╂枡鍒楄〃 - 鍥哄畾楂樺害甯︽粴鍔ㄦ潯 -->
+      <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">鍏� {{ materials.length }} 鏉¤褰�</el-tag>
-              <el-tag type="primary">宸茬粍鐩� {{ totalStockCount }}</el-tag>
-              <el-tag type="primary">搴撳瓨鏁伴噺 {{ totalStockSum }}<span>{{ uniqueUnit }}</span></el-tag>
-              <el-tag v-if="trayBarcode" type="success">鎵樼洏: {{ trayBarcode }}</el-tag>
-    <!--           <el-button 
-                v-if="materials.length > 0"
-                class="small-button clear-all-btn"
-                type="danger" 
-                icon="el-icon-delete" 
-                @click="clearAllMaterials"
-              >
-                娓呯┖鍒楄〃
-              </el-button> -->
-          <!--     <el-button 
-                class="small-button clear-all-btn"
-                @click="debugMode = !debugMode"
-              >
-                {{ debugMode ? '闅愯棌璋冭瘯' : '鏄剧ず璋冭瘯' }}
-              </el-button> -->
+              <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.locationType" type="info" size="small">鍖哄煙: {{ currentLocationDesc }}</el-tag>
             </span>
           </div>
           
-          <div v-if="materials.length === 0" class="empty-state">
+          <div v-if="materials.length === 0" class="empty-state compact">
             <i class="el-icon-document"></i>
-            <p v-if="!trayBarcode">璇峰厛杈撳叆鏂欑鏉$爜</p>
+            <p v-if="!form.locationType">璇峰厛閫夋嫨浠撳簱鍖哄煙</p>
+            <p v-else-if="!trayBarcode">璇峰厛杈撳叆鏂欑鏉$爜</p>
             <p v-else>鏆傛棤鐗╂枡鏁版嵁锛岃鎵弿鎴栬緭鍏ョ墿鏂欐潯鐮�</p>
           </div>
           
-          <el-table
-            v-else
-            :data="materials"
-            stripe
-            style="width: 100%"
-          >
-            <el-table-column type="index" label="搴忓彿" width="60" align="center"></el-table-column>
-              <el-table-column prop="barcode" label="鏉$爜" min-width="140"></el-table-column>
-            <el-table-column prop="materielCode" label="鐗╂枡缂栫爜" min-width="150"></el-table-column>
-            <el-table-column prop="batchNo" label="鎵规" min-width="150"></el-table-column>
-            <el-table-column prop="stockQuantity" label="鏁伴噺" min-width="130"></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"></el-table-column>
-            <el-table-column prop="warehouseCode" label="浠撳簱" min-width="120"></el-table-column>
-         
-     <!--        <el-table-column label="鎿嶄綔" width="100" align="center">
-              <template slot-scope="scope">
-                <el-button
-                  v-if="scope"
-                  class="small-button"
-                  type="danger"
-                  icon="el-icon-delete"
-                  circle
-                  @click="removeMaterial(scope.$index)"
-                ></el-button>
-              </template>
-            </el-table-column> -->
-          </el-table>
+          <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="warehouseCode" label="浠撳簱" min-width="120" show-overflow-tooltip></el-table-column>
+            </el-table>
+          </div>
         </el-card>
       </div>
     </div>
@@ -191,7 +190,6 @@
     </div> -->
     </vol-box>
 </template>
-
 <script>
 import http from '@/api/http.js';
 import VolBox from '@/components/basic/VolBox.vue';
@@ -234,7 +232,22 @@
           totalStockCount: 0,
           uniqueUnit: '',
           sumLoading: false,
-          sumError: ''
+          sumError: '',
+
+        // 浠撳簱鍖哄煙鐩稿叧鍙橀噺
+        locationTypes: [],
+        locationLoading: false,
+        form: {
+            locationType: null
+        },
+    rules: {
+      locationType: [
+        { 
+          validator: this.validateLocationType, 
+          trigger: 'change' 
+        }
+      ]
+    }
     }
   },
   computed: {
@@ -242,7 +255,12 @@
       get() { return this.visible; },
       set(newVal) { this.$emit('update:visible', newVal); }
     },
-    currentDocNo() { return this.docNo; }
+    currentDocNo() { return this.docNo; },
+        // 褰撳墠閫夋嫨鐨勪粨搴撳尯鍩熸弿杩�
+    currentLocationDesc() {
+        const location = this.locationTypes.find(item => item.locationType === this.form.locationType)
+        return location ? location.locationTypeDesc : ''
+    }
   },
   watch: {
     visible(newVal, oldVal) {
@@ -254,7 +272,8 @@
       this.resetData();
       this.$nextTick(() => {
         setTimeout(() => {
-          this.focusTrayInput();
+         // this.focusTrayInput();
+            this.initLocationTypes(); // 鍒濆鍖栦粨搴撳尯鍩�
           this.fetchStockStatistics(); // 鍔犺浇缁熻鏁版嵁
         }, 300);
       });
@@ -286,7 +305,8 @@
         
         // 浣跨敤setTimeout纭繚DOM瀹屽叏娓叉煋鍚庡啀鑱氱劍
         setTimeout(() => {
-          this.focusTrayInput();
+         // this.focusTrayInput();
+                  this.focusLocationSelect();
         }, 300);
       },
       beforeDestroy() {
@@ -295,6 +315,76 @@
          this.clearAllTimers();
       },
       methods: {
+         /**
+   * 鑷畾涔変粨搴撳尯鍩熼獙璇�
+   * 鍏佽鍊间负0锛屽洜涓�0鏄悎娉曠殑locationType
+   */
+  validateLocationType(rule, value, callback) {
+    // 妫�鏌ュ�兼槸鍚︿负null銆乽ndefined鎴栫┖瀛楃涓诧紝浣嗗厑璁告暟瀛�0
+    if (value === null || value === undefined || value === '') {
+      callback(new Error('璇烽�夋嫨浠撳簱鍖哄煙'));
+    } else {
+      // 鍊间负0鎴栧叾浠栨湁鏁堝�奸兘閫氳繃楠岃瘉
+      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;
+            }
+        },
+
+ /**
+ * 浠撳簱鍖哄煙鍙樻洿澶勭悊
+ */
+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.focusTrayInput();
+            }
+          });
+        }, 100);
+    }
+  });
+},
         // 鏂板锛氭煡璇㈠悗绔簱瀛樼粺璁℃暟鎹紙璋冪敤涔嬪墠鐨� SumQuantity 鎺ュ彛锛�
     async fetchStockStatistics() {
       // 鍗曟嵁鍙蜂负绌烘椂涓嶆煡璇�
@@ -326,6 +416,69 @@
         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.form.locationType === null || this.form.locationType === undefined || this.form.locationType === '') {
+          this.error = '璇峰厛閫夋嫨浠撳簱鍖哄煙';
+          this.$message.warning('璇峰厛閫夋嫨浠撳簱鍖哄煙');
+        } else {
+          // 濡傛灉鍊煎瓨鍦紙鍖呮嫭0锛夛紝浣嗛獙璇佷笉閫氳繃锛屽彲鑳芥槸鍏朵粬楠岃瘉閿欒
+          this.error = '璇锋鏌ヨ〃鍗曞~鍐欐槸鍚︽纭�';
+        }
+        resolve(false);
+      }
+    });
+  });
+},
+        // 鑱氱劍鍒颁粨搴撳尯鍩熼�夋嫨
+        focusLocationSelect() {
+            if (this.$refs.locationForm) {
+                const selectEl = this.$el.querySelector('.el-select .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('閲嶇疆寮规鏁版嵁');
@@ -338,13 +491,20 @@
       this.lastKeyTime = null;
       this.isManualInput = false;
       this.isScanning = false;
-      this.currentFocus = 'tray';
+      this.currentFocus = 'location';
       this.scanTarget = 'tray';
       this.clearAllTimers();
       this.totalStockSum = 0;
       this.totalStockCount = 0;
       this.sumLoading = false;
       this.sumError = '';
+        this.form.locationType = null;
+          // 娓呴櫎琛ㄥ崟楠岃瘉鐘舵��
+  this.$nextTick(() => {
+    if (this.$refs.locationForm) {
+      this.$refs.locationForm.clearValidate();
+    }
+  });
     },
     
     // 娓呴櫎鎵�鏈夎鏃跺櫒
@@ -366,7 +526,16 @@
       // 浣跨敤setTimeout纭繚DOM瀹屽叏娓叉煋鍚庡啀鑱氱劍
       this.$nextTick(() => {
         setTimeout(() => {
-          this.focusTrayInput();
+            this.initLocationTypes(); // 鍒濆鍖栦粨搴撳尯鍩�
+             // 纭繚琛ㄥ崟寮曠敤瀛樺湪鍚庡啀鑱氱劍
+      if (this.$refs.locationForm) {
+        this.focusLocationSelect();
+      } else {
+        // 濡傛灉琛ㄥ崟寮曠敤杩樹笉瀛樺湪锛岀◢鍚庨噸璇�
+        setTimeout(() => {
+          this.focusLocationSelect();
+        }, 500);
+      }
         }, 300);
       });
     },
@@ -383,7 +552,9 @@
     },
     
     // 纭鎸夐挳
-    handleConfirm() {
+   async  handleConfirm() {
+           if (!await this.validateForm()) return;
+
       if (this.materials.length === 0) {
         this.$message.warning('璇疯嚦灏戞坊鍔犱竴涓墿鏂�');
         return;
@@ -395,6 +566,8 @@
       }
       
       const result = {
+        locationType: this.form.locationType,
+        locationDesc: this.currentLocationDesc,
         trayBarcode: this.trayBarcode,
         materials: this.materials,
         docNo: this.docNo
@@ -404,84 +577,70 @@
       this.$emit('back-success', result);
       this.palletVisible = false;
     },
-        // 鑱氱劍鍒版墭鐩樿緭鍏ユ
-        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';
-            }
-          }
-        },
-        
-        // 澶勭悊鎵樼洏杈撳叆
+    // 澶勭悊鎵樼洏杈撳叆
         handleTrayInput() {
-          // 鏍囪涓烘墜鍔ㄨ緭鍏ユā寮�
-          this.isManualInput = true;
-          this.isScanning = false;
-          
-          // 娓呴櫎涔嬪墠鐨勮鏃跺櫒
-          if (this.manualInputTimer) {
-            clearTimeout(this.manualInputTimer);
-          }
-          
-          // 璁剧疆璁℃椂鍣紝濡傛灉涓�娈垫椂闂村唴娌℃湁杈撳叆锛屽垯閲嶇疆涓烘壂鐮佹ā寮�
-          this.manualInputTimer = setTimeout(() => {
-            this.isManualInput = false;
-          }, 1000);
+            // 鏍囪涓烘墜鍔ㄨ緭鍏ユā寮�
+            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);
-        },
-        
-        // 澶勭悊鎵樼洏鏉$爜鎻愪氦
-        handleTraySubmit() {
-          const currentTrayBarcode = this.trayBarcode.trim();
-          
-          if (!currentTrayBarcode) {
-            this.error = '璇疯緭鍏ユ垨鎵弿鎵樼洏鏉$爜';
-            return;
-          }
+            // 鏍囪涓烘墜鍔ㄨ緭鍏ユā寮�
+            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.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
-          });
-        },
+  this.error = '';
+  
+  // 璁剧疆鎵樼洏鏉$爜鍚庯紝鑷姩鑱氱劍鍒扮墿鏂欒緭鍏ユ
+  this.focusBarcodeInput();
+  
+  this.$message({
+    message: `鎵樼洏鏉$爜宸茶缃�: ${currentTrayBarcode}`,
+    type: 'success',
+    duration: 2000
+  });
+},
         
         // 娓呴櫎鎵樼洏
         clearTray() {
@@ -510,6 +669,7 @@
         
         // 澶勭悊鐗╂枡鏉$爜鎻愪氦
         async handleBarcodeSubmit() {
+                    if (!await this.validateForm()) return;
           const currentBarcode = this.barcode.trim();
           
           if (!this.trayBarcode) {
@@ -553,6 +713,8 @@
           this.materials.push({
             ...item, 
              trayCode: this.trayBarcode,
+               locationType: this.form.locationType,
+                            locationDesc: this.currentLocationDesc,
                scanTime: this.formatTime(new Date())
           });
         });
@@ -590,7 +752,8 @@
            {
             palletCode: this.trayBarcode,
             orderNo: this.docNo,
-            barcodes: barcode
+            barcodes: barcode,
+                    locationType: this.form.locationType // 娣诲姞浠撳簱鍖哄煙淇℃伅
           } 
         );
         
@@ -729,135 +892,299 @@
     .barcode-scanner-container {
       max-width: 1200px;
       margin: 0 auto;
-      padding: 20px;
+      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: 30px;
+      margin-bottom: 15px;
     }
-    .input-section {
-      margin-bottom: 30px;
-    }
+    
     .scan-status {
-      float: right;
       font-size: 12px;
       color: #67C23A;
     }
+    
     .scan-indicator {
       display: inline-block;
-      width: 10px;
-      height: 10px;
+      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;
-      margin-bottom: 15px;
     }
+    
     .input-tips {
-      margin-top: 10px;
-      font-size: 12px;
+      margin-top: 6px;
       color: #909399;
     }
-    .loading {
-      text-align: center;
-      margin: 20px 0;
+    
+    .warning-text {
+        color: #E6A23C;
+        font-weight: bold;
     }
-    .loading p {
-      margin-top: 10px;
+    
+    .loading.compact {
+      text-align: center;
+      margin: 10px 0;
+      padding: 5px;
+    }
+    
+    .loading.compact p {
+      margin-top: 5px;
       color: #409EFF;
+      font-size: 12px;
     }
-    .error-message {
-      margin-bottom: 20px;
+    
+    .error-message.compact {
+      margin: 5px 0;
     }
-    .material-list {
-      margin-top: 30px;
+    
+    .error-message.compact >>> .el-alert {
+      padding: 6px 12px;
     }
+    
     .list-actions {
-      float: right;
+      display: flex;
+      align-items: center;
+      gap: 4px;
     }
+    
+    .list-actions >>> .el-tag {
+      height: 24px;
+      line-height: 22px;
+      padding: 0 6px;
+    }
+    
     .clear-all-btn {
-      margin-left: 10px;
+      margin-left: 8px;
     }
-    .empty-state {
-      text-align: center;
-      padding: 40px 0;
-      color: #909399;
-    }
-    .empty-state i {
-      font-size: 48px;
-      margin-bottom: 10px;
-    }
+    
     .material-code {
       font-family: 'Courier New', monospace;
       font-weight: bold;
       color: #409EFF;
     }
-    .tray-info {
-      background: #f0f9ff;
-      padding: 10px 15px;
-      border-radius: 4px;
-      margin-bottom: 15px;
-      border-left: 4px solid #409EFF;
+    
+    .location-info {
+        color: #606266;
+        font-weight: normal;
     }
+    
     .debug-info {
       background: #f5f7fa;
-      padding: 10px;
+      padding: 8px;
       border-radius: 4px;
-      margin-top: 10px;
-      font-size: 12px;
+      margin-top: 8px;
+      font-size: 11px;
       color: #909399;
     }
+    
     .small-button {
-      padding: 7px 9px;
-      font-size: 12px;
+      padding: 6px 8px;
+      font-size: 11px;
     }
-.custom-input-group {
-  display: flex;
-  align-items: center;
-  width: 100%;
-  margin: 20px 0;
-  border: 1px solid #DCDFE6;
-  border-radius: 4px;
-  overflow: hidden;
-  background: #fff;
-}
 
-.input-label {
-  padding: 0 15px;
-  background: #F5F7FA;
-  border-right: 1px solid #DCDFE6;
-  color: #606266;
-  font-size: 14px;
-  white-space: nowrap;
-  height: 40px;
-  line-height: 40px;
-  flex-shrink: 0;
-}
+    /* 杈撳叆妗嗙粍鏍峰紡璋冩暣 */
+    .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-container {
-  display: flex;
-  flex: 1;
-  align-items: center;
-}
+    .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;
+    }
 
-.custom-input {
-  flex: 1;
-}
+    .input-container {
+      display: flex;
+      flex: 1;
+      align-items: center;
+    }
 
-.custom-input ::v-deep .el-input__inner {
-  border: none;
-  border-radius: 0;
-  height: 40px;
-  line-height: 40px;
-}
+    .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/views/outbound/PickingConfirm.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/PickingConfirm.vue"
index 899297b..ef26541 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/PickingConfirm.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/PickingConfirm.vue"
@@ -48,6 +48,14 @@
                   :disabled="!currentLockInfo"
                 />
               </el-form-item>
+
+              <!-- 鐗╂枡淇℃伅鏄剧ず -->
+              <el-form-item label="鐗╂枡缂栫爜" v-if="currentMaterialInfo">
+                <el-input v-model="currentMaterialInfo.materielCode" readonly />
+              </el-form-item>
+              <el-form-item label="鐗╂枡鍚嶇О" v-if="currentMaterialInfo">
+                <el-input v-model="currentMaterialInfo.materielName" readonly />
+              </el-form-item>
             </el-form>
 
             <div class="current-info" v-if="currentPallet">
@@ -141,6 +149,7 @@
       },
       currentPallet: null,
       currentLockInfo: null,
+      currentMaterialInfo: null, // 鏂板锛氬綋鍓嶇墿鏂欎俊鎭�
       pickedList: [],
       pickedColumns: [
         { field: 'barcode', title: '鐗╂枡鏉$爜', width: 150 },
@@ -153,7 +162,8 @@
         { field: 'action', title: '鎿嶄綔', width: 80, slot: true }
       ],
       splitVisible: false,
-      maxPickQuantity: 0
+      maxPickQuantity: 0,
+      allLockInfos: [] // 鏂板锛氫繚瀛樻墍鏈夐攣瀹氫俊鎭紝鐢ㄤ簬鏉$爜鍖归厤
     }
   },
   computed: {
@@ -174,7 +184,7 @@
       if (!orderId) return
 
       try {
-        const result = await this.http.post(`api/OutboundOrder/GetById?id=${orderId}`)
+        const result = await this.http.get(`api/OutboundOrder/GetById?id=${orderId}`)
         if (result.status) {
           this.orderInfo = result.data
         }
@@ -195,7 +205,7 @@
         )
         if (result.status) {
           this.currentPallet = result.data
-          this.loadPalletLockInfo()
+          await this.loadPalletLockInfo()
           this.$message.success(`鎵樼洏 ${this.scanForm.palletCode} 璇嗗埆鎴愬姛`)
         } else {
           this.$message.error(result.message)
@@ -212,42 +222,148 @@
         const result = await this.http.get(
           `api/OutboundPicking/GetPalletLockInfos?palletCode=${this.currentPallet.palletCode}`
         )
-        if (result.status && result.data.length > 0) {
-          this.currentLockInfo = result.data[0]
-          this.maxPickQuantity = this.currentLockInfo.assignQuantity - this.currentLockInfo.pickedQty
+        if (result.status) {
+          this.allLockInfos = result.data
+          // 榛樿閫夋嫨绗竴涓攣瀹氫俊鎭�
+          if (this.allLockInfos.length > 0) {
+            this.currentLockInfo = this.allLockInfos[0]
+            this.currentMaterialInfo = {
+              materielCode: this.currentLockInfo.materielCode,
+              materielName: this.currentLockInfo.materielName
+            }
+            this.maxPickQuantity = this.currentLockInfo.assignQuantity - this.currentLockInfo.pickedQty
+          }
         }
       } catch (error) {
         console.error('鍔犺浇閿佸畾淇℃伅澶辫触:', error)
       }
     },
 
+    // 鏍规嵁鏉$爜鏌ユ壘瀵瑰簲鐨勯攣瀹氫俊鎭拰鐗╂枡淇℃伅
+    findLockInfoByBarcode(barcode) {
+      if (!this.allLockInfos || this.allLockInfos.length === 0) {
+        return null
+      }
+      
+      // 棣栧厛绮剧‘鍖归厤褰撳墠鏉$爜
+      let lockInfo = this.allLockInfos.find(x => x.currentBarcode === barcode)
+      if (lockInfo) {
+        return lockInfo
+      }
+      
+      // 濡傛灉娌℃湁绮剧‘鍖归厤锛屾煡鎵捐鏉$爜瀵瑰簲鐨勭墿鏂欐槸鍚﹀湪閿佸畾淇℃伅涓�
+      // 杩欓噷闇�瑕佽皟鐢ㄥ悗绔帴鍙i獙璇佹潯鐮佸搴旂殑鐗╂枡
+      return null
+    },
+
     async handleBarcodeScan() {
-      // 瀹炵幇鎵爜纭閫昏緫
       if (!this.scanForm.barcode) {
         this.$message.warning('璇疯緭鍏ョ墿鏂欐潯鐮�')
         return
       }
 
+      if (!this.currentPallet) {
+        this.$message.warning('璇峰厛鎵弿鎵樼洏鏉$爜')
+        return
+      }
+
+      if (this.scanForm.quantity <= 0) {
+        this.$message.warning('璇疯緭鍏ユ湁鏁堢殑鎷i�夋暟閲�')
+        return
+      }
+
       try {
+        // 楠岃瘉鏉$爜骞惰幏鍙栫墿鏂欎俊鎭�
+        const materialInfo = await this.validateBarcode(this.scanForm.barcode)
+        if (!materialInfo) {
+          this.$message.error('鏃犳晥鐨勭墿鏂欐潯鐮�')
+          return
+        }
+
+        // 鏌ユ壘瀵瑰簲鐨勯攣瀹氫俊鎭�
+        const targetLockInfo = this.findLockInfoByBarcodeAndMaterial(this.scanForm.barcode, materialInfo.materielCode)
+        if (!targetLockInfo) {
+          this.$message.error('璇ョ墿鏂欐潯鐮佷笉鍦ㄥ綋鍓嶆墭鐩樼殑閿佸畾淇℃伅涓�')
+          return
+        }
+
+        // 妫�鏌ユ嫞閫夋暟閲�
+        const availableQuantity = targetLockInfo.assignQuantity - targetLockInfo.pickedQty
+        if (this.scanForm.quantity > availableQuantity) {
+          this.$message.error(`鎷i�夋暟閲忚秴杩囧彲鐢ㄦ暟閲忥紝鍓╀綑鍙嫞閫夛細${availableQuantity}`)
+          return
+        }
+
+        // 鍑嗗璇锋眰鏁版嵁
         const request = {
+          orderDetailId: targetLockInfo.orderDetailId,
           barcode: this.scanForm.barcode,
-          quantity: this.scanForm.quantity,
+          materielCode: materialInfo.materielCode, // 浼犻�掔墿鏂欑紪鐮�
+          pickQuantity: this.scanForm.quantity,
+          locationCode: this.currentPallet.locationCode,
           palletCode: this.currentPallet.palletCode,
-          orderId: this.orderInfo.id
+          stockId: targetLockInfo.stockId,
+          outStockLockInfoId: targetLockInfo.id // 浼犻�掗攣瀹氫俊鎭疘D
         }
 
         const result = await this.http.post('api/OutboundPicking/ConfirmPicking', request)
         if (result.status) {
           this.$message.success('鎷i�夌‘璁ゆ垚鍔�')
+          
+          // 閲嶇疆琛ㄥ崟
           this.scanForm.barcode = ''
           this.scanForm.quantity = 1
-          this.loadPickedHistory()
+          this.currentMaterialInfo = null
+          
+          // 鍒锋柊鏁版嵁
           this.loadOrderInfo()
+          this.loadPickedHistory()
+          this.loadPalletLockInfo()
         } else {
           this.$message.error(result.message)
         }
       } catch (error) {
-        this.$message.error('鎷i�夌‘璁ゅけ璐�')
+        this.$message.error('鎷i�夌‘璁ゅけ璐�: ' + (error.message || '鏈煡閿欒'))
+      }
+    },
+
+    // 鏍规嵁鏉$爜鍜岀墿鏂欑紪鐮佹煡鎵鹃攣瀹氫俊鎭�
+    findLockInfoByBarcodeAndMaterial(barcode, materielCode) {
+      if (!this.allLockInfos || this.allLockInfos.length === 0) {
+        return null
+      }
+      
+      // 棣栧厛灏濊瘯绮剧‘鍖归厤鏉$爜
+      let lockInfo = this.allLockInfos.find(x => 
+        x.currentBarcode === barcode && x.materielCode === materielCode
+      )
+      
+      if (lockInfo) {
+        return lockInfo
+      }
+      
+      // 濡傛灉绮剧‘鍖归厤澶辫触锛屽彧鍖归厤鐗╂枡缂栫爜锛堝厑璁镐粠鍚屼竴鐗╂枡鐨勪笉鍚屾潯鐮佹嫞閫夛級
+      lockInfo = this.allLockInfos.find(x => 
+        x.materielCode === materielCode && 
+        (x.assignQuantity - x.pickedQty) > 0
+      )
+      
+      return lockInfo
+    },
+
+    // 楠岃瘉鏉$爜骞惰幏鍙栫墿鏂欎俊鎭�
+    async validateBarcode(barcode) {
+      try {
+        const result = await this.http.get(`api/OutboundPicking/ValidateBarcode?barcode=${barcode}`)
+        if (result.status) {
+          return result.data
+        } else {
+          this.$message.error(result.message)
+          return null
+        }
+      } catch (error) {
+        this.$message.error('鏉$爜楠岃瘉澶辫触')
+        return null
       }
     },
 
@@ -261,7 +377,8 @@
 
         const result = await this.http.post('api/BackToStock/GenerateBackToStockTask', {
           palletCode: this.currentPallet.palletCode,
-          currentLocation: '鎷i�変綅'
+          currentLocation: '鎷i�変綅',
+          operator: '褰撳墠鐢ㄦ埛'
         })
 
         if (result.status) {
@@ -311,6 +428,8 @@
     resetCurrentPallet() {
       this.currentPallet = null
       this.currentLockInfo = null
+      this.currentMaterialInfo = null
+      this.allLockInfos = []
       this.scanForm.palletCode = ''
     },
 
@@ -351,4 +470,49 @@
     this.loadPickedHistory()
   }
 }
-</script>
\ No newline at end of file
+</script>
+
+<style scoped>
+.picking-confirm {
+  padding: 20px;
+}
+
+.page-header {
+  margin-bottom: 20px;
+}
+
+.title {
+  font-size: 18px;
+  font-weight: bold;
+}
+
+.scan-section {
+  margin-bottom: 20px;
+}
+
+.action-buttons {
+  display: flex;
+  flex-direction: column;
+  gap: 10px;
+}
+
+.action-buttons .el-button {
+  width: 100%;
+}
+
+.current-info {
+  margin-top: 15px;
+  padding: 10px;
+  background-color: #f5f7fa;
+  border-radius: 4px;
+}
+
+.current-info p {
+  margin: 5px 0;
+  font-size: 14px;
+}
+
+.summary-info {
+  margin-bottom: 15px;
+}
+</style>
\ 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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/CodeChunks.db-shm" "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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/CodeChunks.db-shm"
index 114e070..3153eb6 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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/CodeChunks.db-shm"
+++ "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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/CodeChunks.db-shm"
Binary files differ
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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/SemanticSymbols.db-shm" "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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/SemanticSymbols.db-shm"
index 21d420b..0d91de9 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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/SemanticSymbols.db-shm"
+++ "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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/SemanticSymbols.db-shm"
Binary files differ
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/LocationInfoService.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/LocationInfoService.cs"
index e20fa2b..33789ce 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/LocationInfoService.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/LocationInfoService.cs"
@@ -36,13 +36,13 @@
         private readonly IUnitOfWorkManage _unitOfWorkManage;
         private readonly IRepository<Dt_StockInfo> _stockInfoRepository;
         public  IRepository<Dt_LocationInfo> Repository => BaseDal;
+        public readonly IRepository<Dt_LocationType> _locationTypeRepository;
 
-  
-        public LocationInfoService(IRepository<Dt_LocationInfo> BaseDal, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockInfoRepository ) : base(BaseDal)
+        public LocationInfoService(IRepository<Dt_LocationInfo> BaseDal, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_LocationType> locationTypeRepository) : base(BaseDal)
         {
             _unitOfWorkManage = unitOfWorkManage;
             _stockInfoRepository = stockInfoRepository;
-         
+            _locationTypeRepository = locationTypeRepository;
         }
 
         /// <summary>
@@ -173,6 +173,12 @@
             return Repository.QueryData(x => locationCodes.Contains(x.LocationCode));
         }
 
+        public List<LocationTypeDto> GetLocationTypes()
+        {
+          return   _locationTypeRepository.Db.Queryable<Dt_LocationType>().Select(x=>
+              new LocationTypeDto { LocationType=x.LocationType,LocationTypeDesc=x.LocationTypeDesc}).ToList();   
+        }
+
         /// <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_BasicService/WarehouseService.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/WarehouseService.cs"
index d2ad594..5ca706b 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/WarehouseService.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/WarehouseService.cs"
@@ -12,16 +12,19 @@
 using WIDESEA_Common.CommonEnum;
 using WIDESEA_Core.Caches;
 using WIDESEA_Core.BaseRepository;
+using WIDESEA_Model.Models.Basic;
+using WIDESEA_DTO.Basic;
 
 namespace WIDESEA_BasicService
 {
     public partial class WarehouseService : ServiceBase<Dt_Warehouse, IRepository<Dt_Warehouse>>, IWarehouseService
     {
         private readonly ICacheService _cacheService;
-
-        public WarehouseService(IRepository<Dt_Warehouse> BaseDal,ICacheService cacheService) : base(BaseDal)
+        private readonly IRepository<Dt_WarehouseArea> _warehouseArearepository;
+        public WarehouseService(IRepository<Dt_Warehouse> BaseDal, ICacheService cacheService, IRepository<Dt_WarehouseArea> warehouseArearepository) : base(BaseDal)
         {
             _cacheService = cacheService;
+            _warehouseArearepository = warehouseArearepository;
         }
 
         public IRepository<Dt_Warehouse> Repository => BaseDal;
@@ -80,6 +83,35 @@
             return WarehouseDisableStatus(new int[] { key });
         }
 
+        public async Task<WebResponseContent> ReceiveWarehouseArea(List<WarehouseAreaDto> models)
+        {
 
+            var lists = _warehouseArearepository.Db.Queryable<Dt_WarehouseArea>().ToList();
+            foreach (var item in models)
+            {
+                var dbfirst = lists.FirstOrDefault(x => x.Code == item.Code);
+                if (dbfirst != null)
+                {
+                    dbfirst.Code = item.Code;
+                    dbfirst.Name = item.Name;
+                    dbfirst.FactoryArea = item.FactoryArea;
+                    _warehouseArearepository.UpdateData(dbfirst);
+                }
+                else
+                {
+                    _warehouseArearepository.AddData(new Dt_WarehouseArea { Code=item.Code,Name=item.Name,FactoryArea=item.FactoryArea});
+                }
+            }
+            return WebResponseContent.Instance.OK();
+
+        }
     }
+
 }
+
+
+
+
+
+
+
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/Basic/LocationGroupDTO.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/Basic/LocationGroupDTO.cs"
index a3df6d3..4256fd2 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/Basic/LocationGroupDTO.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/Basic/LocationGroupDTO.cs"
@@ -1,8 +1,10 @@
-锘縰sing System;
+锘縰sing SqlSugar;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEA_Core.DB.Models;
 
 namespace WIDESEA_DTO.Basic
 {
@@ -32,4 +34,10 @@
 
         public int EnableStatusB { get; set; }
     }
+
+    public class LocationTypeDto 
+    {
+        public int LocationType { get; set; }
+        public string LocationTypeDesc { get; set; }
+    }
 }
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/Basic/SupplierDTO.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/Basic/SupplierDTO.cs"
index f5d96aa..721e3fe 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/Basic/SupplierDTO.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/Basic/SupplierDTO.cs"
@@ -1,9 +1,11 @@
-锘縰sing System;
+锘縰sing SqlSugar;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using WIDESEA_Core.Attributes;
+using WIDESEA_Core.DB.Models;
 
 namespace WIDESEA_DTO.Basic
 {
@@ -76,4 +78,13 @@
         [PropertyValidate("鎿嶄綔绫诲瀷", NotNullAndEmpty = true,Check = new object[] { 0, 1, 2 })]
         public string OperateType { get; set; }
     }
+
+
+    public class WarehouseAreaDto 
+    {         
+
+        public string Code { get; set; }
+        public string Name { get; set; }
+        public string FactoryArea { get; set; }
+    }
 }
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/Outbound/OutboundOrderGetDTO.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/Outbound/OutboundOrderGetDTO.cs"
index 5eeecc4..af72465 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/Outbound/OutboundOrderGetDTO.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/Outbound/OutboundOrderGetDTO.cs"
@@ -31,6 +31,8 @@
         public decimal PickQuantity { get; set; }
         public string LocationCode { get; set; }
         public string PalletCode { get; set; }
+        public int StockId { get; set; } // 搴撳瓨ID
+        public int OutStockLockInfoId { get; set; } // 鍑哄簱閿佸畾淇℃伅ID
     }     
 
     public class DirectOutboundRequest
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/ILocationInfoService.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/ILocationInfoService.cs"
index 7c4b431..f92fab0 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/ILocationInfoService.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/ILocationInfoService.cs"
@@ -59,6 +59,8 @@
 
         List<Dt_LocationInfo> GetLocationInfos(List<string> locationCodes);
 
+        List<LocationTypeDto> GetLocationTypes();
+
 
 
     }
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/IWarehouseService.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/IWarehouseService.cs"
index 2a49178..35695e4 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/IWarehouseService.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/IWarehouseService.cs"
@@ -6,6 +6,7 @@
 using WIDESEA_Core;
 using WIDESEA_Core.BaseRepository;
 using WIDESEA_Core.BaseServices;
+using WIDESEA_DTO.Basic;
 using WIDESEA_Model.Models;
 
 namespace WIDESEA_IBasicService
@@ -13,5 +14,7 @@
     public interface IWarehouseService : IService<Dt_Warehouse>
     {
         IRepository<Dt_Warehouse> Repository { get; }
+
+        Task<WebResponseContent> ReceiveWarehouseArea(List<WarehouseAreaDto> models);
     }
 }
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_IOutboundService/IOutStockLockInfoService.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_IOutboundService/IOutStockLockInfoService.cs"
index 67f3519..6d4dd63 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_IOutboundService/IOutStockLockInfoService.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_IOutboundService/IOutStockLockInfoService.cs"
@@ -21,8 +21,9 @@
  
         Task<List<Dt_OutStockLockInfo>> GetByOrderDetailId(int orderDetailId);
         Task<List<Dt_OutStockLockInfo>> GetByPalletCode(string palletCode, int? status = null);
-        Dt_OutStockLockInfo GetOutStockLockInfo(Dt_OutboundOrder outboundOrder, Dt_OutboundOrderDetail outboundOrderDetail, Dt_StockInfo outStock, decimal assignQuantity, int? taskNum = null);
-        Dt_OutStockLockInfo GetOutStockLockInfo(Dt_OutboundOrder outboundOrder, Dt_OutboundOrderDetail outboundOrderDetail, Dt_StockInfo outStock, decimal assignQuantity, string barcode = null, int? taskNum = null);
+ 
+
+        Dt_OutStockLockInfo GetOutStockLockInfo(Dt_OutboundOrder outboundOrder,Dt_OutboundOrderDetail outboundOrderDetail,Dt_StockInfo outStock, decimal assignQuantity, string barcode = null);
         Task<List<Dt_OutStockLockInfo>> GetPalletLockInfos(string palletCode);
         Task<WebResponseContent> UpdateLockInfoBarcode(int lockInfoId, string newBarcode);
     }
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_IOutboundService/IOutboundPickingService.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_IOutboundService/IOutboundPickingService.cs"
index a0c4c6f..bc178b0 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_IOutboundService/IOutboundPickingService.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_IOutboundService/IOutboundPickingService.cs"
@@ -18,7 +18,7 @@
         Task<WebResponseContent> CancelPicking(CancelPickingRequest request);
         Task<WebResponseContent> ConfirmPicking(PickingConfirmRequest request);
         Task<List<Dt_PickingRecord>> GetPickingHistory(int orderId);
-
+         Task<WebResponseContent> ValidateBarcode(string barcode);
         Task<WebResponseContent> GetPalletOutboundStatus(string palletCode);
     }
 }
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_IStockService/IStockInfoService.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_IStockService/IStockInfoService.cs"
index 68039e3..f7145c0 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_IStockService/IStockInfoService.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_IStockService/IStockInfoService.cs"
@@ -12,7 +12,8 @@
         List<Dt_StockInfo> GetStockInfos(string materielCode, string lotNo, List<string> locationCodes);
 
         List<Dt_StockInfo> GetUseableStocks(string materielCode, string batchNo);
-        List<Dt_StockInfo> GetOutboundStocks(List<Dt_StockInfo> stockInfos, string materielCode, decimal needQuantity, out decimal residueQuantity);
+       
         void AddMaterielGroup(Dt_StockInfo stockInfo);
+        (List<Dt_StockInfo>, Dictionary<int, decimal>) GetOutboundStocks(List<Dt_StockInfo> stockInfos, string materielCode, decimal needQuantity, out decimal residueQuantity);
     }
 }
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_InboundService/InboundOrderService.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_InboundService/InboundOrderService.cs"
index 04ad8a0..4b4b52b 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_InboundService/InboundOrderService.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_InboundService/InboundOrderService.cs"
@@ -358,6 +358,7 @@
                         Status = 0,
                         OrderNo = inboundOrder.InboundOrderNo,
                         BusinessType = inboundOrder.BusinessType,
+                        ProductionDate=DateTime.Now.ToString("yyyy-mm-dd HH:mm:ss")
                     });
 
                     item.ReceiptQuantity = item.BarcodeQty;
@@ -376,7 +377,7 @@
                 {
                     inboundOrder.OrderStatus = InOrderStatusEnum.鍏ュ簱涓�.ObjToInt();
                 }
-
+                inboundOrder.Operator = App.User.UserName;
                 content = MaterielGroupUpdateData(inboundOrder, dbinboundOrderDetails, stockInfo);
                 if (content.Status)
                 {
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_Model/Models/Basic/Dt_LocationInfo.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_Model/Models/Basic/Dt_LocationInfo.cs"
index d47c6b7..7bcc4f9 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_Model/Models/Basic/Dt_LocationInfo.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_Model/Models/Basic/Dt_LocationInfo.cs"
@@ -30,7 +30,7 @@
         /// 璐т綅缂栧彿
         /// </summary>
         [SugarColumn(IsNullable = true, Length = 30, ColumnDescription = "璐т綅缂栧彿")]
-        public string LocationCode {  get; set; }
+        public string LocationCode { get; set; }
 
         /// <summary>
         /// 璐т綅鍚嶇О
@@ -42,13 +42,13 @@
         /// 宸烽亾缂栧彿
         /// </summary>
         [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "宸烽亾缂栧彿")]
-        public string RoadwayNo {  get; set; }
+        public string RoadwayNo { get; set; }
 
         /// <summary>
         /// 璐т綅琛�
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDescription = "璐т綅琛�")]
-        public int Row {  get; set; }
+        public int Row { get; set; }
 
         /// <summary>
         /// 璐т綅鍒�
@@ -60,25 +60,25 @@
         /// 璐т綅灞�
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDescription = "璐т綅灞�")]
-        public int Layer {  get; set; }
+        public int Layer { get; set; }
 
         /// <summary>
         /// 璐т綅娣卞害
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDescription = "璐т綅娣卞害")]
-        public int Depth {  get; set; }
+        public int Depth { get; set; }
 
         /// <summary>
         /// 璐т綅绫诲瀷
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDescription = "璐т綅绫诲瀷")]
-        public int LocationType {  get; set; }
+        public int LocationType { get; set; }
 
         /// <summary>
         /// 璐т綅鐘舵��
         /// </summary>
         [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "璐т綅鐘舵��")]
-        public int LocationStatus {  get; set; }
+        public int LocationStatus { get; set; }
 
         /// <summary>
         /// 绂佺敤鐘舵��
@@ -90,6 +90,19 @@
         /// 澶囨敞
         /// </summary>
         [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")]
-        public string Remark {  get; set; }
+        public string Remark { get; set; }
+    }
+
+
+    [SugarTable(nameof(Dt_LocationType), "璐т綅鍖哄煙绫诲瀷")]
+    public class Dt_LocationType : BaseEntity
+    {
+        /// <summary>
+        /// 涓婚敭
+        /// </summary>
+        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")]
+        public int Id { get; set; }
+        public int LocationType { get; set; }
+        public string LocationTypeDesc { get; set; }
     }
 }
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_Model/Models/Basic/Dt_WarehouseArea.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_Model/Models/Basic/Dt_WarehouseArea.cs"
new file mode 100644
index 0000000..9ca8792
--- /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_Model/Models/Basic/Dt_WarehouseArea.cs"
@@ -0,0 +1,24 @@
+锘縰sing SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.DB.Models;
+
+namespace WIDESEA_Model.Models.Basic
+{
+    [SugarTable(nameof(Dt_WarehouseArea), "浠撳簱鍖哄煙淇℃伅")]
+    public class Dt_WarehouseArea : BaseEntity
+    {
+        /// <summary>
+        /// 涓婚敭
+        /// </summary>
+        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")]
+        public int Id { get; set; }
+
+        public string Code { get; set; }
+        public string Name { get; set; }
+        public string FactoryArea { get; set; }
+    }
+}
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_Model/Models/Inbound/Dt_InboundOrder.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_Model/Models/Inbound/Dt_InboundOrder.cs"
index 9b819b1..d0ca972 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_Model/Models/Inbound/Dt_InboundOrder.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_Model/Models/Inbound/Dt_InboundOrder.cs"
@@ -93,6 +93,8 @@
         [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")]
         public string Remark { get; set; }
 
+        [SugarColumn(IsNullable = false, Length = 50,   ColumnDescription = "鎿嶄綔鑰�")]
+        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_Model/Models/Outbound/Dt_OutboundLockInfo.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_Model/Models/Outbound/Dt_OutboundLockInfo.cs"
index f85fe7a..53fcc79 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_Model/Models/Outbound/Dt_OutboundLockInfo.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_Model/Models/Outbound/Dt_OutboundLockInfo.cs"
@@ -108,6 +108,8 @@
         [SugarColumn(IsNullable = true, ColumnDescription = "浠诲姟鍙�")]
         public int? TaskNum { get; set; }
 
+        public string SupplyCode { get; set; }
+        public string WarehouseCode { get; set; }
         /// <summary>
         /// 鐘舵�� 鐘舵�侊細0-宸插垎閰� 1-閮ㄥ垎鎷i�� 2-宸叉嫞閫� 3-宸插畬鎴�
         /// </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_Model/Models/Outbound/Dt_OutboundOrder.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_Model/Models/Outbound/Dt_OutboundOrder.cs"
index a401406..3bcafe6 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_Model/Models/Outbound/Dt_OutboundOrder.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_Model/Models/Outbound/Dt_OutboundOrder.cs"
@@ -99,6 +99,9 @@
         [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")]
         public string Remark { get; set; }
 
+
+        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鎿嶄綔鑰�")]
+        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_Model/Models/Stock/Dt_StockInfoDetail.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_Model/Models/Stock/Dt_StockInfoDetail.cs"
index a69b904..f3fd814 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_Model/Models/Stock/Dt_StockInfoDetail.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_Model/Models/Stock/Dt_StockInfoDetail.cs"
@@ -132,7 +132,7 @@
         [SugarColumn(IsNullable = true, ColumnDescription = "澶囨敞")]
         public string Remark { get; set; }
 
-        [SugarColumn(IsIgnore = true)]
+        [Navigate(NavigateType.ManyToOne, nameof(Dt_StockInfo.Id), nameof(Id))]
         public Dt_StockInfo StockInfo { get; set; }
     }
 }
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/OutStockLockInfoService.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/OutStockLockInfoService.cs"
index ca2bf8b..d407809 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/OutStockLockInfoService.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/OutStockLockInfoService.cs"
@@ -32,59 +32,52 @@
             _recordService = recordService;
         }
 
-        public Dt_OutStockLockInfo GetOutStockLockInfo(Dt_OutboundOrder outboundOrder, Dt_OutboundOrderDetail outboundOrderDetail, Dt_StockInfo outStock, decimal assignQuantity, int? taskNum = null)
-        {
-
-            Dt_OutStockLockInfo outStockLockInfo = new Dt_OutStockLockInfo()
-            {
-                PalletCode = outStock.PalletCode,
-                AssignQuantity = assignQuantity,
-                MaterielCode = outboundOrderDetail.MaterielCode,
-                BatchNo = outboundOrderDetail.BatchNo ?? outStock.Details.FirstOrDefault()?.BatchNo,
-                LocationCode = outStock.LocationCode,
-                MaterielName = outboundOrderDetail.MaterielName,
-                OrderDetailId = outboundOrderDetail.Id,
-                OrderNo = outboundOrder.OrderNo,
-                OrderType = outboundOrder.OrderType,
-
-                OriginalQuantity = outStock.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).Sum(x => x.StockQuantity),
-                Status = taskNum == null ? OutLockStockStatusEnum.宸插垎閰�.ObjToInt() : OutLockStockStatusEnum.鍑哄簱涓�.ObjToInt(),
-                StockId = outStock.Id,
-                TaskNum = taskNum,
-                OrderQuantity = outboundOrderDetail.OrderQuantity,
-                Unit = outboundOrderDetail.Unit,
-                //ProductionDate = outStock.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).FirstOrDefault()?.ProductionDate,
-                //EffectiveDate = outStock.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).FirstOrDefault()?.EffectiveDate
-            };
-
-            return outStockLockInfo;
-        }
-
+      
         /// <summary>
-        /// 鍒涘缓鍑哄簱閿佸畾淇℃伅
+        /// 鍒涘缓鍑哄簱閿佸畾淇℃伅 - 淇鐗堟湰
         /// </summary>
-        public Dt_OutStockLockInfo GetOutStockLockInfo(Dt_OutboundOrder outboundOrder, Dt_OutboundOrderDetail outboundOrderDetail, Dt_StockInfo outStock, decimal assignQuantity, string barcode = null, int? taskNum = null)
+        public Dt_OutStockLockInfo GetOutStockLockInfo(
+            Dt_OutboundOrder outboundOrder,
+            Dt_OutboundOrderDetail outboundOrderDetail,
+            Dt_StockInfo outStock,
+            decimal assignQuantity,
+            string barcode = null)
         {
-            // 鑾峰彇搴撳瓨鏄庣粏涓殑鏉$爜淇℃伅锛堝鏋滄湭鎸囧畾鏉$爜锛屼娇鐢ㄧ涓�涓彲鐢ㄦ潯鐮侊級
-            var stockDetails = outStock.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode && x.StockQuantity > x.OutboundQuantity)
-                .OrderBy(x => x.ProductionDate).ToList();
+            // 鑾峰彇搴撳瓨鏄庣粏淇℃伅
+            var stockDetails = outStock.Details
+                .Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode)
+                .ToList();
 
             if (!stockDetails.Any())
             {
-                throw new Exception($"鏈壘鍒扮墿鏂橻{outboundOrderDetail.MaterielCode}]鐨勫彲鐢ㄥ簱瀛樻槑缁�");
+                throw new Exception($"鏈壘鍒扮墿鏂橻{outboundOrderDetail.MaterielCode}]鐨勫簱瀛樻槑缁�");
             }
 
-            // 纭畾鏉$爜锛堝鏋滄湭鎸囧畾锛屼娇鐢ㄦ渶鏃╁叆搴撶殑鏉$爜锛�
-            var targetBarcode = barcode;
-            if (string.IsNullOrEmpty(targetBarcode))
+            // 纭畾鏉$爜
+            string targetBarcode;
+            if (!string.IsNullOrEmpty(barcode))
             {
-                targetBarcode = stockDetails.First().Barcode;
+                // 楠岃瘉鎸囧畾鐨勬潯鐮佹槸鍚﹀瓨鍦�
+                var specifiedBarcodeDetail = stockDetails.FirstOrDefault(x => x.Barcode == barcode);
+                if (specifiedBarcodeDetail == null)
+                {
+                    throw new Exception($"鎸囧畾鐨勬潯鐮乕{barcode}]鍦ㄥ簱瀛樹腑涓嶅瓨鍦�");
+                }
+                targetBarcode = barcode;
             }
-            // 鑾峰彇璇ユ潯鐮佺殑鍙敤鏁伴噺
-            var barcodeDetail = stockDetails.FirstOrDefault(x => x.Barcode == targetBarcode);
-            if (barcodeDetail == null)
+            else
             {
-                throw new Exception($"鏉$爜[{targetBarcode}]鍦ㄥ簱瀛樹腑涓嶅瓨鍦�");
+                // 浣跨敤绗竴涓彲鐢ㄦ潯鐮�
+                var firstAvailableDetail = stockDetails
+                    .Where(x => x.StockQuantity > x.OutboundQuantity)
+                    .OrderBy(x => x.ProductionDate)
+                    .FirstOrDefault();
+
+                if (firstAvailableDetail == null)
+                {
+                    throw new Exception($"鐗╂枡[{outboundOrderDetail.MaterielCode}]娌℃湁鍙敤搴撳瓨");
+                }
+                targetBarcode = firstAvailableDetail.Barcode;
             }
 
             return new Dt_OutStockLockInfo()
@@ -101,19 +94,18 @@
                 OriginalQuantity = outStock.Details
                     .Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode)
                     .Sum(x => x.StockQuantity),
-                Status = taskNum == null ? (int)OutLockStockStatusEnum.宸插垎閰� : (int)OutLockStockStatusEnum.鍑哄簱涓�,
+                Status = (int)OutLockStockStatusEnum.宸插垎閰�,
                 StockId = outStock.Id,
-                TaskNum = taskNum,
                 Unit = outboundOrderDetail.Unit,
-
-
-                // 鏂板瀛楁璧嬪��
-                CurrentBarcode = targetBarcode, // 褰撳墠鍒嗛厤鐨勬潯鐮�
-                OriginalLockQuantity = assignQuantity, // 鍘熷閿佸畾鏁伴噺
-                IsSplitted = 0 // 鍒濆鏈媶鍖�
+                 
+                SupplyCode     = outboundOrderDetail.SupplyCode,
+                WarehouseCode = outboundOrderDetail.WarehouseCode,
+                // 鏂板瀛楁
+                CurrentBarcode = targetBarcode,
+                OriginalLockQuantity = assignQuantity,
+                IsSplitted = 0
             };
         }
-
         /// <summary>
         /// 鏍规嵁璁㈠崟鏄庣粏ID鑾峰彇鍑哄簱閿佸畾淇℃伅
         /// </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_OutboundService/OutboundOrderDetailService.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/OutboundOrderDetailService.cs"
index fdf2e9c..826d45a 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/OutboundOrderDetailService.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/OutboundOrderDetailService.cs"
@@ -1,4 +1,5 @@
-锘縰sing WIDESEA_Common.LocationEnum;
+锘縰sing Microsoft.Extensions.Logging;
+using WIDESEA_Common.LocationEnum;
 using WIDESEA_Common.StockEnum;
 using WIDESEA_Core;
 using WIDESEA_Core.BaseRepository;
@@ -24,8 +25,8 @@
         private readonly IRecordService _recordService;
         private readonly IOutboundOrderService _outboundOrderService;
         private readonly ILocationStatusChangeRecordService _locationStatusChangeRecordService;
-
-        public OutboundOrderDetailService(IRepository<Dt_OutboundOrderDetail> BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockService stockService, IOutStockLockInfoService outStockLockInfoService, IBasicService basicService, IRecordService recordService, ILocationInfoService locationInfoService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IOutboundOrderService outboundOrderService) : base(BaseDal)
+        private readonly ILogger<OutboundOrderDetailService> _logger;
+        public OutboundOrderDetailService(IRepository<Dt_OutboundOrderDetail> BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockService stockService, IOutStockLockInfoService outStockLockInfoService, IBasicService basicService, IRecordService recordService, ILocationInfoService locationInfoService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IOutboundOrderService outboundOrderService, ILogger<OutboundOrderDetailService> logger) : base(BaseDal)
         {
             _unitOfWorkManage = unitOfWorkManage;
             _stockService = stockService;
@@ -35,6 +36,7 @@
             _locationInfoService = locationInfoService;
             _locationStatusChangeRecordService = locationStatusChangeRecordService;
             _outboundOrderService = outboundOrderService;
+            _logger = logger;
         }
 
 
@@ -85,10 +87,10 @@
                 }
 
                 // 鍒嗛厤搴撳瓨锛堟寜鍏堣繘鍏堝嚭锛�
-                List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutboundStocks(
+                var (autoAssignStocks, stockAllocations) = _stockService.StockInfoService.GetOutboundStocks(
                     stockInfos, item.MaterielCode, needQuantity, out decimal residueQuantity);
 
-                if (residueQuantity > 0)
+                if (residueQuantity > 0 && residueQuantity == needQuantity)
                 {
                     throw new Exception($"鐗╂枡[{item.MaterielCode}]搴撳瓨涓嶈冻锛岄渶瑕亄needQuantity}锛屽彲鐢▄needQuantity - residueQuantity}");
                 }
@@ -96,7 +98,7 @@
                 outStocks.AddRange(autoAssignStocks);
 
                 // 鎸夊厛杩涘厛鍑哄師鍒欏垎閰嶉攣瀹氭暟閲忓埌鍚勪釜鏄庣粏
-                DistributeLockQuantityByFIFO(item.Details, autoAssignStocks, outStockLockInfos, outboundOrder);
+                DistributeLockQuantityByFIFO(item.Details, autoAssignStocks, stockAllocations, outStockLockInfos, outboundOrder);
             }
 
             locationInfos.AddRange(_locationInfoService.GetLocationInfos(outStocks.Select(x => x.LocationCode).Distinct().ToList()));
@@ -105,52 +107,59 @@
         }
 
         /// <summary>
-        /// 鎸夊厛杩涘厛鍑哄師鍒欏垎閰嶉攣瀹氭暟閲忓埌鍚勪釜鏄庣粏
+        /// 鎸夊厛杩涘厛鍑哄師鍒欏垎閰嶉攣瀹氭暟閲忓埌鍚勪釜鏄庣粏 - 淇鐗堟湰
         /// </summary>
         private void DistributeLockQuantityByFIFO(
             List<Dt_OutboundOrderDetail> details,
             List<Dt_StockInfo> assignStocks,
+            Dictionary<int, decimal> stockAllocations,
             List<Dt_OutStockLockInfo> outStockLockInfos,
             Dt_OutboundOrder outboundOrder)
         {
             // 鎸夊厛杩涘厛鍑烘帓搴忓嚭搴撳崟鏄庣粏锛堝亣璁惧厛鍒涘缓鐨勬槑缁嗛渶瑕佷紭鍏堟弧瓒筹級
             var sortedDetails = details
-                .OrderBy(x => x.Id) // 鎸塈D鎺掑簭锛屽亣璁惧厛鍒涘缓鐨処D灏�
+                .Where(d => d.OrderQuantity - d.OverOutQuantity - d.LockQuantity > 0) // 鍙鐞嗚繕闇�瑕佸垎閰嶇殑鏁伴噺
+                .OrderBy(x => x.Id)
                 .ToList();
 
-            // 鎸夊厛杩涘厛鍑烘帓搴忓簱瀛橈紙鐢熶骇鏃ユ湡鏈�鏃╃殑浼樺厛锛�
-            var sortedStockDetails = assignStocks
+            if (!sortedDetails.Any()) return;
+
+            // 鑾峰彇鎵�鏈夊垎閰嶄簡搴撳瓨鐨勬槑缁嗭紝鎸夊厛杩涘厛鍑烘帓搴�
+            var allocatedStockDetails = assignStocks
                 .SelectMany(x => x.Details)
-                .Where(x => details.Any(d => d.MaterielCode == x.MaterielCode))
+                .Where(x => stockAllocations.ContainsKey(x.Id))
                 .OrderBy(x => x.ProductionDate)
+                .ThenBy(x => x.StockId)
                 .ToList();
 
             // 涓烘瘡涓簱瀛樻槑缁嗗垱寤哄垎閰嶈褰�
-            foreach (var stockDetail in sortedStockDetails)
+            foreach (var stockDetail in allocatedStockDetails)
             {
-                var stockInfo = assignStocks.First(x => x.Id == stockDetail.StockId);
-                var allocatedQuantity = stockDetail.OutboundQuantity; // 杩欎釜搴撳瓨鏄庣粏鍒嗛厤鐨勬暟閲�
+                if (!stockAllocations.TryGetValue(stockDetail.Id, out decimal allocatedQuantity))
+                    continue;
 
                 if (allocatedQuantity <= 0) continue;
 
-                // 鎸夐『搴忓垎閰嶇粰鍚勪釜鍑哄簱鍗曟槑缁�
+                var stockInfo = assignStocks.First(x => x.Id == stockDetail.StockId);
                 decimal remainingAllocate = allocatedQuantity;
 
+                // 鎸夐『搴忓垎閰嶇粰鍚勪釜鍑哄簱鍗曟槑缁�
                 foreach (var detail in sortedDetails)
                 {
                     if (remainingAllocate <= 0) break;
 
                     // 璁$畻杩欎釜鏄庣粏杩橀渶瑕佸垎閰嶇殑鏁伴噺
-                    var alreadyAssigned = outStockLockInfos
-                        .Where(x => x.OrderDetailId == detail.Id && x.StockId == stockInfo.Id)
-                        .Sum(x => x.AssignQuantity);
-
-                    var detailNeed = detail.OrderQuantity - detail.OverOutQuantity - detail.LockQuantity - alreadyAssigned;
-
+                    var detailNeed = detail.OrderQuantity - detail.OverOutQuantity - detail.LockQuantity;
                     if (detailNeed <= 0) continue;
 
                     // 鍒嗛厤鏁伴噺
                     var assignQuantity = Math.Min(remainingAllocate, detailNeed);
+
+                    // 楠岃瘉鏉$爜鏄惁瀛樺湪
+                    if (string.IsNullOrEmpty(stockDetail.Barcode))
+                    {
+                        throw new Exception($"搴撳瓨鏄庣粏ID[{stockDetail.Id}]鐨勬潯鐮佷负绌�");
+                    }
 
                     // 鍒涘缓鍑哄簱閿佸畾淇℃伅
                     var lockInfo = _outStockLockInfoService.GetOutStockLockInfo(
@@ -162,10 +171,32 @@
                     remainingAllocate -= assignQuantity;
                 }
 
-                // 濡傛灉杩樻湁鍓╀綑鍒嗛厤鏁伴噺锛岃鏄庨�昏緫鏈夎
+                // 濡傛灉杩樻湁鍓╀綑鍒嗛厤鏁伴噺锛岄噸鏂板垎閰嶆垨璁板綍璀﹀憡
                 if (remainingAllocate > 0)
                 {
-                    throw new Exception($"搴撳瓨鍒嗛厤閫昏緫閿欒锛屽墿浣欐湭鍒嗛厤鏁伴噺锛歿remainingAllocate}");
+                    // 閲嶆柊鍒嗛厤缁欏叾浠栭渶瑕佸垎閰嶇殑鏄庣粏
+                    foreach (var detail in sortedDetails)
+                    {
+                        if (remainingAllocate <= 0) break;
+
+                        var detailNeed = detail.OrderQuantity - detail.OverOutQuantity - detail.LockQuantity;
+                        if (detailNeed <= 0) continue;
+
+                        var assignQuantity = Math.Min(remainingAllocate, detailNeed);
+
+                        var lockInfo = _outStockLockInfoService.GetOutStockLockInfo(
+                            outboundOrder, detail, stockInfo, assignQuantity, stockDetail.Barcode);
+                        outStockLockInfos.Add(lockInfo);
+
+                        detail.LockQuantity += assignQuantity;
+                        remainingAllocate -= assignQuantity;
+                    }
+
+                    // 濡傛灉杩樻湁鍓╀綑锛岃褰曡鍛婁絾涓嶆姏鍑哄紓甯�
+                    if (remainingAllocate > 0)
+                    {
+                        _logger.LogWarning($"搴撳瓨鍒嗛厤鍚庝粛鏈夊墿浣欐暟閲忔湭鍒嗛厤: {remainingAllocate}, 鏉$爜: {stockDetail.Barcode}");
+                    }
                 }
             }
         }
@@ -219,7 +250,7 @@
                         var (barcode, barcodeQuantity) = GetBarcodeForAllocation(barcodeAllocation, canAssign);
 
                         var lockInfo = _outStockLockInfoService.GetOutStockLockInfo(
-                            outboundOrder, detail, stock, canAssign, barcode,null);
+                            outboundOrder, detail, stock, canAssign, barcode);
                         outStockLockInfos.Add(lockInfo);
 
                         availableAssign -= canAssign;
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 a47f4b8..5a87c34 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"
@@ -46,6 +46,47 @@
             _splitPackageService = splitPackageService;
         }
 
+        public async Task<WebResponseContent> ValidateBarcode(string barcode)
+        {
+            try
+            {
+                if (string.IsNullOrEmpty(barcode))
+                {
+                    return WebResponseContent.Instance.Error("鏉$爜涓嶈兘涓虹┖");
+                }
+
+                // 鏍规嵁鏉$爜鏌ヨ搴撳瓨鏄庣粏
+                var stockDetail = await _stockInfoDetailService.Db.Queryable<Dt_StockInfoDetail>()
+                    .Includes(x => x.StockInfo)
+                    .Where(x => x.Barcode == barcode)
+                    .FirstAsync();
+
+                if (stockDetail == null)
+                {
+                    return WebResponseContent.Instance.Error("鏉$爜涓嶅瓨鍦�");
+                }
+
+                
+
+                var result = new
+                {
+                    Barcode = barcode,
+                    MaterielCode = stockDetail.MaterielCode,
+                 
+                    BatchNo = stockDetail.BatchNo,
+                    AvailableQuantity = stockDetail.StockQuantity - stockDetail.OutboundQuantity,
+                    LocationCode = stockDetail.StockInfo?.LocationCode,
+                    PalletCode = stockDetail.StockInfo?.PalletCode
+                };
+
+                return WebResponseContent.Instance.OK(null, result);
+            }
+            catch (Exception ex)
+            {
+                return WebResponseContent.Instance.Error($"鏉$爜楠岃瘉澶辫触: {ex.Message}");
+            }
+        }
+
         /// <summary>
         /// 鎵爜鎷i�夌‘璁� - 绠�鍖栫増鏈�
         /// 鍙鐞嗗疄闄呮嫞閫夌殑搴撳瓨鎵e噺
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_StockService/StockInfoService.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_StockService/StockInfoService.cs"
index 90cfa42..fd7e47c 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_StockService/StockInfoService.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_StockService/StockInfoService.cs"
@@ -87,15 +87,25 @@
         /// <param name="needQuantity"></param>
         /// <param name="residueQuantity"></param>
         /// <returns></returns>
-        public List<Dt_StockInfo> GetOutboundStocks(List<Dt_StockInfo> stockInfos, string materielCode, decimal needQuantity, out decimal residueQuantity)
+        public (List<Dt_StockInfo>, Dictionary<int, decimal>) GetOutboundStocks(List<Dt_StockInfo> stockInfos, string materielCode, decimal needQuantity, out decimal residueQuantity)
         {
             List<Dt_StockInfo> outStocks = new List<Dt_StockInfo>();
-            // 鎸夊厛杩涘厛鍑烘帓搴忥紙鎸夋潯鐮佺殑鐢熶骇鏃ユ湡锛�
+            Dictionary<int, decimal> stockAllocations = new Dictionary<int, decimal>(); // 璁板綍姣忎釜搴撳瓨鏄庣粏鐨勫垎閰嶆暟閲�
+
+            // 鎸夊厛杩涘厛鍑烘帓搴忔墍鏈夌浉鍏崇殑搴撳瓨鏄庣粏
             var sortedStockDetails = stockInfos
                 .SelectMany(x => x.Details)
-                .Where(x => x.MaterielCode == materielCode && x.StockQuantity > x.OutboundQuantity)
-                .OrderBy(x => x.ProductionDate).ThenBy(x => x.StockId)
+                .Where(x => x.MaterielCode == materielCode &&
+                           x.StockQuantity > x.OutboundQuantity) // 鏈夊彲鐢ㄥ簱瀛�
+                .OrderBy(x => x.ProductionDate) // 鎸夌敓浜ф棩鏈熸帓搴忥紝鍏堣繘鍏堝嚭
+                .ThenBy(x => x.StockId)         // 鐩稿悓鐢熶骇鏃ユ湡鎸夊簱瀛業D鎺掑簭
                 .ToList();
+
+            if (!sortedStockDetails.Any())
+            {
+                residueQuantity = needQuantity;
+                return (outStocks, stockAllocations);
+            }
 
             // 璁$畻鎬诲彲鐢ㄥ簱瀛�
             var stockTotalQuantity = sortedStockDetails.Sum(x => x.StockQuantity - x.OutboundQuantity);
@@ -103,6 +113,7 @@
             if (stockTotalQuantity < needQuantity)
             {
                 residueQuantity = needQuantity - stockTotalQuantity;
+                // 涓嶆姏鍑哄紓甯革紝鍏佽閮ㄥ垎鍒嗛厤
             }
             else
             {
@@ -111,17 +122,22 @@
 
             decimal remainingNeed = needQuantity;
 
-            // 鎸夋潯鐮佸垎閰嶅簱瀛�
+            // 鎸夊厛杩涘厛鍑洪『搴忓垎閰嶅簱瀛�
             foreach (var detail in sortedStockDetails)
             {
                 if (remainingNeed <= 0) break;
 
                 decimal availableQuantity = detail.StockQuantity - detail.OutboundQuantity;
+                if (availableQuantity <= 0) continue;
+
                 decimal allocateQuantity = Math.Min(availableQuantity, remainingNeed);
 
                 // 鏇存柊鍑哄簱鏁伴噺
                 detail.OutboundQuantity += allocateQuantity;
                 remainingNeed -= allocateQuantity;
+
+                // 璁板綍鍒嗛厤鏁伴噺
+                stockAllocations[detail.Id] = allocateQuantity;
 
                 // 濡傛灉杩欎釜搴撳瓨杩樻病娣诲姞鍒板嚭搴撳垪琛ㄤ腑锛屽氨娣诲姞
                 var stockInfo = stockInfos.First(x => x.Id == detail.StockId);
@@ -132,8 +148,9 @@
             }
 
             residueQuantity = remainingNeed;
-            return outStocks;
+            return (outStocks, stockAllocations);
         }
+        
         /// <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_WMSServer/Controllers/Basic/LocationInfoController.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/Basic/LocationInfoController.cs"
index 4c84613..a39ae97 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/Basic/LocationInfoController.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/Basic/LocationInfoController.cs"
@@ -45,12 +45,17 @@
         public WebResponseContent TTTTTAssignLocation()
         {
 
-          
+
 
             var sddd = Service.AssignLocation();
 
             return WebResponseContent.Instance.OK("resdasd", sddd);
         }
-
+        [HttpPost, Route("GetLocationTypes"), AllowAnonymous, MethodParamsValidate]
+        public WebResponseContent GetLocationTypes()
+        {
+            var lists = Service.GetLocationTypes();
+            return WebResponseContent.Instance.OK("", lists);
+        }
     }
 }
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/Basic/WarehouseController.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/Basic/WarehouseController.cs"
index 9a40dd7..9bad1ca 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/Basic/WarehouseController.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/Basic/WarehouseController.cs"
@@ -1,9 +1,15 @@
-锘縰sing Microsoft.AspNetCore.Http;
+锘縰sing Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
 using WIDESEA_Core;
+using WIDESEA_Core.Attributes;
 using WIDESEA_Core.BaseController;
+using WIDESEA_DTO.Basic;
+using WIDESEA_DTO.Inbound;
 using WIDESEA_IBasicService;
 using WIDESEA_Model.Models;
+using WIDESEA_WMSServer.Controllers.Inbound;
 
 namespace WIDESEA_WMSServer.Controllers.Basic
 {
@@ -14,9 +20,34 @@
     [ApiController]
     public class WarehouseController : ApiBaseController<IWarehouseService, Dt_Warehouse>
     {
-        public WarehouseController(IWarehouseService service) : base(service)
+        private readonly ILogger<WarehouseController> _logger;
+        public WarehouseController(IWarehouseService service, ILogger<WarehouseController> logger) : base(service)
         {
+            _logger = logger;
         }
 
+
+        /// <summary>
+        /// 鎺ユ敹MES 浠撳簱淇℃伅 
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost, Route("ReceiveWarehouse"), AllowAnonymous, MethodParamsValidate]
+        public async Task<WebResponseContent> ReceiveWarehouse([FromBody] List<WarehouseAreaDto> model)
+        {
+            if (model == null || !model.Any())
+            {
+                return WebResponseContent.Instance.Error("浠撳簱鏁版嵁涓嶈兘涓虹┖");
+            }
+
+            _logger.LogInformation("WarehouseController ReceiveWarehouse:  " + JsonConvert.SerializeObject(model));
+
+            var content = await Service.ReceiveWarehouseArea(model);
+
+            if (content.Status) return WebResponseContent.Instance.OK(200);
+            else return WebResponseContent.Instance.Error(content.Message);
+        }
+
+
     }
 }
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/Outbound/OutboundOrderController.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/Outbound/OutboundOrderController.cs"
index 366a6a4..c97a841 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/Outbound/OutboundOrderController.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/Outbound/OutboundOrderController.cs"
@@ -62,7 +62,7 @@
         /// <summary>
         /// 鏍规嵁ID鑾峰彇鍑哄簱鍗�
         /// </summary>ss
-        [HttpPost, Route("GetById"), AllowAnonymous, MethodParamsValidate]
+        [HttpGet, Route("GetById"), AllowAnonymous, MethodParamsValidate]
         public async Task<WebResponseContent> GetById(int id)
         {
             var order = await Service.GetById(id);
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/Outbound/OutboundPickingController.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/Outbound/OutboundPickingController.cs"
index 5b1725d..3935b6d 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/Outbound/OutboundPickingController.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/Outbound/OutboundPickingController.cs"
@@ -46,7 +46,14 @@
         {
             return await Service.ConfirmPicking(request);
         }
-
+        /// <summary>
+        /// 楠岃瘉鏉$爜骞惰幏鍙栫墿鏂欎俊鎭�
+        /// </summary>
+        [HttpGet("ValidateBarcode")]
+        public async Task<WebResponseContent> ValidateBarcode(string barcode)
+        {
+            return await Service.ValidateBarcode(barcode);
+        }
         /// <summary>
         /// 鎷嗗寘鎿嶄綔
         /// </summary>

--
Gitblit v1.9.3