From 1703db290a6ee6511d50efff6e67c716be2cdb58 Mon Sep 17 00:00:00 2001
From: kyy <3283105747@qq.com>
Date: 星期四, 14 八月 2025 18:27:54 +0800
Subject: [PATCH] 1、来料检验申请增加需求单据号字段2、免检增加默认组织、新的对供应商的 维护校验3、新增底部汇总、保存刷新4、到货条码打印新增底部汇总、列表明细5、到货单按钮布局改变5、UtilityHelper类新增委托事件(列表显示明细)、快速配置GridView底部汇总(启用汇总行+设置列求和汇总)

---
 DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs |  113 ++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 80 insertions(+), 33 deletions(-)

diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index 44f212d..07579d0 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -268,7 +268,8 @@
                         {
                             colmn.Visible = true;
                             colmn.OptionsColumn.ReadOnly = false;
-                        };
+                        }
+                        ;
                         if (colmn.Name.ToString().Contains("gvMxDel") || colmn.Name.ToString().Contains("gvMxTui"))
                         {
                             colmn.Visible = !isEdt;
@@ -1678,15 +1679,18 @@
         public delegate void DelegateGetModel(string guid);
         public delegate void DelegateGetList(int currentPage);
         /// <summary>
-        /// 璁剧疆涓昏〃鐨勬牱寮�
+        /// 
         /// </summary>
         /// <param name="gridView1">gridview</param>
         /// <param name="picCheckBox">鍥炬爣鎸夐挳</param>
-        /// <param name="fm"></param>
+        /// <param name="fm">绐椾綋</param>
         /// <param name="fileName">瀛楁</param>
         /// <param name="icoName">鍥炬爣璺緞</param>
-        /// <param name="action"></param>
-        public static void SetGridViewParameter(GridView gridView1, PictureBox picCheckBox = null, Form fm = null, string fileName = "checkStatus", string icoName = "", DelegateGetModel action = null, DevExpress.Utils.ToolTipController tips = null, bool isPostSearch = true)
+        /// <param name="action">濮旀墭1</param>
+        /// <param name="tips">楦熷槾鎻愮ず</param>
+        /// <param name="isPostSearch"></param>
+        /// <param name="action2">濮旀墭2锛堝垪琛ㄦ樉绀烘槑缁嗭級</param>
+        public static void SetGridViewParameter(GridView gridView1, PictureBox picCheckBox = null, Form fm = null, string fileName = "checkStatus", string icoName = "", DelegateGetModel action = null, DevExpress.Utils.ToolTipController tips = null, bool isPostSearch = true, DelegateGetModel action2 = null)
         {
             gridView1.PopupMenuShowing += (s, e) =>
             {
@@ -1708,7 +1712,6 @@
                 }
             };
             gridView1.OptionsView.ColumnAutoWidth = false;//鑷姩璋冩暣鍒楀
-
             if (isPostSearch == true)
             {
                 gridView1.OptionsView.ShowGroupPanel = false;
@@ -1725,7 +1728,6 @@
                 //鏄惁鏄剧ず搴曢儴鐨勮繃婊ゆ潯
                 // gridView1.OptionsView.ShowFilterPanelMode = DevExpress.XtraGrid.Views.Base.ShowFilterPanelMode.Never;
             }
-
             // gridView1.Appearance.HeaderPanel.ForeColor = DevExpress.LookAndFeel.DXSkinColors.ForeColors.ControlText;
             foreach (GridColumn column in gridView1.Columns)
             {
@@ -1751,7 +1753,6 @@
                         column.OptionsFilter.AllowAutoFilter = false;
                 }
             }
-
             gridView1.IndicatorWidth = 60;
             gridView1.CustomDrawRowIndicator += (s, e) =>
             {
@@ -1793,6 +1794,22 @@
                     };
                     if (view.ActiveEditor is TextEdit)
                         view.ActiveEditor.MouseUp += ActiveEditor_MouseUp;
+                };
+            }
+            if (action2 != null)
+            {
+                gridView1.FocusedRowChanged += (s, e) =>
+                {
+                    int _handle = gridView1.FocusedRowHandle;
+                    if (_handle == -1)
+                        return;
+                    DataRow row = gridView1.GetDataRow(_handle);
+                    if (row == null)
+                        return;
+                    string _guid = row["guid"].ToString();
+                    if (string.IsNullOrEmpty(_guid))
+                        return;
+                    action2(_guid);
                 };
             }
             gridView1.RowStyle += (s, e) =>
@@ -1879,6 +1896,7 @@
                 };
             }
         }
+
         private static void ActiveEditor_MouseUp(object sender, MouseEventArgs e)
         {
             BaseEdit edit = sender as BaseEdit;
@@ -1911,7 +1929,8 @@
                 {
                     int _handle = gridView1.FocusedRowHandle;
                     bool _bl = xtraTabControl1.TabPages[0].PageEnabled;
-                    if (_bl == false) { return; };
+                    if (_bl == false) { return; }
+                    ;
                     if (_handle < 0)
                     {
                         xtraTabControl1.SelectedTabPageIndex = -1;
@@ -2356,30 +2375,56 @@
         #endregion
 
 
-      //璇诲彇榛樿缁勭粐
-  public static string GetFirstOrg(UserControl.UcLookOrg txt_erpSczz)
-  {
-      string userGuid = LoginInfoModel.CurrentUser.LoginUserGuid;
-      var pgq = new PageQueryModel(1, 999999, "FID", "asc", userGuid, " and IS_STATUS=1");
-      var json = JsonConvert.SerializeObject(pgq);
-      try
-      {
-          var strReturn = UtilityHelper.HttpPost("", "Organization/GetListPage", json);
-          var _obj = UtilityHelper.ReturnToDynamic(strReturn);
-          string _extendText = _obj.rtnData.extendText;
-          string[] _dftOrg = _extendText.Split(',');
-          if (_dftOrg.Length > 0)
-          {
-              txt_erpSczz.SetIdOrCode(_dftOrg[0].Trim());
-              return _dftOrg[0].Trim();
-          }
-          return "";
-      }
-      catch (Exception ex)
-      {
-          return "";
-      }
-  }
+        //璇诲彇榛樿缁勭粐
+        public static string GetFirstOrg(UserControl.UcLookOrg txt_erpSczz)
+        {
+            string userGuid = LoginInfoModel.CurrentUser.LoginUserGuid;
+            var pgq = new PageQueryModel(1, 999999, "FID", "asc", userGuid, " and IS_STATUS=1");
+            var json = JsonConvert.SerializeObject(pgq);
+            try
+            {
+                var strReturn = UtilityHelper.HttpPost("", "Organization/GetListPage", json);
+                var _obj = UtilityHelper.ReturnToDynamic(strReturn);
+                string _extendText = _obj.rtnData.extendText;
+                string[] _dftOrg = _extendText.Split(',');
+                if (_dftOrg.Length > 0)
+                {
+                    txt_erpSczz.SetIdOrCode(_dftOrg[0].Trim());
+                    return _dftOrg[0].Trim();
+                }
+                return "";
+            }
+            catch (Exception ex)
+            {
+                return "";
+            }
+        }
+
+        #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>
@@ -2466,4 +2511,6 @@
 
 
 
+
+
 }
\ No newline at end of file

--
Gitblit v1.9.3