焊接管理,补充公司级树
This commit is contained in:
@@ -10,6 +10,20 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
{
|
||||
#region 定义项
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 试压包主键
|
||||
/// </summary>
|
||||
public string PTP_ID
|
||||
@@ -62,13 +76,49 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
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.txtReportDate.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
|
||||
|
||||
BLL.UserService.InitUserDropDownList(this.drpPTP_Finisher, this.CurrUser.LoginProjectId, true);//完工人
|
||||
|
||||
this.InitTreeMenu();
|
||||
}
|
||||
}
|
||||
|
||||
private void InitDropDownList()
|
||||
{
|
||||
BLL.UserService.InitUserDropDownList(this.drpPTP_Finisher, this.ProjectId, 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.InitTreeMenu();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 加载树装置-单位-工作区
|
||||
@@ -77,6 +127,10 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
/// </summary>
|
||||
private void InitTreeMenu()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtReportDate.Text.Trim()))
|
||||
{
|
||||
DateTime? startTime = Funs.GetNewDateTime(this.txtReportDate.Text.Trim());
|
||||
@@ -93,16 +147,16 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
var unit = BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId);
|
||||
if (unit == null || unit.UnitTypeId == BLL.Const.ProjectUnitType_1 || unit.UnitTypeId == BLL.Const.ProjectUnitType_3)
|
||||
{
|
||||
if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.CurrUser.LoginProjectId))
|
||||
if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.ProjectId))
|
||||
{
|
||||
units = (from x in Funs.DB.Base_Unit
|
||||
join y in Funs.DB.ProjectData_WorkArea on x.UnitId equals y.UnitId
|
||||
where (x.UnitId == this.CurrUser.UnitId || y.SupervisorUnitId == this.CurrUser.UnitId) && y.ProjectId == this.CurrUser.LoginProjectId
|
||||
where (x.UnitId == this.CurrUser.UnitId || y.SupervisorUnitId == this.CurrUser.UnitId) && y.ProjectId == this.ProjectId
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, "2");
|
||||
units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.ProjectId, "2");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -113,7 +167,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
if (!this.txtReportDate.Hidden)
|
||||
{
|
||||
testPackageLists = (from x in Funs.DB.TP_TestPackage
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.PTP_AduditDate >= startTime && x.PTP_AduditDate < endTime
|
||||
where x.ProjectId == this.ProjectId && x.PTP_AduditDate >= startTime && x.PTP_AduditDate < endTime
|
||||
select x).ToList();
|
||||
}
|
||||
if (units != null)
|
||||
@@ -472,7 +526,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
/// <returns></returns>
|
||||
private bool GetButtonPower(string button)
|
||||
{
|
||||
return BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_TestPackageManageViewMenuId, button);
|
||||
return BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_TestPackageManageViewMenuId, button);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user