From d741e7a7ad7de5045e5c6b6145d9da1783cadecd Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期二, 13 一月 2026 09:55:03 +0800
Subject: [PATCH] Merge branch 'htq20251215' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu into htq20251215

---
 项目代码/WIDESEA_WMSClient/src/extension/outbound/extend/StockSelect.vue |  255 ++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 182 insertions(+), 73 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/StockSelect.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/StockSelect.vue"
index 55145a5..2201e5b 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/StockSelect.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/StockSelect.vue"
@@ -1,9 +1,10 @@
 <template>
   <div>
+    <!-- 搴撳瓨鎸囧畾寮圭獥 -->
     <vol-box
       v-model="showDetialBox"
       :lazy="true"
-      width="60%"
+      width="80%"
       :padding="15"
       title="鎸囧畾搴撳瓨"
     >
@@ -11,6 +12,8 @@
         <el-alert :closable="false" style="width: 100%">
           <el-row>
             <el-col :span="16">
+              <span class="less-style">鍗曟嵁缂栧彿锛歿{ mainOrderNo }}</span>
+              <el-divider direction="vertical"></el-divider>
               <span class="less-style">鐗╂枡鍚嶇О锛� {{ row.materielName }} </span>
               <el-divider direction="vertical"></el-divider>
               <span class="less-style">鐗╂枡缂栧彿锛� {{ row.materielCode }} </span>
@@ -24,13 +27,6 @@
               </span>
             </el-col>
             <el-col :span="8">
-             <!--  <el-link
-                type="primary"
-                size="small"
-                style="float: right; height: 20px"
-                @click="getData(false)"
-                >{{ kcname }}</el-link
-              > -->
               <el-link
                 type="primary"
                 size="small"
@@ -38,13 +34,6 @@
                 @click="getData"
                 >鍒锋柊</el-link
               >
-      <!--         <el-link
-                type="primary"
-                size="small"
-                style="float: right; height: 20px; margin-right: 10px"
-                @click="revokeAssign"
-                >鎾ら攢鍒嗛厤</el-link
-              > -->
             </el-col>
           </el-row>
         </el-alert>
@@ -59,7 +48,6 @@
           height="500px"
           @selection-change="handleSelectionChange"
         >
-          >
           <el-table-column type="selection" width="55"> </el-table-column>
           <el-table-column
             label="搴忓彿"
@@ -92,30 +80,78 @@
         </el-table>
       </div>
       <template #footer>
-       <!--  <el-button type="primary" size="small" @click="outbound"
+        <el-button type="primary" size="small" @click="openStationDialog"
           >鐩存帴鍑哄簱</el-button
         >
-        <el-button type="primary" size="small" @click="lockStock"
-          >閿佸畾搴撳瓨</el-button
-        > -->
         <el-button type="danger" size="small" @click="showDetialBox = false"
           >鍏抽棴</el-button
         >
       </template>
     </vol-box>
+
+    <!-- 绔欏彴閫夋嫨寮圭獥 -->
+    <el-dialog
+      v-model="showStationDialog"
+      title="閫夋嫨鍑哄簱绔欏彴"
+      width="500px"
+      :close-on-click-modal="false"
+    >
+      <div class="station-dialog-content">
+        <el-form :model="stationForm" label-width="100px">
+          <el-form-item label="閫夋嫨绔欏彴锛�" required>
+            <el-select
+              v-model="stationForm.selectedPlatform"
+              placeholder="璇烽�夋嫨鍑哄簱绔欏彴"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in stations"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="鍑哄簱鏁伴噺锛�">
+            <el-input
+              v-model="selectionSum"
+              readonly
+              style="width: 100%"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="鐗╂枡淇℃伅锛�">
+            <div style="font-size: 12px; color: #666; line-height: 1.5">
+              <div>鐗╂枡缂栧彿锛歿{ row.materielCode }}</div>
+              <div>鐗╂枡鍚嶇О锛歿{ row.materielName }}</div>
+            </div>
+          </el-form-item>
+        </el-form>
+      </div>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="showStationDialog = false">鍙栨秷</el-button>
+          <el-button type="primary" @click="confirmOutbound">纭鍑哄簱</el-button>
+        </span>
+      </template>
+    </el-dialog>
   </div>
 </template>
+
 <script>
 import VolBox from "@/components/basic/VolBox.vue";
-import { fa } from "element-plus/es/locales.mjs";
+// 寮曞叆绔欏彴绠$悊宸ュ叿
+import { stationManager } from "@/../src/uitils/stationManager";
+
 export default {
   components: { VolBox },
   data() {
     return {
       row: null,
       kcname: "",
+      mainOrderNo: "",
       pkcx: false,
       showDetialBox: false,
+      showStationDialog: false, // 绔欏彴閫夋嫨寮圭獥鏄剧ず鎺у埗
       tableData: [],
       tableColumns: [
         {
@@ -137,6 +173,12 @@
           width: 150,
         },
         {
+          prop: "barcode",
+          title: "鏉$爜",
+          type: "string",
+          width: 150,
+        },
+        {
           prop: "locationCode",
           title: "璐т綅缂栧彿",
           type: "string",
@@ -147,21 +189,51 @@
           title: "鍙敤鏁伴噺",
           type: "string",
         },
+        {
+          prop: "supplyCode",
+          title: "渚涘簲鍟�",
+          type: "string",
+        },
+        {
+          prop: "batchNo",
+          title: "鎵规鍙�",
+          type: "string",
+        },
+        {
+          prop: "stockId",
+          title: "搴撳瓨涓婚敭",
+          type: "string",
+        },
+        {
+          prop: "orderDetailId",
+          title: "鍗曟嵁鏄庣粏涓婚敭",
+          type: "string",
+        },
       ],
       selection: [],
       selectionSum: 0,
       selectionClass: "less-style",
       originalQuantity: 0,
+      
+      // 绔欏彴鐩稿叧鏁版嵁
+      stations: [
+        { label: "绔欏彴2", value: "2-1" },
+        { label: "绔欏彴3", value: "3-1" },
+      ],
+      stationForm: {
+        selectedPlatform: "", // 淇敼瀛楁鍚嶄互鍖归厤鍙傛暟
+      },
     };
   },
   methods: {
-    open(row) {
-      console.log(row);
+    open(row, orderNo) {
       this.row = row;
+      this.mainOrderNo = orderNo;
       this.showDetialBox = true;
       this.originalQuantity = this.row.lockQuantity;
       this.selectionSum = this.row.lockQuantity;
       this.getData();
+
       if (this.selectionSum == this.row.orderQuantity) {
         this.selectionClass = "equle-style";
       } else if (this.selectionSum < this.row.orderQuantity) {
@@ -170,40 +242,80 @@
         this.selectionClass = "more-style";
       }
     },
-    lockStock() {
-      this.http
-        .post(
-          "api/OutboundOrderDetail/LockOutboundStock?id=" + this.row.id,
-          this.selection,
-          "鏁版嵁澶勭悊涓�"
-        )
-        .then((x) => {
-          if (!x.status) return this.$message.error(x.message);
-          this.$message.success("鎿嶄綔鎴愬姛");
-          this.showDetialBox = false;
-          this.$emit("parentCall", ($vue) => {
-            $vue.getData();
-          });
-        });
-    },
-    outbound() {
+
+    // 鎵撳紑绔欏彴閫夋嫨寮圭獥
+    openStationDialog() {
       if (this.selection.length <= 0) {
-        return this.$message.error("璇峰嬀閫�");
+        return this.$message.error("璇峰厛鍕鹃�夎鍑哄簱鐨勫簱瀛�");
       }
-      let url = this.pkcx
-        ? "api/Task/GenerateOutboundTask?orderDetailId="
-        : "api/Task/GenerateOutboundTask?orderDetailId=";
-      this.http
-        .post(url + this.row.id, this.selection, "鏁版嵁澶勭悊涓�")
-        .then((x) => {
-          if (!x.status) return this.$message.error(x.message);
-          this.$message.success("鎿嶄綔鎴愬姛");
-          this.showDetialBox = false;
-          this.$emit("parentCall", ($vue) => {
-            $vue.getData();
-          });
-        });
+      
+      // 浠庣紦瀛樹腑鑾峰彇榛樿绔欏彴
+      const cachedStation = stationManager.getStation();
+      this.stationForm.selectedPlatform = cachedStation || "";
+      
+      this.showStationDialog = true;
     },
+
+    // 纭鍑哄簱
+    async confirmOutbound() {
+      if (!this.stationForm.selectedPlatform) {
+        return this.$message.error("璇烽�夋嫨鍑哄簱绔欏彴");
+      }
+
+      // 鍑嗗璇锋眰鍙傛暟
+      const requestParams = {
+        detailIds: [this.row.id], // 鍑哄簱鍗曠殑鏄庣粏ID
+        outboundTargetLocation: this.stationForm.selectedPlatform, // 閫夋嫨鐨勭珯鍙�
+        outboundQuantity: this.selectionSum, // 宸查�夋暟閲�
+        operator: this.getCurrentOperator(), // 鑾峰彇褰撳墠鎿嶄綔浜�
+        orderNo: this.mainOrderNo, // 鍗曟嵁缂栧彿
+        stockDetailIds: this.selection.map(item => item.stockId) // 搴撳瓨鏄庣粏涓婚敭鏁扮粍
+      };
+
+      try {
+        const x = await this.http.post(
+          "api/Outbound/ProcessPickingOutbound",
+          requestParams,
+          "鏁版嵁澶勭悊涓�"
+        );
+
+        if (!x.status) {
+          return this.$message.error(x.message);
+        }
+        
+        this.$message.success("鍑哄簱浠诲姟鍒涘缓鎴愬姛");
+        this.showStationDialog = false;
+        this.showDetialBox = false;
+        this.$emit("parentCall", ($vue) => {
+          $vue.getData();
+        });
+      } catch (error) {
+        this.$message.error(error.message || "鍑哄簱澶勭悊澶辫触");
+      }
+    },
+
+    // 鑾峰彇褰撳墠鎿嶄綔浜�
+    getCurrentOperator() {
+      // 鍙互浠庢湰鍦板瓨鍌ㄣ�乂uex鎴栧叏灞�鐘舵�佷腑鑾峰彇褰撳墠鐢ㄦ埛
+      try {
+        // 绀轰緥锛氫粠localStorage鑾峰彇鐢ㄦ埛淇℃伅
+        const userInfo = JSON.parse(localStorage.getItem('userInfo') || '{}');
+        if (userInfo.userName) {
+          return userInfo.userName;
+        }
+        
+        // 绀轰緥锛氫粠Vuex鑾峰彇鐢ㄦ埛淇℃伅
+        if (this.$store && this.$store.state.user) {
+          return this.$store.state.user.userName;
+        }
+      } catch (error) {
+        console.error('鑾峰彇鎿嶄綔浜轰俊鎭け璐�:', error);
+      }
+      
+      // 榛樿鎿嶄綔浜�
+      return "admin";
+    },
+
     getData(a) {
       if (!a) this.pkcx = !this.pkcx;
       let url = this.pkcx
@@ -220,23 +332,7 @@
           this.tableData = x;
         });
     },
-    revokeAssign() {
-      console.log(this.row);
-      this.http
-        .post(
-          "api/OutboundOrderDetail/RevokeLockOutboundStock?id=" + this.row.id,
-          null,
-          "鏁版嵁澶勭悊涓�"
-        )
-        .then((x) => {
-          if (!x.status) return this.$message.error(x.message);
-          this.$message.success("鎿嶄綔鎴愬姛");
-          this.showDetialBox = false;
-          this.$emit("parentCall", ($vue) => {
-            $vue.getData();
-          });
-        });
-    },
+
     handleSelectionChange(val) {
       this.selection = val;
       this.selectionSum =
@@ -253,6 +349,7 @@
         this.selectionClass = "more-style";
       }
     },
+
     toggleSelection(rows) {
       if (rows) {
         rows.forEach((row) => {
@@ -262,15 +359,18 @@
         this.$refs.singleTable.clearSelection();
       }
     },
+
     clearSelection() {
       this.$refs.singleTable.clearSelection();
     },
+
     handleRowClick(row) {
       this.$refs.singleTable.toggleRowSelection(row);
     },
   },
 };
 </script>
+
 <style scoped>
 .less-style {
   color: black;
@@ -282,6 +382,17 @@
 
 .more-style {
   color: red;
+}
+
+/* 绔欏彴閫夋嫨寮圭獥鏍峰紡 */
+.station-dialog-content {
+  padding: 10px 0;
+}
+
+.dialog-footer {
+  display: flex;
+  justify-content: flex-end;
+  gap: 10px;
 }
 </style>
 
@@ -296,12 +407,10 @@
 
 .box-table .el-table tbody tr:hover > td {
   background-color: #d8e0d4 !important;
-  /* color: #ffffff; */
 }
 
 .box-table .el-table tbody tr.current-row > td {
   background-color: #f0f9eb !important;
-  /* color: #ffffff; */
 }
 
 .el-table .success-row {

--
Gitblit v1.9.3