From f14d1fc28a8012035ee251fba71a0d048e9efd0d Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期四, 16 一月 2025 09:10:48 +0800 Subject: [PATCH] 工具条切换状态 --- DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs | 101 +++++++++++++++++++++++++++++--------------------- 1 files changed, 58 insertions(+), 43 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs index c235171..0629613 100644 --- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs +++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs @@ -15,7 +15,7 @@ { public partial class Frm_MesQaItemsDetect01 : DevExpress.XtraEditors.XtraForm { - int _currentHandle5 =0; + int _currentHandle5 = 0; string _webServiceName = "MesQaItemsDetect01Manager/"; List<FilterEntity> _filterList = new List<FilterEntity>(); public Frm_MesQaItemsDetect01() @@ -25,17 +25,16 @@ this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick; this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick; this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; - this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1; + // this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1; this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick; toolBarMenu1.btnJianYanClick += ToolBarMenu1_btnJianYanClick; - gcMx1.MouseClick += GcMx1_MouseClick; Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1); 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, "modify1FlagTxt", "", (value) => + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "fsubmitTxt", "", (value) => { Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); }); @@ -48,32 +47,29 @@ }); getPageList(1); pageBar1.PagerEvent += PageBar1_PagerEvent; - txt_itemId.EditChanged += (s, e) => - { - txt_itemModel.Text = this.txt_itemId.GetModel(); - txt_itemNo.Text = this.txt_itemId.GetCode(); - }; txtJianYan.KeyDown += TxtJianYan_KeyDown; this.btnLoad.Click += BtnLoad_Click; ucUpFile1.UpChanged += UcUpFile1_UpChanged; xtraTabControl2.SelectedPageChanged += XtraTabControl2_SelectedPageChanged; + gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged; } 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); } - private void GcMx1_MouseClick(object sender, MouseEventArgs e) + private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { - string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gvMx1, e, "guid"); - if (string.IsNullOrEmpty(rowGuid)) - return; - var info = gvMx1.CalcHitInfo(e.Location); - this._currentHandle5 = info.RowHandle; - getList12(rowGuid); + if (e.FocusedRowHandle >= 0) + { + DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle); + string rowGuid = row["guid"].ToString(); + if (string.IsNullOrEmpty(rowGuid)) + return; + getList12(rowGuid); + } } - /// <summary> /// 閲嶆柊鍔犺浇妫�楠� /// </summary> @@ -101,6 +97,10 @@ { getModel(lbGuid.Text.Trim()); } + else + { + Gs.DevApp.ToolBox.MsgHelper.ShowInformation(_rtn.rtnMsg); + } } catch (Exception ex) { @@ -115,6 +115,7 @@ private void TxtJianYan_KeyDown(object sender, KeyEventArgs e) { int intHandle = this.gvMx1.FocusedRowHandle; + this._currentHandle5 = intHandle; if (intHandle < 0) { ToolBox.MsgHelper.Warning("鎻愮ず锛氳閫夋嫨妫�楠岄」鐩紒"); @@ -179,12 +180,15 @@ _webServiceName + "EdtModel12", JsonConvert.SerializeObject(_obj)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); - MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); if (_rtn.rtnCode > 0) { - txtJianYan.Text = ""; getModel(lbGuid.Text.Trim()); } + else + { + Gs.DevApp.ToolBox.MsgHelper.ShowInformation(_rtn.rtnMsg); + } + txtJianYan.Text = ""; } catch (Exception ex) { @@ -245,7 +249,7 @@ /// <param name="sender"></param> /// <param name="e"></param> /// <exception cref="NotImplementedException"></exception> - private void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e) + private void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e) { toolBarMenu1.guidKey = ""; string rowGuid, rowName; @@ -259,7 +263,14 @@ } if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎻愪氦妫�楠屽悧锛�")) return; - + if (txt_fcheckResu.Text.Trim() == "涓嶅悎鏍�") + { + if (string.IsNullOrEmpty(txt_lotNo1.Text.Trim())|| string.IsNullOrEmpty(txt_fngDesc.Text.Trim())) + { + MsgHelper.Warning("鍗曟嵁涓轰笉鍚堟牸鏃讹紝璇峰~鍐欏娉ㄤ俊鎭拰涓嶈壇鎻忚堪锛�"); + return; + } + }; var _obj = new { guid = rowGuid, @@ -274,7 +285,9 @@ if (_rtn.rtnCode > 0) { if (xtraTabControl1.SelectedTabPageIndex == 1) - getModel(lbGuid.Text.Trim()); + { + // getModel(lbGuid.Text.Trim()); + } else getPageList(this.pageBar1.CurrentPage); } @@ -283,7 +296,7 @@ { MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } - + } /// <summary> @@ -304,7 +317,7 @@ private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e) { 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("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); @@ -322,9 +335,10 @@ if (_rtn.rtnCode > 0) { if (xtraTabControl1.SelectedTabPageIndex == 0) - getPageList(this.pageBar1.CurrentPage); + { } else Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2); + getPageList(this.pageBar1.CurrentPage); } ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); } @@ -345,14 +359,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> @@ -363,7 +378,7 @@ private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e) { 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("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); @@ -436,10 +451,11 @@ /// </summary> /// <param name="curPage">绗嚑椤�</param> /// <param name="pageSize">姣忛〉鍑犳潯</param> - private void getPageList(int curPage) + private void getPageList(int curPage) { var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); - PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString()); + // _sbSqlWhere += " and isnull(fsubmit,0)=0"; + PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "release_no", "asc", "", _sbSqlWhere.ToString()); string json = JsonConvert.SerializeObject(pgq); try { @@ -471,9 +487,9 @@ { ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } - + } - private void getModel(string strGuid) + private void getModel(string strGuid) { bool isEdit = false; if (toolBarMenu1.currentAction == "add") return; @@ -531,7 +547,7 @@ { ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } - + } @@ -587,9 +603,8 @@ /// 鏍规嵁妫�楠岄」鐩鍙栨娊鏍风粨鏋� /// </summary> /// <param name="guid5"></param> - private void getList12(string guid5) + private void getList12(string guid5) { - var _obj = new { parentGuid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓 @@ -608,7 +623,7 @@ { MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } - + } private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) -- Gitblit v1.9.3