From cd6496f2fadb885056c35a67fb3caf1a1a765ab1 Mon Sep 17 00:00:00 2001
From: tjx <t2856754968@163.com>
Date: 星期五, 24 十月 2025 10:11:16 +0800
Subject: [PATCH] 补充文档

---
 DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs |  100 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 99 insertions(+), 1 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
index 24aeadc..9b8268e 100644
--- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
@@ -1,5 +1,6 @@
 using DevExpress.XtraEditors;
 using DevExpress.XtraEditors.Controls;
+using DevExpress.XtraGrid.Columns;
 using DevExpress.XtraGrid.Views.Grid;
 using Gs.DevApp.DevFrm.Rk;
 using Gs.DevApp.Entity;
@@ -40,6 +41,10 @@
            {
                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
            }, tips);
+            // 娣诲姞gridView1鐨凴owStyle浜嬩欢锛屽綋閫�璐ф爣璇唗h=1鏃舵暣琛屾爣绾�
+            gridView1.RowStyle += GridView1_RowStyle;
+            // 娣诲姞gvMx1鐨凴owStyle浜嬩欢锛屽綋澶勭悊鎰忚clyj涓�"閫�璐�"鏃舵暣琛屾爣绾�
+            gvMx1.RowStyle += GvMx1_RowStyle;
             Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
             {
                 getModel(value);
@@ -137,6 +142,9 @@
                         gvMx1.UpdateCurrentRow();
                         gvMx1.BestFitColumns();
                         Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
+                        ConfigureOaColumns();
+                        // 鍒锋柊瑙嗗浘鏍峰紡锛屼娇RowStyle浜嬩欢鐢熸晥
+                        gvMx1.RefreshData();
                     }
                     catch (Exception ex)
                     {
@@ -145,9 +153,94 @@
                 };
                 frm.ShowDialog();
             };
+
+            ConfigureOaColumns();
         }
 
 
+        private void ConfigureOaColumns()
+        {
+            ConfigureOaColumn(gridColumn15, "clyj", "澶勭悊鎰忚", 17);
+            ConfigureOaColumn(gridColumn16, "txsl", "鎸戦�夋暟閲�", 18);
+            ConfigureOaColumn(gridColumn2, "xblb", "閫夊埆绫诲埆", 19);
+        }
+
+        /// <summary>
+        /// gridView1鐨凴owStyle浜嬩欢锛屽綋閫�璐ф爣璇唗h=1鏃舵暣琛屾爣绾�
+        /// </summary>
+        private void GridView1_RowStyle(object sender, RowStyleEventArgs e)
+        {
+            if (e.RowHandle >= 0)
+            {
+                var view = sender as GridView;
+                if (view != null)
+                {
+                    var thValue = view.GetRowCellValue(e.RowHandle, "th");
+                    if (thValue != null && thValue.ToString() == "1")
+                    {
+                        e.Appearance.BackColor = System.Drawing.Color.Red;
+                        e.Appearance.ForeColor = System.Drawing.Color.White;
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// gvMx1鐨凴owStyle浜嬩欢锛屽綋澶勭悊鎰忚clyj涓�"閫�璐�"鏃舵暣琛屾爣绾�
+        /// </summary>
+        private void GvMx1_RowStyle(object sender, RowStyleEventArgs e)
+        {
+            if (e.RowHandle >= 0)
+            {
+                var view = sender as GridView;
+                if (view != null)
+                {
+                    try
+                    {
+                        var clyjValue = view.GetRowCellValue(e.RowHandle, "clyj");
+                        if (clyjValue != null && !string.IsNullOrEmpty(clyjValue.ToString()))
+                        {
+                            string clyj = clyjValue.ToString().Trim();
+                            if (clyj == "閫�璐�")
+                            {
+                                e.Appearance.BackColor = System.Drawing.Color.Red;
+                                e.Appearance.ForeColor = System.Drawing.Color.White;
+                            }
+                        }
+                    }
+                    catch
+                    {
+                        // 濡傛灉鍒椾笉瀛樺湪锛屽拷鐣ラ敊璇�
+                    }
+                }
+            }
+        }
+
+        private static void ConfigureOaColumn(GridColumn column, string fieldName, string caption, int visibleIndex)
+        {
+            if (column == null)
+            {
+                return;
+            }
+
+            if (!string.IsNullOrEmpty(fieldName))
+            {
+                column.FieldName = fieldName;
+            }
+
+            if (!string.IsNullOrEmpty(caption))
+            {
+                column.Caption = caption;
+            }
+
+            column.Visible = true;
+            column.VisibleIndex = visibleIndex;
+            column.OptionsColumn.AllowEdit = false;
+            column.OptionsColumn.ReadOnly = true;
+            column.OptionsColumn.ShowInCustomizationForm = true;
+        }
+
+    
         private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
             _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
@@ -335,6 +428,7 @@
             gridViews.Add(gvMx1);
             UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
             Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
+            ConfigureOaColumns();
             //澧炲姞鏃讹紝榛樿缁勭粐
             string deftOrg = UtilityHelper.GetFirstOrg(txt_receiveOrgId);
             txt_isSrm.Checked = false;
@@ -523,10 +617,14 @@
                         gcMx1.ForceInitialize();
                         gvMx1.BestFitColumns();
                         Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
+                        ConfigureOaColumns();
+                        // 鍒锋柊瑙嗗浘鏍峰紡锛屼娇RowStyle浜嬩欢鐢熸晥
+                        gvMx1.RefreshData();
                     }
                     else
                     {
                         UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
+                        ConfigureOaColumns();
                     }
                 }
                 else
@@ -714,4 +812,4 @@
             }
         }
     }
-}
\ No newline at end of file
+}

--
Gitblit v1.9.3