焊接管理,补充公司级树

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.WeldingManage
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
/// <summary>
/// 焊接日报主键
/// </summary>
public string DReportID
@@ -29,6 +43,20 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
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.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(this.ProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法
//this.GetButtonPower();
}
this.txtMonth.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
btnNew.OnClientClick = Window1.GetShowReference("WeldReportEdit.aspx") + "return false;";
@@ -36,25 +64,45 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
/// <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();
}
#region -
/// <summary>
/// 加载树
/// </summary>
private void InitTreeMenu()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
if (!string.IsNullOrEmpty(this.txtMonth.Text.Trim()))
{
this.tvControlItem.Nodes.Clear();
List<Model.Base_Unit> units = null;
var getUnit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId);
var getUnit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.ProjectId, this.CurrUser.UnitId);
if (getUnit != null && getUnit.UnitType == BLL.Const.ProjectUnitType_2)
{
units = (from x in Funs.DB.Base_Unit where x.UnitId == this.CurrUser.UnitId select x).ToList();
}
else
{
units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2);
units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.ProjectId, BLL.Const.ProjectUnitType_2);
}
if (units != null)
@@ -70,13 +118,13 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var instaRe = (from x in Funs.DB.BO_WeldReportMain
join y in Funs.DB.Project_Installation
on x.InstallationId equals y.InstallationId
where x.UnitId == unit.UnitId && x.ProjectId == this.CurrUser.LoginProjectId
where x.UnitId == unit.UnitId && x.ProjectId == this.ProjectId
select y).Distinct();
foreach (var ins in instaRe)
{
TreeNode newNode = new TreeNode();
newNode.Text = ins.InstallationName;
newNode.NodeID = ins.InstallationId+"|"+rootNode.NodeID;
newNode.NodeID = ins.InstallationId + "|" + rootNode.NodeID;
newNode.EnableExpandEvent = true;
newNode.CommandName = "Installation";
rootNode.Nodes.Add(newNode);
@@ -112,7 +160,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
TreeNode newNode = new TreeNode();
newNode.Text = this.txtMonth.Text.Trim();
newNode.NodeID = this.txtMonth.Text.Trim()+"|"+e.NodeID;
newNode.NodeID = this.txtMonth.Text.Trim() + "|" + e.NodeID;
newNode.EnableExpandEvent = true;
newNode.CommandName = "Month";
e.Node.Nodes.Add(newNode);
@@ -135,7 +183,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
TreeNode newNode = new TreeNode();
newNode.Text = string.Format("{0:yyyy-MM-dd}", day);
newNode.NodeID = day.ToString()+"|"+e.NodeID;
newNode.NodeID = day.ToString() + "|" + e.NodeID;
newNode.EnableExpandEvent = true;
newNode.CommandName = "Day";
e.Node.Nodes.Add(newNode);
@@ -387,7 +435,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// <param name="e"></param>
protected void btnEdit_Click(object sender, EventArgs e)
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_WeldReportMenuId, BLL.Const.BtnModify))
if (BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_WeldReportMenuId, BLL.Const.BtnModify))
{
var daily = BLL.WeldReportService.GetWeldReportByDReportID(tvControlItem.SelectedNodeID);
if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID) && daily != null)
@@ -422,7 +470,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// <param name="e"></param>
protected void btnDelete_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_WeldReportMenuId, Const.BtnDelete))
if (CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, Const.HJGL_WeldReportMenuId, Const.BtnDelete))
{
var daily = BLL.WeldReportService.GetWeldReportByDReportID(tvControlItem.SelectedNodeID);
if (daily == null)
@@ -529,7 +577,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
string varValue = string.Empty;
var project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId);
var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId);
var unitName = BLL.UnitService.GetUnitNameByUnitId(report.UnitId);
var ins = BLL.Project_InstallationService.GetInstallationByInstallationId(report.InstallationId);
@@ -539,7 +587,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
varValue = Microsoft.JScript.GlobalObject.escape(varValue.Replace("/", ","));
}
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointReportDayReportId, DReportID, varValue, this.CurrUser.LoginProjectId)));
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointReportDayReportId, DReportID, varValue, this.ProjectId)));
}
else
{
@@ -557,7 +605,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// <param name="e"></param>
protected void btnImport_Click(object sender, EventArgs e)
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_WeldReportMenuId, BLL.Const.BtnSave))
if (BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_WeldReportMenuId, BLL.Const.BtnSave))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WeldReportDataInNews.aspx", "导入 - ")));
}