From 8daa94248baa30f5606c9486b0c1c5603f9de8b4 Mon Sep 17 00:00:00 2001
From: cnf <3283105747@qq.com>
Date: 星期四, 11 十二月 2025 20:45:39 +0800
Subject: [PATCH] Merge branch 'master' of http://git.gs-mes.com:8080/r/~cnf/JH/JH_MesCilent

---
 DevApp/Gs.DevApp/DevFrm/WW/Frm_WwTbl.cs |  142 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 142 insertions(+), 0 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/WW/Frm_WwTbl.cs b/DevApp/Gs.DevApp/DevFrm/WW/Frm_WwTbl.cs
index 830a4be..d89388e 100644
--- a/DevApp/Gs.DevApp/DevFrm/WW/Frm_WwTbl.cs
+++ b/DevApp/Gs.DevApp/DevFrm/WW/Frm_WwTbl.cs
@@ -30,6 +30,7 @@
             toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
             toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
             toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
+            this.toolBarMenu1.btnPrintClick += ToolBarMenu1_btnPrintClick;
             this.toolBarMenu1.getXmlConfig();
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
@@ -88,6 +89,90 @@
                 };
                 frm.ShowDialog();
             };
+            // 鎵撳嵃浜嬩欢
+            this.ucBtnPrint1.btnPrintClick += (s, e) =>
+            {
+                string rowGuid = lbMxGuid.Text.Trim();
+                ucBtnPrint1.guidKey = rowGuid;
+                if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_iCount_1.Text.Trim(), txt_yuliang_1.Text.Trim()))
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇疯緭鍏ユ纭殑鏉$爜鏁伴噺锛�");
+                    txt_iCount_1.Focus();
+                    this.ucBtnPrint1.rptParameter = "return false";
+                    return;
+                }
+                if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_psnQty_1.Text.Trim()))
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�");
+                    txt_psnQty_1.Focus();
+                    this.ucBtnPrint1.rptParameter = "return false";
+                    return;
+                }
+                if (lbMxGuid.Text.Trim().Length < 10)
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鐨勮锛�");
+                    this.ucBtnPrint1.rptParameter = "return false";
+                    return;
+                }
+                this.ucBtnPrint1.rptParameter = "rpt_WWTL{"
+                       + lbMxGuid.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 = "";
+                string strAction = "";
+                frm.UpdateParent += (ss, ee) =>
+                {
+                    strCodeList = ee.StringSingle;
+                    strAction = ee.Data;
+                };
+                frm.ShowDialog();
+                if (string.IsNullOrEmpty(strCodeList))
+                    return;
+                if (strAction == "print")
+                {
+                    try
+                    {
+                        string rptParameter = "rpt_WWTL{"
+                        + "100"//閲嶆墦閮芥槸浼�100锛�
+                        + "," + ""
+                        + "," + ""
+                        + "," + ""
+                        + "," + ""
+                        + "," + strCodeList
+                        + "}";
+                        using (Form rpt = new RptPreview(rowGuid, rptParameter))
+                        {
+                            rpt.ShowDialog();
+                        }
+                        frm.Close();
+                    }
+                    catch (Exception ex)
+                    {
+                        MsgHelper.ShowError(ex.Message);
+                    }
+                }
+            };
+            gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
+            //鎵撳嵃鑷姩璁$畻
+            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);
+            };
+            radOut.SelectedIndexChanged += (s, e) =>
+            {
+                Gs.DevApp.ToolBox.UtilityHelper.PrintAuto(txt_psnQty_1, txt_iCount_1, radOut, txt_yuliang_1);
+            };
         }
 
         private async void GridView1_ColumnFilterChanged(object sender, EventArgs e)
@@ -141,6 +226,30 @@
         {
             _filterList = e.FilterList;
             getPageList(1);
+        }
+
+        private void ToolBarMenu1_btnPrintClick(object sender, EventArgs e)
+        {
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1);
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                this.toolBarMenu1.rptParameter = "return false";
+                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎵撳嵃鐨勫崟鎹紒");
+                return;
+            }
+            string rptParameter = "rpt_wwtlsqd{"
+            + rowGuid  // @inOrderGuid - 鍗曟嵁guid
+            + "," + "100"  // @isDesign - 閲嶆墦閮芥槸浼�100
+            + "," + ""  // @in1 - 鍏ュ簱鏃堕棿锛堟墿灞曠敤锛�
+            + "," + ""  // @in2 - 鐗归噰锛堟墿灞曠敤锛�
+            + "," + ""  // @in3 - 渚涘簲鍟唅d锛堟墿灞曠敤锛�
+            + "," + ""  // @in4 - 寮犳暟锛堟墿灞曠敤锛�
+            + "," + ""  // @in5 - 鏁伴噺锛堟墿灞曠敤锛�
+            + "," + ""  // @in6 - 鎵╁睍鐢�
+            + "}";
+            this.toolBarMenu1.rptParameter = rptParameter;
+            this.toolBarMenu1.guidKey = rowGuid;
         }
 
         /// <summary>
@@ -630,5 +739,38 @@
             };
             frm.ShowDialog();
         }
+
+        private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
+        {
+            if (e.FocusedRowHandle >= 0)
+            {
+                DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle);
+                lbMxGuid.Text = row["tlid"].ToString();
+                if (string.IsNullOrEmpty(lbMxGuid.Text))
+                    return;
+                toolBarMenu1.guidKey = row["tlid"].ToString();
+                txtWlid.Text = row["tld002"].ToString();
+                txtWlgg.Text = row["tld004"].ToString();
+                txtWlmc.Text = row["tld003"].ToString();
+                txtQuantity.Text = row["tld005"].ToString();//鐢宠鎬婚噺
+                txt_yQty.Text = row["ydy"].ToString();//宸叉墦鍗版�婚噺
+                txt_kQty.Text = row["kdy"].ToString();//鍙墦鍗版�婚噺
+                txt_psnQty_1.Text = row["tld005"].ToString(); //榛樿姣忓紶鏉$爜鏁伴噺
+            }
+            else
+            {
+                lbMxGuid.Text = "";
+                ucBtnPrint1.guidKey = "";
+                txtWlid.Text = "";
+                txtWlgg.Text = "";
+                txtWlmc.Text = "";
+                txtQuantity.Text = "";
+                txt_yQty.Text = "";
+                txt_kQty.Text = "";
+                txt_psnQty_1.Text = "";
+                txt_iCount_1.Text = "";
+            }
+        }
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3