From fe256a7afaa132910875d3dc73783d9ab2d7ace5 Mon Sep 17 00:00:00 2001
From: liulijun <liulijun@hnkhzn.com>
Date: 星期四, 12 三月 2026 18:57:44 +0800
Subject: [PATCH] 老厂排程单页面增加用纸顺序号和是否缺料

---
 项目代码/WMS/WMSServices/WIDESEA_Model/Models/Outbound/Dt_OutSGOrder.cs     |    6 +++
 项目代码/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderService.cs       |    7 +++
 项目代码/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs |   13 +++++-
 项目代码/WMS/WMSServices/WIDESEA_Common/OrderEnum/OutboundOrderMenu.cs      |    9 ++++
 项目代码/WMS/WMSClient/src/extension/outbound/extend/outSGOrderDetail.vue   |   16 +++++++
 项目代码/WMS/WMSClient/src/views/outbound/outSGOrder.vue                    |   50 +++++++++++++++++++++++--
 6 files changed, 92 insertions(+), 9 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/extension/outbound/extend/outSGOrderDetail.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/extension/outbound/extend/outSGOrderDetail.vue"
index b02081a..d9eb0a2 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/extension/outbound/extend/outSGOrderDetail.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/extension/outbound/extend/outSGOrderDetail.vue"
@@ -86,7 +86,9 @@
               </div>
 
               <div v-else-if="item.type == 'tag'">
-                <el-tag size="small">
+                <el-tag 
+                  size="small" 
+                  :type="getTagType(scoped.row, item)">
                   {{ getDictionary(scoped.row, item) }}
                 </el-tag>
               </div>
@@ -412,6 +414,18 @@
         }
       }
     },
+    getTagType(row, column) {
+      // 鏍规嵁璁㈠崟鐘舵�佽繑鍥炲搴旂殑鏍囩绫诲瀷
+      const status = row[column.prop];
+      if (status === 3) { // 缂烘枡
+        return 'danger'; // 绾㈣壊
+      } else if (status === 0) { // 鏈紑濮�
+        return 'success'; // 缁胯壊
+      } else if (status === 1) { // 鍑哄簱涓�
+        return 'primary'; // 钃濊壊
+      }
+      return ''; // 榛樿鏃犻鑹�
+    },
   },
 };
 </script>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/outbound/outSGOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/outbound/outSGOrder.vue"
index 3252127..c243620 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/outbound/outSGOrder.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/outbound/outSGOrder.vue"
@@ -93,9 +93,16 @@
       },
       {
         field: "orderId",
-        title: "涓婃父鐢熶骇鍗曞彿",
+        title: "鎺掔▼鍙�",
         type: "string",
         width: 160,
+        align: "left",
+      },
+      {
+        field: "number",
+        title: "鐢ㄧ焊搴忓彿",
+        type: "string",
+        width: 90,
         align: "left",
       },
       {
@@ -108,10 +115,21 @@
       {
         field: "outSGOrderStatus",
         title: "鍑哄簱鍗曠姸鎬�",
-        type: "string",
+        type: "tag",
         width: 110,
         align: "left",
         bind: { key: "outboundStatusEnum", data: [] },
+        getColor: (row) => {
+          const status = row.outSGOrderStatus;
+          if (status === 3) { // 缂烘枡
+            return 'danger'; // 绾㈣壊
+          } else if (status === 0) { // 鏈紑濮�
+            return 'success'; // 缁胯壊
+          } else if (status === 1) { // 鍑哄簱涓�
+            return 'primary'; // 钃濊壊
+          }
+          return ''; // 榛樿鏃犻鑹�
+        }
       },
       {
         field: "createDate",
@@ -133,6 +151,19 @@
           type: "string",
           width: 100,
           align: "left",
+        },
+        {
+          field: "isLackMaterial",
+          title: "鏄惁缂烘枡",
+          type: "string",
+          width: 100,
+          align: "center",
+          formatter: (row) => {
+            const isLack = Boolean(row.isLackMaterial);
+            const text = isLack ? "鏄�" : "鍚�";
+            const bgColor = isLack ? '#ff4d4f' : '#52c41a';
+            return `<div style="background-color: ${bgColor}; color: #ffffff; text-align: center; font-weight: bold; width: 100%; height: 100%; padding: 10px 0; display: flex; justify-content: center; align-items: center;">${text}</div>`;
+          }
         },
     ]);
     const detail = ref({
@@ -254,12 +285,23 @@
           align: "left",
         },
         {
-          field: "outBSTOrderDetailStatus",
+          field: "outSGOrderDetailStatus",
           title: "璁㈠崟鏄庣粏鐘舵��",
-          type: "string",
+          type: "tag",
           width: 180,
           align: "left",
           bind: { key: "outboundStatusEnum", data: [] },
+          getColor: (row) => {
+            const status = row.outSGOrderDetailStatus;
+            if (status === 3) { // 缂烘枡
+              return 'danger'; // 绾㈣壊
+            } else if (status === 0) { // 鏈紑濮�
+              return 'success'; // 缁胯壊
+            } else if (status === 1) { // 鍑哄簱涓�
+              return 'primary'; // 钃濊壊
+            }
+            return ''; // 榛樿鏃犻鑹�
+          }
         },
         {
           field: "createDate",
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Common/OrderEnum/OutboundOrderMenu.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Common/OrderEnum/OutboundOrderMenu.cs"
index 7a3c2f1..c0215b2 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Common/OrderEnum/OutboundOrderMenu.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Common/OrderEnum/OutboundOrderMenu.cs"
@@ -1,4 +1,4 @@
-锘縰sing System;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Linq;
@@ -12,6 +12,7 @@
     /// 0锛氭湭寮�濮�<br/>
     /// 1锛氬嚭搴撲腑<br/>
     /// 2锛氬嚭搴撳畬鎴�<br/>
+    /// 3锛氱己鏂�<br/>
     /// 99锛氬叧闂�<br/>
     /// </summary>
     public enum OutOrderStatusEnum
@@ -35,6 +36,12 @@
         鍑哄簱瀹屾垚 = 2,
 
         /// <summary>
+        /// 缂烘枡
+        /// </summary>
+        [Description("缂烘枡")]
+        缂烘枡 = 3,
+
+        /// <summary>
         /// 鍏抽棴
         /// </summary>
         [Description("鍏抽棴")]
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Outbound/Dt_OutSGOrder.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Outbound/Dt_OutSGOrder.cs"
index 50b9055..326e1f1 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Outbound/Dt_OutSGOrder.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Outbound/Dt_OutSGOrder.cs"
@@ -85,6 +85,12 @@
         public string MaterialWides { get; set; }
 
         /// <summary>
+        /// 鏄惁缂烘枡
+        /// </summary>
+        [SugarColumn(IsIgnore = true, ColumnDescription = "鏄惁缂烘枡")]
+        public bool IsLackMaterial { get; set; }
+
+        /// <summary>
         /// 閲囪喘鍒楄〃
         /// </summary>
         [Navigate(NavigateType.OneToMany, nameof(Dt_OutSGOrderDetail.OutSGOrderId), nameof(Id))]
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs"
index 59292fb..37383cd 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs"
@@ -5,6 +5,7 @@
 using System.Text;
 using System.Threading.Tasks;
 using WIDESEA_Common.LocationEnum;
+using WIDESEA_Common.OrderEnum;
 using WIDESEA_Common.StockEnum;
 using WIDESEA_Core;
 using WIDESEA_Core.BaseServices;
@@ -78,16 +79,22 @@
                 List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseOldCacheStocks(item.MaterialNo, item.Width) ?? new List<Dt_StockInfo>();
                 //鑾峰彇绔嬪簱鍙敤搴撳瓨
                 stockInfos.AddRange(_stockService.StockInfoService.GetUseableStocks(item.MaterialNo, item.Width, outBSTOrders.FirstOrDefault().WarehouseId).Where(x=>!outStocks.Select(x=>x.PalletCode).Contains(x.PalletCode)).ToList());
+                //鑾峰彇鎵�鏈夎鐗╂枡鍗曟嵁
+                List<Dt_OutSGOrderDetail> details = outboundOrderDetails.Where(x => x.MaterialNo == item.MaterialNo && x.Width == item.Width && x.MachineName == item.MachineName).ToList();
+                
                 if (!stockInfos.Any())
                 {
+                    //娌℃湁鍙敤搴撳瓨锛屾爣璁颁负缂烘枡
+                    foreach (var detail in details)
+                    {
+                        detail.OutSGOrderDetailStatus = OutOrderStatusEnum.缂烘枡.ObjToInt();
+                    }
                     continue;
                 }
                 //鍒嗛厤瀹為檯搴撳瓨
                 List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutOldStocks(stockInfos, needQuantity).ToList();
                 //娣诲姞搴撳瓨鍒嗛厤
                 outStocks.AddRange(autoAssignStocks);
-                //鑾峰彇鎵�鏈夎鐗╂枡鍗曟嵁
-                List<Dt_OutSGOrderDetail> details = outboundOrderDetails.Where(x => x.MaterialNo == item.MaterialNo && x.Width == item.Width && x.MachineName == item.MachineName).ToList();
                 autoAssignStocks.ForEach(x =>
                 {
                     x.StockOutLength = 0;
@@ -129,6 +136,8 @@
                             Dt_OutStockLockInfo outStockLockInfo = _outStockLockInfoService.GetOutStockLockInfo(sGOrder, details[i], autoAssignStocks[0], orderDetailNeedQuantity);
                             outStockLockInfos.Add(outStockLockInfo);
                             details[i].AssignTotalUsage = orderQuantity;
+                            //鍒嗛厤鎴愬姛锛岀姸鎬佽涓烘湭寮�濮�
+                            details[i].OutSGOrderDetailStatus = OutOrderStatusEnum.鏈紑濮�.ObjToInt();
                             autoAssignStocks[0].StockOutLength+= orderDetailNeedQuantity;
                             if (autoAssignStocks[0].StockOutLength== autoAssignStocks[0].StockLength)
                             {
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderService.cs"
index 45e4270..83ea239 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderService.cs"
@@ -61,7 +61,7 @@
                 
                 // 鎵归噺鏌ヨ鎵�鏈夊叧鑱旂殑鏄庣粏锛岃繃婊ゆ帀鐗╂枡缂栧彿涓虹┖鐨勬暟鎹�
                 var allDetails = BaseDal.Db.Queryable<Dt_OutSGOrderDetail>()
-                    .Where(d => orderIds.Contains(d.OutSGOrderId) && !string.IsNullOrEmpty(d.MaterialNo))
+                    .Where(d => orderIds.Contains(d.OutSGOrderId))
                     .ToList();
                 
                 // 鎸夎鍗旾D鍒嗙粍
@@ -90,11 +90,16 @@
                         order.MaterialWides = uniqueWidths.Count == 1 
                             ? uniqueWidths[0] 
                             : string.Join("/", uniqueWidths);
+                        
+                        // 璁剧疆鏄惁缂烘枡锛氬鏋滄湁浠讳綍涓�涓槑缁嗘槸缂烘枡鐘舵�侊紝灏辫缃负true
+                        // 寮曠敤WIDESEA_Common.OrderEnum鍛藉悕绌洪棿鏉ヤ娇鐢∣utOrderStatusEnum鏋氫妇
+                        order.IsLackMaterial = details.Any(d => d.OutSGOrderDetailStatus == 3); // 3鏄己鏂欑姸鎬佺殑鏋氫妇鍊�
                     }
                     else
                     {
                         order.MaterialNos = "";
                         order.MaterialWides = "";
+                        order.IsLackMaterial = false;
                     }
                 }
             }

--
Gitblit v1.9.3