From c6ec5dda891c9b6ef9c3ff97cc964a826c0ddbff Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期六, 09 八月 2025 17:42:43 +0800
Subject: [PATCH] Merge branch 'master' of http://git.gs-mes.com:8080/r/~tjx/GsMesClient

---
 DevApp/Gs.DevApp/DevFrm/JJGZ/Frm_MESJJERRORJS.cs |   66 +++++++++++++++++++++++++++++++--
 1 files changed, 62 insertions(+), 4 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/JJGZ/Frm_MESJJERRORJS.cs b/DevApp/Gs.DevApp/DevFrm/JJGZ/Frm_MESJJERRORJS.cs
index db29302..c9dde64 100644
--- a/DevApp/Gs.DevApp/DevFrm/JJGZ/Frm_MESJJERRORJS.cs
+++ b/DevApp/Gs.DevApp/DevFrm/JJGZ/Frm_MESJJERRORJS.cs
@@ -38,6 +38,8 @@
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
             toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
             toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
+            btnFZ.Click += btnFZ_Click;
+            gridView2.CustomUnboundColumnData += gridView2_CustomUnboundColumnData;
             this.toolBarMenu1.getXmlConfig();
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "checkStatus", "", (value) =>
             {
@@ -79,7 +81,11 @@
                         }
 
                         DataTable _newTable = JsonConvert.DeserializeObject<DataTable>(array.ToString());
-                        DataTable _oldTable = _newTable.Clone();
+                        DataTable _oldTable = gridControl1.DataSource as DataTable;
+                        if (_oldTable == null)
+                        {
+                            _oldTable = _newTable.Clone();
+                        }
                         DataRow[] sourceRows = _newTable.Select();
                         for (int i = 0; i < sourceRows.Length; i++)
                         {
@@ -285,7 +291,7 @@
         private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e)
         {
             string rowGuid = "", rowName = "";
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_Guid, gridView1, "guid");
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_Guid, gridView1, "errorNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
                 ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -354,7 +360,12 @@
         {
             lbGuid.Text = "";
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
-            UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true);
+            List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+            gridViews.Add(gridView1);
+            gridViews.Add(gridView2);
+            UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
+            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMain1, gridView1);
+            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gridControl1, gridView2);
             txt_ErrorType.EditValue = "璁℃椂宸ユ椂";
             GetTimeType();
             GetWOMDAAInfo();
@@ -558,6 +569,12 @@
                     dynamic dy = _rtn.rtnData;
                     lbGuid.Text = strGuid;
                     UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit);
+                    // 鎺у埗鏄庣粏琛ㄥ彲缂栬緫鐘舵��
+                    List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+                    gvList.Add(gridView2);
+                    UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
+
+
                     JObject _job = JObject.Parse(strJson);
                     JArray array = new JArray();
                     foreach (var a in _job["rtnData"]["list"])
@@ -607,7 +624,7 @@
             ;
             toolBarMenu1.guidKey = "";
             string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_Guid, gridView1, "guid");
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_Guid, gridView1, "errorNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
                 MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -702,5 +719,46 @@
                 }
             }
         }
+
+        private void gridView2_CustomUnboundColumnData(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDataEventArgs e)
+        {
+            if (e.Column.FieldName == "rowNo" && e.IsGetData)
+            {
+                e.Value = e.ListSourceRowIndex + 1;
+            }
+        }
+
+        private void btnFZ_Click(object sender, EventArgs e)
+        {
+            // 鑾峰彇褰撳墠閫変腑琛岀殑琛屽彿
+            int focusedRowHandle = gridView2.FocusedRowHandle;
+            if (focusedRowHandle < 0) return;
+
+            // 鑾峰彇褰撳墠琛岀殑鏃堕暱
+            DataRow currentRow = gridView2.GetDataRow(focusedRowHandle);
+            if (currentRow == null) return;
+
+            var hourValue = currentRow["hour"];
+            if (hourValue == null) return;
+
+            decimal hourlySalary = 0;
+            decimal hour = 0;
+            decimal.TryParse(txt_HourlySalary.Text, out hourlySalary);
+            // 鑾峰彇鏃堕暱
+            decimal.TryParse(currentRow["hour"]?.ToString(), out hour);
+
+            // 鎵归噺璁剧疆涓嬮潰鎵�鏈夎鐨勬椂闀�
+            for (int i = focusedRowHandle + 1; i < gridView2.DataRowCount; i++)
+            {
+                var row = gridView2.GetDataRow(i);
+                if (row != null)
+                {
+                    row["hour"] = hourValue;
+                    // 璁$畻璁℃椂宸ヨ祫
+                    row["salary"] = hourlySalary * hour;
+                }
+            }
+            gridView2.RefreshData();
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3