From b73c48f8aac079b85551d6fc05772c3b335c917f Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 20 三月 2025 17:18:53 +0800
Subject: [PATCH] 用户管理
---
DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSq.cs | 135 +++++++++++++++++++++++++++++++-------------
1 files changed, 95 insertions(+), 40 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSq.cs b/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSq.cs
index edd4f5b..caad93f 100644
--- a/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSq.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSq.cs
@@ -15,6 +15,8 @@
{
string _webServiceName = "MesCgthSqManager/";
List<FilterEntity> _filterList = new List<FilterEntity>();
+ string _ucCk = "";//鍙戞枡浠撳簱
+ string _ucGys = "";//渚涘簲鍟�
public Frm_MesCgthSq()
{
InitializeComponent();
@@ -27,6 +29,8 @@
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
+ toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
+ this.toolBarMenu1.getXmlConfig();
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "status", "", (value) =>
{
@@ -41,17 +45,24 @@
});
getPageList(1);
pageBar1.PagerEvent += PageBar1_PagerEvent;
- txt_depotId.getSuppler("");
- txt_suppId.getSuppler("");
+ //閫夋嫨搴撳瓨缁勭粐锛堜粨搴撳拰渚涘簲鍟嗭級
+ txt_thOrgId.EditChanged += (s, e) =>
+ {
+ var orgId = txt_thOrgId.GetId();
+ if (string.IsNullOrEmpty(orgId))
+ return;
+ txt_suppId.getSuppler(orgId, _ucGys);
+ txt_depotId.getSuppler(orgId, _ucCk);
+ };
//閫夋嫨闇�瑕佺殑鏄庣粏
btnSelect.Click += (s, e) =>
{
if (string.IsNullOrEmpty(this.txt_suppId.GetId()))
{
- Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨渚涘簲鍟嗭紝鎵嶈兘閫夋嫨鏉ユ枡鏄庣粏锛�");
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨渚涘簲鍟嗭紒");
return;
}
- var frm = new SelectMesCgthSq(this.txt_suppId.GetId());
+ var frm = new SelectMesCgthSq(this.txt_suppId.GetId(), this.txt_thOrgId.GetId());
//璧嬪�肩粰鏄庣粏琛�
frm.UpdateParent += (ss, ee) =>
{
@@ -85,11 +96,23 @@
}
private async void GridView1_ColumnFilterChanged(object sender, EventArgs e)
{
- _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
+ _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
await Task.Delay(100);
getPageList(1);
}
-
+ /// <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_billNo, gridView1);
+ toolBarMenu1.guidKey = rowGuid;
+ }
/// <summary>
/// 鍒嗛〉浜嬩欢
/// </summary>
@@ -150,7 +173,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>
@@ -183,8 +206,11 @@
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- getPageList(1);
+ if (xtraTabControl1.SelectedTabPageIndex == 0)
+ { }
+ else
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
+ getPageList(this.pageBar1.CurrentPage);
}
MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
@@ -207,14 +233,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>
@@ -224,17 +251,26 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
{
+ toolBarMenu1.currentAction = "edit";
string rowGuid = "", rowName = "";
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1, "blNo");
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+ lbGuid, txt_billNo, gridView1);
if (string.IsNullOrEmpty(rowGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
- List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
- gvList.Add(gvMx1);
- UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList);
+ if (xtraTabControl1.SelectedTabPageIndex == 1)
+ {
+ getModel(rowGuid);
+ }
+ else
+ {
+ List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+ gvList.Add(gvMx1);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
+ }
}
/// <summary>
/// 鏂板浜嬩欢
@@ -247,7 +283,7 @@
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gridViews.Add(gvMx1);
- UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
+ UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
}
/// <summary>
@@ -260,6 +296,13 @@
toolBarMenu1.isSetBtn = false;
var _ckId = txt_depotId.GetId(); //浠撳簱缂栧彿 depots_code
var _gysId = txt_suppId.GetId(); //渚涘簲鍟嗙紪鍙�
+ string _orgId = txt_thOrgId.GetId();
+ if (string.IsNullOrEmpty(_orgId))
+ {
+ MsgHelper.Warning("璇烽�夋嫨缁勭粐锛�");
+ txt_thOrgId.Focus();
+ return;
+ }
if (string.IsNullOrEmpty(_gysId))
{
MsgHelper.Warning("璇烽�夋嫨渚涘簲鍟嗭紒");
@@ -272,15 +315,15 @@
txt_depotId.Focus();
return;
}
- if (string.IsNullOrEmpty(txt_returnMethod.Text.Trim()))
+ if (txt_returnMethod.SelectedIndex <= 0)
{
MsgHelper.Warning("璇烽�夋嫨閫�鏂欐柟寮忥紒");
txt_returnMethod.Focus();
return;
}
- if (string.IsNullOrEmpty(txt_returnType.Text.Trim()))
+ if (txt_returnType.SelectedIndex <= 0)
{
- MsgHelper.Warning("璇烽�夋嫨閫�鏂欑被鍨嬶紒");
+ MsgHelper.Warning("璇烽�夋嫨閫�鏂欏師鍥狅紒");
txt_returnType.Focus();
return;
}
@@ -292,10 +335,11 @@
DepotId = int.Parse(_ckId),//浠撳簱
FType = txt_isOut.Checked == true ? 1 : 0, //0=閲囪喘锛�1=濮斿
Fmrmode = txt_returnMethod.Text,//閫�鏂欐柟寮�
- Reason = txt_returnType.Text,//閫�鏂欑被鍨�
+ Reason = txt_returnType.Text,//閫�鏂欏師鍥�
list = new List<dynamic>(),
};
gvMx1.CloseEditor();
+ gvMx1.PostEditor();
gvMx1.UpdateCurrentRow();
if (gvMx1.DataRowCount <= 0)
{
@@ -332,9 +376,13 @@
MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
if (_rtn.rtnCode > 0)
{
- lbGuid.Text = _rtn.rtnData;
+ lbGuid.Text = _rtn.rtnData.outGuid;
+ txt_billNo.Text = _rtn.rtnData.outNo;
toolBarMenu1.isSetBtn = true;
- UtilityHelper.ChangeEnableByControl(panel1.Controls, false);
+ List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+ gvList.Add(gvMx1);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList);
+ toolBarMenu1.currentAction = "";
}
}
catch (Exception ex)
@@ -360,15 +408,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;//褰撳墠椤�
@@ -405,10 +454,14 @@
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.panel1.Controls, dy, isEdit, gvList);
+ UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
+ _ucGys = "";
+ _ucCk = "";
JObject _job = JObject.Parse(strJson);
JArray array = new JArray();
foreach (var a in _job["rtnData"]["list"])
@@ -421,6 +474,7 @@
gcMx1.BindingContext = new BindingContext();
gcMx1.DataSource = dt;
gcMx1.ForceInitialize();
+ gvMx1.BestFitColumns();
}
else
{
@@ -435,7 +489,6 @@
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
-
/// <summary>
/// 宸ュ叿鏉′簨浠�
/// </summary>
@@ -474,24 +527,26 @@
JsonConvert.SerializeObject(_obj));
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
- if (_rtn.rtnCode > 0)
+ if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 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());
}
}
catch (Exception ex)
{
MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
-
}
-
private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
{
gvMx1.CloseEditor();
+ gvMx1.PostEditor();
gvMx1.UpdateCurrentRow();
var rowhandle = gvMx1.FocusedRowHandle;
if (rowhandle < 0)
--
Gitblit v1.9.3