修改进度录入页面

This commit is contained in:
高飞 2023-07-05 17:20:04 +08:00
parent 89c0966c2a
commit 205b67e05e
4 changed files with 100 additions and 72 deletions

View File

@ -231,7 +231,7 @@ namespace Web.Controls
for (int i = 0; i < chart1.Series["本月计划工作预算费用-BCWS"].Points.Count; i++)
{
chart1.Series["本月计划工作预算费用-BCWS"].Points[i].ToolTip = "#VALX,#VALY";
chart1.Series["本月计划工作预算费用-BCWS"].Points[i].ToolTip = "本月计划工作预算费用-BCWS\n#VALX\n#VALY";
}
chart1.Series["本月已完工作预算费用-BCWP"].Points.DataBindXY(dv, "月份", dv, "本月已完工作预算费用-BCWP");
@ -239,7 +239,7 @@ namespace Web.Controls
for (int i = 0; i < chart1.Series["本月已完工作预算费用-BCWP"].Points.Count; i++)
{
chart1.Series["本月已完工作预算费用-BCWP"].Points[i].ToolTip = "#VALX,#VALY";
chart1.Series["本月已完工作预算费用-BCWP"].Points[i].ToolTip = "本月已完工作预算费用-BCWP\n#VALX\n#VALY";
}
chart1.Series["本月已完工作实际费用-ACWP"].Points.DataBindXY(dv, "月份", dv, "本月已完工作实际费用-ACWP");
@ -247,7 +247,7 @@ namespace Web.Controls
for (int i = 0; i < chart1.Series["本月已完工作实际费用-ACWP"].Points.Count; i++)
{
chart1.Series["本月已完工作实际费用-ACWP"].Points[i].ToolTip = "#VALX,#VALY";
chart1.Series["本月已完工作实际费用-ACWP"].Points[i].ToolTip = "本月已完工作实际费用-ACWP\n#VALX\n#VALY";
}
chart1.Series["累计计划工作预算费用-BCWS"].Points.DataBindXY(dv, "月份", dv, "累计计划工作预算费用-BCWS");
@ -257,7 +257,7 @@ namespace Web.Controls
for (int i = 0; i < chart1.Series["累计计划工作预算费用-BCWS"].Points.Count; i++)
{
chart1.Series["累计计划工作预算费用-BCWS"].Points[i].ToolTip = "#VALX,#VALY";
chart1.Series["累计计划工作预算费用-BCWS"].Points[i].ToolTip = "累计计划工作预算费用-BCWS\n#VALX\n#VALY";
}
chart1.Series["累计已完工作预算费用-BCWP"].Points.DataBindXY(dv, "月份", dv, "累计已完工作预算费用-BCWP");
@ -267,7 +267,7 @@ namespace Web.Controls
for (int i = 0; i < chart1.Series["累计已完工作预算费用-BCWP"].Points.Count; i++)
{
chart1.Series["累计已完工作预算费用-BCWP"].Points[i].ToolTip = "#VALX,#VALY";
chart1.Series["累计已完工作预算费用-BCWP"].Points[i].ToolTip = "累计已完工作预算费用-BCWP\n#VALX\n#VALY";
}
chart1.Series["累计已完工作实际费用-ACWP"].Points.DataBindXY(dv, "月份", dv, "累计已完工作实际费用-ACWP");
@ -277,7 +277,7 @@ namespace Web.Controls
for (int i = 0; i < chart1.Series["累计已完工作实际费用-ACWP"].Points.Count; i++)
{
chart1.Series["累计已完工作实际费用-ACWP"].Points[i].ToolTip = "#VALX,#VALY";
chart1.Series["累计已完工作实际费用-ACWP"].Points[i].ToolTip = "累计已完工作实际费用-ACWP\n#VALX\n#VALY";
}
Controls.Add(chart1);

View File

@ -28,6 +28,7 @@
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
<Items>
<f:TextBox runat="server" ID="hdId" Hidden="true"></f:TextBox>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存"
OnClick="btnSave_Click">
@ -93,9 +94,27 @@
</Editor>
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="afteredit" Handler="onGridAfterEdit" />
</Listeners>
</f:Grid>
</Items>
</f:Panel>
</form>
<script type="text/javascript">
var hdIdClientID = '<%= hdId.ClientID %>';
function onGridAfterEdit(event, value, params) {
var me = this, columnId = params.columnId, rowId = params.rowId;
var str = F(hdIdClientID).ooIl1;
if (str == undefined) {
str = rowId;
}
else {
str = str + "," + rowId;
}
F(hdIdClientID).setValue(str);
}
</script>
</body>
</html>

View File

@ -169,77 +169,77 @@ namespace FineUIPro.Web.JDGL.WBS
where x.ProjectId == this.CurrUser.LoginProjectId
select x;
Model.SGGLDB db = Funs.DB;
foreach (JObject mergedRow in Grid1.GetMergedData())
//foreach (JObject mergedRow in Grid1.GetModifiedData())
string[] ids = this.hdId.Text.Split(',');
if (ids.Length > 0)
{
JObject values = mergedRow.Value<JObject>("values");
int i = mergedRow.Value<int>("index");
if (this.Grid1.Rows[i].DataKeys[2] != null)
foreach (JObject mergedRow in Grid1.GetMergedData())
{
Model.WBS_CostControl costControl = oldViewInfos.FirstOrDefault(x => x.CostControlId == this.Grid1.Rows[i].DataKeys[2].ToString());
if (costControl != null)
JObject values = mergedRow.Value<JObject>("values");
int i = mergedRow.Value<int>("index");
if (this.Grid1.Rows[i].DataKeys[2] != null)
{
decimal oldPlanPrice = costControl.PlanPrice ?? 0;
decimal oldRealPrice = costControl.RealPrice ?? 0;
string costControlId = costControl.CostControlId;
string totalNum = values.Value<string>("TotalNum");
string planPrice = values.Value<string>("PlanPrice");
string realPrice = values.Value<string>("RealPrice");
string planStartDate = values.Value<string>("PlanStartDate");
string planEndDate = values.Value<string>("PlanEndDate");
string realStartDate = values.Value<string>("RealStartDate");
string realEndDate = values.Value<string>("RealEndDate");
costControl.TotalNum = Funs.GetNewDecimal(totalNum);
costControl.PlanPrice = Funs.GetNewDecimal(planPrice);
costControl.RealPrice = Funs.GetNewDecimal(realPrice);
costControl.PlanStartDate = Funs.GetNewDateTime(planStartDate);
costControl.PlanEndDate = Funs.GetNewDateTime(planEndDate);
costControl.RealStartDate = Funs.GetNewDateTime(realStartDate);
costControl.RealEndDate = Funs.GetNewDateTime(realEndDate);
BLL.CostControlService.UpdateCostControl(costControl);
for (int j = 0; j < months.Count; j++)
Model.WBS_CostControl costControl = oldViewInfos.FirstOrDefault(x => x.CostControlId == this.Grid1.Rows[i].DataKeys[2].ToString());
if (costControl != null && ids.Contains(this.Grid1.Rows[i].DataKeys[2].ToString()))
{
oldThisPlanValue = 0;
oldThisRealCost = 0;
oldThisPlanCost = 0;
changeThisPlanValue = 0;
changeThisRealCost = 0;
changeThisPlanCost = 0;
string planNum = values.Value<string>(string.Format("{0:yyyy-MM}", months[j]) + "Plan");
string thisNum = values.Value<string>(string.Format("{0:yyyy-MM}", months[j]) + "This");
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlIdAndMonths(costControlId, months[j]);
if (costControlDetail != null)
{
oldThisPlanValue = (costControlDetail.PlanNum ?? 0) * oldPlanPrice;
oldThisRealCost = (costControlDetail.ThisNum ?? 0) * oldRealPrice;
oldThisPlanCost = (costControlDetail.ThisNum ?? 0) * oldPlanPrice;
costControlDetail.PlanNum = Funs.GetNewDecimalOrZero(planNum);
costControlDetail.ThisNum = Funs.GetNewDecimalOrZero(thisNum);
thisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0);
thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
//BLL.CostControlDetailService.UpdateCostControlDetail(costControlDetail);
}
else
{
costControlDetail = new Model.WBS_CostControlDetail();
costControlDetail.CostControlDetailId = SQLHelper.GetNewID();
costControlDetail.CostControlId = costControlId;
costControlDetail.Months = months[j];
costControlDetail.PlanNum = Funs.GetNewDecimalOrZero(planNum);
costControlDetail.ThisNum = Funs.GetNewDecimalOrZero(thisNum);
thisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0);
thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
//BLL.CostControlDetailService.AddCostControlDetail(costControlDetail);
db.WBS_CostControlDetail.InsertOnSubmit(costControlDetail);
}
//累加变化值,计算总的变化值
changeThisPlanValue += thisPlanValue - oldThisPlanValue;
changeThisRealCost += thisRealCost - oldThisRealCost;
changeThisPlanCost += thisPlanCost - oldThisPlanCost;
if (changeThisPlanValue != 0 || changeThisRealCost != 0 || changeThisPlanCost != 0)
decimal oldPlanPrice = costControl.PlanPrice ?? 0;
decimal oldRealPrice = costControl.RealPrice ?? 0;
string costControlId = costControl.CostControlId;
string totalNum = values.Value<string>("TotalNum");
string planPrice = values.Value<string>("PlanPrice");
string realPrice = values.Value<string>("RealPrice");
string planStartDate = values.Value<string>("PlanStartDate");
string planEndDate = values.Value<string>("PlanEndDate");
string realStartDate = values.Value<string>("RealStartDate");
string realEndDate = values.Value<string>("RealEndDate");
costControl.TotalNum = Funs.GetNewDecimal(totalNum);
costControl.PlanPrice = Funs.GetNewDecimal(planPrice);
costControl.RealPrice = Funs.GetNewDecimal(realPrice);
costControl.PlanStartDate = Funs.GetNewDateTime(planStartDate);
costControl.PlanEndDate = Funs.GetNewDateTime(planEndDate);
costControl.RealStartDate = Funs.GetNewDateTime(realStartDate);
costControl.RealEndDate = Funs.GetNewDateTime(realEndDate);
BLL.CostControlService.UpdateCostControl(costControl);
for (int j = 0; j < months.Count; j++)
{
oldThisPlanValue = 0;
oldThisRealCost = 0;
oldThisPlanCost = 0;
changeThisPlanValue = 0;
changeThisRealCost = 0;
changeThisPlanCost = 0;
string planNum = values.Value<string>(string.Format("{0:yyyy-MM}", months[j]) + "Plan");
string thisNum = values.Value<string>(string.Format("{0:yyyy-MM}", months[j]) + "This");
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlIdAndMonths(costControlId, months[j]);
if (costControlDetail != null)
{
oldThisPlanValue = (costControlDetail.PlanNum ?? 0) * oldPlanPrice;
oldThisRealCost = (costControlDetail.ThisNum ?? 0) * oldRealPrice;
oldThisPlanCost = (costControlDetail.ThisNum ?? 0) * oldPlanPrice;
costControlDetail.PlanNum = Funs.GetNewDecimalOrZero(planNum);
costControlDetail.ThisNum = Funs.GetNewDecimalOrZero(thisNum);
thisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0);
thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
//BLL.CostControlDetailService.UpdateCostControlDetail(costControlDetail);
}
else
{
costControlDetail = new Model.WBS_CostControlDetail();
costControlDetail.CostControlDetailId = SQLHelper.GetNewID();
costControlDetail.CostControlId = costControlId;
costControlDetail.Months = months[j];
costControlDetail.PlanNum = Funs.GetNewDecimalOrZero(planNum);
costControlDetail.ThisNum = Funs.GetNewDecimalOrZero(thisNum);
thisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0);
thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
//BLL.CostControlDetailService.AddCostControlDetail(costControlDetail);
db.WBS_CostControlDetail.InsertOnSubmit(costControlDetail);
}
//累加变化值,计算总的变化值
changeThisPlanValue += thisPlanValue - oldThisPlanValue;
changeThisRealCost += thisRealCost - oldThisRealCost;
changeThisPlanCost += thisPlanCost - oldThisPlanCost;
//更新工作包、工作项
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(costControl.WbsSetId);
UpdateWbsSetDetail(db, costControl.WbsSetId, months[j], changeThisPlanValue, changeThisRealCost, changeThisPlanCost);

View File

@ -57,6 +57,15 @@ namespace FineUIPro.Web.JDGL.WBS {
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// hdId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox hdId;
/// <summary>
/// btnSave 控件。
/// </summary>