lu
2025-02-19 9cdebe64f7ce63aee080491dec6d108466527432
DevApp/Gs.DevApp/DevFrm/WW/Frm_WwGd.cs
@@ -1,4 +1,3 @@
using DevExpress.RichEdit.Export;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
@@ -7,7 +6,6 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -29,9 +27,8 @@
            this.toolBarMenu1.btnTzblClick += ToolBarMenu1_btnTzblClick;
            this.toolBarMenu1.btnKgClick += ToolBarMenu1_btnKgClick;
            this.toolBarMenu1.btnWgClick += ToolBarMenu1_btnWgClick;
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, null, "", (value) =>
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx( gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter( gridView1, picCheckBox, this, "pcShChk", "", (value) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
            });
@@ -44,18 +41,10 @@
            });
            getPageList(1);
            pageBar1.PagerEvent += PageBar1_PagerEvent;
            this.ucBtnPrint1.btnDesignClick += (s, e) =>
            {
                ucBtnPrint1.rptParameter = "rpt_daa{}";
            };
            this.ucBtnPrint1.btnReportClick += (s, e) =>
            {
                _print();
            };
        }
        private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
        {
            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
            Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
            Task.Delay(100);
            getPageList(1);
        }
@@ -145,14 +134,15 @@
                getModel(lbGuid.Text.Trim());
            else
            {
                _filterList.Clear();
                if (gridView1.ActiveFilter.Count > 0)
                {
                    gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
                    gridView1.ActiveFilter.Clear();
                    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
                }
                getPageList(1);
                //_filterList.Clear();
                //if (gridView1.ActiveFilter.Count > 0)
                //{
                //    gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
                //    gridView1.ActiveFilter.Clear();
                //    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
                //}
                //getPageList(1);
                getPageList(this.pageBar1.CurrentPage);
            }
        }
        /// <summary>
@@ -230,6 +220,7 @@
                    {
                        gcMain.DataSource = dt;
                        gcMain.ForceInitialize();
                        gridView1.BestFitColumns();
                    }
                    else
                        UtilityHelper.SetDefaultTable(gcMain, gridView1);
@@ -289,26 +280,11 @@
                        gcMx1.BindingContext = new BindingContext();
                        gcMx1.DataSource = dt;
                        gcMx1.ForceInitialize();
                        gvMx1.BestFitColumns();
                    }
                    else
                    {
                        Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
                    }
                    JArray array2 = new JArray();
                    foreach (var a in _job["rtnData"]["list2"])
                    {
                        array2.Add(a);
                    }
                    DataTable dt2 = JsonConvert.DeserializeObject<DataTable>(array2.ToString());
                    if (dt.Rows.Count > 0)
                    {
                        gcMx2.BindingContext = new BindingContext();
                        gcMx2.DataSource = dt2;
                        gcMx2.ForceInitialize();
                    }
                    else
                    {
                        Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
                    }
                }
                else
@@ -394,38 +370,5 @@
            }
        }
        private void _print()
        {
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_daa001, gridView1);
            ucBtnPrint1.guidKey = rowGuid;
            if (rowGuid.Length < 36)
            {
                Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择你要打印的行!");
                this.ucBtnPrint1.rptParameter = "return false";
                return;
            }
            if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim()))
            {
                Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择打印条码张数!");
                txt_iCount_1.Focus();
                this.ucBtnPrint1.rptParameter = "return false";
                return;
            }
            if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim()))
            {
                Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择打印条码数量!");
                txt_psnQty_1.Focus();
                this.ucBtnPrint1.rptParameter = "return false";
                return;
            }
            this.ucBtnPrint1.rptParameter = "rpt_daa{" + ""
                   + "," + txt_printRemark.Text.Trim()
                   + "," + ""
                   + "," + txt_iCount_1.Text.Trim()
                   + "," + txt_psnQty_1.Text.Trim()
                   + "}";
        }
    }
}