From 374a87fcff65eae6999de6621383e999cbefc8e3 Mon Sep 17 00:00:00 2001
From: lg <123456>
Date: 星期一, 24 十一月 2025 15:36:04 +0800
Subject: [PATCH] 退料点击排序

---
 DevApp/Gs.DevApp/DevFrm/Rk/SelectItemTbl.cs |   39 +++++++++++++++++++++++++++++++++++----
 1 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/SelectItemTbl.cs b/DevApp/Gs.DevApp/DevFrm/Rk/SelectItemTbl.cs
index 6f7613b..87f9925 100644
--- a/DevApp/Gs.DevApp/DevFrm/Rk/SelectItemTbl.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Rk/SelectItemTbl.cs
@@ -12,9 +12,13 @@
     {
         private readonly string _webServiceName = "MesItemTblManager/";
         private string daaGuid = "";
+        //鍕鹃�夋搴�
+        Dictionary<string, int> ageDict = new Dictionary<string, int>();
+
         public SelectItemTbl(string _daaGuid)
         {
             InitializeComponent();
+            #region  鍕鹃��
             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); };
             this.colChkInt.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
@@ -23,6 +27,23 @@
             this.colChkInt.OptionsFilter.AllowInHeaderSearch = DevExpress.Utils.DefaultBoolean.False;
             this.colChkInt.Fixed = DevExpress.XtraGrid.Columns.FixedStyle.Left;
             this.colChkInt.VisibleIndex = 0;
+            #endregion
+
+
+            #region 鍕鹃�夋搴�2025-11-24
+            this.gridView1.CellValueChanged += (s, e) =>
+            {
+                var row = gridView1.GetDataRow(e.RowHandle);
+                var mxGuid = row["guid"].ToString();
+                bool isChecked = (bool)e.Value;
+                int dicCount = ageDict.Count + 1;
+                if (isChecked)
+                {
+                    ageDict.Add(mxGuid, dicCount); // 娣诲姞鏂伴敭鍊煎
+                }
+            };
+            #endregion
+
             this.daaGuid = _daaGuid;
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, null, "", null, null, false);
             getPageList(1);
@@ -30,21 +51,31 @@
             {
                 gridView1.PostEditor();
                 gridView1.UpdateCurrentRow();
-                var list = new List<string>();
+                var list = new List<dynamic>();
                 DataTable dt = this.gcMain.DataSource as DataTable;
                 {
                     foreach (DataRow dr in dt.Rows)
                     {
                         string checkBox = dr["chkInt"].ToString();
                         string _guid = dr["guid"].ToString();
+                        int _idx = 0;
+                        // 瀹夊叏鑾峰彇锛堟帹鑽愶級
+                        if (ageDict.TryGetValue(_guid, out _idx))
+                        {
+                        }
+                        else
+                            _idx = 0;
                         if (Gs.DevApp.ToolBox.UtilityHelper.ToCheck(checkBox))
                         {
-                            list.Add(_guid);
+                            list.Add(new
+                            {
+                                guid = _guid,
+                                index = _idx
+                            });
                         }
                     }
                 }
-                UpdateParent?.Invoke(this, new UpdateParentEventArgs { StringList = list }); Close();
-
+                UpdateParent?.Invoke(this, new UpdateParentEventArgs { DynamicList = list }); Close();
             };
         }
 

--
Gitblit v1.9.3