kyy
21 小时以前 e9017904e6895720b37e8ecea71316c01d8eb8ba
DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
@@ -23,6 +23,8 @@
            InitializeComponent();
            this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
            this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
            toolBarMenu1.btnQueryChkClick += ToolBarMenu1_btnQueryChkClick;
            toolBarMenu1.btnQueryFchkClick += ToolBarMenu1_btnQueryFchkClick;
            this.toolBarMenu1.getXmlConfig();
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
@@ -53,80 +55,50 @@
            #region 打印相关 2025-10-18 
            // -------------------- gvMx1 打印事件 --------------------
            //浏览打印事件
            this.ucBtnPrint1.btnPrintClick += (s, e) =>
            {
                  _print(0);
                _print(0);
              
            };
            //直接打印事件
            this.ucBtnPrint1.btnZhiJieClick += (s, e) =>
            {
                _print(1);
            };
            //打印批量操作事件
            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_Arrival{"
                        + "100"//重打都是传100,
                        + "," + ""
                        + "," + ""
                        + "," + ""
                        + "," + ""
                        + "," + strCodeList
                        + "}";
                        using (Form rpt = new RptPreview(rowGuid, rptParameter))
                        {
                            rpt.ShowDialog();
                        }
                        frm.Close();
                    }
                    catch (Exception ex)
                    {
                        MsgHelper.ShowError(ex.Message);
                    }
                }
                _print100(rowGuid, frm);//重打都是传100,
            };
            //直接打印事件
            this.ucBtnPrint1.btnZhiJieClick += (s, e) =>
            {
                  _print(1);
            };
            // -------------------- gvMx3 打印事件 --------------------
            this.ucBtnPrint2.btnPrintClick += (s, e) =>
            {
                _print2(0);
            };
            //直接打印事件
            this.ucBtnPrint2.btnZhiJieClick += (s, e) =>
            {
                _print2(1);
            };
            // gvMx3 批量打印事件
            // gvMx1 1打印事件
            this.ucBtnPrint2.btnAllClick += (s, e) =>
            {
                // string rowGuid = lbMxGuid3.Text.Trim(); // 使用gvMx3的GUID
                string rowGuid = txt_releaseNo.Text.Trim();
                SelectDeleteBar frm = new SelectDeleteBar(rowGuid, "到货条码(合并)码"); // 标题区分来源
              //  _print100(rowGuid, frm);//重打都是传100,
                string strCodeList = "";
                string strAction = "";
                frm.UpdateParent += (ss, ee) =>
@@ -161,68 +133,36 @@
                    }
                }
            };
            // --------------------gvMx3 ucBtnPrintOne1 批量打印事件(优化版)--------------------
            // --------------------gvMx1 ucBtnPrintOne1  明细打印事件(优化版)--------------------
            //一键打印事件
            this.ucBtnPrintOne1.btnPrintClick += (s, e) =>
            {
                string mainGuid = lbGuid.Text.Trim();
                ucBtnPrintOne1.guidKey = mainGuid;
                this.ucBtnPrintOne1.rptParameter = "rpt_Arrival{"
                     + "101"//一键打印101
                     + "," + ""
                     + "," + ""
                     + "," + ""
                     + "," + ""
                     + "}";
                txt_iCount_1.Text = "";
                txt_psnQty_1.Text = "";
                _print3(101); //一键打印101
            };
            this.ucBtnPrintOne1.btnAllClick += (s, e) =>
            {
                string mainGuid = lbGuid.Text.Trim();
                SelectDeleteBar frm = new SelectDeleteBar(mainGuid, "批量条码"); // 标题区分来源
                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_Arrival{"
                        + "100"//重打都是传100,
                        + "," + ""
                        + "," + ""
                        + "," + ""
                        + "," + ""
                        + "," + strCodeList
                        + "}";
                        using (Form rpt = new RptPreview(mainGuid, rptParameter))
                        {
                            rpt.ShowDialog();
                        }
                        frm.Close();
                    }
                    catch (Exception ex)
                    {
                        MsgHelper.ShowError(ex.Message);
                    }
                }
                _print100(mainGuid, frm);//重打都是传100,
            };
            // --------------------gvMx3 ucBtnPrintOne2 合并批量打印事件(优化版)--------------------
            //一键打印事件
            this.ucBtnPrintOne2.btnPrintClick += (s, e) =>
            {
                _print4(102); //一键合并打印102
            };
            this.ucBtnPrintOne2.btnAllClick += (s, e) =>
            {
                string mainGuid = lbGuid.Text.Trim();
                SelectDeleteBar frm = new SelectDeleteBar(mainGuid, "批量条码"); // 标题区分来源
                _print100(mainGuid, frm);//重打都是传100,
            };
            //明细行切换事件
            // 关键:绑定gvMx1和gvMx3的焦点行变化事件
@@ -339,7 +279,6 @@
            txt_iCount_1.Text = "";
            txt_psnQty_1.Text = "";
        }
        private void _print2(int type)
        {
            string rowGuid = txt_releaseNo.Text.Trim(); // 新增lbMxGuid3用于存储gvMx3的选中行GUID
@@ -380,7 +319,74 @@
            txt_iCount_2.Text = "";
            txt_psnQty_2.Text = "";
        }
        private void _print3(int type)
        {
            string mainGuid = lbGuid.Text.Trim();
            ucBtnPrintOne1.guidKey = mainGuid;
            this.ucBtnPrintOne1.rptParameter = "rpt_Arrival{"
            + type
            + "," + ""
            + "," + ""
            + "," + ""
            + "," + ""
            + "}";
            txt_iCount_1.Text = "";
            txt_psnQty_1.Text = "";
        }
        private void _print4(int type)
        {
            string mainGuid = lbGuid.Text.Trim();
            ucBtnPrintOne2.guidKey = mainGuid;
            this.ucBtnPrintOne2.rptParameter = "rpt_Arrival{"
            + type
            + "," + ""
            + "," + ""
            + "," + ""
            + "," + ""
            + "}";
            txt_iCount_1.Text = "";
            txt_psnQty_1.Text = "";
        }
        private void _print100(string mainGuid, SelectDeleteBar frm)
        {
            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_Arrival{"
                    + "100"//重打都是传100,
                    + "," + ""
                    + "," + ""
                    + "," + ""
                    + "," + ""
                    + "," + strCodeList
                    + "}";
                    using (Form rpt = new RptPreview(mainGuid, rptParameter))
                    {
                        rpt.ShowDialog();
                    }
                    frm.Close();
                }
                catch (Exception ex)
                {
                    MsgHelper.ShowError(ex.Message);
                }
            }
        }
        private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
        {
            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
@@ -484,6 +490,28 @@
            _filterList = e.FilterList;
            getPageList(1);
        }
        /// <summary>
        ///     查询已完成
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <exception cref="NotImplementedException"></exception>
        private void ToolBarMenu1_btnQueryChkClick(object sender, EventArgs e)
        {
            getPageQueryList(1);
        }
        /// <summary>
        ///     查询未完成
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <exception cref="NotImplementedException"></exception>
        private void ToolBarMenu1_btnQueryFchkClick(object sender, EventArgs e)
        {
            getPageQueryList(0);
        }
        /// <summary>
        /// 刷新事件
@@ -551,6 +579,54 @@
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="curPage"></param>
        /// <param name="pageSize"></param>
        private void getPageQueryList(int curPage)
        {
            gcMain1.DataSource = null;
            System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
            _sbSqlWhere.Append(" and a.receiveOrgId in");
            _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere());
            _sbSqlWhere.Append(" and isnull(A.STATUS,0) =");
            _sbSqlWhere.Append(curPage);
            PageQueryModel pgq = new PageQueryModel(1, 1000, "create_date", "asc", "", _sbSqlWhere.ToString());
            string json = JsonConvert.SerializeObject(pgq);
            try
            {
                string strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPage", json);
                ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn);
                if (dd.rtnCode > 0)
                {
                    DataTable dt = dd.rtnData.list;
                    gcMain1.BindingContext = new BindingContext();
                    gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
                    if (dt.Rows.Count > 0)
                    {
                        gcMain1.DataSource = dt;
                        gcMain1.ForceInitialize();
                        gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
                    }
                    else
                        UtilityHelper.SetDefaultTable(gcMain1, gridView1);
                    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
                    pageBar1.TotalPages = dd.rtnData.pages;//总页
                    pageBar1.CurrentPage = curPage;//当前页
                    pageBar1.RecordCount = dd.rtnData.total;//总记录数
                }
                else
                {
                    ToolBox.MsgHelper.ShowError("提示:" + dd.rtnMsg);
                }
            }
            catch (Exception ex)
            {
                ToolBox.MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        private void getModel(string strGuid)
        {
            gcMx3.DataSource = null;