From 5bb244513c2a80b1745c10229274183b6f8af934 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期四, 12 十二月 2024 09:51:33 +0800 Subject: [PATCH] 其它业务-出库 --- DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesDepot.cs | 105 +++++++++++++++++++++++++++++++++------------------- 1 files changed, 67 insertions(+), 38 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesDepot.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesDepot.cs index e6335f6..85fefd2 100644 --- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesDepot.cs +++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesDepot.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; using System.Data; -using System.Drawing; -using System.Text; using System.Windows.Forms; using DevExpress.XtraEditors; using DevExpress.XtraEditors.Controls; @@ -32,21 +30,10 @@ toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; gcMain.MouseDoubleClick += GcMain_MouseDoubleClick; - getPageList(1, UtilityHelper.GetPageSize()); + Gs.DevApp.ToolBox.UtilityHelper.SetGridSear(gridView1, picCheckBox, this, "checkStatus", ""); + Gs.DevApp.ToolBox.UtilityHelper.SetGridSearMx(gvMx1); + getPageList(1); pageBar1.PagerEvent += PageBar1_PagerEvent; - gridView1.CustomDrawRowIndicator += (s, e) => - { - if (e.Info.IsRowIndicator && e.RowHandle >= 0) - e.Info.DisplayText = (e.RowHandle + 1).ToString(); - }; - gridView1.CustomDrawEmptyForeground += (s, e) => - { - var str = "鏆傛湭鏌ユ壘鍒板尮閰嶇殑鏁版嵁!"; - var f = new Font("寰蒋闆呴粦", 16); - var r = new Rectangle(gridView1.GridControl.Width / 2 - 100, - e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5); - e.Graphics.DrawString(str, f, Brushes.Gray, r); - }; } /// <summary> @@ -69,7 +56,7 @@ /// <param name="pageSize"></param> private void PageBar1_PagerEvent(int curPage, int pageSize) { - getPageList(curPage, pageSize); + getPageList(curPage); } /// <summary> @@ -92,7 +79,7 @@ private void Frm_UpdateParent(object sender, UpdateParentEventArgs e) { _filterList = e.FilterList; - getPageList(1, pageBar1.RowsCount); + getPageList(1); } /// <summary> @@ -103,11 +90,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_depotName, gridView1); - toolBarMenu1.guidKey = rowGuid; + _toolCk(0); } /// <summary> @@ -117,11 +100,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_depotName, gridView1); - toolBarMenu1.guidKey = rowGuid; + _toolCk(1); } /// <summary> @@ -144,7 +123,7 @@ if (xtraTabControl1.SelectedTabPageIndex == 1) getModel(lbGuid.Text.Trim(), false, 999); else - getPageList(1, UtilityHelper.GetPageSize()); + getPageList(1); } /// <summary> @@ -207,7 +186,6 @@ CompletenessFlag = Gs.DevApp.ToolBox.UtilityHelper.ToInt(row["completenessFlag"].ToString()), }); } - var _obj = new MesDepots { Guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), @@ -241,13 +219,10 @@ /// </summary> /// <param name="curPage">绗嚑椤�</param> /// <param name="pageSize">姣忛〉鍑犳潯</param> - private void getPageList(int curPage, int pageSize) + private void getPageList(int curPage) { - var _sbSqlWhere = new StringBuilder(); - foreach (var itm in _filterList) - _sbSqlWhere.Append(" and " + itm.fileId + itm.fileOper + "'" + - itm.fileValue + "'"); - var pgq = new PageQueryModel(curPage, pageSize, "a.depot_code", "asc", + var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); + var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "a.depot_code", "asc", "", _sbSqlWhere.ToString()); var json = JsonConvert.SerializeObject(pgq); try @@ -263,8 +238,6 @@ pageBar1.TotalPages = dddd; pageBar1.RecordCount = dd.rtnData.total; //璁板綍鎬绘暟 pageBar1.CurrentPage = curPage; //褰撳墠椤� - pageBar1.RowsCount = pageSize; //姣忛〉鏄剧ず - pageBar1.setTxt(); } catch (Exception ex) { @@ -364,5 +337,61 @@ } } } + + + /// <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_depotName, gridView1, "depotName"); + if (string.IsNullOrEmpty(rowGuid)) + { + MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + return; + } + if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵")) + return; + + var _obj = new + { + guid = rowGuid, + ckValue = _inFieldValue, + parameter = "MES_DEPOTS,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(), false, 999); + else + getPageList(1); + } + } + catch (Exception ex) + { + MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + } + + } + } } \ No newline at end of file -- Gitblit v1.9.3