补充公司级树

This commit is contained in:
2025-04-13 20:44:26 +08:00
parent 96899ce306
commit f5344bddfb
34 changed files with 2330 additions and 1350 deletions
@@ -8,6 +8,22 @@ namespace FineUIPro.Web.HJGL.PersonManage
{
public partial class PersonManage : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
@@ -19,27 +35,62 @@ namespace FineUIPro.Web.HJGL.PersonManage
if (!IsPostBack)
{
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true);
//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.ProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法
//this.GetButtonPower();
}
Funs.FineUIPleaseSelect(drpTeamGroupId);
var unit = BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId);
if (unit == null || CommonService.GetProjectUnitType(this.CurrUser.LoginProjectId, this.CurrUser.UnitId) == BLL.Const.ProjectUnitType_1 || UnitService.IsSubUnitByProjectAndUnit(this.CurrUser.LoginProjectId, this.CurrUser.UnitId))
{
drpUnitId.Enabled = true;
}
else
{
drpUnitId.SelectedValue = this.CurrUser.UnitId;
drpUnitId.Enabled = false;
BLL.TeamGroupService.InitTeamGroupProjectUnitDropDownList(this.drpTeamGroupId, this.CurrUser.LoginProjectId, this.drpUnitId.SelectedValue, true);
}
// 绑定表格
this.BindGrid();
}
}
private void InitDropDownList()
{
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true);
var unit = BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId);
if (unit == null || CommonService.GetProjectUnitType(this.ProjectId, this.CurrUser.UnitId) == BLL.Const.ProjectUnitType_1 || UnitService.IsSubUnitByProjectAndUnit(this.ProjectId, this.CurrUser.UnitId))
{
drpUnitId.Enabled = true;
}
else
{
drpUnitId.SelectedValue = this.CurrUser.UnitId;
drpUnitId.Enabled = false;
BLL.TeamGroupService.InitTeamGroupProjectUnitDropDownList(this.drpTeamGroupId, this.ProjectId, this.drpUnitId.SelectedValue, true);
}
}
/// <summary>
/// 公司级树加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void changeTree(object sender, EventArgs e)
{
this.ProjectId = this.ucTree.ProjectId;
this.InitDropDownList();
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
btnNew.Hidden = true;
}
//this.GetButtonPower();
this.BindGrid();
}
#region
/// <summary>
@@ -47,6 +98,10 @@ namespace FineUIPro.Web.HJGL.PersonManage
/// </summary>
private void BindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
string strSql = @"SELECT Welder.WED_ID,
Welder.ProjectId,
Welder.WED_Unit,
@@ -66,7 +121,7 @@ namespace FineUIPro.Web.HJGL.PersonManage
+ @" LEFT JOIN ProjectData_TeamGroup AS TeamGroup ON TeamGroup.TeamGroupId = Welder.TeamGroupId"
+ @" WHERE Welder.ProjectId=@projectId AND (Welder.WederType='1' OR Welder.WederType is null)";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@projectId", this.ProjectId));
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
{
strSql += " AND Welder.WED_Unit = @unitId";
@@ -258,7 +313,7 @@ namespace FineUIPro.Web.HJGL.PersonManage
}
}
}
Project_HJGLData_HJGLService.StatisticalData(this.CurrUser.LoginProjectId, Project_HJGLData_HJGLService.HJGLDateType.TotalNumberOfWelders);
Project_HJGLData_HJGLService.StatisticalData(this.ProjectId, Project_HJGLData_HJGLService.HJGLDateType.TotalNumberOfWelders);
BindGrid();
if (!string.IsNullOrEmpty(strShowNotify))
{
@@ -345,7 +400,7 @@ namespace FineUIPro.Web.HJGL.PersonManage
this.drpTeamGroupId.Items.Clear();
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
{
BLL.TeamGroupService.InitTeamGroupProjectUnitDropDownList(this.drpTeamGroupId, this.CurrUser.LoginProjectId, this.drpUnitId.SelectedValue, true);
BLL.TeamGroupService.InitTeamGroupProjectUnitDropDownList(this.drpTeamGroupId, this.ProjectId, this.drpUnitId.SelectedValue, true);
this.drpTeamGroupId.SelectedIndex = 0;
}
else
@@ -364,7 +419,7 @@ namespace FineUIPro.Web.HJGL.PersonManage
/// <returns></returns>
private bool GetButtonPower(string button)
{
return BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_WelderManageMenuId, button);
return BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_WelderManageMenuId, button);
}
#endregion
}