lu
2025-03-06 f23d33d0cf77a73d449cd7c38effda9e50c8fda4
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs
@@ -31,14 +31,16 @@
            toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick;
            toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick;
            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1);
            List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
            gvList.Add(gridView1);
            Gs.DevApp.ToolBox.UtilityHelper.getGridViewConfig(this.GetType().FullName, gvList);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx3);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "qualityAudit", "", (value) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
            });
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "modifyFlagTxt", "", (value) =>
           {
               Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
           });
            Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
            {
                getModel(value);
@@ -54,7 +56,7 @@
        }
        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);
        }
@@ -177,15 +179,26 @@
        /// <param name="e"></param>
        private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
        {
            toolBarMenu1.currentAction = "edit";
            string rowGuid = "", rowName = "";
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1);
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1, "releaseNo");
            if (string.IsNullOrEmpty(rowGuid))
            {
                ToolBox.MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
            UtilityHelper.ChangeEnableByControl(panel1.Controls, true);
            if (xtraTabControl1.SelectedTabPageIndex == 1)
            {
                getModel(rowGuid);
            }
            else
            {
                List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                gvList.Add(gvMx1);
                gvList.Add(gvMx2);
                UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList);
            }
        }
        private void ToolBarMenu1_btnDesignClick(object sender, EventArgs e)
        {
@@ -201,11 +214,11 @@
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_itemName, gridView1);
            toolBarMenu1.guidKey = rowGuid;
            this.toolBarMenu1.rptParameter = "rpt_Detect01{" + ""
                   + "," + ""
                   + "," + ""
                   + "," + ""
                   + "," + ""
            this.toolBarMenu1.rptParameter = "rpt_Detect01{" + "1"
                   + "," + "1"
                   + "," + "1"
                   + "," + "1"
                   + "," + "1"
                   + "}";
        }
@@ -249,14 +262,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);
            }
        }
@@ -265,7 +279,7 @@
        /// </summary>
        /// <param name="curPage">第几页</param>
        /// <param name="pageSize">每页几条</param>
        private   void getPageList(int curPage)
        private void getPageList(int curPage)
        {
            var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
            _sbSqlWhere += " and isnull(fsubmit,0)=1";
@@ -284,6 +298,7 @@
                    {
                        gcMain.DataSource = dt;
                        gcMain.ForceInitialize();
                        gridView1.BestFitColumns();
                    }
                    else
                        UtilityHelper.SetDefaultTable(gcMain, gridView1);
@@ -301,9 +316,9 @@
            {
                ToolBox.MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        private   void getModel(string strGuid)
        private void getModel(string strGuid)
        {
            bool isEdit = false;
            if (toolBarMenu1.currentAction == "add") return;
@@ -340,6 +355,7 @@
                        gcMx1.BindingContext = new BindingContext();
                        gcMx1.DataSource = dt;
                        gcMx1.ForceInitialize();
                        gvMx1.BestFitColumns();
                        ucUpFile1.parentGuid = lbGuid.Text.Trim();
                        getList12(dt.Rows[0]["guid"].ToString());
                    }
@@ -355,7 +371,7 @@
            {
                ToolBox.MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        /// <summary>
        /// 选项卡切换
@@ -409,7 +425,7 @@
        /// 根据检验项目读取抽样结果 
        /// </summary>
        /// <param name="guid5"></param>
        private   void getList12(string guid5)
        private void getList12(string guid5)
        {
            var _obj = new
            {
@@ -424,6 +440,7 @@
                gcMx2.BindingContext = new BindingContext();
                gcMx2.DataSource = dt;
                gcMx2.ForceInitialize();
                gvMx2.BestFitColumns();
            }
            catch (Exception ex)
            {
@@ -543,6 +560,17 @@
            }
            if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定" + strMsg + "吗?"))
                return;
            if (_inFieldValue == 1)
            {
                if (txt_fcheckResu.Text == "不合格")
                {
                    if (txt_fngHandle.Text.Trim().Length == 0)
                    {
                        MsgHelper.Warning("单据为不合格时请选择处理方式!");
                        return;
                    }
                }
            }
            var _obj = new
            {
                guid = rowGuid,
@@ -555,12 +583,27 @@
                    JsonConvert.SerializeObject(_obj));
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
                if (_rtn.rtnCode > 0)
                if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
                {
                    if (xtraTabControl1.SelectedTabPageIndex == 1)
                        getModel(lbGuid.Text.Trim());
                    if (_inFieldValue >= 0)
                    {
                        if (xtraTabControl1.SelectedTabPageIndex == 1)
                        {
                            getModel(lbGuid.Text.Trim());
                        }
                        int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
                        gridView1.FocusedRowHandle = rowHandle;
                        UtilityHelper.SetCheckIco(gridView1, "modifyFlagTxt", "modify1By", "modify1Date", picCheckBox, this, _inFieldValue.ToString());
                    }
                    else
                    {
                        //if (xtraTabControl1.SelectedTabPageIndex == 1)
                        //    getModel(lbGuid.Text.Trim());
                        //else
                        //    getPageList(this.pageBar1.CurrentPage);
                        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
                        getPageList(this.pageBar1.CurrentPage);
                    }
                }
            }
            catch (Exception ex)
@@ -568,6 +611,5 @@
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
    }
}