From d37df25d14c9bf8ddaa4a0578dd8a84e2ffc7900 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期二, 11 三月 2025 08:17:03 +0800
Subject: [PATCH] 采购到货

---
 DevApp/Gs.DevApp/DevFrm/WOM/Frm_Womdaa.cs |   67 +++++++++++++++++++++++----------
 1 files changed, 46 insertions(+), 21 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Womdaa.cs b/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Womdaa.cs
index 5d6f140..5efd486 100644
--- a/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Womdaa.cs
+++ b/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Womdaa.cs
@@ -1,3 +1,4 @@
+using DevExpress.RichEdit.Export;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
@@ -28,12 +29,13 @@
             this.toolBarMenu1.btnKgClick += ToolBarMenu1_btnKgClick;
             this.toolBarMenu1.btnWgClick += ToolBarMenu1_btnWgClick;
             toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
+            this.toolBarMenu1.getXmlConfig();
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, null, "", (value) =>
-            {
-                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
-            });
+           {
+               Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
+           });
             Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
             {
                 getModel(value);
@@ -43,7 +45,7 @@
             });
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
-            txt_sjXt.getSuppler("");
+          
             this.ucBtnPrint1.btnDesignClick += (s, e) =>
             {
                 ucBtnPrint1.rptParameter = "rpt_daa{}";
@@ -59,7 +61,7 @@
             Task.Delay(100);
             getPageList(1);
         }
-
+       
         /// <summary>
         /// 鍒嗛〉浜嬩欢
         /// </summary>
@@ -175,6 +177,7 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
         {
+            toolBarMenu1.currentAction = "edit";
             string rowGuid = "", rowName = "";
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_daa001, gridView1);
             if (string.IsNullOrEmpty(rowGuid))
@@ -183,9 +186,17 @@
                 return;
             }
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
-            List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
-            gvList.Add(gvMx1);
-            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(this.layoutMx1.Controls, true, gvList);
+            }
         }
 
         /// <summary>
@@ -211,7 +222,10 @@
                 {
                     lbGuid.Text = _rtn.rtnData;
                     toolBarMenu1.isSetBtn = true;
-                    UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false);
+                    List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+                    gvList.Add(gvMx1);
+                    UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList);
+                    toolBarMenu1.currentAction = "";
                 }
             }
             catch (Exception ex)
@@ -228,7 +242,7 @@
         private void getPageList(int curPage)
         {
             var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
-            PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString());
+            PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "desc", "", _sbSqlWhere.ToString());
             string json = JsonConvert.SerializeObject(pgq);
             try
             {
@@ -237,16 +251,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();
+                        gcMain1.DataSource = dt;
+                        gcMain1.ForceInitialize();
                         gridView1.BestFitColumns();
                     }
                     else
-                        UtilityHelper.SetDefaultTable(gcMain, gridView1);
+                        UtilityHelper.SetDefaultTable(gcMain1, gridView1);
                     gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
                     pageBar1.TotalPages = dd.rtnData.pages;//鎬婚〉
                     pageBar1.CurrentPage = curPage;//褰撳墠椤�
@@ -265,11 +279,13 @@
         private void getModel(string strGuid)
         {
             bool isEdit = false;
-            if (toolBarMenu1.currentAction == "add")
+            if (toolBarMenu1.currentAction == "add") return;
+            if (toolBarMenu1.currentAction == "edit") isEdit = true;
+            if (string.IsNullOrEmpty(strGuid))
             {
-                Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
+                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
-            };
+            }
             if (string.IsNullOrEmpty(strGuid))
             {
                 ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -286,12 +302,14 @@
                 if (_rtn.rtnCode > 0)
                 {
                     dynamic dy = _rtn.rtnData;
+                    string cjId = dy.daa013;
+                    string xjxt = dy.sjXt;
+                    txt_sjXt.getSuppler(cjId, xjxt);
                     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);
-                   // txt_sjXt.getSuppler(txt_daa013.Text);
+                   UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
                     JObject _job = JObject.Parse(strJson);
                     JArray array = new JArray();
                     foreach (var a in _job["rtnData"]["list"])
@@ -397,12 +415,18 @@
                     JsonConvert.SerializeObject(_obj));
                 var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                 MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
-                if (_rtn.rtnCode > 0)
+                if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
                 {
                     if (xtraTabControl1.SelectedTabPageIndex == 1)
+                    {
                         getModel(lbGuid.Text.Trim());
-                    else
+                    }
+                    else {
+                        //娉ㄦ剰锛岃繖閲屽拰鍏跺畠椤甸潰鏈夌偣涓嶄竴鏍�
                         getPageList(this.pageBar1.CurrentPage);
+                        int rowHandle = gridView1.LocateByValue("guid", rowGuid);
+                        gridView1.FocusedRowHandle = rowHandle;
+                    }
                 }
             }
             catch (Exception ex)
@@ -478,5 +502,6 @@
                 }
             }
         }
+ 
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3