lu
2025-10-13 70c49ce94352ea6097b5de48536e81b1b96682e5
DevApp/Gs.DevApp/DevFrm/RkQC/RkDetect01.cs
@@ -1,4 +1,5 @@
using Gs.DevApp.DevFrm.QC;
using DevExpress.XtraLayout.Customization;
using Gs.DevApp.DevFrm.QC;
using Gs.DevApp.DevFrm.Rpt;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
@@ -91,40 +92,11 @@
                layoutControlItem27.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                tabMxPage3.PageVisible = false;
            }
            #region 打印相关
            this.ucBtnPrint1.btnPrintClick += (s, e) =>
        {
            ucBtnPrint1.guidKey = "";
            string rowGuid = txt_aboutGuid.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 (rowGuid.Length < 10)
            {
                Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择打印的行!");
                this.ucBtnPrint1.rptParameter = "return false";
                return;
            }
            this.ucBtnPrint1.rptParameter = rptName + "{" + rowGuid.Trim()
                   + "," + ""
                   + "," + Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_yuliang_1.Text.Trim())
                   + "," + txt_iCount_1.Text.Trim()
                   + "," + txt_psnQty_1.Text.Trim()
                   + "}";
        };
                _print(0, rptName);
            };
            this.ucBtnPrint1.btnAllClick += (s, e) =>
            {
                string rowGuid = txt_aboutGuid.Text.Trim();
@@ -163,6 +135,10 @@
                    }
                }
            };
            this.ucBtnPrint1.btnZhiJieClick += (s, e) =>
            {
                _print(1, rptName);
            };
            //自动计算打印量
            txt_psnQty_1.TextChanged += (s, e) =>
            {
@@ -172,6 +148,45 @@
            {
                Gs.DevApp.ToolBox.UtilityHelper.PrintAuto(txt_psnQty_1, txt_iCount_1, radOut, txt_yuliang_1);
            };
            #endregion
        }
        /// <summary>
        /// 打印
        /// </summary>
        /// <param name="type">0表示预览打印,1表示直接打印</param>
        private void _print(int type, string rptName)
        {
            ucBtnPrint1.guidKey = "";
            string rowGuid = txt_aboutGuid.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 (rowGuid.Length < 10)
            {
                Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择打印的行!");
                this.ucBtnPrint1.rptParameter = "return false";
                return;
            }
            this.ucBtnPrint1.rptParameter = rptName + "{" + rowGuid.Trim()
                   + "," + ""
                   + "," + Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_yuliang_1.Text.Trim())
                   + "," + txt_iCount_1.Text.Trim()
                   + "," + txt_psnQty_1.Text.Trim()
                   + "}";
        }
        /// <summary>
        /// 批量录入