焊接管理,补充公司级树

This commit is contained in:
2025-04-14 09:53:19 +08:00
parent f5344bddfb
commit c8b553efc6
16 changed files with 832 additions and 383 deletions
@@ -11,6 +11,20 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
/// <summary>
/// 热处理委托主键
/// </summary>
public string HotProessTrustId
@@ -36,13 +50,42 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
{
if (!IsPostBack)
{
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.ProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法
this.GetButtonPower();
}
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
this.HotProessTrustId = string.Empty;
this.InitTreeMenu();//加载树
}
}
/// <summary>
/// 公司级树加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void changeTree(object sender, EventArgs e)
{
this.ProjectId = this.ucTree.ProjectId;
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
btnNew.Hidden = true;
}
this.GetButtonPower();
this.InitTreeMenu();
}
#endregion
#region
@@ -57,7 +100,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_HotProessTrustMenuId);
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_HotProessTrustMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
@@ -82,6 +125,10 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
/// </summary>
private void InitTreeMenu()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
this.tvControlItem.Nodes.Clear();
TreeNode rootNode = new TreeNode();
rootNode.Text = "装置-单位-工作区";
@@ -89,14 +136,14 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
rootNode.Expanded = true;
this.tvControlItem.Nodes.Add(rootNode);
////装置
var pInstallation = (from x in Funs.DB.Project_Installation where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
var pInstallation = (from x in Funs.DB.Project_Installation where x.ProjectId == this.ProjectId select x).ToList();
////区域
var pWorkArea = (from x in Funs.DB.ProjectData_WorkArea where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
var pWorkArea = (from x in Funs.DB.ProjectData_WorkArea where x.ProjectId == this.ProjectId select x).ToList();
////单位
var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.ProjectId select x).ToList();
var workAreaIdList = (from x in BLL.Funs.DB.PW_IsoInfo
where x.ProjectId == this.CurrUser.LoginProjectId
where x.ProjectId == this.ProjectId
orderby x.ISO_IsoNo
select x.WorkAreaId).Distinct().ToList();
pWorkArea = pWorkArea.Where(x => workAreaIdList.Contains(x.WorkAreaId)).OrderBy(x => x.WorkAreaCode).ToList();
@@ -223,7 +270,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
/// <param name="e"></param>
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_HotProessTrustMenuId);
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_HotProessTrustMenuId);
if (this.tvControlItem.SelectedNode.CommandName == "委托单号")
{
if (buttonList.Contains(BLL.Const.BtnSave))
@@ -274,7 +321,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
+ @" FROM dbo.View_HJGL_HotProess_TrustItem AS Trust"
+ @" WHERE Trust.ProjectId= @ProjectId AND Trust.HotProessTrustId=@HotProessTrustId ";
listStr.Add(new SqlParameter("@ProjectId", hotProessTrust != null ? hotProessTrust.ProjectId : this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@ProjectId", hotProessTrust != null ? hotProessTrust.ProjectId : this.ProjectId));
listStr.Add(new SqlParameter("@HotProessTrustId", this.HotProessTrustId));
if (!string.IsNullOrEmpty(this.txtIsoNo.Text.Trim()))
@@ -405,7 +452,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_HotProessTrustMenuId, Const.BtnAdd))
if (CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, Const.HJGL_HotProessTrustMenuId, Const.BtnAdd))
{
if (this.tvControlItem.SelectedNode != null && this.tvControlItem.SelectedNode.ToolTip == "区域")
{
@@ -434,7 +481,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
/// <param name="e"></param>
protected void btnEdit_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_HotProessTrustMenuId, Const.BtnSave))
if (CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, Const.HJGL_HotProessTrustMenuId, Const.BtnSave))
{
var trustManage = BLL.HotProess_TrustService.GetHotProessTrustById(this.HotProessTrustId);
if (trustManage != null)
@@ -463,7 +510,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
/// <param name="e"></param>
protected void btnDelete_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_HotProessTrustMenuId, Const.BtnDelete))
if (CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, Const.HJGL_HotProessTrustMenuId, Const.BtnDelete))
{
var trustManage = BLL.HotProess_TrustService.GetHotProessTrustById(this.HotProessTrustId);
if (trustManage != null)
@@ -479,7 +526,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
}
BLL.HotProessTrustItemService.DeleteHotProessTrustItemById(this.HotProessTrustId);
BLL.HotProess_TrustService.DeleteHotProessTrustById(this.HotProessTrustId);
//BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Resources.Lan.DeleteHotProess);
//BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.ProjectId, this.CurrUser.UserId, Resources.Lan.DeleteHotProess);
Alert.ShowInTop("删除成功!", MessageBoxIcon.Success);
this.InitTreeMenu();
SetTextTemp();
@@ -536,7 +583,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
/// <param name="e"></param>
protected void btnMenuHotProessReport_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_HotProessTrustMenuId, Const.BtnSave))
if (CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, Const.HJGL_HotProessTrustMenuId, Const.BtnSave))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HotProessReport.aspx?HotProessTrustItemId={0}", this.Grid1.SelectedRowID, "编辑热处理报告 - ")));
}