补充公司级别树

This commit is contained in:
2025-04-09 19:14:54 +08:00
parent 8514fb0156
commit 023e3d33cf
86 changed files with 5694 additions and 3375 deletions
@@ -39,13 +39,19 @@ namespace FineUIPro.Web.HSSE.ActionPlan
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
////权限按钮方法
this.GetButtonPower();
this.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
{
this.ProjectId = Request.Params["projectId"];
}
this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法
this.GetButtonPower();
}
this.btnNew.OnClientClick = Window1.GetShowReference("ActionPlanListEdit.aspx") + "return false;";
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
{
@@ -57,49 +63,66 @@ namespace FineUIPro.Web.HSSE.ActionPlan
}
}
/// <summary>
/// 公司级树加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void changeTree(object sender, EventArgs e)
{
this.ProjectId = this.ucTree.ProjectId;
this.BindGrid();
this.GetButtonPower();
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
btnNew.Hidden = true;
}
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
if (!string.IsNullOrEmpty(this.ProjectId))
if (string.IsNullOrEmpty(this.ProjectId))
{
string strSql = "SELECT ActionPlanList.ActionPlanListId,ActionPlanList.ProjectId,CodeRecords.Code AS ActionPlanListCode,ActionPlanList.ActionPlanListName,ActionPlanList.VersionNo,(CASE ProjectType WHEN '1' THEN '系统内项目' WHEN '2' THEN '系统外项目' WHEN '3' THEN '海外项目' END ) AS ProjectType,ActionPlanList.ActionPlanListContents,ActionPlanList.CompileMan,Users.UserName AS CompileManName, ActionPlanList.CompileDate,ActionPlanList.States"
+ @" ,(CASE WHEN ActionPlanList.States = " + BLL.Const.State_0 + " OR ActionPlanList.States IS NULL THEN '待['+OperateUser.UserName+']提交' WHEN ActionPlanList.States = " + BLL.Const.State_2 + " THEN '审核/审批完成' ELSE '待['+OperateUser.UserName+']办理' END) AS FlowOperateName"
+ @" FROM ActionPlan_ActionPlanList AS ActionPlanList "
+ @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON ActionPlanList.ActionPlanListId=CodeRecords.DataId "
+ @" LEFT JOIN Sys_FlowOperate AS FlowOperate ON ActionPlanList.ActionPlanListId=FlowOperate.DataId AND FlowOperate.IsClosed <> 1"
+ @" LEFT JOIN Sys_User AS OperateUser ON FlowOperate.OperaterId=OperateUser.UserId "
+ @" LEFT JOIN Sys_User AS Users ON Users.UserId = ActionPlanList.CompileMan "
+ @" WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND ActionPlanList.ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值
{
strSql += " AND ActionPlanList.States = @States"; ///状态为已完成
listStr.Add(new SqlParameter("@States", BLL.Const.State_2));
}
if (!string.IsNullOrEmpty(this.txtActionPlanListCode.Text.Trim()))
{
strSql += " AND ActionPlanListCode LIKE @ActionPlanListCode";
listStr.Add(new SqlParameter("@ActionPlanListCode", "%" + this.txtActionPlanListCode.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtActionPlanListName.Text.Trim()))
{
strSql += " AND ActionPlanListName LIKE @ActionPlanListName";
listStr.Add(new SqlParameter("@ActionPlanListName", "%" + this.txtActionPlanListName.Text.Trim() + "%"));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
return;
}
string strSql = "SELECT ActionPlanList.ActionPlanListId,ActionPlanList.ProjectId,CodeRecords.Code AS ActionPlanListCode,ActionPlanList.ActionPlanListName,ActionPlanList.VersionNo,(CASE ProjectType WHEN '1' THEN '系统内项目' WHEN '2' THEN '系统外项目' WHEN '3' THEN '海外项目' END ) AS ProjectType,ActionPlanList.ActionPlanListContents,ActionPlanList.CompileMan,Users.UserName AS CompileManName, ActionPlanList.CompileDate,ActionPlanList.States"
+ @" ,(CASE WHEN ActionPlanList.States = " + BLL.Const.State_0 + " OR ActionPlanList.States IS NULL THEN '待['+OperateUser.UserName+']提交' WHEN ActionPlanList.States = " + BLL.Const.State_2 + " THEN '审核/审批完成' ELSE '待['+OperateUser.UserName+']办理' END) AS FlowOperateName"
+ @" FROM ActionPlan_ActionPlanList AS ActionPlanList "
+ @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON ActionPlanList.ActionPlanListId=CodeRecords.DataId "
+ @" LEFT JOIN Sys_FlowOperate AS FlowOperate ON ActionPlanList.ActionPlanListId=FlowOperate.DataId AND FlowOperate.IsClosed <> 1"
+ @" LEFT JOIN Sys_User AS OperateUser ON FlowOperate.OperaterId=OperateUser.UserId "
+ @" LEFT JOIN Sys_User AS Users ON Users.UserId = ActionPlanList.CompileMan "
+ @" WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND ActionPlanList.ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值
{
strSql += " AND ActionPlanList.States = @States"; ///状态为已完成
listStr.Add(new SqlParameter("@States", BLL.Const.State_2));
}
if (!string.IsNullOrEmpty(this.txtActionPlanListCode.Text.Trim()))
{
strSql += " AND ActionPlanListCode LIKE @ActionPlanListCode";
listStr.Add(new SqlParameter("@ActionPlanListCode", "%" + this.txtActionPlanListCode.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtActionPlanListName.Text.Trim()))
{
strSql += " AND ActionPlanListName LIKE @ActionPlanListName";
listStr.Add(new SqlParameter("@ActionPlanListName", "%" + this.txtActionPlanListName.Text.Trim() + "%"));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion
@@ -203,7 +226,7 @@ namespace FineUIPro.Web.HSSE.ActionPlan
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ActionPlanListEdit.aspx?ActionPlanListId={0}", id, "编辑 - ")));
}
}
}
}
#endregion
@@ -276,7 +299,7 @@ namespace FineUIPro.Web.HSSE.ActionPlan
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectActionPlanListMenuId);
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectActionPlanListMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))