From b084bd77d01a94c8f0a2d20c86a1f45ba7c8a23c Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期六, 19 四月 2025 14:08:05 +0800
Subject: [PATCH] 页面跳转

---
 DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesDbck.cs |  127 ++++++++++++++++++++++++++---------------
 1 files changed, 80 insertions(+), 47 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesDbck.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesDbck.cs
index 1ffc9cf..b538b57 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesDbck.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesDbck.cs
@@ -29,19 +29,20 @@
             toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
             toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
             toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
-           // Gs.DevApp.ToolBox.DragResizeHelp.RegisterControl(this, this.panelControl3, splitContainerControl1.Panel1, label1);
+            this.toolBarMenu1.getXmlConfig();
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "chkStatus", "", (value) =>
             {
                 Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
-            });
+
+            }, tips);
             Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
             {
                 getModel(value);
             }, (value) =>
             {
                 getPageList(this.pageBar1.CurrentPage);
-            });
+            }, lbGuid);
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
             //璁剧疆鐢宠缁勭粐
@@ -61,16 +62,34 @@
                     var rtn = UtilityHelper.ReturnToTablePage(strReturn);
                     var dt = rtn.rtnData.list;
                     this.repositoryItemSearchLookUpEdit1.DataSource = dt;
+                    //  repositoryItemSearchLookUpEdit1.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
+                    //Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView2);
                 }
                 catch (Exception ex)
                 {
                     MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
                 }
             };
+
+            this.gvMx1.InitNewRow += (s, e) =>
+            {
+                string _orgId = txt_fapporgid.GetId();
+                string _orgName = txt_fapporgid.GetName();
+                if (string.IsNullOrEmpty(_orgId)) return;
+
+                gvMx1.SetFocusedRowCellValue("dcOrg", _orgName);
+                gvMx1.SetFocusedRowCellValue("dcOrgGuid", _orgId);
+                gvMx1.SetFocusedRowCellValue("drOrg", _orgName);
+                gvMx1.SetFocusedRowCellValue("drOrgGuid", _orgId);
+                gvMx1.SetFocusedRowCellValue("drHz", _orgName);
+                gvMx1.SetFocusedRowCellValue("drHzGuid", _orgId);
+                gvMx1.SetFocusedRowCellValue("dcHz", _orgName);
+                gvMx1.SetFocusedRowCellValue("dcHzGuid", _orgId);
+            };
         }
         private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
-            Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
+            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
             Task.Delay(100);
             getPageList(1);
         }
@@ -93,7 +112,7 @@
             gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
             gridView1.ActiveFilter.Clear();
             gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
-            var frm = new ShowFilter(gridView1.Columns, _filterList);
+            var frm = new ShowFilter(gridView1.Columns, _filterList, this.GetType().FullName);
             frm.UpdateParent += Frm_UpdateParent;
             frm.ShowDialog();
         }
@@ -127,7 +146,7 @@
         {
             string rowGuid = "", rowName = "";
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_fBillNo, gridView1, "fBillNo");
+                lbGuid, txt_fBillNo, gridView1, "FBillNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
                 MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -154,7 +173,6 @@
                         Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
                     getPageList(this.pageBar1.CurrentPage);
                 }
-
                 MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
             }
             catch (Exception ex)
@@ -194,7 +212,7 @@
         private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
         {
             string rowGuid = "", rowName = "";
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_fBillNo, gridView1, "billno");
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_fBillNo, gridView1, "FBillNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
                 ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -203,13 +221,13 @@
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
             if (xtraTabControl1.SelectedTabPageIndex == 1)
             {
-                getModel(lbGuid.Text.Trim());
+                getModel(rowGuid);
             }
             else
             {
                 List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                 gvList.Add(gvMx1);
-                UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList);
+                UtilityHelper.ChangeEnableByControl(splitMx1.Panel1.Controls, true, gvList);
             }
         }
         /// <summary>
@@ -223,9 +241,8 @@
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
             List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
             gridViews.Add(gvMx1);
-            UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
+            UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
             Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
-
         }
         /// <summary>
         /// 淇濆瓨浜嬩欢
@@ -260,18 +277,18 @@
                 txt_fapporgid.Focus();
                 return;
             }
-            if (txt_fOwnerTypeIdHead.SelectedIndex <= 0)
-            {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璋冨嚭璐т富绫诲瀷锛�");
-                txt_fOwnerTypeIdHead.Focus();
-                return;
-            }
-            if (txt_fOwnerTypeInIdHead.SelectedIndex <= 0)
-            {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璋冨叆璐т富绫诲瀷锛�");
-                txt_fOwnerTypeInIdHead.Focus();
-                return;
-            }
+            //if (txt_fOwnerTypeIdHead.SelectedIndex <= 0)
+            //{
+            //    Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璋冨嚭璐т富绫诲瀷锛�");
+            //    txt_fOwnerTypeIdHead.Focus();
+            //    return;
+            //}
+            //if (txt_fOwnerTypeInIdHead.SelectedIndex <= 0)
+            //{
+            //    Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璋冨叆璐т富绫诲瀷锛�");
+            //    txt_fOwnerTypeInIdHead.Focus();
+            //    return;
+            //}
             var _obj = new
             {
                 guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
@@ -286,6 +303,7 @@
                 list = new List<dynamic>(),
             };
             gvMx1.CloseEditor();
+            gvMx1.PostEditor();
             gvMx1.UpdateCurrentRow();
             if (gvMx1.DataRowCount <= 0)
             {
@@ -361,8 +379,9 @@
                     toolBarMenu1.isSetBtn = true;
                     List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                     gvList.Add(gvMx1);
-                    UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false, gvList);
+                    UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList);
                     toolBarMenu1.currentAction = "";
+                    Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
                 }
             }
             catch (Exception ex)
@@ -400,16 +419,16 @@
                 if (dd.rtnCode > 0)
                 {
                     DataTable dt = dd.rtnData.list;
-                    gcMain.BindingContext = new BindingContext();
+                    gcMain1.BindingContext = new BindingContext();
                     gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
                     if (dt.Rows.Count > 0)
                     {
-                        gcMain.DataSource = dt;
-                        gcMain.ForceInitialize();
-                        gridView1.BestFitColumns();
+                        gcMain1.DataSource = dt;
+                        gcMain1.ForceInitialize();
+                        gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
                     }
                     else
-                        UtilityHelper.SetDefaultTable(gcMain, gridView1);
+                        UtilityHelper.SetDefaultTable(gcMain1, gridView1);
                     gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
                     pageBar1.TotalPages = dd.rtnData.pages;//鎬婚〉
                     pageBar1.CurrentPage = curPage;//褰撳墠椤�
@@ -450,7 +469,7 @@
                     lbGuid.Text = strGuid;
                     List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                     gvList.Add(gvMx1);
-                    UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList);
+                    UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
                     JObject _job = JObject.Parse(strJson);
                     JArray array = new JArray();
                     foreach (var a in _job["rtnData"]["list"])
@@ -464,6 +483,7 @@
                         gcMx1.DataSource = dt;
                         gcMx1.ForceInitialize();
                         gvMx1.BestFitColumns();
+                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
                     }
                     else
                     {
@@ -519,7 +539,7 @@
             };
             toolBarMenu1.guidKey = "";
             string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_fBillNo, gridView1, "fBillNo");
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_fBillNo, gridView1, "FBillNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
                 MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -554,8 +574,14 @@
             {
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
-
         }
+
+
+        /// <summary>
+        /// 閫夋嫨鐗╂枡
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void repositoryItemSearchLookUpEdit1_EditValueChanged(object sender, EventArgs e)
         {
             SearchLookUpEdit LookupEdit = sender as SearchLookUpEdit;
@@ -566,9 +592,15 @@
             gvMx1.SetFocusedRowCellValue("itemId", SelectedDataRow["id"].ToString());
             gvMx1.SetFocusedRowCellValue("itemUnit", SelectedDataRow["dwName"].ToString());
             gvMx1.CloseEditor();
+            gvMx1.PostEditor();
             gvMx1.UpdateCurrentRow();
         }
 
+        /// <summary>
+        /// 鍒犻櫎鐗╂枡
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
         {
             var rowhandle = gvMx1.FocusedRowHandle;
@@ -778,14 +810,14 @@
         private void rptDrHz_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
         {
             var rowhandle = gvMx1.FocusedRowHandle;
-            if (rowhandle < 0)
-                return;
+            //if (rowhandle < 0)
+            //    return;
             int _drhzlx = txt_fOwnerTypeInIdHead.SelectedIndex;
-            if (_drhzlx <= 0)
-            {
-                MsgHelper.Warning("鎻愮ず锛氳鍏堥�夋嫨璋冨叆璐т富绫诲瀷锛�");
-                return;
-            }
+            //if (_drhzlx <= 0)
+            //{
+            //    MsgHelper.Warning("鎻愮ず锛氳鍏堥�夋嫨璋冨叆璐т富绫诲瀷锛�");
+            //    return;
+            //}
             SelectHz frm = new SelectHz("", _drhzlx.ToString());
             frm.UpdateParent += (ss, ee) =>
             {
@@ -793,6 +825,7 @@
                 lst = ee.DynamicList;
                 gvMx1.SetFocusedRowCellValue("drHz", lst[0].name);
                 gvMx1.SetFocusedRowCellValue("drHzGuid", lst[0].guid);
+
             };
             frm.ShowDialog();
         }
@@ -805,14 +838,14 @@
         private void rptDcHz_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
         {
             var rowhandle = gvMx1.FocusedRowHandle;
-            if (rowhandle < 0)
-                return;
+            //if (rowhandle < 0)
+            //    return;
             int _drhzlx = txt_fOwnerTypeIdHead.SelectedIndex;
-            if (_drhzlx <= 0)
-            {
-                MsgHelper.Warning("鎻愮ず锛氳鍏堥�夋嫨璋冨嚭璐т富绫诲瀷锛�");
-                return;
-            }
+            //if (_drhzlx <= 0)
+            //{
+            //    MsgHelper.Warning("鎻愮ず锛氳鍏堥�夋嫨璋冨嚭璐т富绫诲瀷锛�");
+            //    return;
+            //}
             SelectHz frm = new SelectHz("", _drhzlx.ToString());
             frm.UpdateParent += (ss, ee) =>
             {

--
Gitblit v1.9.3