From 719a47b4aff725d4224b85e2b2079983cb31cf89 Mon Sep 17 00:00:00 2001
From: lg <123456>
Date: 星期二, 23 十二月 2025 13:28:36 +0800
Subject: [PATCH] 增加临时查询方案
---
DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesDepot.cs | 115 +++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 83 insertions(+), 32 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesDepot.cs b/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesDepot.cs
index b11a2bc..c8364ef 100644
--- a/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesDepot.cs
+++ b/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesDepot.cs
@@ -1,17 +1,18 @@
-using System;
-using System.Collections.Generic;
-using System.Data;
-using System.Threading.Tasks;
-using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraGrid.Views.Grid;
+using Gs.DevApp.DevFrm.Rpt;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
using MES.Service.Modes;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Threading.Tasks;
+using System.Windows.Forms;
namespace Gs.DevApp.DevFrm
{
@@ -28,24 +29,66 @@
toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
- Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
- Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1,null, null, null, "", (value) =>
- {
- Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
- });
+ this.toolBarMenu1.getXmlConfig();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, null, "", (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;
+
+
+ #region 鎵撳嵃搴撲綅鐮侊紝浠呬粎鎵撳嵃
+ this.ucBtnPrint1.SetPlButton(true);
+ this.ucBtnPrint1.SetPrintButton(false);
+ //鎵撳嵃鎵归噺鎿嶄綔浜嬩欢
+ this.ucBtnPrint1.btnAllClick += (s, e) =>
+ {
+ string rowGuid = lbGuid.Text.Trim();
+ SelectDeleteBar frm = new SelectDeleteBar(rowGuid, "浠撲綅鐮�");
+ string strCodeList = "";
+ frm.UpdateParent += (ss, ee) =>
+ {
+ strCodeList = ee.StringSingle;
+ };
+ frm.ShowDialog();
+ if (string.IsNullOrEmpty(strCodeList))
+ return;
+ try
+ {
+ string rptParameter = "rpt_KW{"
+ + "100" // 閲嶆墦閮芥槸浼�100
+ + "," + ""
+ + "," + ""
+ + "," + ""
+ + "," + ""
+ + "," + strCodeList
+ + "}";
+
+ using (Form rpt = new RptPreview(rowGuid, rptParameter))
+ {
+ rpt.ShowDialog();
+ }
+ frm.Close();
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.ShowError(ex.Message);
+ }
+ };
+ #endregion
}
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);
}
@@ -69,7 +112,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();
}
@@ -143,7 +186,7 @@
{
List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gvList.Add(gvMx1);
- UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
}
}
@@ -158,14 +201,14 @@
toolBarMenu1.isSetBtn = false;
if (string.IsNullOrEmpty(txt_depotCode.Text.Trim()))
{
- MsgHelper.Warning("浠撳簱缂栫爜涓嶈兘涓虹┖锛�");
+ MsgHelper.ShowError("浠撳簱缂栫爜涓嶈兘涓虹┖锛�");
txt_depotCode.Focus();
return;
}
if (string.IsNullOrEmpty(txt_depotName.Text.Trim()))
{
- MsgHelper.Warning("浠撳簱鍚嶇О涓嶈兘涓虹┖锛�");
+ MsgHelper.ShowError("浠撳簱鍚嶇О涓嶈兘涓虹┖锛�");
txt_depotName.Focus();
return;
}
@@ -182,11 +225,11 @@
MsgHelper.ShowError("缂栫爜涓嶈兘涓虹┖锛�");
return;
}
- if (string.IsNullOrEmpty(row["DepotSectionName"].ToString()))
- {
- MsgHelper.ShowError("鍚嶇О涓嶈兘涓虹┖锛�");
- return;
- }
+ //if (string.IsNullOrEmpty(row["DepotSectionName"].ToString()))
+ //{
+ // MsgHelper.ShowError("鍚嶇О涓嶈兘涓虹┖锛�");
+ // return;
+ //}
lst.Add(new MesDepotSections
{
Guid = UtilityHelper.ToGuid(row["guid"].ToString()),
@@ -198,33 +241,36 @@
}
var _obj = new MesDepots
{
- Guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()),
+ Guid = lbGuid.Text.Trim(),
DepotCode = txt_depotCode.Text,
DepotName = txt_depotName.Text,
Description = txt_description.Text,
+ Remark5 = txt_remark5.TextTxt.Trim(),
list = lst
};
-
try
{
var strJson = UtilityHelper.HttpPost("",
_webServiceName + "EditModel",
JsonConvert.SerializeObject(_obj));
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
- MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
if (_rtn.rtnCode > 0)
{
+ MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
lbGuid.Text = _rtn.rtnData;
toolBarMenu1.isSetBtn = true;
var gridViews = new List<GridView>();
gridViews.Add(gvMx1);
- UtilityHelper.ChangeEnableByControl(panel1.Controls, false, gridViews);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gridViews);
toolBarMenu1.currentAction = "";
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
}
+ else
+ MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
@@ -234,7 +280,11 @@
/// <param name="pageSize">姣忛〉鍑犳潯</param>
private void getPageList(int curPage)
{
- var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+ gcMain1.DataSource = null;
+ System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
+ _sbSqlWhere.Append(" and a.FSubsidiary in");
+ _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere());
+ _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList));
var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "org.FNumber asc ,a.depot_code", "asc",
"", _sbSqlWhere.ToString());
var json = JsonConvert.SerializeObject(pgq);
@@ -246,16 +296,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();
}
else
- UtilityHelper.SetDefaultTable(gcMain, gridView1);
+ UtilityHelper.SetDefaultTable(gcMain1, gridView1);
gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
pageBar1.TotalPages = dd.rtnData.pages;//鎬婚〉
pageBar1.CurrentPage = curPage;//褰撳墠椤�
@@ -298,7 +348,7 @@
lbGuid.Text = strGuid;
var gvList = new List<GridView>();
gvList.Add(gvMx1);
- UtilityHelper.SetValueByObj(panel1.Controls, dy, isEdit, gvList);
+ UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
var _job = JObject.Parse(strJson);
var array = new JArray();
foreach (var a in _job["rtnData"]["list"]) array.Add(a);
@@ -363,5 +413,6 @@
}
}
}
+
}
}
\ No newline at end of file
--
Gitblit v1.9.3