修改进度页面加载

This commit is contained in:
高飞 2023-04-28 14:39:33 +08:00
parent dbfd7086e1
commit 493fa28b46
1 changed files with 25 additions and 11 deletions

View File

@ -2664,21 +2664,35 @@ namespace BLL
{ {
row[11] = costControl.RealEndDate;//实际完成时间 row[11] = costControl.RealEndDate;//实际完成时间
} }
for (int i = 0; i < months.Count; i++) var detail = details.Where(x => x.CostControlId == item.Id).ToList();
foreach (var item1 in detail)
{ {
Model.View_WBS_CostControlDetail detail = details.FirstOrDefault(x => x.CostControlId == item.Id && x.Months == months[i]); var index = months.FindIndex(x => x.Equals(item1.Months));
if (detail != null) if (item1.PlanNum != 0)
{ {
if (detail.PlanNum != 0) row[12 + index * 2] = decimal.Round(Convert.ToDecimal(item1.PlanNum), 2);
}
if (item1.ThisNum != 0)
{ {
row[12 + i * 2] = decimal.Round(Convert.ToDecimal(detail.PlanNum), 2); row[13 + index * 2] = decimal.Round(Convert.ToDecimal(item1.ThisNum), 2);
}
if (detail.ThisNum != 0)
{
row[13 + i * 2] = decimal.Round(Convert.ToDecimal(detail.ThisNum), 2);
}
} }
} }
//for (int i = 0; i < months.Count; i++)
//{
// Model.View_WBS_CostControlDetail detail = details.FirstOrDefault(x => x.CostControlId == item.Id && x.Months == months[i]);
// if (detail != null)
// {
// if (detail.PlanNum != 0)
// {
// row[12 + i * 2] = decimal.Round(Convert.ToDecimal(detail.PlanNum), 2);
// }
// if (detail.ThisNum != 0)
// {
// row[13 + i * 2] = decimal.Round(Convert.ToDecimal(detail.ThisNum), 2);
// }
// }
//}
row[14 + (months.Count-1) * 2] = item.Id; row[14 + (months.Count-1) * 2] = item.Id;
//row[10] = decimal.Round(Convert.ToDecimal(detail.ThisRealCost), 2);//本月实际成本 //row[10] = decimal.Round(Convert.ToDecimal(detail.ThisRealCost), 2);//本月实际成本
//row[11] = decimal.Round(Convert.ToDecimal(detail.ThisPlanValue), 2);//本月计划完成预算 //row[11] = decimal.Round(Convert.ToDecimal(detail.ThisPlanValue), 2);//本月计划完成预算