安全管理,公司级树补充

This commit is contained in:
夏菊 2025-04-10 17:46:57 +08:00
parent d9a4bb09ac
commit f550c9c63c
5 changed files with 371 additions and 286 deletions

View File

@ -1,19 +1,32 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SpecialHazardsReportList.aspx.cs" Inherits="FineUIPro.Web.Customization.CNCEC4.HSSE.Report.SpecialHazardsReportList" %>
<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>企业重大事故隐患专项排查整治台账</title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Items>
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
EnableCollapse="true" Width="380" Title="公司-项目" TitleToolTip="公司-项目" ShowBorder="true"
ShowHeader="true" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft" Layout="Fit">
<Items>
<f:ContentPanel ID="ContentPanel1" runat="server" ShowHeader="false" EnableCollapse="true" AutoScroll="true"
BodyPadding="0px">
<uc1:UnitProjectTControl ID="ucTree" runat="server" Onchange="changeTree" />
</f:ContentPanel>
</Items>
</f:Panel>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" AutoScroll="true">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" EnableAjax="false" ShowHeader="false" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true" ForceFit="true"
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" EnableColumnLines="true"
@ -30,7 +43,8 @@
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:DatePicker ID="txtMonth" runat="server" Label="月份" Width="200px" LabelAlign="Right" DateFormatString="yyyy-MM" DisplayType="Month"
ShowTodayButton="false" AutoPostBack="true" OnTextChanged="btnSearch_Click"></f:DatePicker>
ShowTodayButton="false" AutoPostBack="true" OnTextChanged="btnSearch_Click">
</f:DatePicker>
@ -155,6 +169,8 @@
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="编辑" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close"
Width="1000px" Height="600px">

View File

@ -35,9 +35,22 @@ namespace FineUIPro.Web.Customization.CNCEC4.HSSE.Report
{
if (!IsPostBack)
{
this.txtMonth.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
Funs.DropDownPageSize(this.ddlPageSize);
this.ProjectId = this.CurrUser.LoginProjectId;
GetButtonPower();
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);
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格
@ -46,6 +59,22 @@ namespace FineUIPro.Web.Customization.CNCEC4.HSSE.Report
}
}
/// <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.BindGrid();
}
#region
private string Btn_Menu = "D9B85395-CF56-442D-8BBB-1FFC35785BA8";
/// <summary>
@ -84,9 +113,11 @@ namespace FineUIPro.Web.Customization.CNCEC4.HSSE.Report
public void BindGrid()
{
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
if (string.IsNullOrEmpty(this.ProjectId))
{
DataTable tb = ChecklistData(this.CurrUser.LoginProjectId);
return;
}
DataTable tb = ChecklistData(this.ProjectId);
Grid1.RecordCount = tb.Rows.Count;
tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
@ -94,7 +125,6 @@ namespace FineUIPro.Web.Customization.CNCEC4.HSSE.Report
Grid1.DataSource = table;
Grid1.DataBind();
}
}
protected DataTable ChecklistData(string projectId)
{

View File

@ -41,6 +41,42 @@ namespace FineUIPro.Web.Customization.CNCEC4.HSSE.Report
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// panelLeftRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelLeftRegion;
/// <summary>
/// ContentPanel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ContentPanel ContentPanel1;
/// <summary>
/// ucTree 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree;
/// <summary>
/// panelCenterRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelCenterRegion;
/// <summary>
/// Grid1 控件。
/// </summary>

View File

@ -4,7 +4,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>接收文管理</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
<style type="text/css">
@ -42,7 +42,8 @@
LabelAlign="right">
</f:TextBox>
<f:DatePicker ID="txtMonth" runat="server" Width="100px" LabelAlign="Right" DateFormatString="yyyy" DisplayType="year"
ShowTodayButton="false" AutoPostBack="true" OnTextChanged="TextBox_TextChanged"></f:DatePicker>
ShowTodayButton="false" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
</f:DatePicker>
<f:DropDownList runat="server" ID="ddlFileType" OnSelectedIndexChanged="TextBox_TextChanged" AutoPostBack="true" Label="">
<f:ListItem Text="请选择收发文类型" Value="" />
@ -68,7 +69,7 @@
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Text="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>

View File

@ -284,7 +284,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
#region
bool UnitBol = false;
//不是本公司
if (CurrUser.UnitId!= "A26E718E-C3B3-458E-A5A3-D2568A0F7D49")
if (CurrUser.UnitId != "A26E718E-C3B3-458E-A5A3-D2568A0F7D49")
{
UnitBol = true;
}
@ -306,7 +306,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
strSql += " and (F.FileType='0' or F.FileType='1' or F.FileType='2' or F.FileType='3' or F.FileType='10' or F.FileType='11') ";
//不是管理员只能看到自己编制的 或者是自己的
//公司级
if (TypesOf == "0"&& UnitBol)
if (TypesOf == "0" && UnitBol)
{
//能看到接收人是自己的
strSql += " and (F.UnitId like '%" + CurrUser.UnitId + "%' or CompileMan = @CompileMan ) ";
@ -346,7 +346,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
strSql += " and (F.UnitId like '%" + CurrUser.UnitId + "%' or CompileMan = @CompileMan ) ";
listStr.Add(new SqlParameter("@CompileMan", CurrUser.UserId));
}
else if(TypesOf=="1" && UnitBol)
else if (TypesOf == "1" && UnitBol)
{
//项目级
//只能看到单位id或者项目id同时是自己的数据
@ -384,7 +384,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
}
if (!string.IsNullOrEmpty(txtMonth.Text))
{
strSql += " AND Year(F.CompileDate) = '"+ txtMonth.Text + "'";
strSql += " AND Year(F.CompileDate) = '" + txtMonth.Text + "'";
}
#endregion
@ -393,7 +393,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
dataTable=tb;
dataTable = tb;
Grid1.RecordCount = tb.Rows.Count;
//tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
@ -538,16 +538,16 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
}
else if (FinalFileManage.States == "1" && (
//接收文件页面,待接收,并且接收人是自己,接收项目是空的:回复页面。
(FinalFileManage.UnitId.IndexOf(CurrUser.UnitId)!=-1 && string.IsNullOrEmpty(FinalFileManage.ProjectId)) || (userId == Const.sysglyId || userId == Const.hfnbdId)))
(FinalFileManage.UnitId.IndexOf(CurrUser.UnitId) != -1 && string.IsNullOrEmpty(FinalFileManage.ProjectId)) || (userId == Const.sysglyId || userId == Const.hfnbdId)))
{
this.Window1.Title = "回复";
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SendAndAccepView.aspx?FileId={0}&Type=1&Fwtype=0", id, "回复 - "),"回复"));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SendAndAccepView.aspx?FileId={0}&Type=1&Fwtype=0", id, "回复 - "), "回复"));
}
else
{
//否则是查看页面
this.Window1.Title = "详情";
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SendAndAccepView.aspx?FileId={0}&Fwtype=0", id, "查看 - "),"查看"));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SendAndAccepView.aspx?FileId={0}&Fwtype=0", id, "查看 - "), "查看"));
}
}
else
@ -580,7 +580,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
//如果是发文件页面,状态是待发送的:编辑,
if (FinalFileManage.States == "0")
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SendAndAccepEdit.aspx?FileId={0}&Fwtype=1", id, "编辑 - "),"编辑"));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SendAndAccepEdit.aspx?FileId={0}&Fwtype=1", id, "编辑 - "), "编辑"));
}
else
{
@ -660,7 +660,8 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
}
#endregion
protected void btnMenuUpdate(object sender, EventArgs e) {
protected void btnMenuUpdate(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
@ -668,7 +669,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
}
string id = Grid1.SelectedRowID;
var model = Funs.DB.FinalFileManage_SendAndAccep.FirstOrDefault(x => x.FileId == id);
if (model!=null)
if (model != null)
{
if (model.States == "2")
{
@ -678,7 +679,8 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
{
model.States = "2";
}
else {
else
{
Alert.ShowInTop("当前数据不允许修改状态!", MessageBoxIcon.Warning);
return;
}
@ -703,7 +705,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
void Print()
{
string path = Funs.RootPath + @"File\Excel\Temp\SendAndAccep"+ string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx";
string path = Funs.RootPath + @"File\Excel\Temp\SendAndAccep" + string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx";
var filetypelist = dataTable.AsEnumerable().Select(x => new
{
@ -714,15 +716,15 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
string fileName = string.Empty;
if (Type == "0")
{
fileName= "发文台账.xlsx";
fileName = "发文台账.xlsx";
}
else
{
fileName = "收文台账.xlsx";
}
var sheets = new DataSet();
string[] Send=new string [] {"0", "1" , "2" , "3" , "10" , "11" };
string[] Accep=new string [] {"4", "5" , "6" , "7" , "8" , "9" };
string[] Send = new string[] { "0", "1", "2", "3", "10", "11" };
string[] Accep = new string[] { "4", "5", "6", "7", "8", "9" };
foreach (var item in filetypelist)
{
if (Send.Contains(item.FileType))
@ -753,7 +755,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
= x.Field<string>("UnitName"),
= x.Field<DateTime?>("CompileDate"),
= x.Field<string>("KeyWords"),
= x.Field<string>("States")== "已回复"?"是":"否",
= x.Field<string>("States") == "已回复" ? "是" : "否",
= x.Field<DateTime?>("ReplyDatePlan"),
= "",
= ""
@ -764,7 +766,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
}
}
MiniExcel.SaveAs(path,sheets);
MiniExcel.SaveAs(path, sheets);
FileInfo info = new FileInfo(path);
long fileSize = info.Length;