20231016月报安全工时、累计工时优化

This commit is contained in:
杨红卫 2023-10-16 11:24:26 +08:00
parent 5a9ebc9ade
commit 87a19f7dfe
6 changed files with 51 additions and 5 deletions

View File

@ -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;
}
}

View File

@ -111,12 +111,12 @@
</f:Panel>
<f:Window ID="Window1" Title="编辑月报" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close"
Width="1300px" Height="600px">
Width="1300px" Height="600px" Maximized="true">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<Items>
<f:MenuButton ID="btnMenuModify" EnablePostBack="true" runat="server" Hidden="true"
Text="编辑" Icon="Pencil" OnClick="btnMenuModify_Click">
Text="编辑" Icon="Pencil" OnClick="btnMenuModify_Click" >
</f:MenuButton>
<f:MenuButton ID="btnPrinter" EnablePostBack="true" runat="server"
Text="导出" Icon="Printer" OnClick="btnPrinter_Click" EnableAjax="false" DisableControlBeforePostBack="false">

View File

@ -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

View File

@ -126,7 +126,8 @@
<f:Panel ID="SeDinMonthReport3Item" Layout="Block" CssClass="blockpanel myblockform" BlockMD="12"
BlockConfigSpace="10px" BodyPadding="5px" Title="2、项目安全工时统计" EnableCollapse="true" runat="server">
<Items>
<f:TextBox ID="MonthWorkTime" runat="server" Label="当月安全人工时" LabelAlign="Right" LabelWidth="160px" BlockMD="4" MaxLength="50">
<f:TextBox ID="MonthWorkTime" runat="server" Label="当月安全人工时" EnableBlurEvent="true" OnBlur="MonthWorkTime_Blur"
LabelAlign="Right" LabelWidth="160px" BlockMD="4" MaxLength="50">
</f:TextBox>
<f:TextBox ID="YearWorkTime" runat="server" Label="年度累计安全人工时" LabelAlign="Right" BlockMD="4" LabelWidth="160px" MaxLength="50">
</f:TextBox>

View File

@ -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();
}
}
}

View File

@ -42,7 +42,7 @@
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtFactoryCode" runat="server" Label="出厂编号" LabelAlign="Right" LabelWidth="110px"
<f:TextBox ID="txtFactoryCode" runat="server" Label="编号" LabelAlign="Right" LabelWidth="110px"
MaxLength="50" ShowRedStar="true" Required="true">
</f:TextBox>
<f:TextBox ID="txtCertificateCode" runat="server" Label="合格证编号" LabelAlign="Right"