lu
2025-02-19 9cdebe64f7ce63aee080491dec6d108466527432
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs
@@ -6,7 +6,6 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -28,7 +27,7 @@
            this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
            toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "status", "", (value) =>
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1,picCheckBox, this, "status", "", (value) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
            });
@@ -41,19 +40,27 @@
            });
            getPageList(1);
            pageBar1.PagerEvent += PageBar1_PagerEvent;
            this.txt_fSubsidiary.EditChanged += (s, e) => {
                string _orgId = txt_fSubsidiary.GetId();
                if (string.IsNullOrEmpty(_orgId))
                    return;
                txt_suppId.getSuppler(_orgId);
                txt_itemId.getSuppler(_orgId);
            };
            txt_itemId.EditChanged += (s, e) =>
            {
                txt_itemNo.Text = this.txt_itemId.GetCode();
                if (!string.IsNullOrEmpty(this.txt_itemId.GetCode()))
                    txt_itemNo.Text = this.txt_itemId.GetCode();
            };
            txt_suppId.getSuppler("");
            txt_suppId.EditChanged += (s, e) =>
            {
                txtGysNo.Text = this.txt_suppId.GetCode();
                if (!string.IsNullOrEmpty(this.txt_suppId.GetCode()))
                    txt_suppNo.Text = this.txt_suppId.GetCode();
            };
        }
        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);
        }
@@ -128,8 +135,11 @@
                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                if (_rtn.rtnCode > 0)
                {
                    UtilityHelper.JumpToTab(xtraTabControl1, 0);
                    getPageList(1);
                    if (xtraTabControl1.SelectedTabPageIndex == 0)
                    { }
                    else
                        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
                    getPageList(this.pageBar1.CurrentPage);
                }
                ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg);
            }
@@ -150,14 +160,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>
@@ -198,6 +209,13 @@
            toolBarMenu1.isSetBtn = false;
            string _ItemId = txt_itemId.GetId();
            string _suppNo = txt_suppId.GetId();
            string _orgId = txt_fSubsidiary.GetId();
            //if (string.IsNullOrEmpty(_orgId))
            //{
            //    Gs.DevApp.ToolBox.MsgHelper.Warning("请选择组织!");
            //    txt_OrgName.Focus();
            //    return;
            //}
            if (string.IsNullOrEmpty(_ItemId))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择物料!");
@@ -242,9 +260,9 @@
        /// <param name="pageSize">每页几条</param>
        private void getPageList(int curPage)
        {
            var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
            PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "a.create_date", "asc", "", _sbSqlWhere.ToString());
            _sbSqlWhere += " and b.guid is not null";
            PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "org.FNumber asc ,b.ITEM_NO", "asc", "", _sbSqlWhere.ToString());
            string json = JsonConvert.SerializeObject(pgq);
            try
            {
@@ -259,6 +277,7 @@
                    {
                        gcMain.DataSource = dt;
                        gcMain.ForceInitialize();
                        gridView1.BestFitColumns();
                    }
                    else
                        UtilityHelper.SetDefaultTable(gcMain, gridView1);
@@ -307,7 +326,6 @@
                    dynamic dy = _rtn.rtnData;
                    lbGuid.Text = strGuid;
                    UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit);
                }
                else
                    ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg);
@@ -385,6 +403,7 @@
                        getModel(lbGuid.Text.Trim());
                    else
                        getPageList(this.pageBar1.CurrentPage);
                    UtilityHelper.SetCheckIco(gridView1, "status", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString());
                }
            }
            catch (Exception ex)
@@ -392,5 +411,7 @@
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
    }
}