提交代码
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user