From 1f45918504bfdafae93b6fc7a5823a48d73e4d3c Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期二, 31 十二月 2024 14:51:58 +0800
Subject: [PATCH] 工单细节

---
 DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs |   72 ++++++++++++++++++++++++-----------
 1 files changed, 49 insertions(+), 23 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs
index c2cf57a..7299801 100644
--- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs
@@ -1,3 +1,4 @@
+using DevExpress.XtraGrid.Views.Base.ViewInfo;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
@@ -83,8 +84,7 @@
                 };
                 frm.ShowDialog();
             };
-
-            gcMx1.MouseClick += GcMx1_MouseClick;
+            gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
             this.ucBtnPrint1.btnDesignClick += (s, e) =>
             {
                 ucBtnPrint1.rptParameter = "rpt_SCTL{}";
@@ -122,6 +122,7 @@
                        + "}";
             };
         }
+         
         private async void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
             _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
@@ -322,7 +323,18 @@
                 return;
             }
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
-            UtilityHelper.ChangeEnableByControl(panel1.Controls, true);
+            if (xtraTabControl1.SelectedTabPageIndex == 1)
+            {
+                getModel(rowGuid);
+            }
+            else
+            {
+                List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+                gvList.Add(gvMx1);
+                gvList.Add(gvMx2);
+                UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList);
+            }
+
         }
         /// <summary>
         /// 鏂板浜嬩欢
@@ -335,6 +347,7 @@
             lbGuid.Text = "";
             List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
             gridViews.Add(gvMx1);
+            gridViews.Add(gvMx2);
             UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
             Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
         }
@@ -418,7 +431,6 @@
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
         private void getPageList(int curPage)
         {
-
             var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
             PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString());
             string json = JsonConvert.SerializeObject(pgq);
@@ -478,6 +490,7 @@
                     lbGuid.Text = strGuid;
                     List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                     gvList.Add(gvMx1);
+                    gvList.Add(gvMx2);
                     UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList);
                     JObject _job = JObject.Parse(strJson);
                     JArray array = new JArray();
@@ -495,6 +508,22 @@
                     else
                     {
                         Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
+                    }
+                    JArray array2 = new JArray();
+                    foreach (var a in _job["rtnData"]["list2"])
+                    {
+                        array2.Add(a);
+                    }
+                    DataTable dt2 = JsonConvert.DeserializeObject<DataTable>(array2.ToString());
+                    if (dt2.Rows.Count > 0)
+                    {
+                        gcMx2.BindingContext = new BindingContext();
+                        gcMx2.DataSource = dt2;
+                        gcMx2.ForceInitialize();
+                    }
+                    else
+                    {
+                        Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
                     }
                 }
                 else
@@ -601,26 +630,23 @@
 
         }
 
-
-        private void GcMx1_MouseClick(object sender, MouseEventArgs e)
+        private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
         {
-            string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gvMx1, e, "tlid");
-            if (string.IsNullOrEmpty(rowGuid))
-                return;
-            lbMxGuid.Text = rowGuid;
-            toolBarMenu1.guidKey = rowGuid;
-            var info = gvMx1.CalcHitInfo(e.Location);
-            var view = info.View;
-            var row = view.GetDataRow(info.RowHandle);
-            txtWlid.Text = row["tld002"].ToString();
-            txtWlgg.Text = row["tld004"].ToString();
-            txtWlmc.Text = row["tld003"].ToString();
-            txtQuantity.Text = row["tld004"].ToString();//鐢宠鎬婚噺
-            //txtYdy.Text = row["YDYNUM"].ToString();//宸叉墦鍗版�婚噺
-            //kyPrtQty.Text = row["KDYNUM"].ToString();//鍙墦鍗版�婚噺
-
-            txtYdy.Text ="";//宸叉墦鍗版�婚噺
-            kyPrtQty.Text ="";//鍙墦鍗版�婚噺
+            if (e.FocusedRowHandle >= 0)
+            {
+                DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle);
+                lbMxGuid.Text = row["tlid"].ToString();
+                toolBarMenu1.guidKey = row["tlid"].ToString();
+                txtWlid.Text = row["tld002"].ToString();
+                txtWlgg.Text = row["tld004"].ToString();
+                txtWlmc.Text = row["tld003"].ToString();
+                txtQuantity.Text = row["tld004"].ToString();//鐢宠鎬婚噺
+                 //txtYdy.Text = row["YDYNUM"].ToString();//宸叉墦鍗版�婚噺
+                 //kyPrtQty.Text = row["KDYNUM"].ToString();//鍙墦鍗版�婚噺
+                txtYdy.Text = "";//宸叉墦鍗版�婚噺
+                kyPrtQty.Text = "";//鍙墦鍗版�婚噺
+            }
         }
+       
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3