cdk
2025-11-01 4dc2dbda4150c7c74a26435a75308789dc359b99
DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs
@@ -41,6 +41,7 @@
            this.toolBarMenu1.btnCaiGouFchkClick += ToolBarMenu1_btnCaiGouFchkClick;
            this.toolBarMenu1.btnCaiWuChkClick += ToolBarMenu1_btnCaiWuChkClick;
            this.toolBarMenu1.btnCaiWuFchkClick += ToolBarMenu1_btnCaiWuFchkClick;
            toolBarMenu1.btnPrintClick += ToolBarMenu1_btnPrintClick;
            this.toolBarMenu1.getXmlConfig();
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
@@ -210,6 +211,45 @@
            radOut.SelectedIndexChanged += (s, e) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.PrintAuto(txt_psnQty_1, txt_iCount_1, radOut, txt_yuliang_1);
            };
            //全部打印
            ucBtnPrintAll1.btnPrintClick += (s, e) =>
            {
                this.ucBtnPrintAll1.rptType = "";
                this.ucBtnPrintAll1.mxList = null;
                if (string.IsNullOrEmpty(lbGuid.Text.Trim()))
                {
                    MsgHelper.ShowError("提示:打印前请先保存单据!");
                    return;
                }
                getModel(lbGuid.Text.Trim());
                List<dynamic> lst = new List<dynamic>();
                DataTable dt = (DataTable)gcMx1.DataSource;
                foreach (DataRow row in dt.Rows)
                {
                    string guid = row["guid"].ToString();
                    string psnQty = row["kdy"].ToString();
                    if (string.IsNullOrEmpty(psnQty))
                    {
                        continue;
                    }
                    if (psnQty == "0")
                    {
                        continue;
                    }
                    lst.Add(new
                    {
                        guid = guid,
                        kdy = psnQty,
                    });
                }
                if (lst.Count <= 0)
                {
                    MsgHelper.ShowError("提示:暂无可打印的物料!");
                    return;
                }
                this.ucBtnPrintAll1.rptType = "rpt_Qtrk";
                this.ucBtnPrintAll1.mxList = lst;
            };
            #region 2025-08-27 复制beg
            btnCopyXls.Click += (s, e) =>
@@ -1027,5 +1067,27 @@
                txt_iCount_1.Text = "";
            }
        }
        private void ToolBarMenu1_btnPrintClick(object sender, EventArgs e)
        {
            //guidKey, rptParameter
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_qtck, gridView1, "qtck");
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.ShowError("请先选择你要操作的行!");
                return;
            }
            this.toolBarMenu1.rptParameter = "rpt_QTRKSQ{"
                                               + ""
                                               + "," + ""
                                               + "," + ""
                                               + "," + ""
                                               + "," + ""
                                               + "}";
            this.toolBarMenu1.guidKey = rowGuid;
        }
    }
}