From ccc1b0d541d8f3bdd2bcb72dd0b5533e68b886d5 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期一, 09 六月 2025 09:53:37 +0800 Subject: [PATCH] 采购明细报表 --- DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs | 70 ++++++++++++++++++++-------------- 1 files changed, 41 insertions(+), 29 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs index 998bcd2..92a4c65 100644 --- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs +++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs @@ -15,11 +15,13 @@ { string _webServiceName = "MesQaMjManager/"; List<FilterEntity> _filterList = new List<FilterEntity>(); + string _ucItem = "";//鐗╂枡 + string _ucGys = "";//鐗╂枡 public Frm_MesQaMj() { InitializeComponent(); this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick; - this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick; + //this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick; this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick; this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1; @@ -27,20 +29,18 @@ this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; - 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); + this.toolBarMenu1.getXmlConfig(); Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "status", "", (value) => { Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); - }); + }, tips); Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) => { getModel(value); }, (value) => { getPageList(this.pageBar1.CurrentPage); - }); + }, lbGuid); getPageList(1); pageBar1.PagerEvent += PageBar1_PagerEvent; this.txt_fSubsidiary.EditChanged += (s, e) => @@ -48,8 +48,8 @@ string _orgId = txt_fSubsidiary.GetId(); if (string.IsNullOrEmpty(_orgId)) return; - txt_suppId.getSuppler(_orgId); - txt_itemId.getSuppler(_orgId); + txt_suppId.getSuppler(_orgId, _ucGys); + txt_itemId.getSuppler(_orgId, _ucItem); }; txt_itemId.EditChanged += (s, e) => { @@ -64,7 +64,7 @@ } private void GridView1_ColumnFilterChanged(object sender, EventArgs e) { - Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1); + _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1); Task.Delay(100); getPageList(1); } @@ -89,7 +89,7 @@ gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; gridView1.ActiveFilter.Clear(); gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; - var frm = new ShowFilter(gridView1.Columns, _filterList, this.GetType().FullName); + var frm = new ShowFilter(gridView1.Columns, _filterList, this.GetType().FullName); frm.UpdateParent += Frm_UpdateParent; frm.ShowDialog(); } @@ -122,7 +122,7 @@ private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e) { string rowGuid = "", rowName = ""; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_itemNo, gridView1); + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_itemNo, gridView1, "itemNo"); if (string.IsNullOrEmpty(rowGuid)) { ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); @@ -190,7 +190,15 @@ return; } Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); - UtilityHelper.ChangeEnableByControl(panel1.Controls, true); + if (xtraTabControl1.SelectedTabPageIndex == 1) + { + getModel(rowGuid); + } + else + { + UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true); + } + } /// <summary> /// 鏂板浜嬩欢 @@ -201,7 +209,7 @@ { lbGuid.Text = ""; Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4); - UtilityHelper.CleanValueByControl(panel1.Controls, true); + UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true); } /// <summary> /// 淇濆瓨浜嬩欢 @@ -248,7 +256,9 @@ { lbGuid.Text = _rtn.rtnData; toolBarMenu1.isSetBtn = true; - UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false); + UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false); + toolBarMenu1.currentAction = ""; + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6); } } catch (Exception ex) @@ -264,7 +274,7 @@ /// <param name="pageSize">姣忛〉鍑犳潯</param> private void getPageList(int curPage) { - var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); + gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); _sbSqlWhere += " and b.guid is not null"; PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "org.FNumber asc ,b.ITEM_NO", "asc", "", _sbSqlWhere.ToString()); string json = JsonConvert.SerializeObject(pgq); @@ -275,16 +285,16 @@ if (dd.rtnCode > 0) { DataTable dt = dd.rtnData.list; - gcMain.BindingContext = new BindingContext(); + gcMain1.BindingContext = new BindingContext(); gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; if (dt.Rows.Count > 0) { - gcMain.DataSource = dt; - gcMain.ForceInitialize(); + gcMain1.DataSource = dt; + gcMain1.ForceInitialize(); gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1); } else - UtilityHelper.SetDefaultTable(gcMain, gridView1); + UtilityHelper.SetDefaultTable(gcMain1, gridView1); gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; pageBar1.TotalPages = dd.rtnData.pages;//鎬婚〉 pageBar1.CurrentPage = curPage;//褰撳墠椤� @@ -302,11 +312,9 @@ } /// <summary> - /// + /// 璇诲彇瀹炰綋 /// </summary> - /// <param name="strGuid">涓婚敭</param> - /// <param name="isEdit">鏄惁鍙紪杈�</param> - /// <param name="tabIdx">閫夐」鍗″簭鍙�</param> + /// <param name="strGuid"></param> private void getModel(string strGuid) { bool isEdit = false; @@ -328,8 +336,12 @@ if (_rtn.rtnCode > 0) { dynamic dy = _rtn.rtnData; + _ucItem = dy.itemId; + _ucGys = dy.suppId; lbGuid.Text = strGuid; - UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit); + UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit); + _ucItem = ""; + _ucGys = ""; } else ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); @@ -380,7 +392,7 @@ }; toolBarMenu1.guidKey = ""; string rowGuid, rowName; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_itemNo, gridView1, "itemName"); + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_itemNo, gridView1, "itemNo"); if (string.IsNullOrEmpty(rowGuid)) { MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); @@ -404,9 +416,11 @@ if (_rtn.rtnCode > 0) { if (xtraTabControl1.SelectedTabPageIndex == 1) + { getModel(lbGuid.Text.Trim()); - else - getPageList(this.pageBar1.CurrentPage); + } + int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid); + gridView1.FocusedRowHandle = rowHandle; UtilityHelper.SetCheckIco(gridView1, "status", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString()); } } @@ -415,7 +429,5 @@ MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } } - - } } \ No newline at end of file -- Gitblit v1.9.3