20241021 修改共检通知单

This commit is contained in:
2024-10-21 16:29:59 +08:00
parent 66d458026e
commit abb15b53fc
11 changed files with 1724 additions and 995 deletions
@@ -21,14 +21,21 @@ namespace FineUIPro.Web.CQMS.ProcessControl
//测试阶段,仅hfnbd账号使用
if (this.CurrUser.UserId == BLL.Const.hfnbdId)
{
this.drpUnitWorkId.Hidden = false;
this.fr1.Hidden = false;
this.fr2.Hidden = false;
}
GetButtonPower();
BLL.UnitService.InitUnitByProjectIdUnitTypeDropDownList(drpUnit, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, true);//施工分包商
BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessionalId, true);//专业
//BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessionalId, true);//专业
UserService.InitUserProjectIdUnitTypeDropDownList(this.drpAcceptanceCheckMan, this.CurrUser.LoginProjectId, string.Empty, false);
//UserService.InitUserNameProjectIdUnitTypeDropDownList(this.drpAcceptanceCheckMan, this.CurrUser.LoginProjectId, string.Empty, false);
//专业
this.drpCNProfessionalId.DataTextField = "DetectionItems";
this.drpCNProfessionalId.DataValueField = "ControlId";
this.drpCNProfessionalId.DataSource = BLL.CNProfessionalService.GetCnProList();
this.drpCNProfessionalId.DataBind();
Funs.FineUIPleaseSelect(this.drpCNProfessionalId);
//单位工程
var q = (from x in Funs.DB.WBS_DivisionDivide
@@ -44,9 +51,11 @@ namespace FineUIPro.Web.CQMS.ProcessControl
this.drpUnitWorkId.DataValueField = "UnitWorkId";
this.drpUnitWorkId.DataSource = q;
this.drpUnitWorkId.DataBind();
Funs.FineUIPleaseSelect(this.drpUnitWorkId);
Funs.FineUIPleaseSelect(this.drpBranch);
Funs.FineUIPleaseSelect(this.drpProEngineering);
Funs.FineUIPleaseSelect(this.drpUnitWorkId);//单位工程
Funs.FineUIPleaseSelect(this.drpChirldUnitWorkId);//子单位工程
Funs.FineUIPleaseSelect(this.drpBranch);//分部工程
Funs.FineUIPleaseSelect(this.drpChildBranch);//子分部工程
Funs.FineUIPleaseSelect(this.drpProEngineering);//分项工程
this.hdInspectionNoticeId.Text = Request.Params["inspectionId"];
if (!string.IsNullOrEmpty(Request.Params["View"]))
@@ -75,27 +84,118 @@ namespace FineUIPro.Web.CQMS.ProcessControl
if (!string.IsNullOrEmpty(inspectionManagement.UnitWorkId))
{
this.drpUnitWorkId.SelectedValue = inspectionManagement.UnitWorkId;
if (!string.IsNullOrEmpty(inspectionManagement.ChildUnitWorkId))
{
//子单位工程
var childUnitWorks = (from x in Funs.DB.WBS_DivisionDivide
join y in Funs.DB.WBS_UnitWork on x.UnitWorkId equals y.UnitWorkId
where x.ProjectId == this.CurrUser.LoginProjectId
&& y.SuperUnitWork == inspectionManagement.UnitWorkId
&& (y.SuperUnitWork != "0")
select new
{
y.UnitWorkId,
UnitWorkName = y.UnitWorkCode + "-" + y.UnitWorkName
}).Distinct().ToList();
this.drpChirldUnitWorkId.DataTextField = "UnitWorkName";
this.drpChirldUnitWorkId.DataValueField = "UnitWorkId";
this.drpChirldUnitWorkId.DataSource = childUnitWorks;
this.drpChirldUnitWorkId.DataBind();
Funs.FineUIPleaseSelect(this.drpChirldUnitWorkId);
this.drpChirldUnitWorkId.SelectedIndex = 0;
this.drpChirldUnitWorkId.SelectedValue = inspectionManagement.ChildUnitWorkId;
}
if (!string.IsNullOrEmpty(inspectionManagement.Branch))
{
//分部工程
var a = (from x in Funs.DB.WBS_DivisionDivide
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.UnitWorkId == this.drpUnitWorkId.SelectedValue
&& y.ParentId == null
select new
{
y.DivisionId,
y.BranchEngineeringName
}).Distinct().ToList();
this.drpBranch.DataTextField = "BranchEngineeringName";
this.drpBranch.DataValueField = "DivisionId";
this.drpBranch.DataSource = a;
this.drpBranch.DataBind();
Funs.FineUIPleaseSelect(this.drpBranch);
this.drpBranch.SelectedIndex = 0;
this.drpBranch.SelectedValue = inspectionManagement.Branch;
if (string.IsNullOrEmpty(inspectionManagement.ChildUnitWorkId))//无子单位工程
{
//分部工程
var a = (from x in Funs.DB.WBS_DivisionDivide
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.UnitWorkId == inspectionManagement.UnitWorkId
&& y.ParentId == null
select new
{
y.DivisionId,
y.BranchEngineeringName
}).Distinct().ToList();
this.drpBranch.DataTextField = "BranchEngineeringName";
this.drpBranch.DataValueField = "DivisionId";
this.drpBranch.DataSource = a;
this.drpBranch.DataBind();
Funs.FineUIPleaseSelect(this.drpBranch);
this.drpBranch.SelectedIndex = 0;
this.drpBranch.SelectedValue = inspectionManagement.Branch;
}
else
{
//分部工程(有子单位工程)
var a = (from x in Funs.DB.WBS_DivisionDivide
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.UnitWorkId == inspectionManagement.ChildUnitWorkId
&& y.ParentId == null
select new
{
y.DivisionId,
y.BranchEngineeringName
}).Distinct().ToList();
this.drpBranch.DataTextField = "BranchEngineeringName";
this.drpBranch.DataValueField = "DivisionId";
this.drpBranch.DataSource = a;
this.drpBranch.DataBind();
Funs.FineUIPleaseSelect(this.drpBranch);
this.drpBranch.SelectedIndex = 0;
this.drpBranch.SelectedValue = inspectionManagement.Branch;
}
if (!string.IsNullOrEmpty(inspectionManagement.ChildBranch))
{
#region
if (!string.IsNullOrEmpty(inspectionManagement.ChildUnitWorkId))
{
//子分部工程
var childBranchs = (from x in Funs.DB.WBS_DivisionDivide
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
where x.ProjectId == this.CurrUser.LoginProjectId
&& y.ParentId == inspectionManagement.Branch
&& x.UnitWorkId == inspectionManagement.ChildUnitWorkId
&& y.SubBranchEngineeringName != null
select new
{
y.DivisionId,
y.SubBranchEngineeringName
}).Distinct().ToList();
this.drpChildBranch.DataTextField = "SubBranchEngineeringName";
this.drpChildBranch.DataValueField = "DivisionId";
this.drpChildBranch.DataSource = childBranchs;
this.drpChildBranch.DataBind();
Funs.FineUIPleaseSelect(this.drpChildBranch);
this.drpChildBranch.SelectedIndex = 0;
}
else
{
var childBranchs = (from x in Funs.DB.WBS_DivisionDivide
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
where x.ProjectId == this.CurrUser.LoginProjectId
&& y.ParentId == inspectionManagement.Branch
&& x.UnitWorkId == inspectionManagement.UnitWorkId
&& y.SubBranchEngineeringName != null
select new
{
y.DivisionId,
y.SubBranchEngineeringName
}).Distinct().ToList();
this.drpChildBranch.DataTextField = "SubBranchEngineeringName";
this.drpChildBranch.DataValueField = "DivisionId";
this.drpChildBranch.DataSource = childBranchs;
this.drpChildBranch.DataBind();
Funs.FineUIPleaseSelect(this.drpChildBranch);
this.drpChildBranch.SelectedIndex = 0;
}
this.drpChildBranch.SelectedValue = inspectionManagement.ChildBranch;
#endregion
}
if (!string.IsNullOrEmpty(inspectionManagement.ControlPointType))
{
@@ -215,10 +315,18 @@ namespace FineUIPro.Web.CQMS.ProcessControl
{
inspectionManagement.UnitWorkId = this.drpUnitWorkId.SelectedValue;
}
if (this.drpChirldUnitWorkId.SelectedValue!=BLL.Const._Null)
{
inspectionManagement.ChildUnitWorkId = this.drpChirldUnitWorkId.SelectedValue;
}
if (this.drpBranch.SelectedValue != BLL.Const._Null)
{
inspectionManagement.Branch = this.drpBranch.SelectedValue;
}
if (this.drpChildBranch.SelectedValue!=BLL.Const._Null)
{
inspectionManagement.ChildBranch = this.drpChildBranch.SelectedValue;
}
if (this.drpProEngineering.SelectedValue != BLL.Const._Null)
{
inspectionManagement.ControlPointType = this.drpProEngineering.SelectedValue;
@@ -527,9 +635,29 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// <param name="e"></param>
protected void drpUnitWorkId_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpBranch.Items.Clear();
this.drpChirldUnitWorkId.Items.Clear();
if (this.drpUnitWorkId.SelectedValue != BLL.Const._Null)
{
//子单位工程
var childUnitWorks = (from x in Funs.DB.WBS_DivisionDivide
join y in Funs.DB.WBS_UnitWork on x.UnitWorkId equals y.UnitWorkId
where x.ProjectId == this.CurrUser.LoginProjectId
&& y.SuperUnitWork == this.drpUnitWorkId.SelectedValue
&& (y.SuperUnitWork != "0")
select new
{
y.UnitWorkId,
UnitWorkName = y.UnitWorkCode + "-" + y.UnitWorkName
}).Distinct().ToList();
this.drpChirldUnitWorkId.DataTextField = "UnitWorkName";
this.drpChirldUnitWorkId.DataValueField = "UnitWorkId";
this.drpChirldUnitWorkId.DataSource = childUnitWorks;
this.drpChirldUnitWorkId.DataBind();
Funs.FineUIPleaseSelect(this.drpChirldUnitWorkId);
this.drpChirldUnitWorkId.SelectedIndex = 0;
//分部工程
this.drpBranch.Items.Clear();
var q = (from x in Funs.DB.WBS_DivisionDivide
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
where x.ProjectId == this.CurrUser.LoginProjectId
@@ -545,8 +673,37 @@ namespace FineUIPro.Web.CQMS.ProcessControl
this.drpBranch.DataSource = q;
this.drpBranch.DataBind();
Funs.FineUIPleaseSelect(this.drpBranch);
this.drpBranch.SelectedIndex = 0;
}
}
/// <summary>
/// 子单位工程下拉选择事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void drpChirldUnitWorkId_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.drpChirldUnitWorkId.SelectedValue != BLL.Const._Null)
{
this.drpBranch.Items.Clear();
var q = (from x in Funs.DB.WBS_DivisionDivide
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.UnitWorkId == this.drpChirldUnitWorkId.SelectedValue
&& y.ParentId == null
select new
{
y.DivisionId,
y.BranchEngineeringName
}).Distinct().ToList();
this.drpBranch.DataTextField = "BranchEngineeringName";
this.drpBranch.DataValueField = "DivisionId";
this.drpBranch.DataSource = q;
this.drpBranch.DataBind();
Funs.FineUIPleaseSelect(this.drpBranch);
this.drpBranch.SelectedIndex = 0;
}
this.drpBranch.SelectedIndex = 0;
}
/// <summary>
@@ -556,9 +713,55 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// <param name="e"></param>
protected void drpBranch_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpProEngineering.Items.Clear();
this.drpChildBranch.Items.Clear();
if (this.drpBranch.SelectedValue != BLL.Const._Null)
{
#region
if (this.drpChirldUnitWorkId.SelectedValue != BLL.Const._Null)
{
//子分部工程
var childBranchs = (from x in Funs.DB.WBS_DivisionDivide
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
where x.ProjectId == this.CurrUser.LoginProjectId
&& y.ParentId == this.drpBranch.SelectedValue
&& x.UnitWorkId == this.drpChirldUnitWorkId.SelectedValue
&& y.SubBranchEngineeringName != null
select new
{
y.DivisionId,
y.SubBranchEngineeringName
}).Distinct().ToList();
this.drpChildBranch.DataTextField = "SubBranchEngineeringName";
this.drpChildBranch.DataValueField = "DivisionId";
this.drpChildBranch.DataSource = childBranchs;
this.drpChildBranch.DataBind();
Funs.FineUIPleaseSelect(this.drpChildBranch);
this.drpChildBranch.SelectedIndex = 0;
}
else
{
var childBranchs = (from x in Funs.DB.WBS_DivisionDivide
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
where x.ProjectId == this.CurrUser.LoginProjectId
&& y.ParentId == this.drpBranch.SelectedValue
&& x.UnitWorkId == this.drpUnitWorkId.SelectedValue
&& y.SubBranchEngineeringName != null
select new
{
y.DivisionId,
y.SubBranchEngineeringName
}).Distinct().ToList();
this.drpChildBranch.DataTextField = "SubBranchEngineeringName";
this.drpChildBranch.DataValueField = "DivisionId";
this.drpChildBranch.DataSource = childBranchs;
this.drpChildBranch.DataBind();
Funs.FineUIPleaseSelect(this.drpChildBranch);
this.drpChildBranch.SelectedIndex = 0;
}
#endregion
//分项工程
this.drpProEngineering.Items.Clear();
var q = (from x in Funs.DB.WBS_DivisionDivide
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
where x.ProjectId == this.CurrUser.LoginProjectId
@@ -600,6 +803,36 @@ namespace FineUIPro.Web.CQMS.ProcessControl
}
this.drpProEngineering.SelectedIndex = 0;
}
/// <summary>
/// 子分部工程下拉选择事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void drpChildBranch_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpProEngineering.Items.Clear();
if (this.drpChildBranch.SelectedValue != BLL.Const._Null)
{
//分项工程
var a = (from x in Funs.DB.WBS_DivisionDivide
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.UnitWorkId == this.drpUnitWorkId.SelectedValue
&& y.ParentId == this.drpChildBranch.SelectedValue
select new
{
y.DivisionId,
y.ProEngineeringName
}).Distinct().ToList();
this.drpProEngineering.DataTextField = "ProEngineeringName";
this.drpProEngineering.DataValueField = "DivisionId";
this.drpProEngineering.DataSource = a;
this.drpProEngineering.DataBind();
Funs.FineUIPleaseSelect(this.drpProEngineering);
this.drpProEngineering.SelectedIndex = 0;
}
}
#endregion
}
}