diff --git a/插件库/Lskj.ProductSched/FrmProductSched.cs b/插件库/Lskj.ProductSched/FrmProductSched.cs
index 22e6f32..d4adef1 100644
--- a/插件库/Lskj.ProductSched/FrmProductSched.cs
+++ b/插件库/Lskj.ProductSched/FrmProductSched.cs
@@ -2001,17 +2001,42 @@ namespace Lskj.ProductiSched
}
}
}
+ // **6. 解决渲染问题**
+ if (!dataMain.Columns.Contains("PrecomputedMaxDate"))
+ {
+ dataMain.Columns.Add("PrecomputedMaxDate", typeof(string));
+ }
+
+ foreach (DataRow row in dataMain.Rows)
+ {
+ DateTime? maxDate = null; // 初始化为 null,表示尚未找到有效日期
+ foreach (DataColumn column in row.Table.Columns)
+ {
+ // 检查列是否为日期类型,这里假设您已确保列名适当反映了它们是日期类型
+ if (DateTime.TryParse(column.ToString(), out DateTime tempDate))
+ {
+ if (!string.IsNullOrEmpty(row[column] + "")) // 只有在找到更大的日期时才更新
+ {
+ if (maxDate == null || tempDate > maxDate)
+ {
+ maxDate = tempDate;
+ }
+ }
+ }
+ }
+ // 赋值操作,确保为字符串格式
+ row["PrecomputedMaxDate"] = maxDate.HasValue ? maxDate.Value.ToString("yyyy-MM-dd") : "";
+ }
return dataMain;
}
-
- ///
- /// 构建带日期的数据源
- ///
- ///
- ///
- ///
- ///
- private void UpdateRowWithDayPlan(DataRow focusedRow, DataTable dataDayPlan, DateTime startDate)
+ ///
+ /// 构建带日期的数据源
+ ///
+ ///
+ ///
+ ///
+ ///
+ private void UpdateRowWithDayPlan(DataRow focusedRow, DataTable dataDayPlan, DateTime startDate)
{
string rightPrimaryKey = DataModel.RightModuleModel.ParmaryKey;
string topPrimaryKey = DataModel.TopModuleModel.ParmaryKey;