From 9ae6f47ca642d1d52c42dbb5bb771bd5910b60d6 Mon Sep 17 00:00:00 2001
From: cnf <3283105747@qq.com>
Date: 星期三, 17 十二月 2025 18:00:59 +0800
Subject: [PATCH] 工单复选框开启可编辑

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

diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index 76052ca..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;
                 }
             };
         }

--
Gitblit v1.9.3