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/WOM/Frm_Womdaa.cs | 127 +++++++++++++++++++++++++++--------------- 1 files changed, 81 insertions(+), 46 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Womdaa.cs b/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Womdaa.cs index c1a178e..5d6f140 100644 --- a/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Womdaa.cs +++ b/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Womdaa.cs @@ -27,9 +27,9 @@ this.toolBarMenu1.btnTzblClick += ToolBarMenu1_btnTzblClick; this.toolBarMenu1.btnKgClick += ToolBarMenu1_btnKgClick; this.toolBarMenu1.btnWgClick += ToolBarMenu1_btnWgClick; - toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick; - toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick; + toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick; Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2); Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, null, "", (value) => { Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); @@ -44,11 +44,18 @@ getPageList(1); pageBar1.PagerEvent += PageBar1_PagerEvent; txt_sjXt.getSuppler(""); + this.ucBtnPrint1.btnDesignClick += (s, e) => + { + ucBtnPrint1.rptParameter = "rpt_daa{}"; + }; + this.ucBtnPrint1.btnReportClick += (s, e) => + { + _print(); + }; } - 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); } @@ -116,7 +123,19 @@ { _toolCk(8); } - + /// <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_daa001, gridView1); + toolBarMenu1.guidKey = rowGuid; + } /// <summary> /// 鍙栨秷浜嬩欢 /// </summary> @@ -124,7 +143,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> @@ -138,14 +157,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> @@ -179,7 +199,7 @@ var _obj = new { guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓 - sjxt = txt_sjXt.GetCode(), //瀹為檯绾夸綋 + sjxt = txt_sjXt.GetId(), //瀹為檯绾夸綋 bz = txt_daa009.Text.Trim()//澶囨敞 }; try @@ -223,6 +243,7 @@ { gcMain.DataSource = dt; gcMain.ForceInitialize(); + gridView1.BestFitColumns(); } else UtilityHelper.SetDefaultTable(gcMain, gridView1); @@ -240,7 +261,6 @@ { ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } - } private void getModel(string strGuid) { @@ -269,7 +289,9 @@ lbGuid.Text = strGuid; List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); gvList.Add(gvMx1); + gvList.Add(gvMx2); UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList); + // txt_sjXt.getSuppler(txt_daa013.Text); JObject _job = JObject.Parse(strJson); JArray array = new JArray(); foreach (var a in _job["rtnData"]["list"]) @@ -282,6 +304,7 @@ gcMx1.BindingContext = new BindingContext(); gcMx1.DataSource = dt; gcMx1.ForceInitialize(); + gvMx1.BestFitColumns(); } else { @@ -293,11 +316,12 @@ array2.Add(a); } DataTable dt2 = JsonConvert.DeserializeObject<DataTable>(array2.ToString()); - if (dt.Rows.Count > 0) + if (dt2.Rows.Count > 0) { gcMx2.BindingContext = new BindingContext(); gcMx2.DataSource = dt2; gcMx2.ForceInitialize(); + gvMx2.BestFitColumns(); } else { @@ -312,21 +336,6 @@ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } } - - private void ToolBarMenu1_btnDesignClick(object sender, EventArgs e) - { - toolBarMenu1.guidKey = ""; - string rowGuid, rowName; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, - lbGuid, txt_daa001, gridView1); - toolBarMenu1.guidKey = rowGuid; - toolBarMenu1.rptParameter = "rpt_daa{}"; - } - private void ToolBarMenu1_btnReportClick(object sender, EventArgs e) - { - _print(); - } - /// <summary> /// 宸ュ叿鏉′簨浠� @@ -401,47 +410,73 @@ MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } } - - private void _print() { - toolBarMenu1.guidKey = ""; string rowGuid, rowName; (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_daa001, gridView1); - toolBarMenu1.guidKey = rowGuid; - if (xtraTabControl1.SelectedTabPageIndex == 0) - { - Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 5); - this.toolBarMenu1.rptParameter = "return false"; - return; - } + ucBtnPrint1.guidKey = rowGuid; if (rowGuid.Length < 36) { Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨浣犺鎵撳嵃鐨勮锛�"); - this.toolBarMenu1.rptParameter = "return false"; + this.ucBtnPrint1.rptParameter = "return false"; return; } if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim())) { Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜寮犳暟锛�"); txt_iCount_1.Focus(); - this.toolBarMenu1.rptParameter = "return false"; + this.ucBtnPrint1.rptParameter = "return false"; return; } if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim())) { Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�"); txt_psnQty_1.Focus(); - this.toolBarMenu1.rptParameter = "return false"; + this.ucBtnPrint1.rptParameter = "return false"; return; } - this.toolBarMenu1.rptParameter = "rpt_daa{" + "" + this.ucBtnPrint1.rptParameter = "rpt_daa{" + "" + "," + txt_printRemark.Text.Trim() + "," + "" + "," + txt_iCount_1.Text.Trim() + "," + txt_psnQty_1.Text.Trim() + "}"; } + + private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) + { + var rowhandle = gvMx2.FocusedRowHandle; + if (rowhandle < 0) + return; + if (e.Button.Index == 0) + { + var dr = gvMx2.GetDataRow(rowhandle); + var mxGuid = dr["guid"].ToString(); + if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵")) + return; + var _obj = new + { + mxGuid = mxGuid, + inType = "dhtm" + }; + try + { + var strJson = UtilityHelper.HttpPost("", + _webServiceName + "DeleteBarcode", + JsonConvert.SerializeObject(_obj)); + var _rtn = UtilityHelper.ReturnToDynamic(strJson); + if (_rtn.rtnCode > 0) + { + if (_rtn.rtnCode > 0) getModel(lbGuid.Text); + } + MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); + } + catch (Exception ex) + { + MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + } + } + } } } \ No newline at end of file -- Gitblit v1.9.3