From b0046e84b9f95ce07dbbd117758da848ede67546 Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期一, 28 七月 2025 08:14:05 +0800
Subject: [PATCH] bug
---
DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs | 251 +++++++++++++++++++++++++++++++++----------------
1 files changed, 167 insertions(+), 84 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
index 535f670..8ee8dbf 100644
--- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
@@ -1,16 +1,17 @@
-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.Rk;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
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
{
@@ -18,10 +19,11 @@
{
private List<FilterEntity> _filterList = new List<FilterEntity>();
private readonly string _webServiceName = "MesInvItemArnManager/";
+ string _ucCk = "";//浠撳簱
+ string _ucGys = "";//渚涘簲鍟�
public Frm_MesInvItemArn()
{
InitializeComponent();
- pageBar1.PagerEvent += PageBar1_PagerEvent;
toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick;
toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick;
@@ -29,25 +31,23 @@
toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
- toolBarMenu1.btnJianYanClick += ToolBarMenu1_btnJianYanClick;
- toolBarMenu1.btnFjianYanClick += ToolBarMenu1_btnFjianYanClick;
+ toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
+ toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
- Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx( gvMx1);
- Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1,picCheckBox, this, "fstatus", "", (value) =>
- {
- Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
- });
+ this.toolBarMenu1.getXmlConfig();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "fstatus", "", (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);
- //浠ヤ笅涓よ鏈夊奖鍝嶆�ц兘锛屼絾鐩墠娌″ソ鏂规
- txt_suppId.getSuppler("");
- txt_depotsId.getSuppler("");
pageBar1.PagerEvent += PageBar1_PagerEvent;
//璁剧疆缁勭粐
this.txt_receiveOrgId.EditChanged += (s, e) =>
@@ -55,13 +55,7 @@
string _orgId = txt_receiveOrgId.GetId();
if (string.IsNullOrEmpty(_orgId))
return;
- txt_suppId.getSuppler(_orgId);
- txt_depotsId.getSuppler(_orgId);
- };
- //璁剧疆浠撳簱閫夋嫨
- this.txt_depotsId.EditChanged += (s, e) =>
- {
- txtDepotsCode.Text = this.txt_depotsId.GetCode();
+ txt_suppId.getSuppler(_orgId, _ucGys);
};
//璁剧疆渚涘簲鍟嗛�夋嫨
this.txt_suppId.EditChanged += (s, e) =>
@@ -71,12 +65,18 @@
//閫夋嫨闇�瑕佸叆搴撶殑鏄庣粏
btnSelect.Click += (s, e) =>
{
+ if (string.IsNullOrEmpty(this.txt_receiveOrgId.GetId()))
+ {
+ MsgHelper.Warning("璇烽�夋嫨鏀舵枡缁勭粐锛�");
+ txt_receiveOrgId.Focus();
+ return;
+ }
if (string.IsNullOrEmpty(this.txt_suppId.GetId()))
{
Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨渚涘簲鍟嗭紝鎵嶈兘閫夋嫨鏉ユ枡鏄庣粏锛�");
return;
}
- var frm = new SelectCgMx(this.txt_suppId.GetId(), txt_receiveOrgId.GetId(), (txt_fType.Checked == true ? 2 : 1).ToString());
+ var frm = new SelectCgMx(this.txt_suppId.GetId(), txt_receiveOrgId.GetId());
//璧嬪�肩粰鏄庣粏琛�
frm.UpdateParent += (ss, ee) =>
{
@@ -84,19 +84,59 @@
{
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;
+ string strReturn = "";
+ ReturnModel<DataTable> dt;
DataTable _oldTable = (DataTable)gcMx1.DataSource;
- DataRow[] sourceRows = _newTable.Select();
- for (int i = 0; i < sourceRows.Length; i++)
+ #region 杩欐槸Srm鏉ョ殑鍗曞瓙
+ if (lst == null)
{
- _oldTable.ImportRow(sourceRows[i]);
+ string strSrmNo = "";
+ List<dynamic> lstSrm = new List<dynamic>();
+ lstSrm = ee.DynamicList;
+ strSrmNo = lstSrm[0].guid;
+ txt_paperBillNo.Text = strSrmNo;
+ var _obj = new
+ {
+ inShdh = strSrmNo,
+ inP1 = "",
+ inP2 = ""
+ };
+ strReturn = UtilityHelper.HttpPost("", _webServiceName + "SelectSrmTo", JsonConvert.SerializeObject(_obj));
+ dt = UtilityHelper.ReturnToList(strReturn);
+ //绂佹淇敼鏁伴噺
+ gvMx1quantity.OptionsColumn.ReadOnly = true;
+ txt_paperBillNo.ReadOnly = true;
+ txt_isSrm.Checked = true;
+ DataTable _newTable = dt.rtnData;
+ _oldTable = _newTable;
}
+ #endregion
+ #region 杩欐槸鏅�氱殑鍗�
+ else
+ {
+ txt_paperBillNo.Text = "";
+ var _obj = lst;
+ strReturn = UtilityHelper.HttpPost("", _webServiceName + "SelectFormTo", JsonConvert.SerializeObject(_obj));
+ dt = UtilityHelper.ReturnToList(strReturn);
+ //淇敼鏁伴噺
+ gvMx1quantity.OptionsColumn.ReadOnly = false;
+ txt_paperBillNo.ReadOnly = false;
+ txt_isSrm.Checked = false;
+ DataTable _newTable = dt.rtnData;
+ DataRow[] sourceRows = _newTable.Select();
+ for (int i = 0; i < sourceRows.Length; i++)
+ {
+ _oldTable.ImportRow(sourceRows[i]);
+ }
+ }
+ #endregion
gcMx1.BindingContext = new BindingContext();
gcMx1.DataSource = _oldTable;
gcMx1.ForceInitialize();
+ gvMx1.PostEditor();
+ gvMx1.UpdateCurrentRow();
+ gvMx1.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
}
catch (Exception ex)
{
@@ -107,9 +147,10 @@
};
}
+
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);
}
@@ -134,7 +175,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();
}
@@ -163,24 +204,13 @@
toolBarMenu1.guidKey = rowGuid;
}
- /// <summary>
- /// 鍙嶆楠�
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ToolBarMenu1_btnFjianYanClick(object sender, EventArgs e)
- {
- _toolCk("EditModelSubmitF");
- }
-
- /// <summary>
- /// 妫�楠�
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e)
+ private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
{
_toolCk("EditModelSubmit");
+ }
+ private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
+ {
+ _toolCk("EditModelSubmitF");
}
/// <summary>
/// 鍙栨秷浜嬩欢
@@ -226,12 +256,14 @@
else
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
getPageList(this.pageBar1.CurrentPage);
+ MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
}
- MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ else
+ MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
@@ -270,7 +302,7 @@
lbGuid, txt_billNo, gridView1);
if (string.IsNullOrEmpty(rowGuid))
{
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
@@ -282,8 +314,12 @@
{
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);
}
+ //2025/07/12鍔犱笂淇敼鐘舵�佷笅涓嶈兘淇敼渚涘簲鍟嗗拰缁勭粐srm,绂佺敤
+ setSrm();
+ txt_receiveOrgId.IsReadly = true;
+ txt_suppId.IsReadly = true;
}
/// <summary>
@@ -297,8 +333,12 @@
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_receiveOrgId);
+ txt_isSrm.Checked = false;
+ setSrm();
}
/// <summary>
@@ -310,24 +350,17 @@
{
toolBarMenu1.isSetBtn = false;
string _orgId = txt_receiveOrgId.GetId();
- string _ckId = txt_depotsId.GetId(); //浠撳簱缂栧彿 depots_code
string _gysId = txt_suppId.GetId(); //渚涘簲鍟嗙紪鍙�
if (string.IsNullOrEmpty(_orgId))
{
- MsgHelper.Warning("璇烽�夋嫨鏀舵枡缁勭粐锛�");
+ MsgHelper.ShowError("璇烽�夋嫨鏀舵枡缁勭粐锛�");
txt_receiveOrgId.Focus();
return;
}
if (string.IsNullOrEmpty(_gysId))
{
- MsgHelper.Warning("璇烽�夋嫨渚涘簲鍟嗭紒");
+ MsgHelper.ShowError("璇烽�夋嫨渚涘簲鍟嗭紒");
txt_suppId.Focus();
- return;
- }
- if (string.IsNullOrEmpty(_ckId))
- {
- MsgHelper.Warning("璇烽�夋嫨浠撳簱锛�");
- txt_depotsId.Focus();
return;
}
var _obj = new
@@ -336,12 +369,12 @@
PaperBillNo = txt_paperBillNo.Text.Trim(), //閫佽揣鍗曞彿;
Remark = txt_remark.Text.Trim(), //澶囨敞
SuppId = _gysId, //渚涘簲鍟�
- DepotsId = _ckId,//浠撳簱
- FType = txt_fType.Checked ? 1 : 0,//0=閲囪喘锛�1=濮斿
OrgId = _orgId,
+ IsSrm = (txt_isSrm.Checked ? 1 : 0),
list = new List<dynamic>(),
};
gvMx1.CloseEditor();
+ gvMx1.PostEditor();
gvMx1.UpdateCurrentRow();
if (gvMx1.DataRowCount <= 0)
{
@@ -366,7 +399,8 @@
AboutGuid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(row["aboutGuid"].ToString()),
ItemId = int.Parse(row["itemId"].ToString()),
Quantity = decimal.Parse(row["quantity"].ToString()),
- UrgentFlag = Gs.DevApp.ToolBox.UtilityHelper.ToBit(row["urgentFlag"].ToString()),
+ UrgentFlag = (row["urgentFlagTxt"].ToString().Replace(":","").Replace("鏅��", "").Replace("鎬ユ枡", "").Replace("涓�鑸�", "")),
+ Remark = row["memo"].ToString(),
});
}
}
@@ -376,20 +410,24 @@
_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;
+ txt_billNo.Text = _rtn.rtnData.outNo;
toolBarMenu1.isSetBtn = true;
List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gvList.Add(gvMx1);
- UtilityHelper.ChangeEnableByControl(panel1.Controls, false);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false);
+ 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);
}
}
@@ -399,7 +437,7 @@
/// <param name="pageSize">姣忛〉鍑犳潯</param>
private void getPageList(int curPage)
{
- var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+ gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date",
"asc", "", _sbSqlWhere.ToString());
var json = JsonConvert.SerializeObject(pgq);
@@ -411,16 +449,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();
- gridView1.BestFitColumns();
+ 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;//褰撳墠椤�
@@ -460,10 +498,14 @@
if (_rtn.rtnCode > 0)
{
var dy = _rtn.rtnData;
+ _ucGys = dy.suppId;
+ _ucCk = dy.depotsId;
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);
+ _ucGys = "";
+ _ucCk = "";
var _job = JObject.Parse(strJson);
var array = new JArray();
foreach (var a in _job["rtnData"]["list"]) array.Add(a);
@@ -476,6 +518,7 @@
gcMx1.DataSource = dt;
gcMx1.ForceInitialize();
gvMx1.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
}
else
{
@@ -561,7 +604,6 @@
}
var lst = new List<string>();
lst.Add(mxGuid);
-
var _obj = lst;
try
{
@@ -571,13 +613,14 @@
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
-
+ MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
}
- MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
+ else
+ MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
}
@@ -607,9 +650,9 @@
_webServiceName + _meth,
JsonConvert.SerializeObject(_obj));
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
- MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnData.outMsg);
if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
{
+ MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnData.outMsg);
if (xtraTabControl1.SelectedTabPageIndex == 1)
{
getModel(lbGuid.Text.Trim());
@@ -619,12 +662,52 @@
int _inFieldValue = (_meth == "EditModelSubmit" ? 1 : -1);
UtilityHelper.SetCheckIco(gridView1, "fstatus", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString());
}
+ else
+ MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnData.outMsg);
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
+ /// <summary>
+ /// 鏌ョ湅鍒拌揣璁板綍锛屾牴鎹噰璐槑缁唃uid
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void rptHistory_ButtonClick(object sender, ButtonPressedEventArgs e)
+ {
+ var rowhandle = gvMx1.FocusedRowHandle;
+ if (rowhandle < 0)
+ return;
+ var dr = gvMx1.GetDataRow(rowhandle);
+ var mxGuid = dr["aboutGuid"].ToString();
+ HistoryDhmxcs frm = new HistoryDhmxcs(mxGuid);
+ frm.ShowDialog();
+ }
+
+ private void setSrm()
+ {
+ bool isSrm = (txt_isSrm.Checked);
+ if (isSrm == true)
+ {
+ gvMx1quantity.OptionsColumn.ReadOnly = true;
+ txt_paperBillNo.ReadOnly = true;
+ txt_isSrm.Checked = true;
+ txt_receiveOrgId.IsReadly = true;
+ txt_suppId.IsReadly = true;
+ btnSelect.Enabled = false;
+ }
+ else
+ {
+ gvMx1quantity.OptionsColumn.ReadOnly = false;
+ txt_paperBillNo.ReadOnly = false;
+ txt_isSrm.Checked = false;
+ txt_receiveOrgId.IsReadly = false;
+ txt_suppId.IsReadly = false;
+ btnSelect.Enabled = true;
+ }
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.3