SVN-Revision: r879
This commit is contained in:
wyf
2025-07-21 12:50:36 +00:00
parent e0134d28ad
commit 443703f29c
+16 -10
View File
@@ -179,7 +179,7 @@ namespace Lskj.ProductiSched
treebandGcTop.Model = DataModel.TopSysModel; treebandGcTop.Model = DataModel.TopSysModel;
treebandGcTop.moduleModel = DataModel.TopModuleModel; treebandGcTop.moduleModel = DataModel.TopModuleModel;
treebandGcTop.SetEditColumns(DataModel.TopGridColumns, GridCustomColumnStruct.BaseMainGridView + DataModel.TopModuleModel.FormKey); treebandGcTop.SetEditColumns(DataModel.TopGridColumns, GridCustomColumnStruct.BaseMainGridView + DataModel.TopModuleModel.FormKey);
treebandGcTop.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.ModeCode), DataModel.TopSysModel,this.OnGridViewRightCallBack); treebandGcTop.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.ModeCode), DataModel.TopSysModel, this.OnGridViewRightCallBack);
treebandGcTop.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.ModeCode)); treebandGcTop.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.ModeCode));
bandGcTop.Visible = false; bandGcTop.Visible = false;
} }
@@ -188,7 +188,7 @@ namespace Lskj.ProductiSched
//上方表格 //上方表格
bandGcTop.Model = DataModel.TopSysModel; bandGcTop.Model = DataModel.TopSysModel;
bandGcTop.SetEditColumns(DataModel.TopGridColumns, GridCustomColumnStruct.BaseMainGridView + DataModel.TopModuleModel.FormKey); bandGcTop.SetEditColumns(DataModel.TopGridColumns, GridCustomColumnStruct.BaseMainGridView + DataModel.TopModuleModel.FormKey);
bandGcTop.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.ModeCode), DataModel.TopSysModel,this.OnGridViewRightCallBack); bandGcTop.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.ModeCode), DataModel.TopSysModel, this.OnGridViewRightCallBack);
bandGcTop.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.ModeCode)); bandGcTop.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.ModeCode));
bandGcTop.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.ModeCode)); bandGcTop.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.ModeCode));
treebandGcTop.Visible = false; treebandGcTop.Visible = false;
@@ -247,7 +247,7 @@ namespace Lskj.ProductiSched
gcRight.Name = "gridEx"; gcRight.Name = "gridEx";
gcRight.IsDetail = true; gcRight.IsDetail = true;
gcRight.Dock = DockStyle.Fill; gcRight.Dock = DockStyle.Fill;
gcRight.OperShortMode =false; // 不显示简短模式 gcRight.OperShortMode = false; // 不显示简短模式
gcRight.VisibleSearchPanel = false; gcRight.VisibleSearchPanel = false;
DataTable rightDt = BaseModuleImpl.GetBaseGridRightMenus(DataModel.RightSysModel.ModuleCode, ModuleType.MrpClickBtn); DataTable rightDt = BaseModuleImpl.GetBaseGridRightMenus(DataModel.RightSysModel.ModuleCode, ModuleType.MrpClickBtn);
gcRight.VisibleOperPanel = !DataModel.RightDetailModel.IsReadOnly; gcRight.VisibleOperPanel = !DataModel.RightDetailModel.IsReadOnly;
@@ -1345,6 +1345,7 @@ namespace Lskj.ProductiSched
gridBand.AppearanceHeader.Font = new Font("宋体", 9, FontStyle.Bold); gridBand.AppearanceHeader.Font = new Font("宋体", 9, FontStyle.Bold);
gridBand.AppearanceHeader.Options.UseTextOptions = true; gridBand.AppearanceHeader.Options.UseTextOptions = true;
gridBand.AppearanceHeader.TextOptions.HAlignment = HorzAlignment.Center; gridBand.AppearanceHeader.TextOptions.HAlignment = HorzAlignment.Center;
gridBand.AppearanceHeader.TextOptions.WordWrap = WordWrap.Wrap;
bandedGridControlEx.BandedView.Bands.Add(gridBand); bandedGridControlEx.BandedView.Bands.Add(gridBand);
BandedGridColumn gridColumn = new BandedGridColumn(); BandedGridColumn gridColumn = new BandedGridColumn();
gridColumn.AppearanceCell.Options.UseTextOptions = true; gridColumn.AppearanceCell.Options.UseTextOptions = true;
@@ -1380,6 +1381,7 @@ namespace Lskj.ProductiSched
gridBand.AppearanceHeader.Font = new Font("宋体", 9, FontStyle.Bold); gridBand.AppearanceHeader.Font = new Font("宋体", 9, FontStyle.Bold);
gridBand.AppearanceHeader.Options.UseTextOptions = true; gridBand.AppearanceHeader.Options.UseTextOptions = true;
gridBand.AppearanceHeader.TextOptions.HAlignment = HorzAlignment.Center; gridBand.AppearanceHeader.TextOptions.HAlignment = HorzAlignment.Center;
gridBand.AppearanceHeader.TextOptions.WordWrap = WordWrap.Wrap;
bandedGridControlEx.BandedView.Bands.Add(gridBand); bandedGridControlEx.BandedView.Bands.Add(gridBand);
BandedGridColumn gridColumn = new BandedGridColumn(); BandedGridColumn gridColumn = new BandedGridColumn();
gridColumn.AppearanceCell.Options.UseTextOptions = true; gridColumn.AppearanceCell.Options.UseTextOptions = true;
@@ -1626,6 +1628,7 @@ namespace Lskj.ProductiSched
/// </summary> /// </summary>
private void UpdateWeeklyColumns(BandedGridControlEx grid, DateTime currentDate) private void UpdateWeeklyColumns(BandedGridControlEx grid, DateTime currentDate)
{ {
grid.BandedView.BandPanelRowHeight = 45;
DateTime endDate = currentDate.AddMonths(3).AddDays(-1); // 3 个月窗口 DateTime endDate = currentDate.AddMonths(3).AddDays(-1); // 3 个月窗口
DateTime weekStart = GetStartOfWeek(currentDate); // 本周周一 DateTime weekStart = GetStartOfWeek(currentDate); // 本周周一
int weekIndex = 0; // Week_0 ~ Week_14 int weekIndex = 0; // Week_0 ~ Week_14
@@ -1657,10 +1660,10 @@ namespace Lskj.ProductiSched
BandedGridColumn weekColumn = weekBand.Columns[0]; BandedGridColumn weekColumn = weekBand.Columns[0];
weekBand.Visible = true; weekBand.Visible = true;
weekBand.Caption = $"{weekStart:MM.dd}/{weekEnd:MM.dd}"; // 父 Band:日期范围 weekBand.Caption = $"{weekStart:MM.dd}\r\n|\r\n{weekEnd:MM.dd}"; // 父 Band:日期范围
weekColumn.FieldName = weekStart.ToString("yyyy-MM-dd"); // 字段名:周一 weekColumn.FieldName = weekStart.ToString("yyyy-MM-dd"); // 字段名:周一
weekColumn.Caption = $"{pivotDate.Month}月第{weekOfMonth}周"; // 列标题:几月第几周 weekColumn.Caption = $"{pivotDate.Month}月第{weekOfMonth}周"; // 列标题:几月第几周
weekColumn.Width = 90; weekColumn.Width = 65;
DataModel.columnDateMapping[weekColumn] = weekStart; DataModel.columnDateMapping[weekColumn] = weekStart;
weekColumn.OptionsColumn.AllowEdit = weekEnd >= DateTime.Today; // 仅未来可编辑 weekColumn.OptionsColumn.AllowEdit = weekEnd >= DateTime.Today; // 仅未来可编辑
weekColumn.Visible = true; weekColumn.Visible = true;
@@ -1789,6 +1792,7 @@ namespace Lskj.ProductiSched
private void UpdateDailyColumns(BandedGridControlEx grid, DateTime currentDate) private void UpdateDailyColumns(BandedGridControlEx grid, DateTime currentDate)
{ {
grid.BandedView.BandPanelRowHeight = -1;
// 原有的日处理逻辑(保持原代码不变) // 原有的日处理逻辑(保持原代码不变)
DateTime endDate = currentDate.AddMonths(3).AddDays(-1); DateTime endDate = currentDate.AddMonths(3).AddDays(-1);
grid.BandedView.BeginUpdate(); grid.BandedView.BeginUpdate();
@@ -1943,8 +1947,8 @@ namespace Lskj.ProductiSched
DateTime startDate, DateTime startDate,
string typeDate = "0") string typeDate = "0")
{ {
string rightPrimaryKey = DataModel.RightModuleModel.ParmaryKey; string rightPrimaryKey = !string.IsNullOrEmpty(DataModel.RightDetailModel.UnionValue) ? DataModel.RightDetailModel.UnionValue : "billdocument_id";
string topPrimaryKey = "keyvalue"; // DataModel.TopModuleModel.ParmaryKey; string topPrimaryKey = !string.IsNullOrEmpty(DataModel.RightDetailModel.UnionParentField) ? DataModel.RightDetailModel.UnionParentField : "keyvalue";
// 结束日期 = 开始日期 + 3 个月(不包含该日) // 结束日期 = 开始日期 + 3 个月(不包含该日)
DateTime endDate = startDate.AddMonths(3); DateTime endDate = startDate.AddMonths(3);
@@ -2139,8 +2143,10 @@ namespace Lskj.ProductiSched
/// <returns></returns> /// <returns></returns>
private void UpdateRowWithDayPlan(DataRow focusedRow, DataTable dataDayPlan, DateTime startDate) private void UpdateRowWithDayPlan(DataRow focusedRow, DataTable dataDayPlan, DateTime startDate)
{ {
string rightPrimaryKey = DataModel.RightModuleModel.ParmaryKey; string rightPrimaryKey = !string.IsNullOrEmpty(DataModel.RightDetailModel.UnionValue) ? DataModel.RightDetailModel.UnionValue : "billdocument_id";
string topPrimaryKey = DataModel.TopModuleModel.ParmaryKey; string topPrimaryKey = !string.IsNullOrEmpty(DataModel.RightDetailModel.UnionParentField) ? DataModel.RightDetailModel.UnionParentField : "keyvalue";
//string rightPrimaryKey = DataModel.RightModuleModel.ParmaryKey;
//string topPrimaryKey = DataModel.TopModuleModel.ParmaryKey;
DateTime endDate = startDate.AddMonths(3).AddDays(-1); // 计算结束日期 DateTime endDate = startDate.AddMonths(3).AddDays(-1); // 计算结束日期
// **1. 预索引 dataDayPlan 数据(billdocument_id -> 该 key 相关的所有行)** // **1. 预索引 dataDayPlan 数据(billdocument_id -> 该 key 相关的所有行)**
Dictionary<string, List<DataRow>> dayPlanMap = new Dictionary<string, List<DataRow>>(); Dictionary<string, List<DataRow>> dayPlanMap = new Dictionary<string, List<DataRow>>();
@@ -2586,4 +2592,4 @@ namespace Lskj.ProductiSched
dt = this.bandGcTop.GridView.GetGridViewFilteredAndSortedDataToDataTable(); dt = this.bandGcTop.GridView.GetGridViewFilteredAndSortedDataToDataTable();
BindingSource bindingSource = new BindingSource(); BindingSource bindingSource = new BindingSource();
bindingSource.DataSource = dt; bindingSource.DataSource = dt;
int numberOfRows = binding int numb