焊接管理,补充公司级树

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
@@ -10,6 +10,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 PW_PointID
@@ -53,59 +67,25 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
if (!IsPostBack)
{
this.txtPointManageDate.Text = string.Format("{0:yyyy-MM}", System.DateTime.Now);
this.InitTreeMenu();//加载树
#region
BLL.UserService.InitUserDropDownList(this.drpTabler, this.CurrUser.LoginProjectId, true);//制单人
//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))
// {
// BLL.UnitService.InitSubUnitNameDownList(this.drpUnit, this.CurrUser.LoginProjectId, this.CurrUser.UnitId, true);
// }
// else
// {
// BLL.UnitService.InitUnitNameByUnitTypeDropDownList(this.drpUnit, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, true);
// }
//}
//else
//{
// BLL.UnitService.InitSubUnitNameListDownList(this.drpUnit, this.CurrUser.LoginProjectId, this.CurrUser.UnitId, true);
//}
var pUnit = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2);
if (pUnit != null)
this.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
{
this.drpUnit.DataTextField = "UnitName";
this.drpUnit.DataValueField = "UnitId";
this.drpUnit.DataSource = pUnit;
this.drpUnit.DataBind();
this.drpUnit.SelectedValue = this.CurrUser.UnitId;
if (CommonService.GetProjectUnitType(this.CurrUser.LoginProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && this.CurrUser.UserId != Const.hfnbdId)
{
this.drpUnit.Enabled = false;
}
BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.CurrUser.LoginProjectId, this.drpUnit.SelectedValue, true);
this.drpInstallationId.SelectedIndex = 0;
this.ProjectId = Request.Params["projectId"];
}
//Funs.FineUIPleaseSelect(this.drpInstallationId);
this.drpTabler.SelectedValue = this.CurrUser.UserId;
this.InitDropDownList();
this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(this.ProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法
//this.GetButtonPower();
}
this.txtPointManageDate.Text = string.Format("{0:yyyy-MM}", System.DateTime.Now);
this.txtTableDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
this.txtPointDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
//if (BLL.Project_SysSetService.IsAuto("2", this.CurrUser.LoginProjectId) == true)
var set = BLL.Project_SysSetService.GetSysSetBySetId("2", this.CurrUser.LoginProjectId);
if (set != null && set.IsAuto == true)
{
string date = this.txtPointDate.Text.Trim().Replace("-", "");
this.txtPointID.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode3ByProjectPrefix", "dbo.BO_Point", "PW_PointNo", this.CurrUser.LoginProjectId, date + "-");
}
else
{
this.txtPointID.Readonly = false;
}
#endregion
this.InitTreeMenu();//加载树
}
else
{
@@ -117,6 +97,72 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
}
private void InitDropDownList()
{
BLL.UserService.InitUserDropDownList(this.drpTabler, this.ProjectId, true);//制单人
//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.ProjectId))
// {
// BLL.UnitService.InitSubUnitNameDownList(this.drpUnit, this.ProjectId, this.CurrUser.UnitId, true);
// }
// else
// {
// BLL.UnitService.InitUnitNameByUnitTypeDropDownList(this.drpUnit, this.ProjectId, BLL.Const.ProjectUnitType_2, true);
// }
//}
//else
//{
// BLL.UnitService.InitSubUnitNameListDownList(this.drpUnit, this.ProjectId, this.CurrUser.UnitId, true);
//}
var pUnit = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.ProjectId, BLL.Const.ProjectUnitType_2);
if (pUnit != null)
{
this.drpUnit.DataTextField = "UnitName";
this.drpUnit.DataValueField = "UnitId";
this.drpUnit.DataSource = pUnit;
this.drpUnit.DataBind();
this.drpUnit.SelectedValue = this.CurrUser.UnitId;
if (CommonService.GetProjectUnitType(this.ProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && this.CurrUser.UserId != Const.hfnbdId)
{
this.drpUnit.Enabled = false;
}
BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.ProjectId, this.drpUnit.SelectedValue, true);
this.drpInstallationId.SelectedIndex = 0;
}
//Funs.FineUIPleaseSelect(this.drpInstallationId);
this.drpTabler.SelectedValue = this.CurrUser.UserId;
//if (BLL.Project_SysSetService.IsAuto("2", this.ProjectId) == true)
var set = BLL.Project_SysSetService.GetSysSetBySetId("2", this.ProjectId);
if (set != null && set.IsAuto == true)
{
string date = this.txtPointDate.Text.Trim().Replace("-", "");
this.txtPointID.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode3ByProjectPrefix", "dbo.BO_Point", "PW_PointNo", this.ProjectId, date + "-");
}
else
{
this.txtPointID.Readonly = false;
}
}
/// <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
private void seTGV()
@@ -166,6 +212,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// </summary>
private void InitTreeMenu()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
if (!string.IsNullOrEmpty(this.txtPointManageDate.Text.Trim()))
{
DateTime? startTime = Funs.GetNewDateTime(this.txtPointManageDate.Text.Trim());