From 5a7f68bf4dbbdca1abbb939bd43e1fb695bc7c0b Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期六, 23 八月 2025 15:39:04 +0800
Subject: [PATCH] 数据过滤
---
DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesSctkSq.cs | 107 +++++++++++++++++++++++++++++++++--------------------
1 files changed, 67 insertions(+), 40 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesSctkSq.cs b/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesSctkSq.cs
index fe954d2..ca64647 100644
--- a/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesSctkSq.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesSctkSq.cs
@@ -16,7 +16,6 @@
string _webServiceName = "MesSctkSqManager/";
List<FilterEntity> _filterList = new List<FilterEntity>();
string _ucCk = "";//鍙戞枡浠撳簱
- string _ucGys = "";//渚涘簲鍟�
public Frm_MesSctkSq()
{
InitializeComponent();
@@ -45,7 +44,7 @@
}, lbGuid);
getPageList(1);
pageBar1.PagerEvent += PageBar1_PagerEvent;
- //閫夋嫨搴撳瓨缁勭粐锛堜粨搴撳拰渚涘簲鍟嗭級
+ //閫夋嫨搴撳瓨缁勭粐锛堜粨搴擄級
txt_thOrgId.EditChanged += (s, e) =>
{
var orgId = txt_thOrgId.GetId();
@@ -72,23 +71,33 @@
{
try
{
- var lst = new List<string>();
- lst = ee.StringList;
- var _obj = lst;
- var strReturn = UtilityHelper.HttpPost("",
- _webServiceName + "SelectFormTo",
- JsonConvert.SerializeObject(_obj));
- var dt = UtilityHelper.ReturnToList(strReturn);
- DataTable _newTable = dt.rtnData;
- DataTable _oldTable = (DataTable)gcMx1.DataSource;
- DataRow[] sourceRows = _newTable.Select();
- for (int i = 0; i < sourceRows.Length; i++)
+ var lst = ee.DynamicList;
+ DataTable _Table = (DataTable)gcMx1.DataSource;
+ foreach (dynamic dym in lst)
{
- _oldTable.ImportRow(sourceRows[i]);
+ DataRow _row = _Table.NewRow();
+ _row["rkmxGuid"] = dym.rkmxGuid;
+ _row["id"] = "";
+ _row["mid"] = "";
+ _row["workShop"] = dym.workShop;
+ _row["itemId"] = dym.itemId;
+ _row["itemNo"] = dym.itemNo;
+ _row["itemName"] = dym.itemName;
+ _row["itemModel"] = dym.itemModel;
+ _row["dwName"] = dym.dwName;
+ // _row["sqNum"] = "";
+ _row["ysNum"] = "0";
+ _row["remark"] = "";
+ _Table.Rows.Add(_row);
}
gcMx1.BindingContext = new BindingContext();
- gcMx1.DataSource = _oldTable;
+ gcMx1.DataSource = _Table;
gcMx1.ForceInitialize();
+ gvMx1.CloseEditor();
+ gvMx1.PostEditor();
+ gvMx1.UpdateCurrentRow();
+ gvMx1.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
}
catch (Exception ex)
{
@@ -192,7 +201,7 @@
lbGuid, txt_billNo, gridView1, "billNo");
if (string.IsNullOrEmpty(rowGuid))
{
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵"))
@@ -210,20 +219,20 @@
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
+ MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
if (xtraTabControl1.SelectedTabPageIndex == 0)
{ }
else
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
getPageList(this.pageBar1.CurrentPage);
}
-
- MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ else
+ MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
-
}
/// <summary>
@@ -261,7 +270,7 @@
lbGuid, txt_billNo, gridView1);
if (string.IsNullOrEmpty(rowGuid))
{
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
@@ -275,6 +284,8 @@
gvList.Add(gvMx1);
UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
}
+ //2025/07/12鍔犱笂淇敼鐘舵�佷笅涓嶈兘淇敼
+ txt_thOrgId.IsReadly = true;
}
/// <summary>
/// 鏂板浜嬩欢
@@ -302,28 +313,29 @@
string _orgId = txt_thOrgId.GetId();
if (string.IsNullOrEmpty(_orgId))
{
- MsgHelper.Warning("璇烽�夋嫨缁勭粐锛�");
+ MsgHelper.ShowError("璇烽�夋嫨缁勭粐锛�");
txt_thOrgId.Focus();
return;
}
if (string.IsNullOrEmpty(_ckId))
{
- MsgHelper.Warning("璇烽�夋嫨浠撳簱锛�");
+ MsgHelper.ShowError("璇烽�夋嫨浠撳簱锛�");
txt_depotId.Focus();
return;
}
- if (txt_returnType.SelectedIndex <= 0)
+ if (txt_returnType.TextTxt.Length <= 0)
{
- MsgHelper.Warning("璇烽�夋嫨閫�鏂欏師鍥狅紒");
+ MsgHelper.ShowError("璇烽�夋嫨閫�搴撳師鍥狅紒");
txt_returnType.Focus();
return;
}
var _obj = new
{
- Guid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(lbGuid.Text.Trim()), //鍒拌揣鍗曚富閿�
+ Guid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(lbGuid.Text.Trim()),
+ OrgId = txt_thOrgId.GetId(),//閫夋嫨缁勭粐
Remark = txt_remark.Text.Trim(), //澶囨敞
DepotId = int.Parse(_ckId),//浠撳簱
- Reason = txt_returnType.Text,//閫�鏂欏師鍥�
+ Reason = txt_returnType.TextTxt,//閫�鏂欏師鍥�
list = new List<dynamic>(),
};
gvMx1.CloseEditor();
@@ -346,6 +358,12 @@
MsgHelper.ShowError("鐢宠鏁伴噺涓嶈兘涓虹┖锛�");
return;
}
+ _msl = row["remark"].ToString();
+ if (string.IsNullOrEmpty(_msl))
+ {
+ MsgHelper.ShowError("鐢宠澶囨敞涓嶈兘涓虹┖锛�");
+ return;
+ }
_obj.list.Add(new
{
Guid = _guid,
@@ -361,9 +379,9 @@
_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.outGuid;
txt_billNo.Text = _rtn.rtnData.outNo;
toolBarMenu1.isSetBtn = true;
@@ -373,10 +391,12 @@
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);
}
}
@@ -387,7 +407,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.TH_ORG_ID in");
+ _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere());
+ _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList));
PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "BILL_NO", "asc", "", _sbSqlWhere.ToString());
string json = JsonConvert.SerializeObject(pgq);
try
@@ -443,13 +467,11 @@
if (_rtn.rtnCode > 0)
{
dynamic dy = _rtn.rtnData;
- _ucGys = dy.suppId;
_ucCk = dy.depotId;
lbGuid.Text = strGuid;
List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gvList.Add(gvMx1);
UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
- _ucGys = "";
_ucCk = "";
JObject _job = JObject.Parse(strJson);
JArray array = new JArray();
@@ -472,11 +494,11 @@
}
}
else
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
/// <summary>
@@ -494,7 +516,8 @@
case 0:
strMsg = "鍙嶅鏍�";
break;
- };
+ }
+ ;
toolBarMenu1.guidKey = "";
string rowGuid, rowName;
(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1, "billNo");
@@ -516,9 +539,9 @@
_webServiceName + "EditModelSubmit",
JsonConvert.SerializeObject(_obj));
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
- MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
{
+ MsgHelper.ShowInformation(_rtn.rtnData.outMsg.ToString());
if (xtraTabControl1.SelectedTabPageIndex == 1)
{
getModel(lbGuid.Text.Trim());
@@ -527,10 +550,12 @@
gridView1.FocusedRowHandle = rowHandle;
UtilityHelper.SetCheckIco(gridView1, "status", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString());
}
+ else
+ MsgHelper.ShowError(_rtn.rtnData.outMsg.ToString());
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
@@ -565,13 +590,15 @@
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
- if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
+ MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
+ getModel(lbGuid.Text);
}
- MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ else
+ MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
}
--
Gitblit v1.9.3