From 0e9ba4ee9ee5c37a9379de1d352fd4973d3691f7 Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期六, 02 八月 2025 08:56:20 +0800
Subject: [PATCH] bug
---
DevApp/Gs.DevApp/DevFrm/Ck/UcBlcl.cs | 264 ++++++++++++++++++++++++++++++++--------------------
1 files changed, 162 insertions(+), 102 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Ck/UcBlcl.cs b/DevApp/Gs.DevApp/DevFrm/Ck/UcBlcl.cs
index 9e75e22..bb7e11b 100644
--- a/DevApp/Gs.DevApp/DevFrm/Ck/UcBlcl.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Ck/UcBlcl.cs
@@ -14,10 +14,9 @@
{
public partial class UcBlcl : DevExpress.XtraEditors.XtraUserControl
{
-
+ string _ucGd = "";//宸ュ崟
string _webServiceName = "MesItemBlManager/";
List<FilterEntity> _filterList = new List<FilterEntity>();
-
public string strType = "";
public UcBlcl(string _strType)
{
@@ -26,7 +25,6 @@
txt_bl017.Text = _strType;
txt_bl017.Tag = "moren." + _strType;
}
-
protected override void OnCreateControl()
{
base.OnCreateControl();
@@ -40,19 +38,21 @@
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
- Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
+ toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
+ this.toolBarMenu1.getXmlConfig();
Form parentForm = this.FindForm();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, parentForm, "bl018", "", (value) =>
- {
- Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
- });
+ {
+ 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;
//璁剧疆缁勭粐
@@ -60,14 +60,7 @@
{
string orgdId = txt_orgId.GetId();
if (string.IsNullOrEmpty(orgdId)) return;
- txt_bl010.getSuppler(orgdId);
- txt_aboutGuid.getSuppler(orgdId);
- };
- //璁剧疆浠撳簱閫夋嫨
- // txt_bl010.getSuppler("");
- this.txt_bl010.EditChanged += (s, e) =>
- {
-
+ txt_aboutGuid.getSuppler(orgdId, _ucGd, "and ( daa018<>'S:鏆傚仠') and ( daa018<>'W:瀹屽伐')");
};
//璁剧疆宸ュ崟
this.txt_aboutGuid.EditChanged += (s, e) =>
@@ -77,37 +70,87 @@
txt_bl002.Text = txt_aboutGuid.GetPrdNo();
txt_bl014.Text = txt_aboutGuid.GetPrdName();
txt_bl015.Text = txt_aboutGuid.GetPrdModel();
- txt_bl011.Text = txt_aboutGuid.GetWorkName();
+ txt_dptName.Text = txt_aboutGuid.GetWorkName();
txt_bl012.Text = txt_aboutGuid.GetWorkXb();
txt_bl013.Text = txt_aboutGuid.GetRwd();
- var _obj = new
+ txt_tldh.Text = txt_aboutGuid.GetTldh();
+ };
+ //閫夋嫨闇�瑕佸叆搴撶殑鏄庣粏
+ btnSelect.Click += (s, e) =>
+ {
+ if (string.IsNullOrEmpty(this.txt_orgId.GetId()))
{
- currentPage = 1,
- everyPageSize = 999999,
- sortName = "",
- keyWhere = "",
- daaGuid = strGdId
+ MsgHelper.ShowError("璇烽�夋嫨鐢熶骇缁勭粐锛�");
+ txt_orgId.Focus();
+ return;
+ }
+ if (string.IsNullOrEmpty(this.txt_aboutGuid.GetId()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨鐢熶骇宸ュ崟锛�");
+ return;
+ }
+ var frm = new UcBlclSelect(txt_aboutGuid.GetId(), this.txt_orgId.GetId());
+ //璧嬪�肩粰鏄庣粏琛�
+ frm.UpdateParent += (ss, ee) =>
+ {
+ try
+ {
+ var lst = ee.DynamicList;
+ DataTable _Table = (DataTable)gcMx1.DataSource;
+ int idx = 1;
+ foreach (dynamic dym in lst)
+ {
+ DataRow _row = _Table.NewRow();
+ _row["bld001"] = dym.gdh;//宸ュ崟鍙�
+ _row["bld002"] = dym.itemNo;//鐗╂枡缂栧彿
+ _row["bld003"] = dym.itemName;//鐗╂枡鍚嶇О
+ _row["bld004"] = dym.itemModel;//瑙勬牸鍨嬪彿
+ _row["dwName"] = dym.dwName;
+ _row["dabGuid"] = dym.dabGuid;
+ _row["bld013"] = idx.ToString();//椤规
+ _Table.Rows.Add(_row);
+ idx++;
+ }
+ gcMx1.BindingContext = new BindingContext();
+ gcMx1.DataSource = _Table;
+ gcMx1.ForceInitialize();
+ gvMx1.CloseEditor();
+ gvMx1.PostEditor();
+ gvMx1.UpdateCurrentRow();
+ gvMx1.BestFitColumns();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message);
+ }
};
- var json = JsonConvert.SerializeObject(_obj);
- try
- {
- var strReturn = UtilityHelper.HttpPost("",
- "WomdaaManager/GetListSelectDab", json);
- var rtn = UtilityHelper.ReturnToTablePage(strReturn);
- var dt = rtn.rtnData.list;
- this.repositoryItemSearchLookUpEdit1.DataSource = dt;
- }
- catch (Exception ex)
- {
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
- }
+ frm.ShowDialog();
};
}
private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
{
- _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
+ _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
Task.Delay(100);
getPageList(1);
+ }
+ /// <summary>
+ /// 甯冨眬浜嬩欢
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+
+ /// <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_blNo, gridView1);
+ toolBarMenu1.guidKey = rowGuid;
}
/// <summary>
/// 鍒嗛〉浜嬩欢
@@ -125,10 +168,16 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e)
{
+ Form parentForm;
+ if (this.Parent is Form)
+ parentForm = this.Parent as Form;
+ else
+ parentForm = this.Parent.Parent as Form;
+
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, parentForm.GetType().FullName);
frm.UpdateParent += Frm_UpdateParent;
frm.ShowDialog();
}
@@ -165,7 +214,7 @@
lbGuid, txt_blNo, gridView1, "blNo");
if (string.IsNullOrEmpty(rowGuid))
{
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵"))
@@ -183,17 +232,18 @@
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);
+ MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
-
}
/// <summary>
@@ -207,14 +257,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>
@@ -234,14 +285,17 @@
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);
}
+ //2025/07/12鍔犱笂淇敼鐘舵�佷笅涓嶈兘淇敼
+ txt_orgId.IsReadly = true;
+ txt_aboutGuid.IsReadly = true;
}
/// <summary>
/// 鏂板浜嬩欢
@@ -254,8 +308,10 @@
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_orgId);
}
/// <summary>
@@ -268,28 +324,21 @@
toolBarMenu1.isSetBtn = false;
string inOrgId = txt_orgId.GetId();//宸ュ崟鍙�
string inGdId = txt_aboutGuid.GetId();//宸ュ崟鍙�
- string inCkId = txt_bl010.GetId();//鍙戞枡浠�
if (string.IsNullOrEmpty(inGdId))
{
- Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨宸ュ崟锛�");
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨宸ュ崟锛�");
txt_aboutGuid.Focus();
return;
}
if (string.IsNullOrEmpty(inGdId))
{
- Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨宸ュ崟锛�");
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨宸ュ崟锛�");
txt_aboutGuid.Focus();
- return;
- }
- if (string.IsNullOrEmpty(inCkId))
- {
- Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨浠撳簱锛�");
- txt_bl010.Focus();
return;
}
if (string.IsNullOrEmpty(txt_bl017.Text.Trim()))
{
- Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鍗曟嵁绫诲瀷锛�");
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鍗曟嵁绫诲瀷锛�");
txt_bl017.Focus();
return;
}
@@ -298,12 +347,12 @@
guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
inOrgId = inOrgId,//宸ュ崟鍙�
inGdId = inGdId,//宸ュ崟鍙�
- inCkId = inCkId,//浠撳簱
inYy = txt_bl007.Text.Trim(),//鍘熷洜
inType = txt_bl017.Text.Trim(),
list = new List<dynamic>(),
};
gvMx1.CloseEditor();
+ gvMx1.PostEditor();
gvMx1.UpdateCurrentRow();
if (gvMx1.DataRowCount <= 0)
{
@@ -336,19 +385,25 @@
{
string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+
if (_rtn.rtnCode > 0)
{
- lbGuid.Text = _rtn.rtnData;
+ ToolBox.MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
+ lbGuid.Text = _rtn.rtnData.outGuid;
+ txt_blNo.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(this.panel1.Controls, false, gvList);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList);
+ toolBarMenu1.currentAction = "";
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
}
+ else
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
@@ -359,7 +414,8 @@
/// <param name="pageSize">姣忛〉鍑犳潯</param>
private void getPageList(int curPage)
{
- var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+ gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+ _sbSqlWhere += " and a.bl008='" + strType + "'";
PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString());
string json = JsonConvert.SerializeObject(pgq);
try
@@ -369,16 +425,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;//褰撳墠椤�
@@ -395,6 +451,11 @@
}
}
+
+ /// <summary>
+ /// 璇诲彇瀹炰綋
+ /// </summary>
+ /// <param name="strGuid"></param>
private void getModel(string strGuid)
{
bool isEdit = false;
@@ -416,10 +477,12 @@
if (_rtn.rtnCode > 0)
{
dynamic dy = _rtn.rtnData;
+ _ucGd = dy.aboutGuid;
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);
+ _ucGd = "";
JObject _job = JObject.Parse(strJson);
JArray array = new JArray();
foreach (var a in _job["rtnData"]["list"])
@@ -433,6 +496,7 @@
gcMx1.DataSource = dt;
gcMx1.ForceInitialize();
gvMx1.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
}
else
{
@@ -485,13 +549,14 @@
case 0:
strMsg = "鍙嶅鏍�";
break;
- };
+ }
+ ;
toolBarMenu1.guidKey = "";
string rowGuid, rowName;
(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_blNo, gridView1, "blNo");
if (string.IsNullOrEmpty(rowGuid))
{
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵"))
@@ -507,34 +572,27 @@
_webServiceName + "EditModelSubmit",
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)
{
+ MsgHelper.ShowInformation(_rtn.rtnData.outMsg.ToString());
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;
+ Form parentForm = this.FindForm();
+ UtilityHelper.SetCheckIco(gridView1, "bl018", "bl016", "bl006", picCheckBox, parentForm, _inFieldValue.ToString());
}
+ else
+ MsgHelper.ShowError(_rtn.rtnData.outMsg.ToString());
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
-
}
-
- private void repositoryItemSearchLookUpEdit1_EditValueChanged(object sender, EventArgs e)
- {
- SearchLookUpEdit LookupEdit = sender as SearchLookUpEdit;
- DataRowView SelectedDataRow = (DataRowView)LookupEdit.GetSelectedDataRow();
- gvMx1.SetFocusedRowCellValue("bld001", SelectedDataRow["gdh"]);
- gvMx1.SetFocusedRowCellValue("bld002", SelectedDataRow["itemNo"]);
- gvMx1.SetFocusedRowCellValue("bld003", SelectedDataRow["itemName"]);
- gvMx1.SetFocusedRowCellValue("bld004", SelectedDataRow["itemModel"]);
- gvMx1.SetFocusedRowCellValue("dwName", SelectedDataRow["dwName"]);
- gvMx1.SetFocusedRowCellValue("dabGuid", SelectedDataRow["dabGuid"]);
- }
-
private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
{
var rowhandle = gvMx1.FocusedRowHandle;
@@ -564,13 +622,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