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 |  112 +++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 87 insertions(+), 25 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs
index b1de19b..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;
@@ -27,8 +28,8 @@
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
             toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
             toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
-            toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick;
-            toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick;
+            //toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick;
+            //toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick;
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "tbl013", "", (value) =>
             {
@@ -83,9 +84,45 @@
                 };
                 frm.ShowDialog();
             };
-
-            gcMx1.MouseClick += GcMx1_MouseClick;
+            gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
+            this.ucBtnPrint1.btnDesignClick += (s, e) =>
+            {
+                ucBtnPrint1.rptParameter = "rpt_SCTL{}";
+            };
+            this.ucBtnPrint1.btnReportClick += (s, e) =>
+            {
+                ucBtnPrint1.guidKey = "";
+                string rowGuid = lbMxGuid.Text.Trim();
+                ucBtnPrint1.guidKey = rowGuid;
+                if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim()))
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜寮犳暟锛�");
+                    txt_iCount_1.Focus();
+                    this.ucBtnPrint1.rptParameter = "return false";
+                    return;
+                }
+                if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim()))
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�");
+                    txt_psnQty_1.Focus();
+                    this.ucBtnPrint1.rptParameter = "return false";
+                    return;
+                }
+                if (lbMxGuid.Text.Trim().Length < 10)
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鐨勮锛�");
+                    this.ucBtnPrint1.rptParameter = "return false";
+                    return;
+                }
+                this.ucBtnPrint1.rptParameter = "rpt_SCTL{" + lbMxGuid.Text.Trim()
+                       + "," + ""
+                       + "," + ""
+                       + "," + txt_iCount_1.Text.Trim()
+                       + "," + txt_psnQty_1.Text.Trim()
+                       + "}";
+            };
         }
+         
         private async void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
             _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
@@ -286,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>
         /// 鏂板浜嬩欢
@@ -299,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);
         }
@@ -382,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);
@@ -442,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();
@@ -459,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
@@ -565,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