From ed546f521cb8db95d092ff67e076cededd53e725 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期六, 21 十二月 2024 11:25:40 +0800
Subject: [PATCH] 各种细节

---
 DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs |  173 ++++++++++++++++++++++++---------------------------------
 1 files changed, 74 insertions(+), 99 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
similarity index 89%
rename from DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs
rename to DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
index 234d055..76da4de 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
@@ -3,6 +3,7 @@
 using System.Data;
 using System.Threading.Tasks;
 using System.Windows.Forms;
+using DevExpress.RichEdit.Export;
 using DevExpress.XtraEditors;
 using DevExpress.XtraEditors.Controls;
 using DevExpress.XtraGrid.Views.Grid;
@@ -32,11 +33,20 @@
             toolBarMenu1.btnJianYanClick += ToolBarMenu1_btnJianYanClick;
             toolBarMenu1.btnFjianYanClick += ToolBarMenu1_btnFjianYanClick;
             toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
-            
-            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1);
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, null, "", (value) =>
+            {
+                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
+            });
+            Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
+            {
+                getModel(value);
+            }, (value) =>
+            {
+                getPageList(this.pageBar1.CurrentPage);
+            });
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
-            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             //璁剧疆缁勭粐
             this.txt_receiveOrgId.EditChanged += (s, e) =>
             {
@@ -103,19 +113,7 @@
             Task.Delay(100);
             getPageList(1);
         }
-        /// <summary>
-        ///     鍙屽嚮浜嬩欢
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e)
-        {
-            var rowGuid =
-                UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid");
-            if (!string.IsNullOrEmpty(rowGuid))
-                getModel(rowGuid, false, 999);
-        }
-
+        
         /// <summary>
         ///     鍒嗛〉浜嬩欢
         /// </summary>
@@ -172,43 +170,7 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnFjianYanClick(object sender, EventArgs e)
         {
-            toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_billNo, gridView1, "billNo");
-            toolBarMenu1.guidKey = rowGuid;
-            if (string.IsNullOrEmpty(rowGuid))
-            {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
-                return;
-            }
-            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎾ゅ洖宸叉彁浜ょ殑妫�楠屽悧锛�"))
-                return;
-
-            var _obj = new
-            {
-                guid = rowGuid,
-            };
-            try
-            {
-                var strJson = UtilityHelper.HttpPost("",
-                    _webServiceName + "EditModelSubmitF",
-                    JsonConvert.SerializeObject(_obj));
-                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnData.outMsg);
-                if (_rtn.rtnCode > 0)
-                {
-                    if (xtraTabControl1.SelectedTabPageIndex == 1)
-                        getModel(lbGuid.Text.Trim(), false, 999);
-                    else
-                        getPageList(1);
-                }
-            }
-            catch (Exception ex)
-            {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-            }
-
+            _toolCk("EditModelSubmitF");
         }
 
         /// <summary>
@@ -218,41 +180,7 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e)
         {
-            toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_billNo, gridView1, "billNo");
-            toolBarMenu1.guidKey = rowGuid;
-            if (string.IsNullOrEmpty(rowGuid))
-            {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
-                return;
-            }
-            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎻愪氦妫�楠屽悧锛�"))
-                return;
-            var _obj = new
-            {
-                guid = rowGuid,
-            };
-            try
-            {
-                var strJson = UtilityHelper.HttpPost("",
-                    _webServiceName + "EditModelSubmit",
-                    JsonConvert.SerializeObject(_obj));
-                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnData.outMsg);
-                if (_rtn.rtnCode > 0)
-                {
-                    if (xtraTabControl1.SelectedTabPageIndex == 1)
-                        getModel(lbGuid.Text.Trim(), false, 999);
-                    else
-                        getPageList(1);
-                }
-            }
-            catch (Exception ex)
-            {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-            }
+            _toolCk("EditModelSubmit");
         }
         /// <summary>
         ///     鍙栨秷浜嬩欢
@@ -313,7 +241,7 @@
         private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
         {
             if (xtraTabControl1.SelectedTabPageIndex == 1)
-                getModel(lbGuid.Text.Trim(), false, 999);
+                getModel(lbGuid.Text.Trim());
             else
             {
                 _filterList.Clear();
@@ -334,7 +262,7 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
         {
-            string rowGuid = "", rowName = "";
+            string rowGuid, rowName;
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                 lbGuid, txt_billNo, gridView1);
             if (string.IsNullOrEmpty(rowGuid))
@@ -342,8 +270,8 @@
                 MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
-
-            getModel(rowGuid, true, 1);
+            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
+            UtilityHelper.ChangeEnableByControl(panel1.Controls, true);
         }
 
         /// <summary>
@@ -353,12 +281,12 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnAddClick(object sender, EventArgs e)
         {
-            UtilityHelper.JumpToTab(xtraTabControl1, 1);
             lbGuid.Text = "";
-            var gridViews = new List<GridView>();
+            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(panel1.Controls, true, gridViews);
-            UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
+            UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
+            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
         }
 
         /// <summary>
@@ -493,14 +421,16 @@
             }
         }
 
-        private void getModel(string strGuid, bool isEdit, int tabIdx)
+        private void getModel(string strGuid)
         {
+            bool isEdit = false;
+            if (toolBarMenu1.currentAction == "add") return;
+            if (toolBarMenu1.currentAction == "edit") isEdit = true;
             if (string.IsNullOrEmpty(strGuid))
             {
                 MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
-            UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
             var _obj = new
             {
                 guid = strGuid //涓诲缓
@@ -581,7 +511,7 @@
                     var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                     if (_rtn.rtnCode > 0)
                     {
-                        if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1);
+                        if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
                     }
                     MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
                 }
@@ -635,5 +565,50 @@
 
             }
         }
+
+
+        /// <summary>
+        /// 妫�楠屽拰鍙嶆楠�
+        /// </summary>
+        /// <param name="inFieldValue"></param>
+        private void _toolCk(string _meth)
+        {
+            toolBarMenu1.guidKey = "";
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_billNo, gridView1, "billNo");
+            toolBarMenu1.guidKey = rowGuid;
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎿嶄綔鍚楋紵"))
+                return;
+            var _obj = new
+            {
+                guid = rowGuid,
+            };
+            try
+            {
+                var strJson = UtilityHelper.HttpPost("",
+                    _webServiceName + _meth,
+                    JsonConvert.SerializeObject(_obj));
+                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnData.outMsg);
+                if (_rtn.rtnCode > 0)
+                {
+                    if (xtraTabControl1.SelectedTabPageIndex == 1)
+                        getModel(lbGuid.Text.Trim());
+                    else
+                        getPageList(this.pageBar1.CurrentPage);
+                }
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
+        }
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3