From e4c662a16cbecd88e64bfeea677ef2a0c97ab771 Mon Sep 17 00:00:00 2001
From: wbc <2597324127@qq.com>
Date: 星期四, 11 十二月 2025 23:22:47 +0800
Subject: [PATCH] 蓝宝自动调拨相关更新

---
 DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs |  105 ++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 96 insertions(+), 9 deletions(-)

diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index b9f493e..f995d5b 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -501,6 +501,14 @@
                             txt.IsReadly = isEdt;
                             continue;
                         }
+                        //鑷畾涔夊簱浣�
+                        if (colType is UcLookKw)
+                        {
+                            var txt = colType as UcLookKw;
+                            txt.SetIdOrCode(strVal);
+                            txt.IsReadly = isEdt;
+                            continue;
+                        }
                         //鑷畾涔変緵搴斿晢
                         if (colType is UcLookSupplier)
                         {
@@ -806,6 +814,14 @@
                     txt.IsReadly = isEdt;
                     continue;
                 }
+                //鑷畾涔夊簱浣�
+                if (ctrl is UcLookKw)
+                {
+                    var txt = ctrl as UcLookKw;
+                    txt.SetIdOrCode("-1");
+                    txt.IsReadly = isEdt;
+                    continue;
+                }
                 //鑷畾涔変緵搴斿晢
                 if (ctrl is UcLookSupplier)
                 {
@@ -1062,6 +1078,13 @@
                 if (ctrl is UcLookCk)
                 {
                     var txt = ctrl as UcLookCk;
+                    txt.IsReadly = isEdt;
+                    continue;
+                }
+                //鑷畾涔夊簱浣�
+                if (ctrl is UcLookKw)
+                {
+                    var txt = ctrl as UcLookKw;
                     txt.IsReadly = isEdt;
                     continue;
                 }
@@ -1710,6 +1733,7 @@
         }
         public delegate void DelegateGetModel(string guid);
         public delegate void DelegateGetList(int currentPage);
+        public delegate void DelegateGetUserControlList();
 
         /// <summary>
         /// 
@@ -1846,6 +1870,30 @@
                     action2(_guid);
                 };
             }
+            gridView1.RowCellStyle += (s, e) =>
+            {
+                GridView view = s as GridView;
+                if (view != null && e.Column != null && e.CellValue != null)
+                {
+                    if (e.Column.FieldName.EndsWith("Color"))
+                    {
+                        int rowHandle = e.RowHandle;
+                        if (rowHandle >= 0)
+                        {
+                            DataRow row = gridView1.GetDataRow(e.RowHandle);
+                            string _bgColor = row[e.Column.FieldName + "Rgb"].ToString();
+                            if (!string.IsNullOrEmpty(_bgColor))
+                            {
+                                Color bgColor = ColorTranslator.FromHtml(_bgColor);
+                                e.Appearance.BackColor = bgColor;
+                                //e.Appearance.BackColor2 = Color.LightSkyBlue;
+                                //e.Appearance.ForeColor = ColorTranslator.FromHtml("#ffffff") ;
+                            }
+                        }
+                    }
+                }
+            };
+
             gridView1.RowStyle += (s, e) =>
             {
                 //榛樿閫変腑琛屼笉鍙樿壊
@@ -1946,7 +1994,7 @@
                     column.Width = maxWidth;
             }
         }
- 
+
         /// <summary>
         /// 璁剧疆閫夐」鍗�
         /// </summary>
@@ -1955,10 +2003,24 @@
         /// <param name="pageBar1"></param>
         /// <param name="action"></param>
         /// <param name="page"></param>
-        public static void SetTabParameter(GridView gridView1, DevExpress.XtraTab.XtraTabControl xtraTabControl1, UcPageBar pageBar1, DelegateGetModel action = null, DelegateGetList page = null, Label lbGuid = null)
+        public static void SetTabParameter(GridView gridView1, DevExpress.XtraTab.XtraTabControl xtraTabControl1, UcPageBar pageBar1, DelegateGetModel action = null, DelegateGetList page = null, Label lbGuid = null, UcToolBarMenu barMenu = null, DelegateGetUserControlList ucLst = null)
         {
             xtraTabControl1.SelectedPageChanged += (s, e) =>
             {
+                if (pageBar1 != null && xtraTabControl1.SelectedTabPageIndex == 0)
+                {
+                    if (barMenu != null)
+                        barMenu.SetAllButton(0);
+
+                    page(pageBar1.CurrentPage);
+                    int rowHandle = 0;
+                    rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], lbGuid.Text);
+                    if (rowHandle < 0)
+                        rowHandle = 0;
+                    gridView1.FocusedRowHandle = rowHandle;
+                    return;
+                }
+
                 if (xtraTabControl1.SelectedTabPageIndex == 1)
                 {
                     int _handle = gridView1.FocusedRowHandle;
@@ -1986,15 +2048,14 @@
                         return;
                     }
                     action(_guid);
+                    return;
                 }
-                if (pageBar1 != null && xtraTabControl1.SelectedTabPageIndex == 0)
+
+                if (barMenu != null && xtraTabControl1.SelectedTabPageIndex == 2)
                 {
-                    page(pageBar1.CurrentPage);
-                    int rowHandle = 0;
-                    rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], lbGuid.Text);
-                    if (rowHandle < 0)
-                        rowHandle = 0;
-                    gridView1.FocusedRowHandle = rowHandle;
+                    barMenu.SetAllButton(2);
+                    ucLst();
+                    return;
                 }
             };
         }
@@ -2121,6 +2182,32 @@
         }
 
 
+        #region GridView姹囨�婚厤缃伐鍏锋柟娉�
+        /// <summary>
+        /// 2025-08-14 kyy 蹇�熼厤缃瓽ridView搴曢儴姹囨�伙紙鍚敤姹囨�昏+璁剧疆鍒楁眰鍜屾眹鎬伙級
+        /// </summary>
+        /// <param name="gridView">鐩爣GridView鎺т欢</param>
+        /// <param name="summaryColumns">闇�瑕佽繘琛屾眰鍜屾眹鎬荤殑鍒楀悕鏁扮粍</param>
+        public static void SetupGridSummary(DevExpress.XtraGrid.Views.Grid.GridView gridView, params string[] summaryColumns)
+        {
+            // 鍚敤搴曢儴姹囨�昏
+            gridView.OptionsView.ShowFooter = true;
+
+            // 涓烘瘡涓寚瀹氬垪璁剧疆姹傚拰姹囨��
+            foreach (var columnName in summaryColumns)
+            {
+                // 楠岃瘉鍒楁槸鍚﹀瓨鍦紙閬垮厤寮傚父锛�
+                if (gridView.Columns[columnName] != null)
+                {
+                    gridView.Columns[columnName].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
+                    gridView.Columns[columnName].SummaryItem.DisplayFormat = "鍚堣: {0}";
+                }
+            }
+        }
+      #endregion  
+
+
+
         /// <summary>
         /// 鏁版嵁杩囨护
         /// </summary>

--
Gitblit v1.9.3