diff --git a/SGGL/BLL/API/HSSE/APISeDinMonthReportService.cs b/SGGL/BLL/API/HSSE/APISeDinMonthReportService.cs index 52b80d4f..594e6508 100644 --- a/SGGL/BLL/API/HSSE/APISeDinMonthReportService.cs +++ b/SGGL/BLL/API/HSSE/APISeDinMonthReportService.cs @@ -189,7 +189,22 @@ namespace BLL { newItem.YearWorkTime = 0; } + + var getMaxMonthReport = (from x in Funs.DB.SeDin_MonthReport + where x.ProjectId == projectId && x.ReporMonth < monthD + orderby x.ReporMonth descending + select x).FirstOrDefault(); + if (getMaxMonthReport != null) + { + var getMonthReport2 = Funs.DB.SeDin_MonthReport2.FirstOrDefault(x => x.MonthReportId == getMaxMonthReport.MonthReportId); + if (getMonthReport2 != null) + { + newItem.YearWorkTime = getMonthReport2.YearWorkTime ?? 0; + newItem.SafeWorkTime = getMonthReport2.SafeWorkTime ?? 0; + } + } } + return newItem; } } diff --git a/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonth_SeDin.aspx b/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonth_SeDin.aspx index 3422560f..f6590952 100644 --- a/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonth_SeDin.aspx +++ b/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonth_SeDin.aspx @@ -111,12 +111,12 @@ diff --git a/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonth_SeDin.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonth_SeDin.aspx.cs index cb27259e..4298f4d5 100644 --- a/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonth_SeDin.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonth_SeDin.aspx.cs @@ -214,6 +214,14 @@ namespace FineUIPro.Web.HSSE.Manager Alert.ShowInTop("当前月份的月报已存在!", MessageBoxIcon.Warning); return; } + + var getNMonthReport = Funs.DB.SeDin_MonthReport.FirstOrDefault(x =>x.ProjectId == this.CurrUser.LoginProjectId && x.States != Const.State_3); + if (getNMonthReport != null) + { + Alert.ShowInTop("存在未完成月报,请先办理完成!", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ManagerMonth_SeDinEdit.aspx?Month={0}", txtMonth.Text.Trim()), "添加月报表")); } #endregion diff --git a/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonth_SeDinEdit.aspx b/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonth_SeDinEdit.aspx index c50acea0..27de9647 100644 --- a/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonth_SeDinEdit.aspx +++ b/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonth_SeDinEdit.aspx @@ -126,7 +126,8 @@ - + diff --git a/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonth_SeDinEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonth_SeDinEdit.aspx.cs index 6a9a8af1..d427f429 100644 --- a/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonth_SeDinEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonth_SeDinEdit.aspx.cs @@ -713,7 +713,6 @@ namespace FineUIPro.Web.HSSE.Manager newItem.MonthReportId = MonthReportId; newItem.MonthWorkTime = Funs.GetNewDecimalOrZero(MonthWorkTime.Text); newItem.YearWorkTime = Funs.GetNewDecimalOrZero(YearWorkTime.Text); - newItem.YearWorkTime = Funs.GetNewDecimalOrZero(YearWorkTime.Text); newItem.TotalLostTime = Funs.GetNewDecimalOrZero(TotalLostTime.Text); newItem.MillionLossRate = MillionLossRate.Text; newItem.ProjectWorkTime = Funs.GetNewDecimalOrZero(ProjectWorkTime.Text); @@ -1439,5 +1438,28 @@ namespace FineUIPro.Web.HSSE.Manager { SetStepDrp(); } + + protected void MonthWorkTime_Blur(object sender, EventArgs e) + { + var monthWorkTimeValue = Funs.GetNewDecimalOrZero(this.MonthWorkTime.Text); + decimal hdYearWorkTimeValue =0; + decimal hdSafeWorkTimeValue =0; + DateTime month=Funs.GetNewDateTimeOrNow(this.ReporMonth.Text); + + var getMaxMonthReport = (from x in Funs.DB.SeDin_MonthReport where x.ProjectId == this.ProjectId && x.ReporMonth < month + orderby x.ReporMonth descending select x).FirstOrDefault(); + if (getMaxMonthReport != null) + { + var getMonthReport2 = Funs.DB.SeDin_MonthReport2.FirstOrDefault(x => x.MonthReportId == getMaxMonthReport.MonthReportId); + if (getMonthReport2 != null) + { + hdYearWorkTimeValue = getMonthReport2.YearWorkTime ?? 0; + hdSafeWorkTimeValue = getMonthReport2.SafeWorkTime ?? 0; + } + } + + this.YearWorkTime.Text = (monthWorkTimeValue + hdYearWorkTimeValue).ToString(); + this.SafeWorkTime.Text = (monthWorkTimeValue + hdSafeWorkTimeValue).ToString(); + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/QualityAudit/EquipmentQualityEdit.aspx b/SGGL/FineUIPro.Web/HSSE/QualityAudit/EquipmentQualityEdit.aspx index a743aae7..a966adf7 100644 --- a/SGGL/FineUIPro.Web/HSSE/QualityAudit/EquipmentQualityEdit.aspx +++ b/SGGL/FineUIPro.Web/HSSE/QualityAudit/EquipmentQualityEdit.aspx @@ -42,7 +42,7 @@ -