From cd6496f2fadb885056c35a67fb3caf1a1a765ab1 Mon Sep 17 00:00:00 2001
From: tjx <t2856754968@163.com>
Date: 星期五, 24 十月 2025 10:11:16 +0800
Subject: [PATCH] 补充文档
---
DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs | 300 +++++++++++++++++++++++++++++++++++------------------------
1 files changed, 177 insertions(+), 123 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
index 4193d39..9b8268e 100644
--- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
@@ -1,9 +1,8 @@
-using DevExpress.Utils.VisualEffects;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
+using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Grid;
using Gs.DevApp.DevFrm.Rk;
-using Gs.DevApp.DevFrm.Rpt;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
@@ -12,7 +11,6 @@
using System;
using System.Collections.Generic;
using System.Data;
-using System.Drawing;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -37,19 +35,16 @@
toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
- toolBarMenu1.btnHbClick += ToolBarMenu1_btnHbClick;
- toolBarMenu1.btnPrintClick += ToolBarMenu1_btnPrintClick;
-
this.toolBarMenu1.getXmlConfig();
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
- Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMxL1);
-
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "fstatus", "", (value) =>
{
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
- }, tips, true, (strGuid) => {
- getModelList(strGuid);
- });
+ }, tips);
+ // 娣诲姞gridView1鐨凴owStyle浜嬩欢锛屽綋閫�璐ф爣璇唗h=1鏃舵暣琛屾爣绾�
+ gridView1.RowStyle += GridView1_RowStyle;
+ // 娣诲姞gvMx1鐨凴owStyle浜嬩欢锛屽綋澶勭悊鎰忚clyj涓�"閫�璐�"鏃舵暣琛屾爣绾�
+ gvMx1.RowStyle += GvMx1_RowStyle;
Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
{
getModel(value);
@@ -94,21 +89,62 @@
{
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);
+ ConfigureOaColumns();
+ // 鍒锋柊瑙嗗浘鏍峰紡锛屼娇RowStyle浜嬩欢鐢熸晥
+ gvMx1.RefreshData();
}
catch (Exception ex)
{
@@ -117,51 +153,94 @@
};
frm.ShowDialog();
};
- ////搴曢儴姹囨�诲惎鐢�
- // gvMx1.OptionsView.ShowFooter = true;
- //// 涓烘煇涓�鍒楄缃眰鍜屾眹鎬�
- // gvMx1.Columns["quantity"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
- // gvMx1.Columns["quantity"].SummaryItem.DisplayFormat = "鍚堣: {0}";
- /////搴曢儴姹囨��
- UtilityHelper.SetupGridSummary(gvMx1, "quantity");
- //鎵撳嵃姣斾緥
- UtilityHelper.SetSimpleGridColor(gridView1, "barcodeProgress", "=100.00%", "Cell", Color.Green);
- //鍏ュ簱姣斾緥
- UtilityHelper.SetSimpleGridColor(gridView1, "rkbl", "=100.00%", "Cell", Color.Green);
+ ConfigureOaColumns();
}
- private void ToolBarMenu1_btnPrintClick(object sender, EventArgs e)
+
+
+ private void ConfigureOaColumns()
{
- string rowGuid, rowName;
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1);
- if (string.IsNullOrEmpty(rowGuid))
+ ConfigureOaColumn(gridColumn15, "clyj", "澶勭悊鎰忚", 17);
+ ConfigureOaColumn(gridColumn16, "txsl", "鎸戦�夋暟閲�", 18);
+ ConfigureOaColumn(gridColumn2, "xblb", "閫夊埆绫诲埆", 19);
+ }
+
+ /// <summary>
+ /// gridView1鐨凴owStyle浜嬩欢锛屽綋閫�璐ф爣璇唗h=1鏃舵暣琛屾爣绾�
+ /// </summary>
+ private void GridView1_RowStyle(object sender, RowStyleEventArgs e)
+ {
+ if (e.RowHandle >= 0)
{
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎵撳嵃鐨勫崟鎹紒");
+ var view = sender as GridView;
+ if (view != null)
+ {
+ var thValue = view.GetRowCellValue(e.RowHandle, "th");
+ if (thValue != null && thValue.ToString() == "1")
+ {
+ e.Appearance.BackColor = System.Drawing.Color.Red;
+ e.Appearance.ForeColor = System.Drawing.Color.White;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// gvMx1鐨凴owStyle浜嬩欢锛屽綋澶勭悊鎰忚clyj涓�"閫�璐�"鏃舵暣琛屾爣绾�
+ /// </summary>
+ private void GvMx1_RowStyle(object sender, RowStyleEventArgs e)
+ {
+ if (e.RowHandle >= 0)
+ {
+ var view = sender as GridView;
+ if (view != null)
+ {
+ try
+ {
+ var clyjValue = view.GetRowCellValue(e.RowHandle, "clyj");
+ if (clyjValue != null && !string.IsNullOrEmpty(clyjValue.ToString()))
+ {
+ string clyj = clyjValue.ToString().Trim();
+ if (clyj == "閫�璐�")
+ {
+ e.Appearance.BackColor = System.Drawing.Color.Red;
+ e.Appearance.ForeColor = System.Drawing.Color.White;
+ }
+ }
+ }
+ catch
+ {
+ // 濡傛灉鍒椾笉瀛樺湪锛屽拷鐣ラ敊璇�
+ }
+ }
+ }
+ }
+
+ private static void ConfigureOaColumn(GridColumn column, string fieldName, string caption, int visibleIndex)
+ {
+ if (column == null)
+ {
return;
}
- try
+ if (!string.IsNullOrEmpty(fieldName))
{
- string rptParameter = "rpt_Cgrk{"
- + rowGuid // @inOrderGuid - 鍗曟嵁guid
- + "," + "100" // @isDesign - 閲嶆墦閮芥槸浼�100
- + "," + "" // @in1 - 鍏ュ簱鏃堕棿锛堟墿灞曠敤锛�
- + "," + "" // @in2 - 鐗归噰锛堟墿灞曠敤锛�
- + "," + "" // @in3 - 渚涘簲鍟唅d锛堟墿灞曠敤锛�
- + "," + "" // @in4 - 寮犳暟锛堟墿灞曠敤锛�
- + "," + "" // @in5 - 鏁伴噺锛堟墿灞曠敤锛�
- + "," + "" // @in6 - 鎵╁睍鐢�
- + "}";
- using (Form rpt = new RptPreview(rowGuid, rptParameter))
- {
- rpt.ShowDialog();
- }
+ column.FieldName = fieldName;
}
- catch (Exception ex)
+
+ if (!string.IsNullOrEmpty(caption))
{
- MsgHelper.ShowError(ex.Message);
+ column.Caption = caption;
}
+
+ column.Visible = true;
+ column.VisibleIndex = visibleIndex;
+ column.OptionsColumn.AllowEdit = false;
+ column.OptionsColumn.ReadOnly = true;
+ column.OptionsColumn.ShowInCustomizationForm = true;
}
+
+
private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
{
_filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
@@ -226,11 +305,6 @@
{
_toolCk("EditModelSubmitF");
}
-
- private void ToolBarMenu1_btnHbClick(object sender, EventArgs e)
- {
- _toolCk("EditModelSubmitHb");
- }
/// <summary>
/// 鍙栨秷浜嬩欢
/// </summary>
@@ -275,12 +349,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);
}
}
@@ -319,7 +395,7 @@
lbGuid, txt_billNo, gridView1);
if (string.IsNullOrEmpty(rowGuid))
{
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
@@ -333,6 +409,10 @@
gvList.Add(gvMx1);
UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
}
+ //2025/07/12鍔犱笂淇敼鐘舵�佷笅涓嶈兘淇敼渚涘簲鍟嗗拰缁勭粐srm,绂佺敤
+ setSrm();
+ txt_receiveOrgId.IsReadly = true;
+ txt_suppId.IsReadly = true;
}
/// <summary>
@@ -348,9 +428,11 @@
gridViews.Add(gvMx1);
UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
-
+ ConfigureOaColumns();
//澧炲姞鏃讹紝榛樿缁勭粐
string deftOrg = UtilityHelper.GetFirstOrg(txt_receiveOrgId);
+ txt_isSrm.Checked = false;
+ setSrm();
}
/// <summary>
@@ -365,13 +447,13 @@
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;
}
@@ -382,6 +464,7 @@
Remark = txt_remark.Text.Trim(), //澶囨敞
SuppId = _gysId, //渚涘簲鍟�
OrgId = _orgId,
+ IsSrm = (txt_isSrm.Checked ? 1 : 0),
list = new List<dynamic>(),
};
gvMx1.CloseEditor();
@@ -399,7 +482,6 @@
{
Guid? _guid = UtilityHelper.ToGuid(row["guid"].ToString());
string _msl = row["quantity"].ToString();
-
if (string.IsNullOrEmpty(_msl))
{
MsgHelper.ShowError("鏁伴噺涓嶈兘涓虹┖锛�");
@@ -411,8 +493,7 @@
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(),
});
}
@@ -423,9 +504,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;
@@ -433,19 +514,14 @@
gvList.Add(gvMx1);
UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false);
toolBarMenu1.currentAction = "";
- // 銆愭柊澧炲埛鏂伴�昏緫銆戜繚瀛樻垚鍔熷悗绔嬪嵆鍒锋柊褰撳墠妯″瀷鏁版嵁鍜屽垪琛�
- // 鍒锋柊褰撳墠鍗曟嵁璇︽儏
- getModel(lbGuid.Text.Trim());
- // 鍒锋柊鍒楄〃椤垫暟鎹�
- getPageList(this.pageBar1.CurrentPage);
-
- // 璺宠浆鍒版煡鐪嬬粨鏋滈〉闈�
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
}
+ else
+ MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
@@ -455,7 +531,11 @@
/// <param name="pageSize">姣忛〉鍑犳潯</param>
private void getPageList(int curPage)
{
- gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+ gcMain1.DataSource = null;
+ System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
+ _sbSqlWhere.Append(" and a.ReceiveOrgId in");
+ _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere());
+ _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList));
var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date",
"asc", "", _sbSqlWhere.ToString());
var json = JsonConvert.SerializeObject(pgq);
@@ -537,10 +617,14 @@
gcMx1.ForceInitialize();
gvMx1.BestFitColumns();
Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
+ ConfigureOaColumns();
+ // 鍒锋柊瑙嗗浘鏍峰紡锛屼娇RowStyle浜嬩欢鐢熸晥
+ gvMx1.RefreshData();
}
else
{
UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
+ ConfigureOaColumns();
}
}
else
@@ -668,7 +752,6 @@
_webServiceName + _meth,
JsonConvert.SerializeObject(_obj));
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-
if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
{
MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnData.outMsg);
@@ -678,8 +761,7 @@
}
int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
gridView1.FocusedRowHandle = rowHandle;
- //鍒ゆ柇瀹℃牳鍚庢槸鍚﹀彉涓虹孩绔狅紙1锛氱孩绔犲凡瀹℃牳 锛�-1 榛戠珷鏈鏍革級
- int _inFieldValue = ((_meth == "EditModelSubmit" || _meth == "EditModelSubmitHb") ? 1 : -1);
+ int _inFieldValue = (_meth == "EditModelSubmit" ? 1 : -1);
UtilityHelper.SetCheckIco(gridView1, "fstatus", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString());
}
else
@@ -707,55 +789,27 @@
frm.ShowDialog();
}
- /// <summary>
- /// 鏂板鏂规硶锛氬垪琛ㄦ樉绀�
- /// </summary>
- /// <param name="strGuid">涓昏〃id</param>
-
- private void getModelList(string strGuid)
+ private void setSrm()
{
- gcMxL1.DataSource = null;
-
-
- var _obj = new
+ bool isSrm = (txt_isSrm.Checked);
+ if (isSrm == true)
{
- guid = strGuid,//涓诲缓
- };
- try
- {
- string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
- ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
- if (_rtn.rtnCode > 0)
- {
- dynamic dy = _rtn.rtnData;
-
- JArray array1 = new JArray();
- foreach (var a in dy["list"])
- {
- array1.Add(a);
- }
- DataTable dt1 = JsonConvert.DeserializeObject<DataTable>(array1.ToString());
- if (dt1.Rows.Count > 0)
- {
- gcMxL1.BindingContext = new BindingContext();
- gcMxL1.DataSource = dt1;
- gcMxL1.ForceInitialize();
- gvMxL1.BestFitColumns();
- Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMxL1);
- }
- else
- {
- Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMxL1, gvMxL1);
- }
- }
- else
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ gvMx1quantity.OptionsColumn.ReadOnly = true;
+ txt_paperBillNo.ReadOnly = true;
+ txt_isSrm.Checked = true;
+ txt_receiveOrgId.IsReadly = true;
+ txt_suppId.IsReadly = true;
+ btnSelect.Enabled = false;
}
- catch (Exception ex)
+ else
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ 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