diff --git a/插件库/Lskj.ProductSched/FrmProductSched.cs b/插件库/Lskj.ProductSched/FrmProductSched.cs index 123722b..2561551 100644 --- a/插件库/Lskj.ProductSched/FrmProductSched.cs +++ b/插件库/Lskj.ProductSched/FrmProductSched.cs @@ -179,7 +179,7 @@ namespace Lskj.ProductiSched treebandGcTop.Model = DataModel.TopSysModel; treebandGcTop.moduleModel = DataModel.TopModuleModel; 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)); bandGcTop.Visible = false; } @@ -188,7 +188,7 @@ namespace Lskj.ProductiSched //上方表格 bandGcTop.Model = DataModel.TopSysModel; 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)); treebandGcTop.Visible = false; @@ -247,7 +247,7 @@ namespace Lskj.ProductiSched gcRight.Name = "gridEx"; gcRight.IsDetail = true; gcRight.Dock = DockStyle.Fill; - gcRight.OperShortMode =false; // 不显示简短模式 + gcRight.OperShortMode = false; // 不显示简短模式 gcRight.VisibleSearchPanel = false; DataTable rightDt = BaseModuleImpl.GetBaseGridRightMenus(DataModel.RightSysModel.ModuleCode, ModuleType.MrpClickBtn); gcRight.VisibleOperPanel = !DataModel.RightDetailModel.IsReadOnly; @@ -1345,6 +1345,7 @@ namespace Lskj.ProductiSched gridBand.AppearanceHeader.Font = new Font("宋体", 9, FontStyle.Bold); gridBand.AppearanceHeader.Options.UseTextOptions = true; gridBand.AppearanceHeader.TextOptions.HAlignment = HorzAlignment.Center; + gridBand.AppearanceHeader.TextOptions.WordWrap = WordWrap.Wrap; bandedGridControlEx.BandedView.Bands.Add(gridBand); BandedGridColumn gridColumn = new BandedGridColumn(); gridColumn.AppearanceCell.Options.UseTextOptions = true; @@ -1380,6 +1381,7 @@ namespace Lskj.ProductiSched gridBand.AppearanceHeader.Font = new Font("宋体", 9, FontStyle.Bold); gridBand.AppearanceHeader.Options.UseTextOptions = true; gridBand.AppearanceHeader.TextOptions.HAlignment = HorzAlignment.Center; + gridBand.AppearanceHeader.TextOptions.WordWrap = WordWrap.Wrap; bandedGridControlEx.BandedView.Bands.Add(gridBand); BandedGridColumn gridColumn = new BandedGridColumn(); gridColumn.AppearanceCell.Options.UseTextOptions = true; @@ -1626,6 +1628,7 @@ namespace Lskj.ProductiSched /// private void UpdateWeeklyColumns(BandedGridControlEx grid, DateTime currentDate) { + grid.BandedView.BandPanelRowHeight = 45; DateTime endDate = currentDate.AddMonths(3).AddDays(-1); // 3 个月窗口 DateTime weekStart = GetStartOfWeek(currentDate); // 本周周一 int weekIndex = 0; // Week_0 ~ Week_14 @@ -1657,10 +1660,10 @@ namespace Lskj.ProductiSched BandedGridColumn weekColumn = weekBand.Columns[0]; 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.Caption = $"{pivotDate.Month}月第{weekOfMonth}周"; // 列标题:几月第几周 - weekColumn.Width = 90; + weekColumn.Width = 65; DataModel.columnDateMapping[weekColumn] = weekStart; weekColumn.OptionsColumn.AllowEdit = weekEnd >= DateTime.Today; // 仅未来可编辑 weekColumn.Visible = true; @@ -1789,6 +1792,7 @@ namespace Lskj.ProductiSched private void UpdateDailyColumns(BandedGridControlEx grid, DateTime currentDate) { + grid.BandedView.BandPanelRowHeight = -1; // 原有的日处理逻辑(保持原代码不变) DateTime endDate = currentDate.AddMonths(3).AddDays(-1); grid.BandedView.BeginUpdate(); @@ -1943,8 +1947,8 @@ namespace Lskj.ProductiSched DateTime startDate, string typeDate = "0") { - string rightPrimaryKey = DataModel.RightModuleModel.ParmaryKey; - string topPrimaryKey = "keyvalue"; // DataModel.TopModuleModel.ParmaryKey; + string rightPrimaryKey = !string.IsNullOrEmpty(DataModel.RightDetailModel.UnionValue) ? DataModel.RightDetailModel.UnionValue : "billdocument_id"; + string topPrimaryKey = !string.IsNullOrEmpty(DataModel.RightDetailModel.UnionParentField) ? DataModel.RightDetailModel.UnionParentField : "keyvalue"; // 结束日期 = 开始日期 + 3 个月(不包含该日) DateTime endDate = startDate.AddMonths(3); @@ -2139,8 +2143,10 @@ namespace Lskj.ProductiSched /// private void UpdateRowWithDayPlan(DataRow focusedRow, DataTable dataDayPlan, DateTime startDate) { - string rightPrimaryKey = DataModel.RightModuleModel.ParmaryKey; - string topPrimaryKey = DataModel.TopModuleModel.ParmaryKey; + string rightPrimaryKey = !string.IsNullOrEmpty(DataModel.RightDetailModel.UnionValue) ? DataModel.RightDetailModel.UnionValue : "billdocument_id"; + 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); // 计算结束日期 // **1. 预索引 dataDayPlan 数据(billdocument_id -> 该 key 相关的所有行)** Dictionary> dayPlanMap = new Dictionary>(); @@ -2571,7 +2577,7 @@ namespace Lskj.ProductiSched } //this.OnSearchAfterCallBack(null,null); } - else + else { int oldRowHandle = bandGcTop.GridView.FocusedRowHandle; DataTable dt = this.bandGcTop.GridView.GetGridViewFilteredAndSortedDataToDataTable(); @@ -2586,4 +2592,4 @@ namespace Lskj.ProductiSched dt = this.bandGcTop.GridView.GetGridViewFilteredAndSortedDataToDataTable(); BindingSource bindingSource = new BindingSource(); bindingSource.DataSource = dt; - int numberOfRows = binding \ No newline at end of file + int numb \ No newline at end of file