This commit is contained in:
李鹏飞 2024-11-27 17:05:11 +08:00
commit caee2aa059
23 changed files with 757 additions and 70 deletions

View File

@ -1,4 +1,8 @@
alter table HSSE_ConstructionRisk add SubUnitDutyPerson nvarchar(50) null
alter table HSSE_ConstructionRisk add MainUnitDutyPerson nvarchar(50) null
alter table HSSE_ConstructionRisk add MainUnitCheckPerson nvarchar(500) null
GO
alter table [dbo].[HSSE_ConstructionRiskCheck] alter column [Rectification] nvarchar(500) null
GO
alter table [dbo].[HSSE_ConstructionRiskControl] alter column Measures nvarchar(500) null
GO

View File

@ -3495,6 +3495,11 @@ namespace BLL
/// 施工作业风险导入模板
/// </summary>
public const string ConstructionRiskTemplateUrl = "File\\Excel\\DataIn\\施工作业风险导入模板.xls";
/// <summary>
/// 施工作业风险导出模板
/// </summary>
public const string ConstructionRiskOutTemplateUrl = "File\\Excel\\DataOut\\每周施工作业风险动态管控表.xlsx";
#endregion
#region

View File

@ -174,6 +174,36 @@ namespace BLL
}
}
/// <summary>
/// 获取作业风险描述下拉项
/// </summary>
/// <returns></returns>
public static ListItem[] LicenseDesList()
{
ListItem[] lis = new ListItem[20];
lis[0] = new ListItem("物体打击", "物体打击");
lis[1] = new ListItem("车辆伤害", "车辆伤害");
lis[2] = new ListItem("机械伤害", "机械伤害");
lis[3] = new ListItem("起重伤害", "起重伤害");
lis[4] = new ListItem("触电", "触电");
lis[5] = new ListItem("淹溺", "淹溺");
lis[6] = new ListItem("灼烫", "灼烫");
lis[7] = new ListItem("火灾", "火灾");
lis[8] = new ListItem("高处坠落", "高处坠落");
lis[9] = new ListItem("坍塌", "坍塌");
lis[10] = new ListItem("冒顶片帮", "冒顶片帮");
lis[11] = new ListItem("透水", "透水");
lis[12] = new ListItem("放炮", "放炮");
lis[13] = new ListItem("火药爆炸", "火药爆炸");
lis[14] = new ListItem("瓦斯爆炸", "瓦斯爆炸");
lis[15] = new ListItem("锅炉爆炸", "锅炉爆炸");
lis[16] = new ListItem("容器爆炸", "容器爆炸");
lis[17] = new ListItem("其他爆炸", "其他爆炸");
lis[18] = new ListItem("中毒和窒息", "中毒和窒息");
lis[19] = new ListItem("其他伤害", "其他伤害");
return lis;
}
/// <summary>
/// 获取风险等级下拉项
/// </summary>

View File

@ -6,6 +6,23 @@
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>施工作业风险</title>
<style type="text/css">
.Red {
background-color: red;
}
.Yellow {
background-color: yellow;
}
.Orange {
background-color: orange;
}
.Blue {
background-color: deepskyblue;
}
</style>
</head>
<body>
<form id="form1" runat="server">
@ -40,6 +57,9 @@
OnClick="btnNew_Click">
</f:Button>
<f:Button ID="btnImport" Text="导入" ToolTip="导入" Icon="ApplicationGet" runat="server" Hidden="true" OnClick="btnImport_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
<%-- <f:Button ID="btnQR" Text="生成二维码" ToolTip="生成二维码" Icon="TableRefresh" runat="server" OnClick="btnQR_Click">
</f:Button>--%>
@ -109,7 +129,7 @@
</f:Window>
<f:Window ID="Window2" Title="施工作业风险" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Top" EnableResize="true" runat="server" OnClose="Window2_Close" IsModal="true"
Width="600px" Height="350px">
Width="600px" Height="370px">
</f:Window>
<f:Window ID="Window3" Title="施工作业风险巡检" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Top" EnableResize="true" runat="server" IsModal="true"
@ -145,7 +165,7 @@
function onGridDataLoad(event) {
this.mergeColumns(['UnitWorkName', 'ConstructionContent', 'RefLicense', 'LicenseDes','RiskLevel']);
this.mergeColumns(['MainItemName', 'ConstructionContent', 'RefLicense', 'LicenseDes','RiskLevel','State','AuditMan','download']);
}
</script>

View File

@ -8,6 +8,8 @@ using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using NPOI.SS.Util;
namespace FineUIPro.Web.HSSE.Hazard
{
@ -207,6 +209,30 @@ namespace FineUIPro.Web.HSSE.Hazard
Grid1.DataSource = tb;
Grid1.DataBind();
for (int i = 0; i < Grid1.Rows.Count; i++)
{
string rowID = Grid1.Rows[i].DataKeys[0].ToString().Split('|')[0];
var risk = BLL.ConstructionRiskListService.GetConstructionRisk(rowID);
if (risk != null)
{
if (risk.RiskLevel == "低风险")
{
Grid1.Rows[i].RowCssClass = "Blue";
}
else if (risk.RiskLevel == "一般风险")
{ //闭环
Grid1.Rows[i].RowCssClass = "Yellow";
}
else if (risk.RiskLevel == "较大风险")
{
Grid1.Rows[i].RowCssClass = "Orange";
}
else if (risk.RiskLevel == "重大风险")
{
Grid1.Rows[i].RowCssClass = " Red ";
}
}
}
}
else
{
@ -254,7 +280,7 @@ namespace FineUIPro.Web.HSSE.Hazard
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
//this.btnImport.Hidden = false;
this.btnImport.Hidden = false;
this.btnNew.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
@ -347,7 +373,7 @@ namespace FineUIPro.Web.HSSE.Hazard
var ins = BLL.ConstructionRiskListService.GetConstructionRisk(id);
if (ins != null)
{
if (ins.States.Equals(Const.ConstructionRisk_Complete))
if (ins.States == Const.ConstructionRisk_Complete)
{
Alert.ShowInTop("施工已完成,无需巡检!", MessageBoxIcon.Warning);
return;
@ -357,6 +383,11 @@ namespace FineUIPro.Web.HSSE.Hazard
Alert.ShowInTop("尚未实施,无法巡检!", MessageBoxIcon.Warning);
return;
}
else if (this.CurrUser.PersonId != ins.SubUnitDutyPerson && this.CurrUser.PersonId != ins.MainUnitDutyPerson && !ins.MainUnitCheckPerson.Contains(this.CurrUser.PersonId))
{
Alert.ShowInTop("只有分包责任人、总包责任人和总包核查人可以进行巡检!", MessageBoxIcon.Warning);
return;
}
}
PageContext.RegisterStartupScript(Window2.GetSaveStateReference(hdState.ClientID)
+ Window2.GetShowReference(String.Format("ConstructionRiskControlCheck.aspx?ConstructionRiskId={0}", id, "编辑 - ")));
@ -448,11 +479,19 @@ namespace FineUIPro.Web.HSSE.Hazard
{
if (ins.States == Const.ConstructionRisk_Audit3)
{
ins.States = Const.ConstructionRisk_Complete;
BLL.ConstructionRiskListService.UpdateConstructionRisk(ins);
BindGrid();
Alert.ShowInTop("操作成功!", MessageBoxIcon.Success);
return;
if (this.CurrUser.PersonId == ins.MainUnitDutyPerson)
{
ins.States = Const.ConstructionRisk_Complete;
BLL.ConstructionRiskListService.UpdateConstructionRisk(ins);
BindGrid();
Alert.ShowInTop("操作成功!", MessageBoxIcon.Success);
return;
}
else
{
Alert.ShowInTop("只有总包责任人可以操作完成!", MessageBoxIcon.Warning);
return;
}
}
else if (ins.States == Const.ConstructionRisk_Complete)
{
@ -524,5 +563,224 @@ namespace FineUIPro.Web.HSSE.Hazard
PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("ConstructionRiskCheckSee.aspx?ConstructionRiskId={0}", ids[0])));
}
}
#region
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
string rootPath = Server.MapPath("~/");
string initTemplatePath = string.Empty;
string uploadfilepath = string.Empty;
string newUrl = string.Empty;
string filePath = string.Empty;
initTemplatePath = Const.ConstructionRiskOutTemplateUrl;
uploadfilepath = rootPath + initTemplatePath;
Model.SGGLDB db = Funs.DB;
if (this.tvControlItem.SelectedNode != null && this.tvControlItem.SelectedNode.ToolTip == "标签")
{
string unitId = this.tvControlItem.SelectedNode.ParentNode.NodeID;
var risks = from x in db.HSSE_ConstructionRisk
join y in db.HSSE_ConstructionRiskControl on x.ConstructionRiskId equals y.ConstructionRiskId
where x.ProjectId == this.CurrUser.LoginProjectId && x.DateWeek == this.tvControlItem.SelectedNode.Text
orderby x.ConstructionContent, y.ShowIndex
select new
{
ControlId = y.ControlId,
ConstructionRiskId = x.ConstructionRiskId,
DateA = x.DateA,
DateZ = x.DateZ,
MainItemName = db.ProjectData_MainItem.First(a => a.MainItemId == x.WorkAreaId).MainItemName,
UnitName = db.Base_Unit.First(a => a.UnitId == x.UnitId).UnitName,
ConstructionContent = x.ConstructionContent,
RefLicense = x.RefLicense,
LicenseDes = x.LicenseDes,
RiskLevel = x.RiskLevel,
Measures = y.Measures,
SubUnitDutyPerson = db.Person_Persons.First(a => a.PersonId == x.SubUnitDutyPerson).PersonName,
MainUnitDutyPerson = db.Person_Persons.First(a => a.PersonId == x.MainUnitDutyPerson).PersonName,
MainUnitCheckPerson = Person_PersonsService.getPersonsNamesPersonIds(x.MainUnitCheckPerson),
};
var checkLists = from x in db.HSSE_ConstructionRiskCheck
join y in db.HSSE_ConstructionRisk on x.ConstructionRiskId equals y.ConstructionRiskId
where y.ProjectId == this.CurrUser.LoginProjectId
select x;
if (risks.Count() > 0)
{
string projectName = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId);
string date = string.Empty;
var r = risks.First();
if (r.DateA != null)
{
date = string.Format("{0:yyyy-MM-dd}", r.DateA);
}
newUrl = uploadfilepath.Replace(".xlsx", "(" + date + ")" + ".xlsx");
File.Copy(uploadfilepath, newUrl);
// 第一步:读取文件流
NPOI.SS.UserModel.IWorkbook workbook;
using (FileStream stream = new FileStream(newUrl, FileMode.Open, FileAccess.Read))
{
workbook = new NPOI.XSSF.UserModel.XSSFWorkbook(stream);
}
// 创建单元格样式
NPOI.SS.UserModel.ICellStyle cellStyle = workbook.CreateCellStyle();
cellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center;
cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center;
cellStyle.WrapText = true;
var font = workbook.CreateFont();
font.FontHeightInPoints = 14;
//font.FontHeightInPoints = (short)8.5;字号为小数时要转为short
cellStyle.SetFont(font);
// 创建单元格样式
NPOI.SS.UserModel.ICellStyle cellStyle2 = workbook.CreateCellStyle();
cellStyle2.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle2.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle2.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle2.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle2.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Left;
cellStyle2.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center;
cellStyle2.WrapText = true;
cellStyle2.SetFont(font);
// 第二步:创建新数据行
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
int i = 0;
NPOI.SS.UserModel.IRow row;
NPOI.SS.UserModel.ICell cell;
row = sheet.GetRow(i);
cell = row.GetCell(0);
DateTime dateA = r.DateA.Value;
DateTime dateZ = r.DateZ.Value;
cell.SetCellValue(projectName + " 每周施工作业风险动态管控表(" + dateA.Month + "月" + dateA.Day + "日-" + dateZ.Month + "月" + dateZ.Day + "日" + "");
i = 3;
int a = 0;
int b = 0;
string oldId = string.Empty;
foreach (var item in risks)
{
i++;
b++;
if (oldId != item.ConstructionRiskId)
{
if (!string.IsNullOrEmpty(oldId)) //非第一行记录
{
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i - 1, 0, 0));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i - 1, 1, 1));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i - 1, 2, 2));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i - 1, 3, 3));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i - 1, 4, 4));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i - 1, 5, 5));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i - 1, 6, 6));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i - 1, 8, 8));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i - 1, 9, 9));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i - 1, 10, 10));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i - 1, 11, 11));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i - 1, 12, 12));
}
oldId = item.ConstructionRiskId;
a++;
b = 1;
}
// 第二步:创建新数据行
row = sheet.CreateRow(i);
// 添加数据
cell = row.CreateCell(0);
cell.CellStyle = cellStyle;
cell.SetCellValue(a.ToString());
cell = row.CreateCell(1);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.MainItemName);
cell = row.CreateCell(2);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.UnitName);
cell = row.CreateCell(3);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.ConstructionContent);
cell = row.CreateCell(4);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.RefLicense);
cell = row.CreateCell(5);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.LicenseDes);
cell = row.CreateCell(6);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.RiskLevel);
cell = row.CreateCell(7);
cell.CellStyle = cellStyle2;
cell.SetCellValue(b.ToString() + "、" + item.Measures);
cell = row.CreateCell(8);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.SubUnitDutyPerson);
cell = row.CreateCell(9);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.MainUnitDutyPerson);
cell = row.CreateCell(10);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.MainUnitCheckPerson);
cell = row.CreateCell(11);
cell.CellStyle = cellStyle2;
var checks = checkLists.Where(x => x.ConstructionRiskId == item.ConstructionRiskId).OrderByDescending(x => x.CheckDate);
string checkResults = string.Empty;
string rectification = string.Empty;
foreach (var check in checks)
{
checkResults += string.Format("{0:yyyy-MM-dd}", check.CheckDate) + "" + check.CheckResult;
if (check.CheckResult == "不符合")
{
rectification += string.Format("{0:yyyy-MM-dd}", check.CheckDate) + "" + check.Rectification;
}
}
//row.Height = (short)(140 * checks.Count());
cell.SetCellValue(checkResults);
cell = row.CreateCell(12);
cell.CellStyle = cellStyle2;
cell.SetCellValue(rectification);
}
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i, 0, 0));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i, 1, 1));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i, 2, 2));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i, 3, 3));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i, 4, 4));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i, 5, 5));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i, 6, 6));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i, 8, 8));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i, 9, 9));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i, 10, 10));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i, 11, 11));
sheet.AddMergedRegion(new CellRangeAddress(i - b + 1, i, 12, 12));
// 第三步:写入文件流
using (FileStream stream = new FileStream(newUrl, FileMode.Create, FileAccess.Write))
{
workbook.Write(stream);
workbook.Close();
}
string fileName = Path.GetFileName(newUrl);
FileInfo info = new FileInfo(newUrl);
long fileSize = info.Length;
Response.Clear();
Response.ContentType = "application/x-zip-compressed";
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
Response.AddHeader("Content-Length", fileSize.ToString());
Response.TransmitFile(newUrl, 0, fileSize);
Response.Flush();
Response.Close();
File.Delete(newUrl);
}
else
{
Alert.ShowInTop("该周无记录,无法导出!", MessageBoxIcon.Warning);
}
}
else
{
Alert.ShowInTop("请选择一周的记录,再点击导出!", MessageBoxIcon.Warning);
}
}
#endregion
}
}

View File

@ -120,6 +120,15 @@ namespace FineUIPro.Web.HSSE.Hazard {
/// </remarks>
protected global::FineUIPro.Button btnImport;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// Label1 控件。
/// </summary>

View File

@ -18,11 +18,11 @@
runat="server" BoxFlex="1" DataKeyNames="ConstructionRiskCheckId" AllowCellEditing="true"
ClicksToEdit="2" DataIDField="ConstructionRiskCheckId" AllowSorting="true" SortField="CheckDate"
SortDirection="DESC" OnSort="Grid1_Sort" EnableColumnLines="true" ForceFit="true"
AllowPaging="false" PageSize="1000"
AllowPaging="false" PageSize="1000" OnRowCommand="Grid1_RowCommand"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" AllowFilters="true"
OnFilterChange="Grid1_FilterChange" OnRowDataBound="Grid1_RowDataBound" EnableTextSelection="True">
<Columns>
<f:TemplateField ColumnID="tfPageIndex" Width="45px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
<f:TemplateField ColumnID="tfPageIndex" Width="50px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
EnableLock="true" Locked="False">
<ItemTemplate>
<asp:Label ID="lblPageIndex" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
@ -45,6 +45,7 @@
<asp:Label ID="Label2" runat="server" Text='<%# ConvertRectification(Eval("Rectification")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:LinkButtonField HeaderText="附件" ColumnID="download" Width="60px" Icon="ArrowDown" CommandName="download" TextAlign="Center" HeaderTextAlign="Center" />
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
@ -56,6 +57,10 @@
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close"
Width="800px" Height="550">
</f:Window>
<f:Window ID="Window2" Title="文件查看" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Parent" EnableResize="false" runat="server" IsModal="true"
Width="680px" Height="480px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<Items>
<f:MenuButton ID="btnMenuModify" EnablePostBack="true" runat="server" Hidden="true" Text="修改" Icon="Pencil"

View File

@ -237,7 +237,7 @@ namespace FineUIPro.Web.HSSE.Hazard
}
else
{
return "";
return Rectification.ToString();
}
}
return "";
@ -247,5 +247,25 @@ namespace FineUIPro.Web.HSSE.Hazard
{
}
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
object[] keys = Grid1.DataKeys[e.RowIndex];
string fileId = string.Empty;
if (keys == null)
{
return;
}
else
{
fileId = keys[0].ToString();
}
if (e.CommandName.Equals("download"))
{
string menuId = Const.ConstructionRiskMenuId;
PageContext.RegisterStartupScript(Window2.GetShowReference(
String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/ConstructionRiskControlCheck&menuId={1}", fileId, menuId)));
}
}
}
}

View File

@ -75,6 +75,15 @@ namespace FineUIPro.Web.HSSE.Hazard {
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary>
/// Menu1 控件。
/// </summary>

View File

@ -49,14 +49,25 @@
</f:RadioButtonList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea runat="server" ID="txtRectification" Label="整改情况" Hidden="true"></f:TextArea>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:LinkButton ID="UploadAttach" runat="server" Label="附件"
Text="上传和查看" OnClick="btnAttachUrl_Click" >
</f:LinkButton>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:Label runat="server" ID="lbTemp">
</f:Label>
<f:HiddenField runat="server" ID="hdId"></f:HiddenField>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存" ValidateForms="SimpleForm1"
@ -69,7 +80,10 @@
</f:Form>
<f:Window ID="Window1" Title="文件上传" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Parent" EnableResize="false" runat="server" IsModal="true"
Width="680px" Height="480px">
</f:Window>
</form>
<script type="text/javascript">

View File

@ -98,6 +98,21 @@ namespace FineUIPro.Web.HSSE.Hazard
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.hdId.Text))
{
Alert.ShowInTop("请上传附件!", MessageBoxIcon.Warning);
return;
}
if (this.rbRectification.Hidden == false && string.IsNullOrEmpty(this.rbRectification.SelectedValue))
{
Alert.ShowInTop("请选择整改情况!", MessageBoxIcon.Warning);
return;
}
if (this.txtRectification.Hidden == false && string.IsNullOrEmpty(this.txtRectification.Text.Trim()))
{
Alert.ShowInTop("请输入整改情况!", MessageBoxIcon.Warning);
return;
}
this.SaveData(BLL.Const.BtnSave);
}
#endregion
@ -116,8 +131,15 @@ namespace FineUIPro.Web.HSSE.Hazard
string str = string.Empty;
if (this.rbCheckResult.SelectedValue == "不符合")
{
check.Rectification = rbRectification.SelectedValue;
str = rbRectification.SelectedValue;
if (this.rbRectification.Hidden == false)
{
check.Rectification = rbRectification.SelectedValue;
str = rbRectification.SelectedValue;
}
else
{
check.Rectification = txtRectification.Text.Trim();
}
}
if (!string.IsNullOrEmpty(this.ConstructionRiskCheckId))
{
@ -127,7 +149,7 @@ namespace FineUIPro.Web.HSSE.Hazard
}
else
{
check.ConstructionRiskCheckId = SQLHelper.GetNewID();
check.ConstructionRiskCheckId = this.hdId.Text;
BLL.ConstructionRiskCheckService.AddConstructionRiskCheck(check);
str += "|" + check.ConstructionRiskCheckId;
PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(str) + ActiveWindow.GetHidePostBackReference());
@ -144,11 +166,37 @@ namespace FineUIPro.Web.HSSE.Hazard
if (this.rbCheckResult.SelectedValue == "符合")
{
this.rbRectification.Hidden = true;
this.txtRectification.Hidden = true;
}
else
{
this.rbRectification.Hidden = false;
var projectUnit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.CurrUser.LoginProjectId,this.CurrUser.UnitId);
if (projectUnit != null && projectUnit.UnitType == BLL.Const.ProjectUnitType_2)
{
this.txtRectification.Hidden = false;
}
else
{
this.rbRectification.Hidden = false;
}
}
}
#region
/// <summary>
/// 上传附件资源
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAttachUrl_Click(object sender, EventArgs e)
{
string edit = "0";
if (string.IsNullOrEmpty(this.hdId.Text))
{
this.hdId.Text = SQLHelper.GetNewID();
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/ConstructionRiskControlCheck&menuId={1}&edit={2}", this.hdId.Text, BLL.Const.ConstructionRiskMenuId, edit)));
}
#endregion
}
}

View File

@ -66,6 +66,24 @@ namespace FineUIPro.Web.HSSE.Hazard {
/// </remarks>
protected global::FineUIPro.RadioButtonList rbRectification;
/// <summary>
/// txtRectification 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextArea txtRectification;
/// <summary>
/// UploadAttach 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.LinkButton UploadAttach;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@ -84,6 +102,15 @@ namespace FineUIPro.Web.HSSE.Hazard {
/// </remarks>
protected global::FineUIPro.Label lbTemp;
/// <summary>
/// hdId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdId;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
@ -101,5 +128,14 @@ namespace FineUIPro.Web.HSSE.Hazard {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
}
}

View File

@ -19,7 +19,7 @@
<f:HiddenField ID="hdfileName" runat="server"></f:HiddenField>
<f:FileUpload ID="FileExcel" runat="server" Label="数据文件" EmptyText="请上传EXCEl格式文件" Width="350px" LabelWidth="90px" LabelAlign="Right"></f:FileUpload>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
<f:Button ID="btnAudit" runat="server" Text="审核" ToolTip="审核" Icon="PageEdit" OnClick="btnAudit_Click"></f:Button>
<f:Button ID="btnAudit" runat="server" Text="审核" ToolTip="审核" Icon="PageEdit" OnClick="btnAudit_Click" Hidden="true"></f:Button>
<f:Button ID="btnSave" runat="server" Text="导入" ToolTip="导入" Icon="SystemSave" OnClick="btnSave_Click"></f:Button>
<f:Button ID="imgbtnUpload" runat="server" Icon="DiskDownload" Text="模板下载" EnableAjaxLoading="false" OnClick="imgbtnUpload_Click"></f:Button>
</Items>

View File

@ -180,13 +180,13 @@ namespace FineUIPro.Web.HSSE.Hazard
string result = string.Empty;
int ic, ir;
ic = pds.Columns.Count;
ir = pds.Rows.Count;
if (pds != null && ir > 0)
{
var units = from x in Funs.DB.Base_Unit select x;
var unitWorks = from x in Funs.DB.WBS_UnitWork where x.ProjectId == CurrUser.LoginProjectId select x;
var unitWorks = from x in Funs.DB.ProjectData_MainItem where x.ProjectId == CurrUser.LoginProjectId select x;
for (int i = 0; i < ir; i++)
{
string row0 = pds.Rows[i][0].ToString().Trim();
@ -208,11 +208,11 @@ namespace FineUIPro.Web.HSSE.Hazard
}
if (string.IsNullOrEmpty(row2))
{
result += (i + 2).ToString() + "," + "单位工程" + "," + "此项为必填项!" + "|";
result += (i + 2).ToString() + "," + "单位工程" + "," + "此项为必填项!" + "|";
}
else
{
var unitWork = unitWorks.Where(x => x.UnitWorkName == row2.Trim()).FirstOrDefault();
var unitWork = unitWorks.Where(x => x.MainItemName == row2.Trim()).FirstOrDefault();
if (unitWork == null)
{
result += (i + 2).ToString() + "," + "单位工程" + "," + "此项目不存在!" + "|";
@ -225,7 +225,7 @@ namespace FineUIPro.Web.HSSE.Hazard
}
else
{
var unit = units.Where(x => x.UnitName == row3.Trim()).FirstOrDefault();
var unit = units.Where(x => x.UnitName == row3.Trim()).FirstOrDefault();
if (unit == null)
{
result += (i + 2).ToString() + "," + "单位" + "," + "此项目不存在!" + "|";
@ -288,6 +288,30 @@ namespace FineUIPro.Web.HSSE.Hazard
{
if (errorInfos.Count <= 0)
{
//string rootPath = Server.MapPath("~/");
//string initFullPath = rootPath + initPath;
//if (!Directory.Exists(initFullPath))
//{
// Directory.CreateDirectory(initFullPath);
//}
//string filePath = initFullPath + this.hdfileName.Text;
//ImportXlsToData2(filePath);
if (this.FileExcel.HasFile == false)
{
Alert.ShowInTop("请您选择Excel文件!", MessageBoxIcon.Warning);
return;
}
string IsXls = Path.GetExtension(FileExcel.FileName).ToString().Trim().ToLower();
if (IsXls != ".xls")
{
Alert.ShowInTop("只可以选择Excel文件!", MessageBoxIcon.Warning);
return;
}
if (errorInfos != null)
{
errorInfos.Clear();
}
string rootPath = Server.MapPath("~/");
string initFullPath = rootPath + initPath;
if (!Directory.Exists(initFullPath))
@ -295,7 +319,9 @@ namespace FineUIPro.Web.HSSE.Hazard
Directory.CreateDirectory(initFullPath);
}
this.hdfileName.Text = BLL.Funs.GetNewFileName() + IsXls;
string filePath = initFullPath + this.hdfileName.Text;
FileExcel.PostedFile.SaveAs(filePath);
ImportXlsToData2(filePath);
}
else
@ -362,16 +388,19 @@ namespace FineUIPro.Web.HSSE.Hazard
string result = string.Empty;
string dReportID = string.Empty;
string dateStr = string.Empty;
int ir;
string des = "";
int ir;
ir = pds.Rows.Count;
if (pds != null && ir > 0)
{
Model.HSSE_ConstructionRisk newConstructionRisk = null;
var units = from x in Funs.DB.Base_Unit select x;
var unitWorks = from x in Funs.DB.WBS_UnitWork where x.ProjectId == CurrUser.LoginProjectId select x;
int index = 1;
var mainItems = from x in Funs.DB.ProjectData_MainItem where x.ProjectId == CurrUser.LoginProjectId select x;
var persons = from x in Funs.DB.Person_Persons
join y in Funs.DB.SitePerson_Person on x.PersonId equals y.PersonId
where y.ProjectId == this.CurrUser.LoginProjectId
select x;
var licenseTypes = from x in Funs.DB.Base_LicenseType orderby x.LicenseTypeCode select x;
var licenseDesList = BLL.ConstructionRiskListService.LicenseDesList();
for (int i = 0; i < ir; i++)
{
string row0 = pds.Rows[i][0].ToString().Trim();
@ -383,46 +412,91 @@ namespace FineUIPro.Web.HSSE.Hazard
string row6 = pds.Rows[i][6].ToString().Trim();
string row7 = pds.Rows[i][7].ToString().Trim();
string row8 = pds.Rows[i][8].ToString().Trim();
string row9 = pds.Rows[i][9].ToString().Trim();
var unit = units.Where(x => x.UnitName == row3).FirstOrDefault();
var unitWork = unitWorks.Where(x => x.UnitWorkName == row2).FirstOrDefault();
var mainItem = mainItems.Where(x => x.MainItemName == row2).FirstOrDefault();
var subDutyPerson = persons.FirstOrDefault(x => x.PersonName == row5);
newConstructionRisk = new Model.HSSE_ConstructionRisk();
newConstructionRisk.ConstructionRiskId = SQLHelper.GetNewID(typeof(Model.HSSE_ConstructionRisk));
if (des != row4)
newConstructionRisk.ProjectId = this.CurrUser.LoginProjectId;
if (unit != null)
{
index = 1;
newConstructionRisk = new Model.HSSE_ConstructionRisk();
newConstructionRisk.ConstructionRiskId = SQLHelper.GetNewID(typeof(Model.HSSE_ConstructionRisk));
newConstructionRisk.ProjectId = this.CurrUser.LoginProjectId;
newConstructionRisk.UnitId = unit.UnitId;
newConstructionRisk.WorkAreaId = unitWork.UnitWorkId;
try
{
newConstructionRisk.DateA = Funs.GetNewDateTime(row0);
newConstructionRisk.DateWeek = newConstructionRisk.DateA.Value.ToString("yyyy年") + Funs.GetWeekOfYear(newConstructionRisk.DateA.Value)+"周";
}
catch (Exception e) { }
try
{
newConstructionRisk.DateZ = Funs.GetNewDateTime(row1);
}
catch (Exception e) { }
newConstructionRisk.ConstructionContent = row4;
newConstructionRisk.RefLicense = row5;
newConstructionRisk.LicenseDes = row6;
newConstructionRisk.RiskLevel = row7;
Funs.DB.HSSE_ConstructionRisk.InsertOnSubmit(newConstructionRisk);
des = row4;
}
if (mainItem != null)
{
newConstructionRisk.WorkAreaId = mainItem.MainItemId;
}
try
{
newConstructionRisk.DateA = Funs.GetNewDateTime(row0);
Model.HSSE_ConstructionRiskControl constructionRiskControl = new Model.HSSE_ConstructionRiskControl();
constructionRiskControl.ControlId = SQLHelper.GetNewID(typeof(Model.HSSE_ConstructionRiskControl));
constructionRiskControl.ConstructionRiskId = newConstructionRisk.ConstructionRiskId;
constructionRiskControl.Measures = row8;
constructionRiskControl.ShowIndex = index;
Funs.DB.HSSE_ConstructionRiskControl.InsertOnSubmit(constructionRiskControl);
newConstructionRisk.DateWeek = newConstructionRisk.DateA.Value.ToString("yyyy年") + Funs.GetWeekOfYear(newConstructionRisk.DateA.Value) + "周";
}
catch (Exception e) { }
try
{
newConstructionRisk.DateZ = Funs.GetNewDateTime(row1);
}
catch (Exception e) { }
newConstructionRisk.ConstructionContent = row4;
if (subDutyPerson != null)
{
newConstructionRisk.SubUnitDutyPerson = subDutyPerson.PersonId;
}
string refLicense = string.Empty;
string[] refLicenses = row6.Split('|');
foreach (var item in refLicenses)
{
var licenseType = licenseTypes.FirstOrDefault(x => x.LicenseTypeName == item);
if (licenseType != null)
{
refLicense += item + ",";
}
}
if (!string.IsNullOrEmpty(refLicense))
{
newConstructionRisk.RefLicense = refLicense.Substring(0, refLicense.Length - 1);
}
string licenseDes = string.Empty;
string[] licenseDess = row7.Split('|');
foreach (var item in licenseDess)
{
var des = licenseDesList.FirstOrDefault(x => x.Text == item);
if (des != null)
{
licenseDes += item + ",";
}
}
if (!string.IsNullOrEmpty(licenseDes))
{
newConstructionRisk.LicenseDes = licenseDes.Substring(0, licenseDes.Length - 1);
}
newConstructionRisk.RiskLevel = row8;
newConstructionRisk.States= BLL.Const.ConstructionRisk_Compile;
Funs.DB.HSSE_ConstructionRisk.InsertOnSubmit(newConstructionRisk);
string[] riskControls = row9.Split('|');
int a = 0;
foreach (var item in riskControls)
{
if (!string.IsNullOrEmpty(item))
{
Model.HSSE_ConstructionRiskControl constructionRiskControl = new Model.HSSE_ConstructionRiskControl();
constructionRiskControl.ControlId = SQLHelper.GetNewID(typeof(Model.HSSE_ConstructionRiskControl));
constructionRiskControl.ConstructionRiskId = newConstructionRisk.ConstructionRiskId;
constructionRiskControl.Measures = item;
constructionRiskControl.ShowIndex = a;
Funs.DB.HSSE_ConstructionRiskControl.InsertOnSubmit(constructionRiskControl);
}
a++;
}
Model.HSSE_ConstructionRiskApprove approve1 = new Model.HSSE_ConstructionRiskApprove();
approve1.ConstructionRiskApproveId = SQLHelper.GetNewID();
approve1.ConstructionRiskId = newConstructionRisk.ConstructionRiskId;
approve1.ApproveMan = this.CurrUser.PersonId;
approve1.ApproveType = BLL.Const.ConstructionRisk_Compile;
Funs.DB.HSSE_ConstructionRiskApprove.InsertOnSubmit(approve1);
}
Funs.DB.SubmitChanges();
ShowNotify("导入成功!", MessageBoxIcon.Success);

View File

@ -38,7 +38,7 @@
<f:FormRow ColumnWidths="66% 34%">
<Items>
<f:TextBox runat="server" ID="txtConstructionContent" LabelWidth="140px" Label="施工内容" ShowRedStar="true" Required="true"></f:TextBox>
<f:DropDownList ID="drpSubUnitDutyPerson" runat="server" EnableEdit="true" Label="施工单位责任人" LabelWidth="140px"
<f:DropDownList ID="drpSubUnitDutyPerson" runat="server" EnableEdit="true" Label="施工单位责任人" LabelWidth="140px" ShowRedStar="true"
>
</f:DropDownList>
</Items>
@ -62,7 +62,7 @@
<f:FormRow>
<Items>
<f:DropDownList ID="drpLicenseDes" runat="server" EnableEdit="true" Label="作业风险描述" EnableMultiSelect="true" LabelWidth="140px" ShowRedStar="true">
<f:ListItem Value="物体打击" Text="物体打击" />
<%--<f:ListItem Value="物体打击" Text="物体打击" />
<f:ListItem Value="车辆伤害" Text="车辆伤害" />
<f:ListItem Value="机械伤害" Text="机械伤害" />
<f:ListItem Value="起重伤害" Text="起重伤害" />
@ -81,7 +81,7 @@
<f:ListItem Value="容器爆炸" Text="容器爆炸" />
<f:ListItem Value="其他爆炸" Text="其他爆炸" />
<f:ListItem Value="中毒和窒息" Text="中毒和窒息" />
<f:ListItem Value="其他伤害" Text="其他伤害" />
<f:ListItem Value="其他伤害" Text="其他伤害" />--%>
</f:DropDownList>
</Items>
</f:FormRow>
@ -138,6 +138,14 @@
<f:Label runat="server" CssStyle="display:none"></f:Label>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="drpMainUnitDutyPerson" runat="server" Label="总包责任人" Required="true" LabelAlign="Right" EnableEdit="true" Hidden="true">
</f:DropDownList>
<f:DropDownList ID="drpMainUnitCheckPerson" runat="server" Label="总包核查人" Required="true" LabelAlign="Right" EnableEdit="true" EnableMultiSelect="true" EnableCheckBoxSelect="true" Hidden="true" AutoPostBack="true" OnSelectedIndexChanged="drpMainUnitCheckPerson_SelectedIndexChanged">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="drpHandleType" OnSelectedIndexChanged="drpHandleType_SelectedIndexChanged" Readonly="true"

View File

@ -76,6 +76,8 @@ namespace FineUIPro.Web.HSSE.Hazard
this.drpHandleMan.DataTextField = "PersonName";
this.drpHandleMan.DataValueField = "PersonId";
this.InitDropDownList();
Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpMainUnitDutyPerson, this.CurrUser.LoginProjectId, BLL.Const.UnitId_SEDIN, BLL.Const.ZBCNEngineer, true);
Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpMainUnitCheckPerson, this.CurrUser.LoginProjectId, BLL.Const.UnitId_SEDIN, null, true);
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
constructionRiskControls.Clear();
this.ConstructionRiskId = Request.Params["ConstructionRiskId"];
@ -162,6 +164,17 @@ namespace FineUIPro.Web.HSSE.Hazard
this.btnSubmit.Visible = false;
this.next.Hidden = true;
}
if (State == BLL.Const.ConstructionRisk_Audit1)
{
this.drpMainUnitDutyPerson.Hidden = false;
}
if (State == BLL.Const.ConstructionRisk_Audit2)
{
this.drpMainUnitDutyPerson.SelectedValue = constructionRisk.MainUnitDutyPerson;
this.drpMainUnitDutyPerson.Hidden = false;
this.drpMainUnitDutyPerson.Readonly = true;
this.drpMainUnitCheckPerson.Hidden = false;
}
}
else
{
@ -196,6 +209,10 @@ namespace FineUIPro.Web.HSSE.Hazard
this.drpRiskLevel.DataSource = BLL.ConstructionRiskListService.RiskLevelList();
this.drpRiskLevel.DataBind();
Funs.FineUIPleaseSelect(this.drpRiskLevel);
this.drpLicenseDes.DataTextField = "Text";
this.drpLicenseDes.DataValueField = "Value";
this.drpLicenseDes.DataSource = BLL.ConstructionRiskListService.LicenseDesList();
this.drpLicenseDes.DataBind();
Funs.FineUIPleaseSelect(this.drpLicenseDes);
UnitService.InitUnitByProjectIdUnitTypeDropDownList(this.drpUnit, this.ProjectId, Const.ProjectUnitType_2, false);
}
@ -235,6 +252,48 @@ namespace FineUIPro.Web.HSSE.Hazard
ShowNotify("请选择作业风险描述!", MessageBoxIcon.Warning);
return;
}
var risk = BLL.ConstructionRiskListService.GetConstructionRisk(this.ConstructionRiskId);
if (risk != null)
{
if (risk.States == BLL.Const.ConstructionRisk_Audit1)
{
if (this.drpMainUnitDutyPerson.SelectedValue == BLL.Const._Null)
{
ShowNotify("请选择总包责任人!", MessageBoxIcon.Warning);
return;
}
}
else if (risk.States == BLL.Const.ConstructionRisk_Audit2)
{
if (this.drpMainUnitCheckPerson.SelectedValueArray.Length == 1 && this.drpMainUnitCheckPerson.SelectedValue == BLL.Const._Null)
{
ShowNotify("请选择总包核查人!", MessageBoxIcon.Warning);
return;
}
else
{
if (this.drpRiskLevel.SelectedValue == "较大风险" || this.drpRiskLevel.SelectedValue == "重大风险")
{
var sitePersons = from x in Funs.DB.SitePerson_Person where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitId == BLL.Const.UnitId_SEDIN && x.RoleIds != "" select x;
bool b = false; //是否勾选总包施工经理
foreach (var item in this.drpMainUnitCheckPerson.SelectedValueArray)
{
var projectUser = sitePersons.FirstOrDefault(x => x.PersonId == item);
if (projectUser != null && projectUser.RoleIds.Contains(BLL.Const.ConstructionManager))
{
b = true;
break;
}
}
if (!b)
{
ShowNotify("风险等级为较大风险及以上时,核查人必须有施工经理!", MessageBoxIcon.Warning);
return;
}
}
}
}
}
this.SaveData(BLL.Const.BtnSubmit);
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
@ -354,6 +413,26 @@ namespace FineUIPro.Web.HSSE.Hazard
newConstructionRisk.ConstructionContent = HttpUtility.HtmlEncode(this.txtConstructionContent.Text);
newConstructionRisk.ConstructionContentId = this.hdConstructionContentId.Text;
newConstructionRisk.Coordinate = this.hdCoordinate.Text;
if (this.drpMainUnitDutyPerson.Hidden == false)
{
newConstructionRisk.MainUnitDutyPerson = this.drpMainUnitDutyPerson.SelectedValue;
}
if (this.drpMainUnitCheckPerson.Hidden == false)
{
string mainUnitCheckPerson = string.Empty;
foreach (var item in this.drpMainUnitCheckPerson.SelectedItemArray)
{
if (item.Value != BLL.Const._Null)
{
mainUnitCheckPerson += item.Value + ",";
}
}
if (!string.IsNullOrEmpty(mainUnitCheckPerson))
{
mainUnitCheckPerson = mainUnitCheckPerson.Substring(0, mainUnitCheckPerson.Length - 1);
}
newConstructionRisk.MainUnitCheckPerson = mainUnitCheckPerson;
}
////单据状态
newConstructionRisk.States = BLL.Const.State_0;
//if (type == BLL.Const.BtnSubmit)
@ -672,5 +751,25 @@ namespace FineUIPro.Web.HSSE.Hazard
Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpSubUnitDutyPerson, CurrUser.LoginProjectId, drpUnit.SelectedValue, null, true);
this.drpSubUnitDutyPerson.SelectedValue = BLL.Const._Null;
}
protected void drpMainUnitCheckPerson_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.drpMainUnitCheckPerson.SelectedValueArray.Length == 1 && this.drpMainUnitCheckPerson.SelectedValue == BLL.Const._Null)
{
}
else
{
List<string> strs = new List<string>();
foreach (var item in this.drpMainUnitCheckPerson.SelectedValueArray)
{
if (item != BLL.Const._Null)
{
strs.Add(item);
}
}
this.drpMainUnitCheckPerson.SelectedValueArray = strs.ToArray();
}
}
}
}

View File

@ -183,6 +183,24 @@ namespace FineUIPro.Web.HSSE.Hazard {
/// </remarks>
protected global::FineUIPro.RadioButtonList rblIsAgree;
/// <summary>
/// drpMainUnitDutyPerson 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpMainUnitDutyPerson;
/// <summary>
/// drpMainUnitCheckPerson 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpMainUnitCheckPerson;
/// <summary>
/// drpHandleType 控件。
/// </summary>

View File

@ -62,7 +62,7 @@
<f:FormRow>
<Items>
<f:DropDownList ID="drpLicenseDes" runat="server" EnableEdit="true" Readonly="true" Label="作业风险描述" EnableMultiSelect="true" LabelWidth="140px" ShowRedStar="true">
<f:ListItem Value="物体打击" Text="物体打击" />
<%--<f:ListItem Value="物体打击" Text="物体打击" />
<f:ListItem Value="车辆伤害" Text="车辆伤害" />
<f:ListItem Value="机械伤害" Text="机械伤害" />
<f:ListItem Value="起重伤害" Text="起重伤害" />
@ -81,7 +81,7 @@
<f:ListItem Value="容器爆炸" Text="容器爆炸" />
<f:ListItem Value="其他爆炸" Text="其他爆炸" />
<f:ListItem Value="中毒和窒息" Text="中毒和窒息" />
<f:ListItem Value="其他伤害" Text="其他伤害" />
<f:ListItem Value="其他伤害" Text="其他伤害" />--%>
</f:DropDownList>
</Items>
</f:FormRow>
@ -117,6 +117,12 @@
</f:Grid>
</Items>
</f:FormRow>
<f:FormRow >
<Items>
<f:TextBox runat="server" ID="txtMainUnitDutyPerson" LabelWidth="140px" Label="总包责任人" Readonly="true"></f:TextBox>
<f:TextBox runat="server" ID="txtMainUnitCheckPerson" LabelWidth="140px" Label="总包核查人" Readonly="true"></f:TextBox>
</Items>
</f:FormRow>
<f:FormRow ID="plApprove2">
<Items>

View File

@ -115,6 +115,8 @@ namespace FineUIPro.Web.HSSE.Hazard
{
this.drpLicenseDes.SelectedValueArray = constructionRisk.LicenseDes.Split(',');
}
this.txtMainUnitDutyPerson.Text = BLL.Person_PersonsService.GetPersonsNameById(constructionRisk.MainUnitDutyPerson);
this.txtMainUnitCheckPerson.Text = BLL.Person_PersonsService.getPersonsNamesPersonIds(constructionRisk.MainUnitCheckPerson);
this.hdCoordinate.Text = constructionRisk.Coordinate;
constructionRiskControls = (from x in Funs.DB.HSSE_ConstructionRiskControl where x.ConstructionRiskId == this.ConstructionRiskId orderby x.ShowIndex select x).ToList();
gvApprove.DataSource = BLL.ConstructionRiskApproveService.getListData(this.ConstructionRiskId);
@ -157,6 +159,10 @@ namespace FineUIPro.Web.HSSE.Hazard
this.drpRiskLevel.DataSource = BLL.ConstructionRiskListService.RiskLevelList();
this.drpRiskLevel.DataBind();
Funs.FineUIPleaseSelect(this.drpRiskLevel);
this.drpLicenseDes.DataTextField = "Text";
this.drpLicenseDes.DataValueField = "Value";
this.drpLicenseDes.DataSource = BLL.ConstructionRiskListService.LicenseDesList();
this.drpLicenseDes.DataBind();
Funs.FineUIPleaseSelect(this.drpLicenseDes);
UnitService.InitUnitByProjectIdUnitTypeDropDownList(this.drpUnit, this.ProjectId, Const.ProjectUnitType_2, false);
}

View File

@ -129,6 +129,24 @@ namespace FineUIPro.Web.HSSE.Hazard {
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// txtMainUnitDutyPerson 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtMainUnitDutyPerson;
/// <summary>
/// txtMainUnitCheckPerson 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtMainUnitCheckPerson;
/// <summary>
/// plApprove2 控件。
/// </summary>

View File

@ -102357,7 +102357,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Rectification", DbType="NVarChar(50)")]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Rectification", DbType="NVarChar(500)")]
public string Rectification
{
get