20241017 共检通知单增加单位工程、分部工程、分项工程

This commit is contained in:
毕文静 2024-10-17 16:24:20 +08:00
parent 6614252a9c
commit 64c14e69e3
4 changed files with 301 additions and 36 deletions

View File

@ -28,9 +28,21 @@
<f:FormRow>
<Items>
<f:TextBox ID="txtNoticeCode" runat="server" Label="共检通知单编号" MaxLength="50" Required="true" ShowRedStar="true" LabelAlign="Right" LabelWidth="130px" ></f:TextBox>
<f:TextBox runat="server" ID="txtAcceptanceSite" Label="验收部位" LabelAlign="Right" LabelWidth="130px" ></f:TextBox>
<f:TextBox runat="server" ID="txtAcceptanceSite" Label="验收部位" LabelAlign="Right" LabelWidth="130px" Required="true" ShowRedStar="true" ></f:TextBox>
</Items>
</f:FormRow>
<f:FormRow ID="fr1" runat="server" Hidden="true">
<Items>
<f:DropDownList ID="drpUnitWorkId" runat="server" Label="单位工程" LabelAlign="Right" LabelWidth="130px" EnableEdit="true" AutoPostBack="true" OnSelectedIndexChanged="drpUnitWorkId_SelectedIndexChanged"></f:DropDownList>
<f:DropDownList ID="drpBranch" runat="server" Label="分部工程" LabelAlign="Right" LabelWidth="130px" EnableEdit="true" AutoPostBack="true" OnSelectedIndexChanged="drpBranch_SelectedIndexChanged"></f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow ID="fr2" runat="server" Hidden="true">
<Items>
<f:DropDownList ID="drpProEngineering" runat="server" Label="分项工程" LabelAlign="Right" LabelWidth="130px" EnableEdit="true"></f:DropDownList>
<f:Label ID="Lable1" runat="server"></f:Label>
</Items>
</f:FormRow>
<%--<f:FormRow ColumnWidths="95% 5%">
<Items>
<f:TextBox ID="txtUnitWork" Label="单位工程名称" runat="server" Readonly="true" LabelAlign="Right" LabelWidth="130px">

View File

@ -18,11 +18,36 @@ namespace FineUIPro.Web.CQMS.ProcessControl
{
if (!IsPostBack)
{
//测试阶段仅hfnbd账号使用
if (this.CurrUser.UserId == BLL.Const.hfnbdId)
{
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);//专业
UserService.InitUserProjectIdUnitTypeDropDownList(this.drpAcceptanceCheckMan, this.CurrUser.LoginProjectId, string.Empty, false);
//UserService.InitUserNameProjectIdUnitTypeDropDownList(this.drpAcceptanceCheckMan, this.CurrUser.LoginProjectId, string.Empty, false);
//单位工程
var q = (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 == null || y.SuperUnitWork == "0")
select new
{
y.UnitWorkId,
UnitWorkName = y.UnitWorkCode + "-" + y.UnitWorkName
}).Distinct().ToList();
this.drpUnitWorkId.DataTextField = "UnitWorkName";
this.drpUnitWorkId.DataValueField = "UnitWorkId";
this.drpUnitWorkId.DataSource = q;
this.drpUnitWorkId.DataBind();
Funs.FineUIPleaseSelect(this.drpUnitWorkId);
Funs.FineUIPleaseSelect(this.drpBranch);
Funs.FineUIPleaseSelect(this.drpProEngineering);
this.hdInspectionNoticeId.Text = Request.Params["inspectionId"];
if (!string.IsNullOrEmpty(Request.Params["View"]))
{
@ -46,6 +71,79 @@ namespace FineUIPro.Web.CQMS.ProcessControl
{
this.drpAcceptanceCheckMan.SelectedValueArray = inspectionManagement.AcceptanceCheckMan.Split(',');
}
//单位工程、分部工程、分项工程
if (!string.IsNullOrEmpty(inspectionManagement.UnitWorkId))
{
this.drpUnitWorkId.SelectedValue = inspectionManagement.UnitWorkId;
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.ControlPointType))
{
//分项工程
var b = (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.drpBranch.SelectedValue
&& y.ParentId != null
select new
{
y.DivisionId,
y.ProEngineeringName,
y.SubBranchEngineeringName
}).Distinct().ToList();
if (b.Where(w => w.SubBranchEngineeringName == null).Count() > 0)
{
this.drpProEngineering.DataTextField = "ProEngineeringName";
this.drpProEngineering.DataValueField = "DivisionId";
this.drpProEngineering.DataSource = b;
}
else
{
var c = (from x in Funs.DB.WBS_DivisionDivide
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
join z in Funs.DB.Division_SubProjects on y.ParentId equals z.DivisionId
join w in Funs.DB.Division_SubProjects on z.ParentId equals w.DivisionId
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.UnitWorkId == this.drpUnitWorkId.SelectedValue
&& z.ParentId == this.drpBranch.SelectedValue
select new
{
y.DivisionId,
y.ProEngineeringName
}).Distinct().ToList();
this.drpProEngineering.DataTextField = "ProEngineeringName";
this.drpProEngineering.DataValueField = "DivisionId";
this.drpProEngineering.DataSource = c;
}
this.drpProEngineering.DataBind();
Funs.FineUIPleaseSelect(this.drpProEngineering);
this.drpProEngineering.SelectedIndex = 0;
this.drpProEngineering.SelectedValue = inspectionManagement.ControlPointType;
}
}
}
this.txtNoticeCode.Text = inspectionManagement.NoticeCode;
this.Grid1.DataSource = BLL.InspectionManagementDetailService.GetInspectionDetails(this.hdInspectionNoticeId.Text.Trim());
this.Grid1.DataBind();
@ -58,7 +156,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
if (requestArg.StartsWith("ReloadGrid$"))
{
this.hdItemsString.Text = requestArg.Substring("ReloadGrid$".Length);
Window1_Close(null,null);
Window1_Close(null, null);
}
}
}
@ -72,7 +170,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
if (this.drpUnit.SelectedValue==BLL.Const._Null)
if (this.drpUnit.SelectedValue == BLL.Const._Null)
{
Alert.ShowInTop("请先选择施工分包商!", MessageBoxIcon.Warning);
return;
@ -112,6 +210,19 @@ namespace FineUIPro.Web.CQMS.ProcessControl
CheckManIds = CheckManIds.Substring(0, CheckManIds.LastIndexOf(","));
}
inspectionManagement.AcceptanceCheckMan = CheckManIds;
if (this.drpUnitWorkId.SelectedValue != BLL.Const._Null)
{
inspectionManagement.UnitWorkId = this.drpUnitWorkId.SelectedValue;
}
if (this.drpBranch.SelectedValue != BLL.Const._Null)
{
inspectionManagement.Branch = this.drpBranch.SelectedValue;
}
if (this.drpProEngineering.SelectedValue != BLL.Const._Null)
{
inspectionManagement.ControlPointType = this.drpProEngineering.SelectedValue;
}
//inspectionManagement.AcceptanceCheckMan = this.txtAcceptanceCheckMan.Text.Trim();
if (string.IsNullOrEmpty(Request.Params["inspectionId"]))
{
@ -146,7 +257,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
{
//编号不能重复
var InspectionManagementModel = Funs.DB.ProcessControl_InspectionManagement.FirstOrDefault(x => x.NoticeCode == this.txtNoticeCode.Text.Trim()
&& x.InspectionId!= Request.Params["inspectionId"]);
&& x.InspectionId != Request.Params["inspectionId"]);
if (InspectionManagementModel != null)
{
ShowNotify("共检通知单编号已存在,不能重复!", MessageBoxIcon.Warning);
@ -192,6 +303,12 @@ namespace FineUIPro.Web.CQMS.ProcessControl
}
#endregion
#region Grid1行内事件
/// <summary>
/// Grid1行内事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
string itemId = Grid1.DataKeys[e.RowIndex][0].ToString();
@ -210,6 +327,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
Grid1.DataBind();
}
}
#endregion
#region
/// <summary>
@ -250,7 +368,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
{
detail.CreateDate = Convert.ToDateTime(createDate);
}
details.Add(detail);
}
return details;
@ -400,5 +518,88 @@ namespace FineUIPro.Web.CQMS.ProcessControl
return name;
}
#endregion
#region DropDownList下拉选择事件
/// <summary>
/// 单位工程下拉选择事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void drpUnitWorkId_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpBranch.Items.Clear();
if (this.drpUnitWorkId.SelectedValue != BLL.Const._Null)
{
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.drpUnitWorkId.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;
}
/// <summary>
/// 分部工程下拉选择事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void drpBranch_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpProEngineering.Items.Clear();
if (this.drpBranch.SelectedValue != BLL.Const._Null)
{
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.drpUnitWorkId.SelectedValue
&& y.ParentId == this.drpBranch.SelectedValue
&& y.ParentId != null
select new
{
y.DivisionId,
y.ProEngineeringName,
y.SubBranchEngineeringName
}).Distinct().ToList();
if (q.Where(w => w.SubBranchEngineeringName == null).Count() > 0)
{
this.drpProEngineering.DataTextField = "ProEngineeringName";
this.drpProEngineering.DataValueField = "DivisionId";
this.drpProEngineering.DataSource = q;
}
else
{
var a = (from x in Funs.DB.WBS_DivisionDivide
join y in Funs.DB.Division_SubProjects on x.DivisionId equals y.DivisionId
join z in Funs.DB.Division_SubProjects on y.ParentId equals z.DivisionId
join w in Funs.DB.Division_SubProjects on z.ParentId equals w.DivisionId
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.UnitWorkId == this.drpUnitWorkId.SelectedValue
&& z.ParentId == this.drpBranch.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
}
}

View File

@ -7,13 +7,11 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.CQMS.ProcessControl
{
public partial class InspectionNoticeEdit
{
namespace FineUIPro.Web.CQMS.ProcessControl {
public partial class InspectionNoticeEdit {
/// <summary>
/// form1 控件。
/// </summary>
@ -22,7 +20,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
@ -31,7 +29,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
@ -40,7 +38,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// drpUnit 控件。
/// </summary>
@ -49,7 +47,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpUnit;
/// <summary>
/// drpCNProfessionalId 控件。
/// </summary>
@ -58,7 +56,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpCNProfessionalId;
/// <summary>
/// txtNoticeCode 控件。
/// </summary>
@ -67,7 +65,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtNoticeCode;
/// <summary>
/// txtAcceptanceSite 控件。
/// </summary>
@ -76,7 +74,61 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtAcceptanceSite;
/// <summary>
/// fr1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FormRow fr1;
/// <summary>
/// drpUnitWorkId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpUnitWorkId;
/// <summary>
/// drpBranch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpBranch;
/// <summary>
/// fr2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FormRow fr2;
/// <summary>
/// drpProEngineering 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpProEngineering;
/// <summary>
/// Lable1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Lable1;
/// <summary>
/// drpAcceptanceCheckMan 控件。
/// </summary>
@ -85,7 +137,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpAcceptanceCheckMan;
/// <summary>
/// Label1 控件。
/// </summary>
@ -94,7 +146,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label1;
/// <summary>
/// btnAttach 控件。
/// </summary>
@ -103,7 +155,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAttach;
/// <summary>
/// Panel2 控件。
/// </summary>
@ -112,7 +164,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel2;
/// <summary>
/// Grid1 控件。
/// </summary>
@ -121,7 +173,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar4 控件。
/// </summary>
@ -130,7 +182,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar4;
/// <summary>
/// btnNew 控件。
/// </summary>
@ -139,7 +191,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// Label2 控件。
/// </summary>
@ -148,7 +200,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label2;
/// <summary>
/// Label3 控件。
/// </summary>
@ -157,7 +209,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label3;
/// <summary>
/// Label5 控件。
/// </summary>
@ -166,7 +218,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label5;
/// <summary>
/// Label4 控件。
/// </summary>
@ -175,7 +227,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label4;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@ -184,7 +236,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// hdItemsString 控件。
/// </summary>
@ -193,7 +245,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdItemsString;
/// <summary>
/// hdInspectionNoticeId 控件。
/// </summary>
@ -202,7 +254,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdInspectionNoticeId;
/// <summary>
/// btnSave 控件。
/// </summary>
@ -211,7 +263,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// Window1 控件。
/// </summary>
@ -220,7 +272,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// WindowAtt 控件。
/// </summary>

View File

@ -12,7 +12,7 @@
<appSettings>
<!--连接字符串-->
<!--<add key="ConnectionString" value="Server=.;Database=SGGLDB_WH;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Connect Timeout=1200"/>-->
<add key="ConnectionString" value="Server=.;Database=SGGLDB_WH;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Connect Timeout=1200"/>
<add key="ConnectionString" value="Server=.\SQL2012;Database=SGGLDB_WH;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Connect Timeout=1200"/>
<!--系统名称-->
<add key="SystemName" value="智慧施工管理信息系统V1.0"/>
<add key="ChartImageHandler" value="storage=file;timeout=20;url=~/Images/;"/>