From 98ab093f1f35f9130e586d81540060b286e45e8e Mon Sep 17 00:00:00 2001
From: cnf <3200815559@qq.com>
Date: 星期日, 24 八月 2025 14:14:32 +0800
Subject: [PATCH] 通用控件采购明细修改

---
 DevApp/Gs.DevApp/UserControl/SelectCgMx.cs |   99 ++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 81 insertions(+), 18 deletions(-)

diff --git a/DevApp/Gs.DevApp/UserControl/SelectCgMx.cs b/DevApp/Gs.DevApp/UserControl/SelectCgMx.cs
index 72d4ae2..2fde402 100644
--- a/DevApp/Gs.DevApp/UserControl/SelectCgMx.cs
+++ b/DevApp/Gs.DevApp/UserControl/SelectCgMx.cs
@@ -8,36 +8,71 @@
 
 namespace Gs.DevApp.UserControl
 {
+    // 缁ф壙鑷猉traForm锛岃繖鏄疍evExpress鎻愪緵鐨勫寮哄瀷琛ㄥ崟鎺т欢
     public partial class SelectCgMx : XtraForm
     {
-
+        // Web鏈嶅姟鍚嶇О甯搁噺锛岀敤浜庤皟鐢ㄥ悗绔帴鍙�
         private readonly string _webServiceName = "MesInvItemArnManager/";
+        // 渚涘簲鍟咺D鍜屾敹鏂欑粍缁嘔D鐨勭鏈夊彉閲�
         private string suppId = "";
         private string receiveOrgId = "";
+
         /// <summary>
-        /// 
+        /// 鏋勯�犲嚱鏁�
         /// </summary>
-        /// <param name="_suppId">渚涘簲鍟�</param>
-        /// <param name="_receiveOrgId">鏀舵枡缁勭粐</param>
-        /// <param name="_isWw">鏄惁濮斿</param>
+        /// <param name="_suppId">渚涘簲鍟咺D鍙傛暟</param>
+        /// <param name="_receiveOrgId">鏀舵枡缁勭粐ID鍙傛暟</param>
         public SelectCgMx(string _suppId, string _receiveOrgId)
         {
+            // 鍒濆鍖栬〃鍗曟帶浠�
             InitializeComponent();
+
+            // 涓篏ridView鐨勫垪鏍囬缁樺埗浜嬩欢娣诲姞澶勭悊鏂规硶锛屼娇鐢ㄨ嚜瀹氫箟缁樺埗
             this.gridView1.CustomDrawColumnHeader += (s, e) => { Gs.DevApp.ToolBox.UtilityHelper.CustomDrawColumnHeader(s, e); };
-            this.gridView1.MouseUp += (s, e) => { Gs.DevApp.ToolBox.UtilityHelper.CustomMouseUp(s, e, gcMain, gridView1); };
+
+            // 涓篏ridView鐨勯紶鏍囨姮璧蜂簨浠舵坊鍔犲鐞嗘柟娉曪紝瀹炵幇鑷畾涔変氦浜�
+            //this.gridView1.MouseUp += (s, e) => { 
+            //    Gs.DevApp.ToolBox.UtilityHelper.CustomMouseUp(s, e, gcMain, gridView1); 
+                
+            //    // 鍏ㄩ��/鍙栨秷鍏ㄩ�夊悗绔嬪嵆鏇存柊姹囨�伙紝缂╃煭寤惰繜鏃堕棿
+            //    System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
+            //    timer.Interval = 80; // 缂╃煭寤惰繜纭繚鎿嶄綔瀹屾垚鍚庣珛鍗冲埛鏂�
+            //    timer.Tick += (sender, args) =>
+            //    {
+            //        timer.Stop();
+            //        timer.Dispose();
+            //        UtilityHelper.RefreshConditionalSummary(gridView1); // 浣跨敤鏂扮殑鍒锋柊鏂规硶
+            //    };
+            //    timer.Start();
+            //};
+
+            // 閰嶇疆澶嶉�夊垪鐨勬帓搴忓拰绛涢�夐�夐」锛岀鐢ㄦ帓搴忓拰绛涢�夊姛鑳�
             this.colChkInt.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
             this.colChkInt.OptionsFilter.AllowAutoFilter = false;
             this.colChkInt.OptionsFilter.AllowFilter = false;
             this.colChkInt.OptionsFilter.AllowInHeaderSearch = DevExpress.Utils.DefaultBoolean.False;
+
+            // 璁剧疆鍗曢�夋寜閽粍榛樿閫変腑绗竴椤癸紙閲囪喘绫诲瀷锛�
             radioGroup1.SelectedIndex = 0;
+
+            // 淇濆瓨浼犲叆鐨勪緵搴斿晢ID鍜屾敹鏂欑粍缁嘔D
             this.suppId = _suppId;
             this.receiveOrgId = _receiveOrgId;
+
+            // 璁剧疆GridView鐨勫弬鏁伴厤缃�
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, null, "", null, null, false);
+
+            // 鍔犺浇绗竴椤垫暟鎹�
             getPageList(1);
+
+            // 涓�"纭畾"鎸夐挳娣诲姞鐐瑰嚮浜嬩欢澶勭悊
             btnIn.Click += (s, e) =>
             {
+                // 鎻愪氦缂栬緫骞舵洿鏂板綋鍓嶈鏁版嵁
                 gridView1.PostEditor();
                 gridView1.UpdateCurrentRow();
+
+                // 鏀堕泦閫変腑琛岀殑GUID
                 var list = new List<string>();
                 DataTable dt = this.gcMain.DataSource as DataTable;
                 {
@@ -45,55 +80,83 @@
                     {
                         string checkBox = dr["chkInt"].ToString();
                         string _guid = dr["guid"].ToString();
+                        // 妫�鏌ユ槸鍚﹂�変腑
                         if (Gs.DevApp.ToolBox.UtilityHelper.ToCheck(checkBox))
                         {
                             list.Add(_guid);
                         }
                     }
                 }
-                UpdateParent?.Invoke(this, new UpdateParentEventArgs { StringList = list }); Close();
+
+                // 瑙﹀彂鍥炶皟浜嬩欢锛屼紶閫掗�変腑鐨凣UID鍒楄〃锛岀劧鍚庡叧闂〃鍗�
+                UpdateParent?.Invoke(this, new UpdateParentEventArgs { StringList = list });
+                Close();
             };
+
+            // 涓哄崟閫夋寜閽粍娣诲姞閫変腑椤瑰彉鍖栦簨浠讹紝鍒囨崲鏃堕噸鏂板姞杞芥暟鎹�
             radioGroup1.SelectedIndexChanged += (s, e) =>
             {
                 getPageList(1);
             };
+         
+            /// <summary>
+            /// 鏉′欢姹囨�伙細鍙閫変腑锛堟墦鍕撅級鐨勮杩涜姹囨��
+            /// chkInt瀛楁涓簍rue鏃舵墠璁$畻purchaseQty鍜寃ssl鐨勫悎璁�
+            /// 浣跨敤涓�閿紡鏂规硶锛屽寘鍚潯浠舵眹鎬�+瀹炴椂鍒锋柊鍔熻兘
+            /// </summary>
+            //UtilityHelper.SetupCompleteConditionalSummary(gridView1, "chkInt", true, new string[] { "purchaseQty", "wssl" });
+
+
         }
 
         /// <summary>
-        ///     閫夋嫨鍚庣殑鍥炶皟浜嬩欢
+        /// 閫夋嫨鍚庣殑鍥炶皟浜嬩欢锛岀敤浜庡悜鐖剁獥浣撲紶閫掗�変腑鐨勬暟鎹�
         /// </summary>
         public event EventHandler<UpdateParentEventArgs> UpdateParent;
 
         /// <summary>
+        /// 浠庢湇鍔″櫒鑾峰彇鍒嗛〉鏁版嵁骞剁粦瀹氬埌GridView
         /// </summary>
-        /// <param name="curPage">绗嚑椤�</param>
-        /// <param name="pageSize">姣忛〉鍑犳潯</param>
+        /// <param name="curPage">褰撳墠椤电爜</param>
         private void getPageList(int curPage)
         {
+            // 鍒涘缓璇锋眰鍙傛暟瀵硅薄
             var _obj = new
             {
-                currentPage = curPage,
-                everyPageSize = 999999,
-                sortName = "",
-                keyWhere = "",
-                inBusType = (radioGroup1.SelectedIndex + 1),//1鏄噰璐紝2鏄澶�
-                inSupId = this.suppId,
-                inReceiveOrgId = this.receiveOrgId,
+                currentPage = curPage,          // 褰撳墠椤电爜
+                everyPageSize = 999999,         // 姣忛〉璁板綍鏁�(杩欓噷璁剧疆浜嗕竴涓緢澶х殑鍊硷紝鍙兘鏄负浜嗚幏鍙栨墍鏈夋暟鎹�)
+                sortName = "",                  // 鎺掑簭瀛楁
+                keyWhere = "",                  // 鏌ヨ鏉′欢
+                inBusType = (radioGroup1.SelectedIndex + 1), // 涓氬姟绫诲瀷锛�1鏄噰璐紝2鏄澶�
+                inSupId = this.suppId,          // 渚涘簲鍟咺D
+                inReceiveOrgId = this.receiveOrgId, // 鏀舵枡缁勭粐ID
             };
+
+            // 灏嗗弬鏁板璞″簭鍒楀寲涓篔SON瀛楃涓�
             var json = JsonConvert.SerializeObject(_obj);
+
             try
             {
+                // 璋冪敤Web鏈嶅姟鑾峰彇鏁版嵁
                 var strReturn = UtilityHelper.HttpPost("",
                     _webServiceName + "SelectForm", json);
+
+                // 瑙f瀽杩斿洖缁撴灉涓篋ataTable
                 var dd = UtilityHelper.ReturnToTablePage(strReturn);
                 var dt = dd.rtnData.list;
+
+                // 缁戝畾鏁版嵁鍒癎ridControl
                 gcMain.BindingContext = new BindingContext();
                 gcMain.DataSource = dt;
                 gcMain.ForceInitialize();
-                gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
+
+                // 鑷姩璋冩暣鍒楀骞跺簲鐢ㄧ綉鏍煎竷灞�
+                gridView1.BestFitColumns();
+                Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
             }
             catch (Exception ex)
             {
+                // 鏄剧ず閿欒淇℃伅
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
         }

--
Gitblit v1.9.3