From aa7cb331d6a76f3b11d2ac042916b35a29d6ebd8 Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期四, 25 九月 2025 16:00:58 +0800
Subject: [PATCH] 调拨加上限制
---
DevApp/Gs.DevApp/DevFrm/WW/WwBlcl.cs | 174 +++++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 131 insertions(+), 43 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/WW/WwBlcl.cs b/DevApp/Gs.DevApp/DevFrm/WW/WwBlcl.cs
index 66c3964..fc0d4ff 100644
--- a/DevApp/Gs.DevApp/DevFrm/WW/WwBlcl.cs
+++ b/DevApp/Gs.DevApp/DevFrm/WW/WwBlcl.cs
@@ -1,4 +1,6 @@
锘縰sing DevExpress.XtraEditors;
+using DevExpress.XtraLayout.Utils;
+using Gs.DevApp.DevFrm.Ck;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
@@ -7,6 +9,7 @@
using System;
using System.Collections.Generic;
using System.Data;
+using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -14,7 +17,7 @@
{
public partial class WwBlcl : DevExpress.XtraEditors.XtraUserControl
{
-
+ string _ucCk = "";//浠撳簱
string _webServiceName = "WWBlManager/";
List<FilterEntity> _filterList = new List<FilterEntity>();
public string strType = "";
@@ -23,7 +26,11 @@
InitializeComponent();
strType = _strType;
txt_bl017.Text = _strType;
- // txt_bl017.Tag = "moren." + _strType;
+ txt_bl017.Tag = "moren." + _strType;
+ if(_strType == "濮斿棰嗘枡")
+ {
+ layoutControlItem14.Visibility = LayoutVisibility.Never;
+ }
}
protected override void OnCreateControl()
{
@@ -38,26 +45,29 @@
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);
- });
+ }, 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_bl010.getSuppler("");
- this.txt_bl010.EditChanged += (s, e) =>
+ //璁剧疆缁勭粐
+ this.txt_orgId.EditChanged += (s, e) =>
{
-
+ string orgdId = txt_orgId.GetId();
+ if (string.IsNullOrEmpty(orgdId)) return;
+ txt_bl010.getSuppler(orgdId, _ucCk);
};
//閫夋嫨濮斿宸ュ崟
this.txt_aboutGuid.EditChanged += (s, e) =>
@@ -89,13 +99,79 @@
MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
};
+
+ //閫夋嫨闇�瑕佸叆搴撶殑鏄庣粏
+ btnSelect.Click += (s, e) =>
+ {
+ if (string.IsNullOrEmpty(this.txt_orgId.GetId()))
+ {
+ MsgHelper.ShowError("璇烽�夋嫨鐢熶骇缁勭粐锛�");
+ txt_orgId.Focus();
+ return;
+ }
+ if (string.IsNullOrEmpty(this.txt_aboutGuid.GetId()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨鐢熶骇宸ュ崟锛�");
+ return;
+ }
+ var frm = new UcWwBlclSelect(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["bld002"] = dym.itemNo;//鐗╂枡缂栧彿
+ _row["bld003"] = dym.itemName;//鐗╂枡鍚嶇О
+ _row["bld004"] = dym.itemModel;//瑙勬牸鍨嬪彿
+ _row["dabGuid"] = dym.dabGuid;
+ _row["bld008"] = dym.dab007;//椤规
+ _row["bld009"] = dym.dwName;//椤规
+ _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);
+ }
+ };
+ frm.ShowDialog();
+ };
}
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);
}
+ /// <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>
/// 鍒嗛〉浜嬩欢
/// </summary>
@@ -112,10 +188,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();
}
@@ -225,14 +307,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>
/// 鏂板浜嬩欢
@@ -245,8 +330,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_orgId);
+
}
/// <summary>
@@ -259,16 +347,17 @@
toolBarMenu1.isSetBtn = false;
string inGdId = txt_aboutGuid.GetId();//宸ュ崟鍙�
string inCkId = txt_bl010.GetId();//鍙戞枡浠�
+ string inFlOrg = txt_orgId.GetId();//鍙戞枡缁勭粐
+ if (string.IsNullOrEmpty(inFlOrg))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鍙戞枡缁勭粐锛�");
+ txt_orgId.Focus();
+ return;
+ }
if (string.IsNullOrEmpty(inGdId))
{
Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨宸ュ崟锛�");
txt_aboutGuid.Focus();
- return;
- }
- if (string.IsNullOrEmpty(inCkId))
- {
- Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨浠撳簱锛�");
- txt_bl010.Focus();
return;
}
if (string.IsNullOrEmpty(txt_bl017.Text.Trim()))
@@ -280,7 +369,7 @@
var _obj = new
{
guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
- inOrgId = "",//
+ inOrgId = inFlOrg,//鍙戞枡缁勭粐
inGdId = inGdId,//宸ュ崟鍙�
inCkId = inCkId,//浠撳簱
inYy = txt_bl007.Text.Trim(),//鍘熷洜
@@ -288,6 +377,7 @@
list = new List<dynamic>(),
};
gvMx1.CloseEditor();
+ gvMx1.PostEditor();
gvMx1.UpdateCurrentRow();
if (gvMx1.DataRowCount <= 0)
{
@@ -323,11 +413,14 @@
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
if (_rtn.rtnCode > 0)
{
- lbGuid.Text = _rtn.rtnData;
+ 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);
}
}
catch (Exception ex)
@@ -343,8 +436,12 @@
/// <param name="pageSize">姣忛〉鍑犳潯</param>
private void getPageList(int curPage)
{
- var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
- // _sbSqlWhere += " and bl017=200";
+ gcMain1.DataSource = null;
+ System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
+ _sbSqlWhere.Append(" and a.bl008='" + strType + "'");
+ _sbSqlWhere.Append(" and a.org_id in");
+ _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere());
+ _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList));
PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString());
string json = JsonConvert.SerializeObject(pgq);
try
@@ -354,16 +451,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;//褰撳墠椤�
@@ -401,10 +498,12 @@
if (_rtn.rtnCode > 0)
{
dynamic dy = _rtn.rtnData;
+ _ucCk = dy.bl010;
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);
+ _ucCk = "";
JObject _job = JObject.Parse(strJson);
JArray array = new JArray();
foreach (var a in _job["rtnData"]["list"])
@@ -511,18 +610,6 @@
}
}
- private void repositoryItemSearchLookUpEdit1_EditValueChanged(object sender, EventArgs e)
- {
- SearchLookUpEdit LookupEdit = sender as SearchLookUpEdit;
- DataRowView SelectedDataRow = (DataRowView)LookupEdit.GetSelectedDataRow();
- gvMx1.SetFocusedRowCellValue("bld002", SelectedDataRow["itemNo"]);
- gvMx1.SetFocusedRowCellValue("bld003", SelectedDataRow["itemName"]);
- gvMx1.SetFocusedRowCellValue("bld004", SelectedDataRow["itemModel"]);
- gvMx1.SetFocusedRowCellValue("dabGuid", SelectedDataRow["dabGuid"]);
- gvMx1.SetFocusedRowCellValue("bld008", SelectedDataRow["dab007"]);//宸查鐢ㄩ噺
- gvMx1.SetFocusedRowCellValue("bld009", SelectedDataRow["dwName"]);//鍗曚綅
- }
-
private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
{
var rowhandle = gvMx1.FocusedRowHandle;
@@ -562,5 +649,6 @@
}
}
}
+
}
}
\ No newline at end of file
--
Gitblit v1.9.3