From f335ea408e22a95b54f6332697b575b474b3863f Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期五, 07 十一月 2025 16:52:00 +0800
Subject: [PATCH] ID转姓名:生产补料申请、生产补料单、生产超领申请、生产超领单。(用户控件实现)
---
DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTui.cs | 199 ++++++++++++++++++++++++++++++-------------------
1 files changed, 120 insertions(+), 79 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTui.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTui.cs
index 95ca2bb..ddbe7d8 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTui.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTui.cs
@@ -13,10 +13,10 @@
{
public partial class Frm_MesShouTui : DevExpress.XtraEditors.XtraForm
{
- string _webServiceName = "MesCgthSqManager/";
+ string _webServiceName = "MesShouTuiManager/";
List<FilterEntity> _filterList = new List<FilterEntity>();
string _ucCk = "";//鍙戞枡浠撳簱
- string _ucGys = "";//渚涘簲鍟�
+ string _ucKh = "";//瀹㈡埛
public Frm_MesShouTui()
{
InitializeComponent();
@@ -32,63 +32,82 @@
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.SetGridViewParameter(gridView1, picCheckBox, this, "isCheck", "", (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_thOrgId.EditChanged += (s, e) =>
+ txt_fStockOrgId.EditChanged += (s, e) =>
{
- var orgId = txt_thOrgId.GetId();
+ var orgId = txt_fStockOrgId.GetId();
if (string.IsNullOrEmpty(orgId))
return;
- txt_suppId.getSuppler(orgId, _ucGys);
- txt_depotId.getSuppler(orgId, _ucCk);
+ txt_fCustId.getSuppler(orgId, _ucKh);
+ //2025-08-11鍔犱笂鍙兘鏄唬绠′粨
+ txt_fStockId.getSuppler(orgId, _ucCk, " and a.depot_id in(select [浠撳簱Id] from [dbo].[浠撳簱灞炴� where [鏄惁浠g鑹搧浠揮=1 )");
};
//閫夋嫨闇�瑕佺殑鏄庣粏
btnSelect.Click += (s, e) =>
{
- if (string.IsNullOrEmpty(this.txt_suppId.GetId()))
+ if (string.IsNullOrEmpty(this.txt_fStockOrgId.GetId()))
{
- Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨渚涘簲鍟嗭紒");
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨缁勭粐锛�");
+ this.txt_fStockOrgId.Focus();
return;
}
- var frm = new SelectMesCgthSq(this.txt_suppId.GetId(), this.txt_thOrgId.GetId(), (txt_isOut.Checked == true ? 1 : 0).ToString());
+ if (string.IsNullOrEmpty(this.txt_fCustId.GetId()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨瀹㈡埛锛�");
+ this.txt_fCustId.Focus();
+ return;
+ }
+ if (string.IsNullOrEmpty(this.txt_fStockId.GetId()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浠撳簱锛�");
+ this.txt_fStockId.Focus();
+ return;
+ }
+ var frm = new SelectShuoTuiSq(this.txt_fCustId.GetId(), txt_fStockOrgId.GetId(), txt_fStockId.GetId(), txt_fHasLinkRad.SelectedIndex.ToString());
//璧嬪�肩粰鏄庣粏琛�
frm.UpdateParent += (ss, ee) =>
{
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["aboutGuid"] = dym.rkmxGuid;
+ _row["rkNo"] = dym.invBillNo;
+ _row["wlbm"] = dym.itemNo;
+ _row["wlmc"] = dym.itemName;
+ _row["wlgg"] = dym.itemModel;
+ _row["dwName"] = dym.dwName;
+ _row["fQty"] = dym.kt;
+ _row["sQty"] = 0;
+ _row["itemId"] = dym.itemId;
+ _Table.Rows.Add(_row);
}
gcMx1.BindingContext = new BindingContext();
- gcMx1.DataSource = _oldTable;
+ gcMx1.DataSource = _Table;
gcMx1.ForceInitialize();
+ gvMx1.CloseEditor();
+ gvMx1.PostEditor();
+ gvMx1.UpdateCurrentRow();
}
catch (Exception ex)
{
- MessageBox.Show(ex.Message);
+ Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message);
}
};
frm.ShowDialog();
@@ -132,7 +151,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();
}
@@ -188,7 +207,7 @@
lbGuid, txt_billNo, gridView1, "billNo");
if (string.IsNullOrEmpty(rowGuid))
{
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵"))
@@ -206,20 +225,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>
@@ -257,7 +276,7 @@
lbGuid, txt_billNo, gridView1);
if (string.IsNullOrEmpty(rowGuid))
{
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
@@ -271,6 +290,10 @@
gvList.Add(gvMx1);
UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
}
+ //2025/07/12鍔犱笂淇敼鐘舵�佷笅涓嶈兘淇敼
+ txt_fStockOrgId.IsReadly = true;
+ txt_fCustId.IsReadly = true;
+ txt_fHasLinkRad.ReadOnly = true;
}
/// <summary>
/// 鏂板浜嬩欢
@@ -285,6 +308,9 @@
gridViews.Add(gvMx1);
UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
+ //澧炲姞鏃讹紝榛樿缁勭粐
+ string deftOrg = UtilityHelper.GetFirstOrg(txt_fStockOrgId);
+
}
/// <summary>
/// 淇濆瓨浜嬩欢
@@ -294,50 +320,45 @@
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();
+ var _ckId = txt_fStockId.GetId();
+ var _khId = txt_fCustId.GetId();
+ string _orgId = txt_fStockOrgId.GetId();
if (string.IsNullOrEmpty(_orgId))
{
- MsgHelper.Warning("璇烽�夋嫨缁勭粐锛�");
- txt_thOrgId.Focus();
- return;
- }
- if (string.IsNullOrEmpty(_gysId))
- {
- MsgHelper.Warning("璇烽�夋嫨渚涘簲鍟嗭紒");
- txt_suppId.Focus();
+ MsgHelper.ShowError("璇烽�夋嫨缁勭粐锛�");
+ txt_fStockOrgId.Focus();
return;
}
if (string.IsNullOrEmpty(_ckId))
{
- MsgHelper.Warning("璇烽�夋嫨浠撳簱锛�");
- txt_depotId.Focus();
+ MsgHelper.ShowError("璇烽�夋嫨浠撳簱锛�");
+ txt_fStockId.Focus();
return;
}
- if (txt_returnMethod.SelectedIndex <= 0)
+ if (string.IsNullOrEmpty(_khId))
{
- MsgHelper.Warning("璇烽�夋嫨閫�鏂欐柟寮忥紒");
- txt_returnMethod.Focus();
+ MsgHelper.ShowError("璇烽�夋嫨瀹㈡埛锛�");
+ txt_fCustId.Focus();
return;
}
- if (txt_returnType.SelectedIndex <= 0)
+ if (txt_fReturnStyle.SelectedIndex <= 0)
{
- MsgHelper.Warning("璇烽�夋嫨閫�鏂欏師鍥狅紒");
- txt_returnType.Focus();
+ MsgHelper.ShowError("璇烽�夋嫨閫�鏂欐柟寮忥紒");
+ txt_fReturnStyle.Focus();
return;
}
var _obj = new
{
Guid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(lbGuid.Text.Trim()), //鍒拌揣鍗曚富閿�
+ KcZz = _orgId,
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,//閫�鏂欏師鍥�
+ CusId = int.Parse(_khId),
+ DepotId = int.Parse(_ckId),
+ FIsLink = txt_fHasLinkRad.SelectedIndex,//鏈夋棤婧愬崟
+ FReturnStyle = txt_fReturnStyle.Text,//閫�鏂欐柟寮�
list = new List<dynamic>(),
};
+ gvMx1.PostEditor();
gvMx1.CloseEditor();
gvMx1.UpdateCurrentRow();
if (gvMx1.DataRowCount <= 0)
@@ -350,19 +371,26 @@
var row = gvMx1.GetDataRow(i);
if (row != null)
{
- Guid _guid = UtilityHelper.ToGuid(row["id"].ToString());
- string _msl = row["sqNum"].ToString();
+ Guid _guid = UtilityHelper.ToGuid(row["guid"].ToString());
+ string _msl = row["fQty"].ToString();
if (string.IsNullOrEmpty(_msl))
{
MsgHelper.ShowError("鐢宠鏁伴噺涓嶈兘涓虹┖锛�");
return;
}
+ if (string.IsNullOrEmpty(row["fStockStatusId"].ToString()) || row["fStockStatusId"].ToString() == "璇烽�夋嫨")
+ {
+ MsgHelper.ShowError("璇烽�夋嫨搴撳瓨鐘舵�侊紒");
+ return;
+ }
_obj.list.Add(new
{
Guid = _guid,
- AboutGuid = UtilityHelper.ToGuid(row["rkmxGuid"].ToString()),
- Quantity = decimal.Parse(row["sqNum"].ToString()),
+ AboutGuid = UtilityHelper.ToGuid(row["aboutGuid"].ToString()),
+ Quantity = decimal.Parse(row["fQty"].ToString()),
Bz = row["remark"].ToString(),
+ ItemId = row["itemId"].ToString(),
+ FStockStatusId = row["fStockStatusId"].ToString(),
});
}
}
@@ -372,9 +400,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;
@@ -382,11 +410,14 @@
gvList.Add(gvMx1);
UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList);
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);
}
}
@@ -397,7 +428,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.FStockOrgId 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
@@ -413,7 +448,7 @@
{
gcMain1.DataSource = dt;
gcMain1.ForceInitialize();
- gridView1.BestFitColumns();
+ gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
}
else
UtilityHelper.SetDefaultTable(gcMain1, gridView1);
@@ -439,7 +474,7 @@
if (toolBarMenu1.currentAction == "edit") isEdit = true;
if (string.IsNullOrEmpty(strGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
var _obj = new
@@ -453,13 +488,13 @@
if (_rtn.rtnCode > 0)
{
dynamic dy = _rtn.rtnData;
- _ucGys = dy.suppId;
- _ucCk = dy.depotId;
+ _ucKh = dy.fCustId;
+ _ucCk = dy.fStockId;
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 = "";
+ _ucKh = "";
_ucCk = "";
JObject _job = JObject.Parse(strJson);
JArray array = new JArray();
@@ -481,11 +516,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>
@@ -509,7 +544,7 @@
(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1, "billNo");
if (string.IsNullOrEmpty(rowGuid))
{
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵"))
@@ -525,26 +560,30 @@
_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());
}
int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
gridView1.FocusedRowHandle = rowHandle;
- UtilityHelper.SetCheckIco(gridView1, "status", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString());
+ UtilityHelper.SetCheckIco(gridView1, "isCheck", "checkBy", "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)
{
gvMx1.CloseEditor();
+ gvMx1.PostEditor();
gvMx1.UpdateCurrentRow();
var rowhandle = gvMx1.FocusedRowHandle;
if (rowhandle < 0)
@@ -552,7 +591,7 @@
if (e.Button.Index == 0)
{
var dr = gvMx1.GetDataRow(rowhandle);
- var mxGuid = dr["id"].ToString();
+ var mxGuid = dr["guid"].ToString();
if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵"))
return;
if (string.IsNullOrEmpty(mxGuid))
@@ -573,13 +612,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