补充公司级树

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
@@ -15,52 +15,43 @@ namespace FineUIPro.Web.CQMS.Solution
{
public partial class ConstructSolution : PageBase
{
#region
#region
/// <summary>
/// 获取按钮权限
/// 项目主键
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
public string ProjectId
{
if (Request.Params["value"] == "0")
get
{
return;
return (string)ViewState["ProjectId"];
}
var buttonList = CommonService.GetAllButtonList(CurrUser.LoginProjectId, CurrUser.UserId, Const.CQMSConstructSolutionMenuId);
if (buttonList.Count() > 0)
set
{
if (buttonList.Contains(Const.BtnAdd))
{
btnNew.Hidden = false;
}
if (buttonList.Contains(Const.BtnModify) || buttonList.Contains(Const.BtnSubmit))
{
btnMenuModify.Hidden = false;
}
if (buttonList.Contains(Const.BtnDelete))
{
btnMenuDel.Hidden = false;
}
ViewState["ProjectId"] = value;
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetButtonPower();
BLL.SolutionTempleteTypeService.InitSolutionTempleteDropDownList(drpSolutionType, true);
//Funs.FineUIPleaseSelect(drpState);
UnitWorkService.InitUnitWorkDownList(drpUnitWork, this.CurrUser.LoginProjectId, true);
CNProfessionalService.InitCNProfessionalDownList(drpCNProfessional, true);
UnitService.InitMainAndSubUnitDropDownList(drpProposeUnit, CurrUser.LoginProjectId, false);
btnNew.OnClientClick = window_tt.GetShowReference("EditConstructSolution.aspx") + "return false;";
if (this.CurrUser.UnitId != null && CommonService.GetProjectUnitType(this.CurrUser.LoginProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && this.CurrUser.UnitId != Const.hfnbdId)
this.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
{
this.drpProposeUnit.Hidden = true;
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();
}
CNProfessionalService.InitCNProfessionalDownList(drpCNProfessional, true);
btnNew.OnClientClick = window_tt.GetShowReference("EditConstructSolution.aspx") + "return false;";
BindGrid();
}
else
@@ -93,6 +84,65 @@ namespace FineUIPro.Web.CQMS.Solution
}
}
private void InitDropDownList()
{
BLL.SolutionTempleteTypeService.InitSolutionTempleteDropDownList(drpSolutionType, true);
//Funs.FineUIPleaseSelect(drpState);
UnitWorkService.InitUnitWorkDownList(drpUnitWork, this.ProjectId, true);
UnitService.InitMainAndSubUnitDropDownList(drpProposeUnit, ProjectId, false);
if (this.CurrUser.UnitId != null && CommonService.GetProjectUnitType(this.ProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && this.CurrUser.UnitId != Const.hfnbdId)
{
this.drpProposeUnit.Hidden = 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>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
if (Request.Params["value"] == "0")
{
return;
}
var buttonList = CommonService.GetAllButtonList(ProjectId, CurrUser.UserId, Const.CQMSConstructSolutionMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(Const.BtnAdd))
{
btnNew.Hidden = false;
}
if (buttonList.Contains(Const.BtnModify) || buttonList.Contains(Const.BtnSubmit))
{
btnMenuModify.Hidden = false;
}
if (buttonList.Contains(Const.BtnDelete))
{
btnMenuDel.Hidden = false;
}
}
}
#endregion
protected string ConvertEdition(object edition)
{
return string.Format("{0:#0.#}",((int)edition)/10.0);
@@ -136,8 +186,8 @@ namespace FineUIPro.Web.CQMS.Solution
+ @" where chec.ProjectId=@ProjectId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", CurrUser.LoginProjectId));
if (this.CurrUser.UnitId != null && CommonService.GetProjectUnitType(this.CurrUser.LoginProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && this.CurrUser.UnitId != Const.hfnbdId)
listStr.Add(new SqlParameter("@ProjectId", ProjectId));
if (this.CurrUser.UnitId != null && CommonService.GetProjectUnitType(this.ProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && this.CurrUser.UnitId != Const.hfnbdId)
{
strSql += " AND chec.UnitId='" + this.CurrUser.UnitId + "'";
}
@@ -216,10 +266,14 @@ namespace FineUIPro.Web.CQMS.Solution
}
private void BindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
var list = ChecklistData();
Grid1.RecordCount = list.Rows.Count;
var CNProfessional = CNProfessionalService.GetCNProfessionalItem();
var uniWork = UnitWorkService.GetUnitWorkLists(CurrUser.LoginProjectId);
var uniWork = UnitWorkService.GetUnitWorkLists(ProjectId);
if (list.Rows.Count > 0)
{
for (int i = 0; i < list.Rows.Count; i++)
@@ -835,7 +889,7 @@ namespace FineUIPro.Web.CQMS.Solution
return;
}
string id = Grid1.SelectedRowID.Split(',')[0];
if (CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, CurrUser.UserId, Const.CQMSConstructSolutionMenuId, Const.BtnDelete))
if (CommonService.GetAllButtonPowerList(ProjectId, CurrUser.UserId, Const.CQMSConstructSolutionMenuId, Const.BtnDelete))
{
var constructSolution = CQMSConstructSolutionService.GetConstructSolutionByConstructSolutionId(id);
CQMSConstructSolutionApproveService.DeleteConstructSolutionApprovesByConstructSolutionId(id);