From cf6a69eed3ac59698f16ee08aedd73d34cf6790d Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期四, 15 一月 2026 11:43:08 +0800
Subject: [PATCH] 代码优化

---
 项目代码/WIDESEA_WMSClient/src/extension/outbound/extend/StockSelect.vue |   83 +++++++++++++++++++++++++++++++++++------
 1 files changed, 70 insertions(+), 13 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 2201e5b..0fc8112 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"
@@ -64,17 +64,27 @@
             :width="item.width"
             align="center"
           >
-            <template #default="scoped" v-if="item.type == 'icon'">
-              <el-tooltip
-                class="item"
-                effect="dark"
-                :content="item.title"
-                placement="bottom"
-                ><el-button
-                  type="text"
-                  @click="tableButtonClick(scoped.row, item)"
-                  ><i :class="item.icon" style="font-size: 22px"></i></el-button
-              ></el-tooltip>
+            <template #default="scoped">
+              <div v-if="item.type == 'icon'">
+                <el-tooltip
+                  class="item"
+                  effect="dark"
+                  :content="item.title"
+                  placement="bottom"
+                  ><el-button
+                    type="text"
+                    @click="tableButtonClick(scoped.row, item)"
+                    ><i :class="item.icon" style="font-size: 22px"></i></el-button
+                ></el-tooltip>
+              </div>
+              <div v-else-if="item.type == 'tag'">
+                <el-tag size="small">
+                  {{ getDictionary(scoped.row, item) }}
+                </el-tag>
+              </div>
+              <div v-else>
+                {{ scoped.row[item.prop] }}
+              </div>
             </template>
           </el-table-column>
         </el-table>
@@ -153,6 +163,7 @@
       showDetialBox: false,
       showStationDialog: false, // 绔欏彴閫夋嫨寮圭獥鏄剧ず鎺у埗
       tableData: [],
+      dictionaryList: null, // 鏂板锛氬瓧鍏告暟鎹�
       tableColumns: [
         {
           prop: "materielCode",
@@ -200,6 +211,13 @@
           type: "string",
         },
         {
+          prop: "stockStatus",
+          title: "搴撳瓨鏄庣粏鐘舵��",
+          type: "tag",
+          width: 90,
+          bindKey: "stockStatusEmun",
+        },
+        {
           prop: "stockId",
           title: "搴撳瓨涓婚敭",
           type: "string",
@@ -232,6 +250,9 @@
       this.showDetialBox = true;
       this.originalQuantity = this.row.lockQuantity;
       this.selectionSum = this.row.lockQuantity;
+      
+      // 鍔犺浇瀛楀吀鏁版嵁
+      this.getDictionaryData();
       this.getData();
 
       if (this.selectionSum == this.row.orderQuantity) {
@@ -241,6 +262,44 @@
       } else {
         this.selectionClass = "more-style";
       }
+    },
+
+    // 鑾峰彇瀛楀吀鏁版嵁
+    getDictionaryData() {
+      if (this.dictionaryList) {
+        return;
+      }
+      var param = [];
+      this.tableColumns.forEach((x) => {
+        if (x.type == "tag" && x.bindKey != "") {
+          param.push(x.bindKey);
+        }
+      });
+      this.http
+        .post("api/Sys_Dictionary/GetVueDictionary", param, "鏌ヨ涓�")
+        .then((x) => {
+          if (x.length > 0) {
+            this.dictionaryList = x;
+          }
+        });
+    },
+
+    // 鑾峰彇瀛楀吀鍊�
+    getDictionary(row, column) {
+      if (this.dictionaryList) {
+        var item = this.dictionaryList.find((x) => x.dicNo == column.bindKey);
+        if (item) {
+          var dicItem = item.data.find((x) => x.key == row[column.prop]);
+          if (dicItem) {
+            return dicItem.value;
+          } else {
+            return row[column.prop];
+          }
+        } else {
+          return row[column.prop];
+        }
+      }
+      return row[column.prop];
     },
 
     // 鎵撳紑绔欏彴閫夋嫨寮圭獥
@@ -394,9 +453,7 @@
   justify-content: flex-end;
   gap: 10px;
 }
-</style>
 
-<style>
 .text-button:hover {
   background-color: #f0f9eb !important;
 }

--
Gitblit v1.9.3