补充公司级树

This commit is contained in:
2025-04-11 15:19:17 +08:00
parent 35e0ebb3b9
commit fc7601612a
9 changed files with 635 additions and 319 deletions
@@ -14,39 +14,40 @@ namespace FineUIPro.Web.CQMS.Comprehensive
{
public partial class ContactList : 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.CQMSContactLitMenuId);
if (buttonList.Count() > 0)
set
{
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);
UnitService.InitUnitByProjectIdUnitTypeDropDownList(drpProposeUnit, CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, true);
{
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();
}
btnNew.OnClientClick = Window1.GetShowReference("ContactListEdit.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)
@@ -63,6 +64,27 @@ namespace FineUIPro.Web.CQMS.Comprehensive
}
}
private void InitDropDownList()
{
UnitService.InitUnitByProjectIdUnitTypeDropDownList(drpProposeUnit, this.ProjectId, BLL.Const.ProjectUnitType_2, 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();
}
protected string ConvertEdition(object edition)
{
return string.Format("{0:#0.#}",((int)edition)/10.0);
@@ -71,11 +93,33 @@ namespace FineUIPro.Web.CQMS.Comprehensive
{
int i = e.RowIndex;
string id = Grid1.Rows[i].DataKeys[0].ToString();
}
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
if (Request.Params["value"] == "0")
{
return;
}
var buttonList = CommonService.GetAllButtonList(CurrUser.LoginProjectId, CurrUser.UserId, Const.CQMSContactLitMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(Const.BtnDelete))
{
btnMenuDel.Hidden = false;
}
}
}
#endregion
protected DataTable ChecklistData()
{
string strSql = @"SELECT ContactListId
,ProjectId
,unit.UnitId
@@ -87,7 +131,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
where ProjectId=@ProjectId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
if (this.CurrUser.UnitId != null && CommonService.GetProjectUnitType(this.CurrUser.LoginProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && this.CurrUser.UnitId != Const.hfnbdId)
{
strSql += " AND contact.UnitId='" + this.CurrUser.UnitId+"'";
@@ -136,10 +180,14 @@ namespace FineUIPro.Web.CQMS.Comprehensive
}
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(this.ProjectId);
list = GetFilteredTable(Grid1.FilteredData, list);
var table = GetPagedDataTable(Grid1, list);