焊接管理,补充公司级树
This commit is contained in:
@@ -12,6 +12,22 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
{
|
||||
public partial class WelderPerformance : PageBase
|
||||
{
|
||||
#region 定义项
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
@@ -24,37 +40,72 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
|
||||
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.cbSteType.DataTextField = "Text";
|
||||
this.cbSteType.DataValueField = "Value";
|
||||
this.cbSteType.DataSource = BLL.DropListService.HJGL_GetSteTypeList();
|
||||
this.cbSteType.DataBind();
|
||||
//单位
|
||||
// var unit = BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId);
|
||||
//if (unit != null && unit.UnitTypeId == BLL.Const.ProjectUnitType_2)
|
||||
if (CommonService.GetProjectUnitType(this.CurrUser.LoginProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && this.CurrUser.UserId!=Const.hfnbdId)
|
||||
Funs.FineUIPleaseSelect(this.drpTeamGroup);
|
||||
}
|
||||
}
|
||||
|
||||
private void InitDropDownList()
|
||||
{
|
||||
//单位
|
||||
// var unit = BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId);
|
||||
//if (unit != null && unit.UnitTypeId == BLL.Const.ProjectUnitType_2)
|
||||
if (CommonService.GetProjectUnitType(this.ProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && this.CurrUser.UserId != Const.hfnbdId)
|
||||
{
|
||||
BLL.UnitService.InitSubUnitNameDownList(this.drpUnit, this.ProjectId, this.CurrUser.UnitId, true);
|
||||
this.drpUnit.SelectedValue = this.CurrUser.UnitId;
|
||||
BLL.WorkAreaService.InitWorkAreaProjectUnitDropDownList(this.drpWorkArea, this.ProjectId, this.CurrUser.UnitId, true);
|
||||
BLL.WelderService.InitWelderListByUnit(this.ddlWloName, this.ProjectId, this.CurrUser.UnitId, true, "-请选择-");
|
||||
}
|
||||
else
|
||||
{
|
||||
var supervisonUnit = BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.ProjectId);
|
||||
if (supervisonUnit)
|
||||
{
|
||||
BLL.UnitService.InitSubUnitNameDownList(this.drpUnit, this.CurrUser.LoginProjectId, this.CurrUser.UnitId, true);
|
||||
this.drpUnit.SelectedValue = this.CurrUser.UnitId;
|
||||
BLL.WorkAreaService.InitWorkAreaProjectUnitDropDownList(this.drpWorkArea, this.CurrUser.LoginProjectId, this.CurrUser.UnitId, true);
|
||||
BLL.WelderService.InitWelderListByUnit(this.ddlWloName, this.CurrUser.LoginProjectId, this.CurrUser.UnitId, true, "-请选择-");
|
||||
BLL.UnitService.InitSubUnitNameDownList(this.drpUnit, this.ProjectId, this.CurrUser.UnitId, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
var supervisonUnit = BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.CurrUser.LoginProjectId);
|
||||
if (supervisonUnit)
|
||||
{
|
||||
BLL.UnitService.InitSubUnitNameDownList(this.drpUnit, this.CurrUser.LoginProjectId, this.CurrUser.UnitId, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
BLL.UnitService.InitUnitByProjectIdUnitTypeDropDownList(this.drpUnit, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, true);
|
||||
}
|
||||
Funs.FineUIPleaseSelect(this.drpWorkArea);
|
||||
Funs.FineUIPleaseSelect(this.ddlWloName);
|
||||
BLL.UnitService.InitUnitByProjectIdUnitTypeDropDownList(this.drpUnit, this.ProjectId, BLL.Const.ProjectUnitType_2, true);
|
||||
}
|
||||
Funs.FineUIPleaseSelect(this.drpTeamGroup);
|
||||
Funs.FineUIPleaseSelect(this.drpWorkArea);
|
||||
Funs.FineUIPleaseSelect(this.ddlWloName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <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.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 绑定BindGrid
|
||||
@@ -68,11 +119,15 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
List<SqlParameter> listStr = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@projectId", this.CurrUser.LoginProjectId)
|
||||
new SqlParameter("@projectId", this.ProjectId)
|
||||
};
|
||||
if (this.drpUnit.SelectedValue != BLL.Const._Null&&!string.IsNullOrEmpty(this.drpUnit.SelectedValue))
|
||||
if (this.drpUnit.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpUnit.SelectedValue))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@unitcode", this.drpUnit.SelectedValue));
|
||||
}
|
||||
@@ -80,7 +135,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
{
|
||||
listStr.Add(new SqlParameter("@unitcode", null));
|
||||
}
|
||||
if (this.drpWorkArea.SelectedValue != BLL.Const._Null&&!string.IsNullOrEmpty(this.drpWorkArea.SelectedValue))
|
||||
if (this.drpWorkArea.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpWorkArea.SelectedValue))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@workareacode", this.drpWorkArea.SelectedValue));
|
||||
}
|
||||
@@ -88,11 +143,10 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
{
|
||||
listStr.Add(new SqlParameter("@workareacode", null));
|
||||
}
|
||||
|
||||
|
||||
listStr.Add(new SqlParameter("@steel", null));
|
||||
|
||||
if (this.ddlWloName.SelectedValue!=BLL.Const._Null&&!string.IsNullOrEmpty(this.ddlWloName.SelectedValue))
|
||||
|
||||
listStr.Add(new SqlParameter("@steel", null));
|
||||
|
||||
if (this.ddlWloName.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.ddlWloName.SelectedValue))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@wloName", this.ddlWloName.SelectedValue));
|
||||
}
|
||||
@@ -116,7 +170,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
{
|
||||
listStr.Add(new SqlParameter("@date2", null));
|
||||
}
|
||||
if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.CurrUser.LoginProjectId))
|
||||
if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.ProjectId))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@supervisorUnitId", this.CurrUser.UnitId));
|
||||
}
|
||||
@@ -126,9 +180,9 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
tb = SQLHelper.GetDataTableRunProc("sp_rpt_WelderPerformance", parameter);
|
||||
if (this.drpSteType.Values!=null && this.drpSteType.Values.Length>0)
|
||||
if (this.drpSteType.Values != null && this.drpSteType.Values.Length > 0)
|
||||
{
|
||||
|
||||
|
||||
if (tb != null)
|
||||
{
|
||||
List<DataRow> needReMoveRow = new List<DataRow>();
|
||||
@@ -390,7 +444,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
{
|
||||
if (!column.Hidden)
|
||||
{
|
||||
if ( !string.IsNullOrEmpty(html) && ("current_passrate" == column.ColumnID || "nowpassrate" == column.ColumnID || "nowunpassrate" == column.ColumnID || "repairrate" == column.ColumnID || "finishedrate" == column.ColumnID || "passrate" == column.ColumnID || "unpassrate" == column.ColumnID || "tofdpassrate" == column.ColumnID || "tdfwpassrate" == column.ColumnID || "utpassrate" == column.ColumnID || "tofdpassrate" == column.ColumnID))
|
||||
if (!string.IsNullOrEmpty(html) && ("current_passrate" == column.ColumnID || "nowpassrate" == column.ColumnID || "nowunpassrate" == column.ColumnID || "repairrate" == column.ColumnID || "finishedrate" == column.ColumnID || "passrate" == column.ColumnID || "unpassrate" == column.ColumnID || "tofdpassrate" == column.ColumnID || "tdfwpassrate" == column.ColumnID || "utpassrate" == column.ColumnID || "tofdpassrate" == column.ColumnID))
|
||||
{
|
||||
sb.AppendFormat("<td style=\"text-align:center;@\" >{0}%</td>", (100 * double.Parse(html)).ToString("0.###"));
|
||||
}
|
||||
@@ -465,7 +519,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
sb.AppendFormat("<td style=\"text-align:center;vnd.ms-excel.numberformat:@\" >{0}</td>", "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -473,16 +527,17 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
|
||||
}
|
||||
|
||||
} sb.Append("</tr>");
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
}
|
||||
|
||||
|
||||
sb.Append("</table>");
|
||||
|
||||
return sb.ToString();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region DropDownList下拉选择事件
|
||||
/// <summary>
|
||||
@@ -496,9 +551,9 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
this.drpTeamGroup.Items.Clear();
|
||||
if (this.drpUnit.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpUnit.SelectedValue))
|
||||
{
|
||||
BLL.WorkAreaService.InitWorkAreaProjectUnitDropDownList(this.drpWorkArea, this.CurrUser.LoginProjectId, this.drpUnit.SelectedValue, true);
|
||||
BLL.WorkAreaService.InitWorkAreaProjectUnitDropDownList(this.drpWorkArea, this.ProjectId, this.drpUnit.SelectedValue, true);
|
||||
this.drpWorkArea.SelectedIndex = 0;
|
||||
BLL.TeamGroupService.InitTeamGroupProjectUnitDropDownList(this.drpTeamGroup, this.CurrUser.LoginProjectId, this.drpUnit.SelectedValue, true);
|
||||
BLL.TeamGroupService.InitTeamGroupProjectUnitDropDownList(this.drpTeamGroup, this.ProjectId, this.drpUnit.SelectedValue, true);
|
||||
this.drpTeamGroup.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
@@ -513,7 +568,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
this.ddlWloName.Items.Clear();
|
||||
if (this.drpTeamGroup.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpTeamGroup.SelectedValue))
|
||||
{
|
||||
BLL.WelderService.InitWelderListByTeamGroupId(this.ddlWloName, this.CurrUser.LoginProjectId, this.drpTeamGroup.SelectedValue, true, "-请选择-");
|
||||
BLL.WelderService.InitWelderListByTeamGroupId(this.ddlWloName, this.ProjectId, this.drpTeamGroup.SelectedValue, true, "-请选择-");
|
||||
this.ddlWloName.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user