From 0fce93ca1940f835ce3f63077acdae94988c6fef Mon Sep 17 00:00:00 2001
From: kyy <3283105747@qq.com>
Date: 星期三, 03 九月 2025 17:49:05 +0800
Subject: [PATCH] 1、合并打印更新

---
 DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs |  142 +++++++++++++++++++++++++++++------------------
 1 files changed, 88 insertions(+), 54 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
index 5c925f2..4a85912 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
@@ -1,3 +1,4 @@
+using DevExpress.XtraRichEdit.Model;
 using Gs.DevApp.DevFrm.Rpt;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
@@ -26,6 +27,9 @@
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx3);
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMxL1);
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMxL2);
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMxL3);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (value) =>
             {
                 Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
@@ -34,7 +38,10 @@
             });
             Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
             {
+               
                 getModel(value);
+           
+
             }, (value) =>
             {
                 getPageList(this.pageBar1.CurrentPage);
@@ -82,33 +89,39 @@
                 string rowGuid = lbMxGuid.Text.Trim();
                 SelectDeleteBar frm = new SelectDeleteBar(rowGuid, "閲囪喘鍏ュ簱");
                 string strCodeList = "";
+                string strAction = "";
                 frm.UpdateParent += (ss, ee) =>
                 {
                     strCodeList = ee.StringSingle;
+                    strAction = ee.Data;
                 };
                 frm.ShowDialog();
                 if (string.IsNullOrEmpty(strCodeList))
                     return;
-                try
+                if (strAction == "print")
                 {
-                    string rptParameter = "rpt_Arrival{"
-                    + "100"//閲嶆墦閮芥槸浼�100锛�
-                    + "," + ""
-                    + "," + ""
-                    + "," + ""
-                    + "," + ""
-                    + "," + strCodeList
-                    + "}";
-                    using (Form rpt = new RptPreview(rowGuid, rptParameter))
+                    try
                     {
-                        rpt.ShowDialog();
+                        string rptParameter = "rpt_Arrival{"
+                        + "100"//閲嶆墦閮芥槸浼�100锛�
+                        + "," + ""
+                        + "," + ""
+                        + "," + ""
+                        + "," + ""
+                        + "," + strCodeList
+                        + "}";
+                        using (Form rpt = new RptPreview(rowGuid, rptParameter))
+                        {
+                            rpt.ShowDialog();
+                        }
+                        frm.Close();
                     }
-                    frm.Close();
+                    catch (Exception ex)
+                    {
+                        MsgHelper.ShowError(ex.Message);
+                    }
                 }
-                catch (Exception ex)
-                {
-                    MsgHelper.ShowError(ex.Message);
-                }
+                   
             };
 
             // -------------------- gvMx3 鎵撳嵃浜嬩欢 --------------------
@@ -160,33 +173,39 @@
                 string rowGuid = txt_releaseNo.Text.Trim();
                 SelectDeleteBar frm = new SelectDeleteBar(rowGuid, "鍒拌揣鏉$爜锛堝悎骞讹級鐮�"); // 鏍囬鍖哄垎鏉ユ簮
                 string strCodeList = "";
+                string strAction = "";
                 frm.UpdateParent += (ss, ee) =>
                 {
                     strCodeList = ee.StringSingle;
+                    strAction = ee.Data;
                 };
                 frm.ShowDialog();
                 if (string.IsNullOrEmpty(strCodeList))
                     return;
-                try
+                if (strAction == "print")
                 {
-                    string rptParameter = "rpt_Arrival_Hb{"
-                    + "100"//閲嶆墦鏍囪瘑
-                    + "," + ""
-                    + "," + ""
-                    + "," + ""
-                    + "," + ""
-                    + "," + strCodeList
-                    + "}";
-                    using (Form rpt = new RptPreview(rowGuid, rptParameter))
+                    try
                     {
-                        rpt.ShowDialog();
+                        string rptParameter = "rpt_Arrival_Hb{"
+                        + "100"//閲嶆墦閮芥槸浼�100锛�
+                        + "," + ""
+                        + "," + ""
+                        + "," + ""
+                        + "," + ""
+                        + "," + strCodeList
+                        + "}";
+                        using (Form rpt = new RptPreview(rowGuid, rptParameter))
+                        {
+                            rpt.ShowDialog();
+                        }
+                        frm.Close();
                     }
-                    frm.Close();
+                    catch (Exception ex)
+                    {
+                        MsgHelper.ShowError(ex.Message);
+                    }
                 }
-                catch (Exception ex)
-                {
-                    MsgHelper.ShowError(ex.Message);
-                }
+
             };
 
 
@@ -274,7 +293,7 @@
         releaseNosStr  // s5 鈫� @in6锛歳eleaseNo鍒楄〃
                 };
 
-                string paramContent = string.Join(",", reportParams);
+                /*string paramContent = string.Join(",", reportParams);
                 string rptParam = $"rpt_Arrival_One{{{paramContent}}}";
 
                 this.ucBtnPrintOne1.guidKey = mainGuid;
@@ -307,7 +326,12 @@
                     Gs.DevApp.ToolBox.MsgHelper.ShowError(errorMsg);
                     this.ucBtnPrintOne1.rptParameter = "return false";
                 }
+*/
 
+                this.ucBtnPrintOne1.guidKey = mainGuid;
+                this.ucBtnPrintOne1.rptParameter = "rpt_Arrival_One{"
+                    + string.Join(",", reportParams)  // 鎷兼帴reportParams鏁扮粍鍏冪礌
+                    + "}";
                 // 6. 娓呯┖鎺т欢
                 txt_iCount_2.Text = "";
                 txt_psnQty_2.Text = "";
@@ -352,6 +376,8 @@
 
             // 妫�鏌ユ暟鎹姞杞藉悗鍐嶈缃鑹�
             this.Load += (s, e) => {
+
+               
                 System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
                 timer.Interval = 1000; // 1绉掑悗鎵ц锛岀‘淇濇暟鎹凡鍔犺浇
                 timer.Tick += (sender, args) => {
@@ -560,9 +586,10 @@
         }
         private void getModel(string strGuid)
         {
+            gcMx3.DataSource = null;
             gcMx1.DataSource = null;
             gcMx2.DataSource = null;
-            gcMx3.DataSource = null;
+            
             bool isEdit = false;
             if (toolBarMenu1.currentAction == "add") return;
             if (toolBarMenu1.currentAction == "edit") isEdit = true;
@@ -579,6 +606,7 @@
             {
                 string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
                 ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+             
                 if (_rtn.rtnCode > 0)
                 {
                     dynamic dy = _rtn.rtnData;
@@ -588,7 +616,27 @@
                     gvList.Add(gvMx2);
                     gvList.Add(gvMx3);
                     UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
-                    
+
+                    JArray array3 = new JArray();
+                    foreach (var a in dy["list3"])
+                    {
+                        array3.Add(a);
+                    }
+                    DataTable dt3 = JsonConvert.DeserializeObject<DataTable>(array3.ToString());
+                    if (dt3.Rows.Count > 0)
+                    {
+                        gcMx3.BindingContext = new BindingContext();
+                        gcMx3.DataSource = dt3;
+                        gcMx3.ForceInitialize();
+                        gvMx3.BestFitColumns();
+                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx3);
+                    }
+                    else
+                    {
+                        Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx3, gvMx3);
+                    }
+
+
                     JArray array1 = new JArray();
                     foreach (var a in dy["list1"])
                     {
@@ -608,6 +656,7 @@
                     {
                         Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
                     }
+                 
                     JArray array2 = new JArray();
                     foreach (var a in dy["list2"])
                     {
@@ -626,25 +675,10 @@
                     {
                         Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
                     }
-                    JArray array3 = new JArray();
-                    foreach (var a in dy["list3"])
-                    {
-                        array3.Add(a);
-                    }
-                    DataTable dt3 = JsonConvert.DeserializeObject<DataTable>(array3.ToString());
-                    if (dt3.Rows.Count > 0)
-                    {
-                        gcMx3.BindingContext = new BindingContext();
-                        gcMx3.DataSource = dt3;
-                        gcMx3.ForceInitialize();
-                        gvMx3.BestFitColumns();
-                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx3);
-                    }
-                    else
-                    {
-                        Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx3, gvMx3);
-                    }
-                }
+                  
+                       }
+
+           
                 else
                     ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
             }

--
Gitblit v1.9.3