From 95fd08692e404e5b3c547bdb3c9d0cc8023ff0be Mon Sep 17 00:00:00 2001
From: kyy <3283105747@qq.com>
Date: 星期六, 09 八月 2025 16:42:40 +0800
Subject: [PATCH] 1、到货条码打印新增合并明细

---
 DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs |  240 ++++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 194 insertions(+), 46 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
index a05afb3..ddd8cca 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
@@ -1,3 +1,4 @@
+using Gs.DevApp.DevFrm.Rpt;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
@@ -23,6 +24,7 @@
             this.toolBarMenu1.getXmlConfig();
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx3);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (value) =>
             {
                 Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
@@ -36,6 +38,7 @@
             }, lbGuid);
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
+            //鎵撳嵃浜嬩欢
             this.ucBtnPrint1.btnPrintClick += (s, e) =>
             {
                 string rowGuid = lbMxGuid.Text.Trim();
@@ -60,17 +63,135 @@
                     this.ucBtnPrint1.rptParameter = "return false";
                     return;
                 }
-                this.ucBtnPrint1.rptParameter = "rpt_Arrival{" + lbMxGuid.Text.Trim()
+                this.ucBtnPrint1.rptParameter = "rpt_Arrival{"
+                       + lbMxGuid.Text.Trim()//鍏宠仈涓婚敭
                        + "," + ""
-                        + "," + Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_yuliang_1.Text.Trim())
-                       + "," + txt_iCount_1.Text.Trim()
-                       + "," + txt_psnQty_1.Text.Trim()
+                       + "," + Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_yuliang_1.Text.Trim())//浣欐暟
+                       + "," + txt_iCount_1.Text.Trim()//寮犳暟
+                       + "," + txt_psnQty_1.Text.Trim()//姣忓紶鏉$爜鏁伴噺
                        + "}";
                 txt_iCount_1.Text = "";
                 txt_psnQty_1.Text = "";
             };
+            //鎵撳嵃鎵归噺鎿嶄綔浜嬩欢
+            this.ucBtnPrint1.btnAllClick += (s, e) =>
+            {
+                string rowGuid = lbMxGuid.Text.Trim();
+                SelectDeleteBar frm = new SelectDeleteBar(rowGuid, "閲囪喘鍏ュ簱");
+                string strCodeList = "";
+                frm.UpdateParent += (ss, ee) =>
+                {
+                    strCodeList = ee.StringSingle;
+                };
+                frm.ShowDialog();
+                if (string.IsNullOrEmpty(strCodeList))
+                    return;
+                try
+                {
+                    string rptParameter = "rpt_Arrival{"
+                    + "100"//閲嶆墦閮芥槸浼�100锛�
+                    + "," + ""
+                    + "," + ""
+                    + "," + ""
+                    + "," + ""
+                    + "," + strCodeList
+                    + "}";
+                    using (Form rpt = new RptPreview(rowGuid, rptParameter))
+                    {
+                        rpt.ShowDialog();
+                    }
+                    frm.Close();
+                }
+                catch (Exception ex)
+                {
+                    MsgHelper.ShowError(ex.Message);
+                }
+            };
+
+            // -------------------- gvMx3 鎵撳嵃浜嬩欢 --------------------
+           
+            this.ucBtnPrint2.btnPrintClick += (s, e) =>
+            {
+                string rowGuid = txt_releaseNo.Text.Trim(); // 鏂板lbMxGuid3鐢ㄤ簬瀛樺偍gvMx3鐨勯�変腑琛孏UID
+                ucBtnPrint2.guidKey = rowGuid;
+
+                // 楠岃瘉杈撳叆锛堜娇鐢╣vMx3瀵瑰簲鐨勮緭鍏ユ帶浠讹級
+                if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_iCount_2.Text.Trim(), txt_yuliang_2.Text.Trim()))
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇疯緭鍏ユ纭殑鏉$爜鏁伴噺锛�");
+                    txt_iCount_2.Focus();
+                    this.ucBtnPrint2.rptParameter = "return false";
+                    return;
+                }
+                if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_psnQty_2.Text.Trim()))
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�");
+                    txt_psnQty_2.Focus();
+                    this.ucBtnPrint2.rptParameter = "return false";
+                    return;
+                }
+                if (rowGuid.Length < 10)
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鐨勮锛�");
+                    this.ucBtnPrint2.rptParameter = "return false";
+                    return;
+                }
+
+                // 缁勮鎵撳嵃鍙傛暟锛堜娇鐢╣vMx3鐨勬帶浠跺�硷級
+                this.ucBtnPrint2.rptParameter = "rpt_Arrival_Hb{"
+                       + rowGuid//鍏宠仈涓婚敭锛坓vMx3鐨凣UID锛�
+                       + "," + ""
+                       + "," + Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_yuliang_2.Text.Trim())//浣欐暟
+                       + "," + txt_iCount_2.Text.Trim()//寮犳暟
+                       + "," + txt_psnQty_2.Text.Trim()//姣忓紶鏉$爜鏁伴噺
+                       + "}";
+
+                // 娓呯┖杈撳叆妗�
+                txt_iCount_2.Text = "";
+                txt_psnQty_2.Text = "";
+            };
+
+            // gvMx3 鎵归噺鎵撳嵃浜嬩欢
+            this.ucBtnPrint2.btnAllClick += (s, e) =>
+            {
+                // string rowGuid = lbMxGuid3.Text.Trim(); // 浣跨敤gvMx3鐨凣UID
+                string rowGuid = txt_releaseNo.Text.Trim();
+                SelectDeleteBar frm = new SelectDeleteBar(rowGuid, "閲囪喘鍏ュ簱"); // 鏍囬鍖哄垎鏉ユ簮
+                string strCodeList = "";
+                frm.UpdateParent += (ss, ee) =>
+                {
+                    strCodeList = ee.StringSingle;
+                };
+                frm.ShowDialog();
+                if (string.IsNullOrEmpty(strCodeList))
+                    return;
+                try
+                {
+                    string rptParameter = "rpt_Arrival_Hb{"
+                    + "100"//閲嶆墦鏍囪瘑
+                    + "," + ""
+                    + "," + ""
+                    + "," + ""
+                    + "," + ""
+                    + "," + strCodeList
+                    + "}";
+                    using (Form rpt = new RptPreview(rowGuid, rptParameter))
+                    {
+                        rpt.ShowDialog();
+                    }
+                    frm.Close();
+                }
+                catch (Exception ex)
+                {
+                    MsgHelper.ShowError(ex.Message);
+                }
+            };
+
+            //鏄庣粏琛屽垏鎹簨浠�
+            // 鍏抽敭锛氱粦瀹歡vMx1鍜実vMx3鐨勭劍鐐硅鍙樺寲浜嬩欢
             gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
-            //鑷姩璁$畻鎵撳嵃閲�
+            gvMx3.FocusedRowChanged += GvMx3_FocusedRowChanged; // 鍙栨秷娉ㄩ噴骞剁粦瀹氫簨浠�
+            //gvMx3鎵撳嵃鑷姩璁$畻
             txt_psnQty_1.TextChanged += (s, e) =>
             {
                 Gs.DevApp.ToolBox.UtilityHelper.PrintJiSuan(txt_psnQty_1, txt_iCount_1, txt_kQty.Text.Trim(), radOut, txt_yuliang_1);
@@ -79,6 +200,16 @@
             {
                 Gs.DevApp.ToolBox.UtilityHelper.PrintAuto(txt_psnQty_1, txt_iCount_1, radOut, txt_yuliang_1);
             };
+
+            // gvMx3鐨勮嚜鍔ㄨ绠�
+            txt_psnQty_2.TextChanged += (s, e) =>
+            {
+                Gs.DevApp.ToolBox.UtilityHelper.PrintJiSuan(txt_psnQty_2, txt_iCount_2, txt_kQtyHb.Text.Trim(), radOut2, txt_yuliang_2);
+            };
+            radOut2.SelectedIndexChanged += (s, e) =>
+            {
+                Gs.DevApp.ToolBox.UtilityHelper.PrintAuto(txt_psnQty_2, txt_iCount_2, radOut2, txt_yuliang_2);
+            };
         }
         private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
@@ -86,6 +217,9 @@
             Task.Delay(100);
             getPageList(1);
         }
+
+
+
         private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
         {
             if (e.FocusedRowHandle >= 0)
@@ -114,6 +248,39 @@
                 txt_iCount_1.Text = "";
             }
         }
+
+        //鏄庣粏琛屽垏鎹簨浠�
+         
+        private void GvMx3_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
+        {
+            if (e.FocusedRowHandle >= 0)
+            {
+                DataRow row = gvMx3.GetDataRow(e.FocusedRowHandle);
+                //lbMxGuid.Text = row["guid"].ToString();
+                txtItemNo.Text = row["itemNo"].ToString();
+                txtItemModel.Text = row["itemModel"].ToString();
+                txtItemName.Text = row["itemName"].ToString();
+                txtQuantityHb.Text = row["quantity"].ToString();//鏈鏀惰揣鎬婚噺
+                txt_yQtyHb.Text = row["yQty"].ToString();//宸叉墦鍗版�婚噺
+                txt_kQtyHb.Text = row["kQty"].ToString(); //鍙墦鍗版�婚噺
+                txt_psnQty_2.Text = row["mrtmsl"].ToString(); //榛樿姣忓紶鏉$爜鏁伴噺
+                txt_releaseNo.Text = row["releaseNo"].ToString(); //鍙墦鍗版�婚噺
+            }
+            else
+            {
+                lbMxGuid.Text = "";
+                ucBtnPrint1.guidKey = "";
+                txtItemNo.Text = "";
+                txtItemModel.Text = "";
+                txtItemName.Text = "";
+                txtQuantityHb.Text = "";
+                txt_yQtyHb.Text = "";
+                txt_kQtyHb.Text = "";
+                txt_psnQty_2.Text = "";
+                txt_iCount_2.Text = "";
+            }
+        }
+
         /// <summary>
         /// 鍒嗛〉浜嬩欢
         /// </summary>
@@ -217,6 +384,8 @@
         private void getModel(string strGuid)
         {
             gcMx1.DataSource = null;
+            gcMx2.DataSource = null;
+            gcMx3.DataSource = null;
             bool isEdit = false;
             if (toolBarMenu1.currentAction == "add") return;
             if (toolBarMenu1.currentAction == "edit") isEdit = true;
@@ -240,6 +409,7 @@
                     List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                     gvList.Add(gvMx1);
                     gvList.Add(gvMx2);
+                    gvList.Add(gvMx3);
                     UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
                     JArray array1 = new JArray();
                     foreach (var a in dy["list1"])
@@ -278,6 +448,24 @@
                     {
                         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);
@@ -287,46 +475,6 @@
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
         }
-        /// <summary>
-        /// 閲嶆墦
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
-        {
-            MsgHelper.ShowInformation("鍔熻兘寮�鍙戜腑锛�");
-            return;
-            var rowhandle = gvMx2.FocusedRowHandle;
-            if (rowhandle < 0)
-                return;
-            if (e.Button.Index == 0)
-            {
-                var dr = gvMx2.GetDataRow(rowhandle);
-                var mxGuid = dr["guid"].ToString();
-                if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵"))
-                    return;
-                var _obj = new
-                {
-                    mxGuid = mxGuid,
-                    inType = "dhtm"
-                };
-                try
-                {
-                    var strJson = UtilityHelper.HttpPost("",
-                        _webServiceName + "DeleteBarcode",
-                        JsonConvert.SerializeObject(_obj));
-                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-                    if (_rtn.rtnCode > 0)
-                    {
-                        if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
-                    }
-                    MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
-                }
-                catch (Exception ex)
-                {
-                    MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-                }
-            }
-        }
+    
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3