lu
2025-02-19 9cdebe64f7ce63aee080491dec6d108466527432
DevApp/Gs.DevApp/DevFrm/QC/Frm_IQCLookups.cs
@@ -29,29 +29,27 @@
            toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
            toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
            gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
            Gs.DevApp.ToolBox.UtilityHelper.SetGridSear(gridView1, picCheckBox, this, "checkStatus", "");
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx( gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1,picCheckBox, this, "checkStatus", "", (value) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
            });
            Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
            {
                getModel(value);
            }, (value) =>
            {
                getPageList(this.pageBar1.CurrentPage);
            });
            getPageList(1);
            pageBar1.PagerEvent += PageBar1_PagerEvent;
        }
        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);
        }
        /// <summary>
        ///     双击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            var rowGuid =
                UtilityHelper.GetCurrentDoubleRow(gridView1,
                    e, "guid");
            if (!string.IsNullOrEmpty(rowGuid))
                getModel(rowGuid, false, 999);
        }
        /// <summary>
@@ -72,12 +70,7 @@
        /// <exception cref="NotImplementedException"></exception>
        private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
        {
            toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_lookupTypeCode, gridView1);
            toolBarMenu1.guidKey = rowGuid;
            _toolCk(0);
        }
        /// <summary>
@@ -87,11 +80,7 @@
        /// <param name="e"></param>
        private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
        {
            toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_lookupTypeCode, gridView1);
            toolBarMenu1.guidKey = rowGuid;
            _toolCk(1);
        }
        /// <summary>
        ///     取消事件
@@ -100,7 +89,7 @@
        /// <param name="e"></param>
        private void ToolBarMenu1_btnEscClick(object sender, EventArgs e)
        {
            UtilityHelper.JumpToTab(xtraTabControl1, 0);
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
        }
 
        /// <summary>
@@ -111,17 +100,18 @@
        private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
        {
            if (xtraTabControl1.SelectedTabPageIndex == 1)
                getModel(lbGuid.Text.Trim(), false, 999);
                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);
            }
        }
@@ -140,7 +130,17 @@
                MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            getModel(rowGuid, true, 1);
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
            if (xtraTabControl1.SelectedTabPageIndex == 1)
            {
                getModel(rowGuid);
            }
            else
            {
                var gvList = new List<GridView>();
                gvList.Add(gvMx1);
                UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList);
            }
        }
        /// <summary>
@@ -193,7 +193,9 @@
                {
                    lbGuid.Text = _rtn.rtnData;
                    toolBarMenu1.isSetBtn = true;
                    getModel(lbGuid.Text, false, 1);
                    var gridViews = new List<GridView>();
                    gridViews.Add(gvMx1);
                    UtilityHelper.ChangeEnableByControl(panel1.Controls, false,gridViews);
                }
            }
            catch (Exception ex)
@@ -244,15 +246,16 @@
            }
        }
        private void getModel(string strGuid, bool isEdit, int tabIdx)
        private void getModel(string strGuid)
        {
            bool isEdit = false;
            if (toolBarMenu1.currentAction == "add") return;
            if (toolBarMenu1.currentAction == "edit") isEdit = true;
            if (string.IsNullOrEmpty(strGuid))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
            var _obj = new
            {
                guid = strGuid //主建
@@ -330,7 +333,7 @@
                        JsonConvert.SerializeObject(lst));
                    var _rtn =
                        UtilityHelper.ReturnToDynamic(strJson);
                    if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1);
                    if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
                    MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                }
@@ -340,5 +343,62 @@
                }
            }
        }
        /// <summary>
        /// 工具条事件
        /// </summary>
        /// <param name="inFieldValue"></param>
        private void _toolCk(int _inFieldValue)
        {
            string strMsg = "";
            switch (_inFieldValue)
            {
                case 1:
                    strMsg = "审核";
                    break;
                case 0:
                    strMsg = "反审核";
                    break;
            };
            toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_lookupTypeName, gridView1, "lookupTypeName");
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定" + strMsg + "吗?"))
                return;
            var _obj = new
            {
                guid = rowGuid,
                ckValue = _inFieldValue,
                parameter = "MES_SYS_LOOKUP_TYPES,check_date,check_status,check_by"
            };
            try
            {
                var strJson = UtilityHelper.HttpPost("", "General/GeneralCheck",
                    JsonConvert.SerializeObject(_obj));
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
                if (_rtn.rtnCode > 0)
                {
                    if (xtraTabControl1.SelectedTabPageIndex == 1)
                        getModel(lbGuid.Text.Trim());
                    else
                        getPageList(this.pageBar1.CurrentPage);
                    UtilityHelper.SetCheckIco(gridView1, "checkStatus", "checkBy", "checkDate", picCheckBox, this, _inFieldValue.ToString());
                }
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
    }
}