From d70880a3d9ae6c9f99ec380ccd16f5524bb622e6 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期六, 05 四月 2025 09:06:31 +0800 Subject: [PATCH] 修改按钮状态 --- DevApp/Gs.DevApp/DevFrm/QC/MesQcExceptional.cs | 81 ++++++++++++++++++---------------------- 1 files changed, 36 insertions(+), 45 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/QC/MesQcExceptional.cs b/DevApp/Gs.DevApp/DevFrm/QC/MesQcExceptional.cs index c732d6d..279281e 100644 --- a/DevApp/Gs.DevApp/DevFrm/QC/MesQcExceptional.cs +++ b/DevApp/Gs.DevApp/DevFrm/QC/MesQcExceptional.cs @@ -1,6 +1,4 @@ -锘縰sing DevExpress.XtraEditors; -using DevExpress.XtraGrid.Views.Grid; -using Gs.DevApp.Entity; +锘縰sing Gs.DevApp.Entity; using Gs.DevApp.ToolBox; using Gs.DevApp.UserControl; using Newtonsoft.Json; @@ -15,20 +13,19 @@ { public partial class MesQcExceptional : DevExpress.XtraEditors.XtraForm { - string _webServiceName = "WompbaManager/"; + string _webServiceName = "MesQcExceptionalManager/"; List<FilterEntity> _filterList = new List<FilterEntity>(); - string _cjBm = "";//杞﹂棿 public MesQcExceptional() { InitializeComponent(); - this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick; this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; + toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick; this.toolBarMenu1.getXmlConfig(); Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); - Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "fstatus", "", (value) => + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "checkStatus", "", (value) => { Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); }); @@ -38,7 +35,7 @@ }, (value) => { getPageList(this.pageBar1.CurrentPage); - }); + }, lbGuid); getPageList(1); pageBar1.PagerEvent += PageBar1_PagerEvent; } @@ -48,7 +45,19 @@ Task.Delay(100); getPageList(1); } - + /// <summary> + /// 鏃ュ織 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void ToolBarMenu1_btnLogClick(object sender, EventArgs e) + { + toolBarMenu1.guidKey = ""; + string rowGuid, rowName; + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, + lbGuid, txt_fBillNo, gridView1); + toolBarMenu1.guidKey = rowGuid; + } /// <summary> /// 鍒嗛〉浜嬩欢 /// </summary> @@ -68,7 +77,7 @@ gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; gridView1.ActiveFilter.Clear(); gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; - var frm = new ShowFilter(gridView1.Columns, _filterList); + var frm = new ShowFilter(gridView1.Columns, _filterList, this.GetType().FullName); frm.UpdateParent += Frm_UpdateParent; frm.ShowDialog(); } @@ -113,7 +122,7 @@ /// <param name="e"></param> private void ToolBarMenu1_btnChkClick(object sender, EventArgs e) { - _toolCk(1, "EditModelSubmit"); + _toolCk(1); } /// <summary> @@ -124,23 +133,10 @@ /// <exception cref="NotImplementedException"></exception> private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e) { - _toolCk(0, "EditModelSubmitFSH"); + _toolCk(0); } - /// <summary> - /// 鏂板浜嬩欢 - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void ToolBarMenu1_btnAddClick(object sender, EventArgs e) - { - lbGuid.Text = ""; - Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4); - List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); - gridViews.Add(gvMx1); - UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews); - Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); - } + /// <summary> /// @@ -207,12 +203,10 @@ if (_rtn.rtnCode > 0) { dynamic dy = _rtn.rtnData; - _cjBm = dy.pba013; lbGuid.Text = strGuid; List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); gvList.Add(gvMx1); UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList); - _cjBm = ""; JObject _job = JObject.Parse(strJson); JArray array = new JArray(); foreach (var a in _job["rtnData"]["list"]) @@ -279,41 +273,37 @@ } } } - + /// <summary> /// 宸ュ叿鏉′簨浠� /// </summary> /// <param name="inFieldValue"></param> - private void _toolCk(int _inFieldValue, string _mth) + /// <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_hNo, gridView1, "hNo"); + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, + lbGuid, txt_fBillNo, gridView1, "fBillNo"); + toolBarMenu1.guidKey = rowGuid; if (string.IsNullOrEmpty(rowGuid)) { MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵")) + if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎿嶄綔鍚楋紵")) return; var _obj = new { guid = rowGuid, - inFieldValue = _inFieldValue, + inFieldValue = _inFieldValue }; try { - var strJson = UtilityHelper.HttpPost("", _webServiceName + _mth, JsonConvert.SerializeObject(_obj)); + var strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModelSubmit", JsonConvert.SerializeObject(_obj)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); MsgHelper.Warning(_rtn.rtnData.outMsg.ToString()); if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0) @@ -324,7 +314,7 @@ } int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid); gridView1.FocusedRowHandle = rowHandle; - UtilityHelper.SetCheckIco(gridView1, "fstatus", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString()); + UtilityHelper.SetCheckIco(gridView1, "checkStatus", "checkBy", "checkDate", picCheckBox, this, _inFieldValue.ToString()); } } catch (Exception ex) @@ -332,5 +322,6 @@ MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } } + } } \ No newline at end of file -- Gitblit v1.9.3