焊接管理,补充公司级树

This commit is contained in:
2025-04-14 15:31:57 +08:00
parent c8b553efc6
commit bb10b1f54e
111 changed files with 6980 additions and 4039 deletions
@@ -12,6 +12,22 @@ namespace FineUIPro.Web.HJGL.WeldingReport
{
public partial class UnitWorkareaAnalyze : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
@@ -22,34 +38,21 @@ namespace FineUIPro.Web.HJGL.WeldingReport
{
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
this.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
{
this.ProjectId = Request.Params["projectId"];
}
this.InitDropDownList();
this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法
//this.GetButtonPower();
}
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
List<Model.Base_Unit> units = new List<Model.Base_Unit>();
var pUnit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId);
if (pUnit == null || pUnit.UnitType == Const.ProjectUnitType_1)
{
units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2);
this.drpUnit.DataTextField = "UnitName";
this.drpUnit.DataValueField = "UnitId";
this.drpUnit.DataSource = units;
this.drpUnit.DataBind();
this.drpUnit.SelectedValue = CurrUser.UnitId;
Funs.FineUIPleaseSelect(this.drpUnit);
Funs.FineUIPleaseSelect(this.drpInstallation);
}
else
{
units = BLL.UnitService.GetSubUnitsListBySupervisorUnitId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId);
this.drpUnit.Enabled = false;
this.drpUnit.DataTextField = "UnitName";
this.drpUnit.DataValueField = "UnitId";
this.drpUnit.DataSource = units;
this.drpUnit.DataBind();
this.drpUnit.SelectedValue = CurrUser.UnitId;
Project_InstallationService.InitInstallationDropDownList(this.drpInstallation, this.CurrUser.LoginProjectId, true);
this.drpInstallation.SelectedValue = BLL.Const._Null;
}
///单位
@@ -71,6 +74,47 @@ namespace FineUIPro.Web.HJGL.WeldingReport
}
}
private void InitDropDownList()
{
List<Model.Base_Unit> units = new List<Model.Base_Unit>();
var pUnit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.ProjectId, this.CurrUser.UnitId);
if (pUnit == null || pUnit.UnitType == Const.ProjectUnitType_1)
{
units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.ProjectId, BLL.Const.ProjectUnitType_2);
this.drpUnit.DataTextField = "UnitName";
this.drpUnit.DataValueField = "UnitId";
this.drpUnit.DataSource = units;
this.drpUnit.DataBind();
this.drpUnit.SelectedValue = CurrUser.UnitId;
Funs.FineUIPleaseSelect(this.drpUnit);
Funs.FineUIPleaseSelect(this.drpInstallation);
}
else
{
units = BLL.UnitService.GetSubUnitsListBySupervisorUnitId(this.ProjectId, this.CurrUser.UnitId);
this.drpUnit.Enabled = false;
this.drpUnit.DataTextField = "UnitName";
this.drpUnit.DataValueField = "UnitId";
this.drpUnit.DataSource = units;
this.drpUnit.DataBind();
this.drpUnit.SelectedValue = CurrUser.UnitId;
Project_InstallationService.InitInstallationDropDownList(this.drpInstallation, this.ProjectId, true);
this.drpInstallation.SelectedValue = BLL.Const._Null;
}
}
/// <summary>
/// 公司级树加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void changeTree(object sender, EventArgs e)
{
this.ProjectId = this.ucTree.ProjectId;
this.InitDropDownList();
this.BindGrid();
}
/// <summary>
///
/// </summary>
@@ -81,9 +125,13 @@ namespace FineUIPro.Web.HJGL.WeldingReport
/// </summary>
private void BindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
List<SqlParameter> listStr = new List<SqlParameter>
{
new SqlParameter("@projectId", this.CurrUser.LoginProjectId)
new SqlParameter("@projectId", this.ProjectId)
};
if (this.drpUnit.SelectedValue != BLL.Const._Null)
{
@@ -125,7 +173,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
{
listStr.Add(new SqlParameter("@endTime", null));
}
if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.CurrUser.LoginProjectId))
if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.ProjectId))
{
listStr.Add(new SqlParameter("@supervisorUnitId", this.CurrUser.UnitId));
}
@@ -429,7 +477,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
this.drpInstallation.Items.Clear(); ///装置
this.drpWorkArea.Items.Clear(); ///区域
Project_InstallationService.InitInstallationDropDownList(this.drpInstallation, this.CurrUser.LoginProjectId, true);
Project_InstallationService.InitInstallationDropDownList(this.drpInstallation, this.ProjectId, true);
this.drpInstallation.SelectedValue = BLL.Const._Null;
Funs.FineUIPleaseSelect(this.drpWorkArea);
@@ -444,7 +492,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
protected void drpInstallation_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpWorkArea.Items.Clear();
WorkAreaService.InitWorkAreaProjectInstallUnitDropDownList(this.drpWorkArea, this.CurrUser.LoginProjectId, this.drpInstallation.SelectedValue, this.drpUnit.SelectedValue, true);
WorkAreaService.InitWorkAreaProjectInstallUnitDropDownList(this.drpWorkArea, this.ProjectId, this.drpInstallation.SelectedValue, this.drpUnit.SelectedValue, true);
this.drpWorkArea.SelectedValue = BLL.Const._Null;
}
#endregion