From 2057778ce796422f1dab4ec011ca66eb1faf66cf Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期日, 13 七月 2025 10:00:15 +0800
Subject: [PATCH] bug
---
DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSq.cs | 171 +++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 123 insertions(+), 48 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSq.cs b/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSq.cs
index 4ee2fb1..e343510 100644
--- a/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSq.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSq.cs
@@ -15,6 +15,7 @@
{
string _webServiceName = "MesCgthSqManager/";
List<FilterEntity> _filterList = new List<FilterEntity>();
+ string _ucGys = "";//渚涘簲鍟�
public Frm_MesCgthSq()
{
InitializeComponent();
@@ -27,39 +28,39 @@
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) =>
{
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;
- 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);
- txt_depotId.getSuppler(orgId);
+ txt_suppId.getSuppler(orgId, _ucGys);
};
//閫夋嫨闇�瑕佺殑鏄庣粏
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) =>
{
@@ -82,6 +83,8 @@
gcMx1.BindingContext = new BindingContext();
gcMx1.DataSource = _oldTable;
gcMx1.ForceInitialize();
+ gvMx1.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
}
catch (Exception ex)
{
@@ -93,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>
@@ -117,7 +132,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();
}
@@ -191,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);
@@ -215,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>
@@ -232,23 +251,25 @@
/// <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, "billNo");
+ (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);
if (xtraTabControl1.SelectedTabPageIndex == 1)
{
- getModel(lbGuid.Text.Trim());
+ getModel(rowGuid);
}
else
{
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);
}
}
/// <summary>
@@ -262,8 +283,11 @@
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);
+ //澧炲姞鏃讹紝榛樿缁勭粐
+ string deftOrg = UtilityHelper.GetFirstOrg(txt_thOrgId);
+
}
/// <summary>
/// 淇濆瓨浜嬩欢
@@ -273,7 +297,6 @@
private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
{
toolBarMenu1.isSetBtn = false;
- var _ckId = txt_depotId.GetId(); //浠撳簱缂栧彿 depots_code
var _gysId = txt_suppId.GetId(); //渚涘簲鍟嗙紪鍙�
string _orgId = txt_thOrgId.GetId();
if (string.IsNullOrEmpty(_orgId))
@@ -288,19 +311,13 @@
txt_suppId.Focus();
return;
}
- if (string.IsNullOrEmpty(_ckId))
- {
- MsgHelper.Warning("璇烽�夋嫨浠撳簱锛�");
- 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("璇烽�夋嫨閫�鏂欏師鍥狅紒");
txt_returnType.Focus();
@@ -311,13 +328,13 @@
Guid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(lbGuid.Text.Trim()), //鍒拌揣鍗曚富閿�
Remark = txt_remark.Text.Trim(), //澶囨敞
SuppId = int.Parse(_gysId), //渚涘簲鍟�
- DepotId = int.Parse(_ckId),//浠撳簱
FType = txt_isOut.Checked == true ? 1 : 0, //0=閲囪喘锛�1=濮斿
Fmrmode = txt_returnMethod.Text,//閫�鏂欐柟寮�
Reason = txt_returnType.Text,//閫�鏂欏師鍥�
list = new List<dynamic>(),
};
gvMx1.CloseEditor();
+ gvMx1.PostEditor();
gvMx1.UpdateCurrentRow();
if (gvMx1.DataRowCount <= 0)
{
@@ -336,12 +353,19 @@
MsgHelper.ShowError("鐢宠鏁伴噺涓嶈兘涓虹┖锛�");
return;
}
+ string _depotId = row["depotId"].ToString();
+ if (string.IsNullOrEmpty(_depotId))
+ {
+ MsgHelper.ShowError("浠撳簱涓嶈兘涓虹┖锛�");
+ return;
+ }
_obj.list.Add(new
{
Guid = _guid,
AboutGuid = UtilityHelper.ToGuid(row["rkmxGuid"].ToString()),
Quantity = decimal.Parse(row["sqNum"].ToString()),
Bz = row["remark"].ToString(),
+ DepotId = row["depotId"].ToString(),
});
}
}
@@ -354,9 +378,14 @@
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 = "";
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
}
}
catch (Exception ex)
@@ -372,7 +401,7 @@
/// <param name="pageSize">姣忛〉鍑犳潯</param>
private void getPageList(int curPage)
{
- var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+ gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "BILL_NO", "asc", "", _sbSqlWhere.ToString());
string json = JsonConvert.SerializeObject(pgq);
try
@@ -382,15 +411,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;//褰撳墠椤�
@@ -406,6 +436,10 @@
ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
+ /// <summary>
+ /// 璇诲彇瀹炰綋
+ /// </summary>
+ /// <param name="strGuid"></param>
private void getModel(string strGuid)
{
bool isEdit = false;
@@ -427,10 +461,12 @@
if (_rtn.rtnCode > 0)
{
dynamic dy = _rtn.rtnData;
+ _ucGys = dy.suppId;
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 = "";
JObject _job = JObject.Parse(strJson);
JArray array = new JArray();
foreach (var a in _job["rtnData"]["list"])
@@ -443,6 +479,8 @@
gcMx1.BindingContext = new BindingContext();
gcMx1.DataSource = dt;
gcMx1.ForceInitialize();
+ gvMx1.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
}
else
{
@@ -495,23 +533,32 @@
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);
}
-
}
+
+ /// <summary>
+ /// 鍒犻櫎鏄庣粏
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
{
gvMx1.CloseEditor();
+ gvMx1.PostEditor();
gvMx1.UpdateCurrentRow();
var rowhandle = gvMx1.FocusedRowHandle;
if (rowhandle < 0)
@@ -550,5 +597,33 @@
}
}
}
+
+ /// <summary>
+ /// 鏌ユ壘浠撳簱
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void rptCk_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
+ {
+ var rowhandle = gvMx1.FocusedRowHandle;
+ if (rowhandle < 0)
+ return;
+ //var dr = gvMx1.GetDataRow(rowhandle);
+ var strOrgGuid = txt_thOrgId.GetId();
+ if (string.IsNullOrEmpty(strOrgGuid))
+ {
+ MsgHelper.Warning("鎻愮ず锛氳鍏堥�夋嫨璋冨嚭缁勭粐锛�");
+ return;
+ };
+ SelectCk frm = new SelectCk(strOrgGuid);
+ frm.UpdateParent += (ss, ee) =>
+ {
+ var lst = new List<dynamic>();
+ lst = ee.DynamicList;
+ gvMx1.SetFocusedRowCellValue("depotName", lst[0].name);
+ gvMx1.SetFocusedRowCellValue("depotId", lst[0].guid);
+ };
+ frm.ShowDialog();
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.3