This commit is contained in:
杨红卫 2024-03-01 15:37:22 +08:00
parent 832da93400
commit e58662ebcd
6 changed files with 153 additions and 56 deletions

View File

@ -0,0 +1,10 @@
ALTER TABLE ProjectSupervision_RectifyItem ADD HiddenHazardType NVARCHAR(50) NULL
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'隐患类别1-一般2-较大3-重大)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProjectSupervision_RectifyItem', @level2type=N'COLUMN',@level2name=N'HiddenHazardType'
GO
ALTER TABLE ProjectSupervision_RectifyItem ALTER COLUMN WrongContent NVARCHAR(500) NULL
GO
ALTER TABLE ProjectSupervision_RectifyItem ALTER COLUMN Requirement NVARCHAR(500) NULL
GO
ALTER TABLE ProjectSupervision_RectifyItem ALTER COLUMN RectifyResults NVARCHAR(500) NULL
GO

View File

@ -42,7 +42,7 @@
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtFactoryCode" runat="server" Label="编号" LabelAlign="Right" LabelWidth="110px"
<f:TextBox ID="txtFactoryCode" runat="server" Label="出厂编号" LabelAlign="Right" LabelWidth="110px"
MaxLength="50" ShowRedStar="true" Required="true">
</f:TextBox>
<f:TextBox ID="txtCertificateCode" runat="server" Label="合格证编号" LabelAlign="Right"

View File

@ -4,9 +4,9 @@
<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" />
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../Controls/My97DatePicker/WdatePicker.js"></script>
</head>
<body>
@ -19,31 +19,33 @@
<Rows>
<f:FormRow runat="server">
<Items>
<f:TextBox ID="txtRectifyNoticesCode" runat="server" Label="编号" MaxLength="70" Required="true" ShowRedStar="true">
<f:TextBox ID="txtRectifyNoticesCode" runat="server" Label="编号" MaxLength="70" Required="true" ShowRedStar="true">
</f:TextBox>
<f:DropDownList ID="drpProjectId" runat="server" Label="受检项目"
<f:DropDownList ID="drpProjectId" runat="server" Label="受检项目"
LabelAlign="Right" EnableEdit="true">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow runat="server">
<Items>
<f:DropDownList ID="drpCheckMan" runat="server" Label="检查人员" LabelAlign="Right"
EnableEdit="true" EnableMultiSelect="true" AutoPostBack="true" OnSelectedIndexChanged="drpCheckMan_SelectedIndexChanged" >
<f:DropDownList ID="drpCheckMan" runat="server" Label="检查人员" LabelAlign="Right"
EnableEdit="true" EnableMultiSelect="true" AutoPostBack="true" OnSelectedIndexChanged="drpCheckMan_SelectedIndexChanged">
</f:DropDownList>
<f:TextBox runat="server" Label="检查人员" ID="txtCheckPerson"></f:TextBox>
</Items>
</f:FormRow>
<f:FormRow runat="server">
<Items>
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="检查日期" ID="txtCheckedDate"
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="检查日期" ID="txtCheckedDate"
LabelAlign="right" ShowRedStar="true">
</f:DatePicker>
<f:DropDownList ID="drpHiddenHazardType" runat="server" Label="隐患类别" EnableEdit="true" EmptyText="--请选择--">
<f:Label runat="server"></f:Label>
<%-- <f:DropDownList ID="drpHiddenHazardType" runat="server" Label="隐患类别" EnableEdit="true" EmptyText="--请选择--">
<f:ListItem Text="一般" Value="1" />
<f:ListItem Text="较大" Value="2" />
<f:ListItem Text="重大" Value="3" />
</f:DropDownList>
</f:DropDownList>--%>
</Items>
</f:FormRow>
</Rows>
@ -51,25 +53,25 @@
<f:Toolbar ID="Toolbar1" Position="Top" ToolbarAlign="Right" runat="server">
<Items>
<f:HiddenField ID="hdRectifyNoticesId" runat="server"></f:HiddenField>
<f:Button ID="btnSave" OnClick="btnSave_Click" Icon="SystemSave" runat="server"
Text="保存" ValidateForms="SimpleForm1" >
<f:Button ID="btnSave" OnClick="btnSave_Click" Icon="SystemSave" runat="server"
Text="保存" ValidateForms="SimpleForm1">
</f:Button>
<f:Button ID="btnSubmit" OnClick="btnSubmit_Click" Icon="SystemSaveNew" runat="server"
Text="签发" ValidateForms="SimpleForm1" >
<f:Button ID="btnSubmit" OnClick="btnSubmit_Click" Icon="SystemSaveNew" runat="server"
Text="签发" ValidateForms="SimpleForm1">
</f:Button>
<f:Button ID="btnSure" OnClick="btnSure_Click" Icon="Accept" runat="server" Hidden="true"
Text="复查确认">
</f:Button>
<f:Button ID="btnSure" OnClick="btnSure_Click" Icon="Accept" runat="server" Hidden="true"
Text="复查确认" >
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Form ID="Form2" ShowBorder="true" ShowHeader="false" Title="安全隐患及整改要求" AutoScroll="true"
runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<Rows>
<f:FormRow>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" AllowCellEditing="true" ClicksToEdit="1"
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" AllowCellEditing="true" ClicksToEdit="1"
ForceFit="true" EnableCollapse="true" EnableColumnLines="true" EnableColumnMove="true" runat="server" BoxFlex="1"
DataKeyNames="RectifyItemId,IsRectify" DataIDField="RectifyItemId" AllowSorting="true" SortField="RectifyItemId"
SortDirection="ASC" EnableTextSelection="True" MinHeight="240px" PageSize="500"
@ -87,14 +89,24 @@
SortField="RectifyItemId" FieldType="String" HeaderTextAlign="Center" TextAlign="Center"
Hidden="true">
</f:RenderField>
<f:RenderField Width="300px" ColumnID="WrongContent" DataField="WrongContent" FieldType="string"
<f:RenderField Width="300px" ColumnID="WrongContent" DataField="WrongContent" FieldType="string"
HeaderText="具体位置及隐患内容">
<Editor>
<f:TextBox ID="tWrongContent" runat="server" MaxLength="800" ShowRedStar="true" Required="true">
</f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Requirement" DataField="Requirement" FieldType="string"
<f:TemplateField ColumnID="HiddenHazardType" HeaderText="隐患类别" HeaderTextAlign="Center" TextAlign="Center" Width="60px">
<ItemTemplate>
<asp:DropDownList ID="drpHiddenHazardType" runat="server">
<asp:ListItem Text="一般" Value="1" Selected="True" />
<asp:ListItem Text="较大" Value="2" />
<asp:ListItem Text="重大" Value="3" />
</asp:DropDownList>
<f:HiddenField ID="hdHiddenHazardType" runat="server" Text='<%# Eval("HiddenHazardType") %>'></f:HiddenField>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="100px" ColumnID="Requirement" DataField="Requirement" FieldType="string" HeaderTextAlign="Center"
HeaderText="整改要求">
<Editor>
<f:TextBox ID="tRequirement" runat="server" MaxLength="800" ShowRedStar="true" Required="true">
@ -121,7 +133,7 @@
</f:RenderField>
<f:LinkButtonField ColumnID="ReAttachUrl" HeaderText="整改后" ConfirmTarget="Top" Width="80" CommandName="ReAttachUrl"
TextAlign="Center" ToolTip="整改照片" Text="整改后" />
<f:TemplateField ColumnID="IsRectify" HeaderText="合格" HeaderTextAlign="Center" TextAlign="Center" Width="60px">
<f:TemplateField ColumnID="IsRectify" HeaderText="合格" HeaderTextAlign="Center" TextAlign="Center" Width="60px">
<ItemTemplate>
<asp:DropDownList ID="drpIsRectify" runat="server">
<asp:ListItem Value="false">否</asp:ListItem>
@ -132,6 +144,8 @@
</f:TemplateField>
<f:LinkButtonField ID="del" ColumnID="del" HeaderText="删除" Width="60px" CommandName="delete"
Icon="Delete" />
<f:RenderField HeaderText="报告明细id" ColumnID="hdCheckReportItemId" DataField="CheckReportItemId" FieldType="String" Hidden="true">
</f:RenderField>
</Columns>
</f:Grid>
</Items>
@ -149,7 +163,7 @@
<f:Label runat="server"></f:Label>
</Items>
</f:FormRow>
</Rows>
</Rows>
</f:Form>
</Items>
</f:Panel>
@ -157,6 +171,6 @@
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
</form>
</form>
</body>
</html>

View File

@ -1,8 +1,6 @@
using BLL;
using FineUIPro.Web.DataShow;
using Model;
using Newtonsoft.Json.Linq;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Data;
@ -51,7 +49,7 @@ namespace FineUIPro.Web.OfficeCheck.Check
this.btnSave.Hidden = true;
this.btnAdd.Hidden = true;
this.btnSubmit.Hidden = true;
this.Grid1.Columns[8].Hidden = true;
this.Grid1.Columns[9].Hidden = true;
}
this.CheckNoticeId = Request.Params["CheckNoticeId"];
@ -71,16 +69,14 @@ namespace FineUIPro.Web.OfficeCheck.Check
this.txtCheckPerson.Text = getRectify.CheckManNames;
this.txtRectifyNoticesCode.Text = getRectify.RectifyCode;
this.txtCheckedDate.Text = getRectify.CheckedDate.ToString();
if (!string.IsNullOrEmpty(getRectify.HiddenHazardType))
{
this.drpHiddenHazardType.SelectedValue = getRectify.HiddenHazardType;
}
//if (!string.IsNullOrEmpty(getRectify.HiddenHazardType))
//{
// this.drpHiddenHazardType.SelectedValue = getRectify.HiddenHazardType;
//}
if (!string.IsNullOrEmpty(getRectify.SignPerson))
{
this.drpSignPerson.SelectedValue = getRectify.SignPerson;
}
BindGrid();
}
if (getRectify.States == Const.State_1 || getRectify.States == Const.State_2)
{
this.btnSure.Hidden = false;
@ -112,6 +108,7 @@ namespace FineUIPro.Web.OfficeCheck.Check
this.txtCheckedDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
}
BindGrid();
rectifyItemLists.Clear();
}
}
@ -132,10 +129,24 @@ namespace FineUIPro.Web.OfficeCheck.Check
/// </summary>
public void BindGrid()
{
string strSql = @"select RectifyItemId, RectifyId, WrongContent, Requirement, LimitTime, RectifyResults, IsRectify from ProjectSupervision_RectifyItem ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += "where RectifyId = @RectifyId";
listStr.Add(new SqlParameter("@RectifyId", this.hdRectifyNoticesId.Text));
string strSql = string.Empty;
List <SqlParameter> listStr = new List<SqlParameter>();
if (Funs.DB.ProjectSupervision_RectifyItem.FirstOrDefault(x => x.RectifyId == this.hdRectifyNoticesId.Text) != null)
{
strSql = @"select RectifyItemId,WrongContent,Requirement,LimitTime,RectifyResults,IsRectify,HiddenHazardType,null as CheckReportItemId
from ProjectSupervision_RectifyItem
where RectifyId = @RectifyId";
listStr.Add(new SqlParameter("@RectifyId", this.hdRectifyNoticesId.Text));
}
else
{
strSql = @"select newid() as RectifyItemId,UnConformItem as WrongContent,null as Requirement,null as LimitTime, null as RectifyResults,0 as IsRectify,'1' as HiddenHazardType,item.CheckReportItemId
from ProjectSupervision_CheckReportItem as item
left join ProjectSupervision_CheckReport as Report on item.CheckReportId=Report.CheckReportId
where Report.CheckNoticeId = @CheckNoticeId";
listStr.Add(new SqlParameter("@CheckNoticeId", this.CheckNoticeId));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
var table = this.GetPagedDataTable(Grid1, tb);
@ -149,7 +160,7 @@ namespace FineUIPro.Web.OfficeCheck.Check
{
addViewTestPlanTrainingList();
Model.ProjectSupervision_RectifyItem notice = new Model.ProjectSupervision_RectifyItem();
notice.RectifyItemId = SQLHelper.GetNewID(typeof(Model.ProjectSupervision_RectifyItem));
notice.RectifyItemId = SQLHelper.GetNewID();
rectifyItemLists.Add(notice);
//将gd数据保存在list中
Grid1.DataSource = rectifyItemLists;
@ -171,8 +182,9 @@ namespace FineUIPro.Web.OfficeCheck.Check
string rectifyNoticesItemId = values.Value<string>("RectifyItemId");
string requirement = values.Value<string>("Requirement");
string rectifyResults = values.Value<string>("RectifyResults");
System.Web.UI.WebControls.TextBox txtlimitTim = (System.Web.UI.WebControls.TextBox)Grid1.Rows[i].FindControl("txtLimitTimes");
System.Web.UI.WebControls.DropDownList drpIsRect = (System.Web.UI.WebControls.DropDownList)Grid1.Rows[i].FindControl("drpIsRectify");
TextBox txtlimitTim = (TextBox)Grid1.Rows[i].FindControl("txtLimitTimes");
var item = new ProjectSupervision_RectifyItem();
item.RectifyItemId = rectifyNoticesItemId;
item.RectifyId = hdRectifyNoticesId.Text.Trim();
@ -180,6 +192,10 @@ namespace FineUIPro.Web.OfficeCheck.Check
item.Requirement = requirement;
item.LimitTime = Funs.GetNewDateTime(txtlimitTim.Text);
item.RectifyResults = rectifyResults;
DropDownList drpIsRect = (DropDownList)Grid1.Rows[i].FindControl("drpIsRectify");
item.IsRectify =Convert.ToBoolean( drpIsRect.SelectedValue);
DropDownList drpHiddenHazardType = (DropDownList)Grid1.Rows[i].FindControl("drpHiddenHazardTypeify");
item.HiddenHazardType = drpHiddenHazardType.SelectedValue;
rectifyItemLists.Add(item);
}
}
@ -242,7 +258,15 @@ namespace FineUIPro.Web.OfficeCheck.Check
string itemId = Grid1.DataKeys[e.RowIndex][0].ToString();
if (e.CommandName == "AttachUrl")
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/Rectify&menuId={1}&type=0&strParam=1", itemId, BLL.Const.CheckInfoMenuId)));
if (Funs.DB.ProjectSupervision_RectifyItem.FirstOrDefault(x => x.RectifyItemId == itemId) != null)
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/Rectify&menuId={1}&type=0&strParam=1", itemId, BLL.Const.CheckInfoMenuId)));
}
else
{
string checkReportItemId= Grid1.Rows[e.RowIndex].Values[10].ToString();
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/Rectify&menuId={1}&type=0&strParam=1", checkReportItemId, BLL.Const.CheckInfoMenuId)));
}
}
if (e.CommandName == "delete")
{
@ -276,6 +300,13 @@ namespace FineUIPro.Web.OfficeCheck.Check
drpIsRectify.SelectedValue = "false";
}
}
System.Web.UI.WebControls.DropDownList drpHiddenHazardType = (System.Web.UI.WebControls.DropDownList)(this.Grid1.Rows[i].FindControl("drpHiddenHazardType"));
HiddenField hdHiddenHazardType = (HiddenField)(this.Grid1.Rows[i].FindControl("hdHiddenHazardType"));
if (!string.IsNullOrEmpty(hdHiddenHazardType.Text))
{
drpHiddenHazardType.SelectedValue = hdHiddenHazardType.Text;
}
}
}
#endregion
@ -345,10 +376,10 @@ namespace FineUIPro.Web.OfficeCheck.Check
{
Notices.CheckedDate = Convert.ToDateTime(this.txtCheckedDate.Text.Trim());
}
if (this.drpHiddenHazardType.SelectedValue != BLL.Const._Null)
{
Notices.HiddenHazardType = this.drpHiddenHazardType.SelectedValue;
}
//if (this.drpHiddenHazardType.SelectedValue != BLL.Const._Null)
//{
// Notices.HiddenHazardType = this.drpHiddenHazardType.SelectedValue;
//}
if (this.drpSignPerson.SelectedValue != BLL.Const._Null)
{
Notices.SignPerson = this.drpSignPerson.SelectedValue;
@ -398,6 +429,7 @@ namespace FineUIPro.Web.OfficeCheck.Check
string rectifyResults = values.Value<string>("RectifyResults");
System.Web.UI.WebControls.TextBox txtlimitTim = (System.Web.UI.WebControls.TextBox)Grid1.Rows[i].FindControl("txtLimitTimes");
System.Web.UI.WebControls.DropDownList drpIsRect = (System.Web.UI.WebControls.DropDownList)Grid1.Rows[i].FindControl("drpIsRectify");
System.Web.UI.WebControls.DropDownList drpHiddenHazardType = (System.Web.UI.WebControls.DropDownList)Grid1.Rows[i].FindControl("drpHiddenHazardType");
string limitTime = txtlimitTim.Text.Trim();
Model.ProjectSupervision_RectifyItem rectifyNoticesItem = Funs.DB.ProjectSupervision_RectifyItem.FirstOrDefault(e => e.RectifyItemId == rectifyNoticesItemId);
if (rectifyNoticesItem != null)
@ -408,6 +440,7 @@ namespace FineUIPro.Web.OfficeCheck.Check
rectifyNoticesItem.Requirement = requirement.Trim();
rectifyNoticesItem.LimitTime = Funs.GetNewDateTime(limitTime);
rectifyNoticesItem.RectifyResults = rectifyResults.Trim();
rectifyNoticesItem.HiddenHazardType = drpHiddenHazardType.SelectedValue;
rectifyNoticesItem.IsRectify = Convert.ToBoolean(drpIsRect.SelectedValue);
Funs.DB.SubmitChanges();
if (rectifyNoticesItem.IsRectify == true)
@ -417,7 +450,6 @@ namespace FineUIPro.Web.OfficeCheck.Check
}
else
{
var item = new ProjectSupervision_RectifyItem();
item.RectifyItemId = rectifyNoticesItemId;
item.RectifyId = this.hdRectifyNoticesId.Text.Trim();
@ -425,9 +457,17 @@ namespace FineUIPro.Web.OfficeCheck.Check
item.Requirement = requirement.Trim();
item.LimitTime = Funs.GetNewDateTime(limitTime);
item.RectifyResults = rectifyResults.Trim();
item.HiddenHazardType = drpHiddenHazardType.SelectedValue;
item.IsRectify = Convert.ToBoolean(drpIsRect.SelectedValue);
Funs.DB.ProjectSupervision_RectifyItem.InsertOnSubmit(item);
Funs.DB.SubmitChanges();
string hdCheckReportItemId = values.Value<string>("CheckReportItemId");
var getAtt = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == hdCheckReportItemId + "#1");
if (getAtt != null)
{
UploadFileService.SaveAttachUrl(getAtt.AttachSource, getAtt.AttachUrl, BLL.Const.CheckInfoMenuId, item.RectifyItemId + "#1");
}
}
}
if (j == data.Count)

View File

@ -95,15 +95,6 @@ namespace FineUIPro.Web.OfficeCheck.Check
/// </remarks>
protected global::FineUIPro.DatePicker txtCheckedDate;
/// <summary>
/// drpHiddenHazardType 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpHiddenHazardType;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@ -194,6 +185,24 @@ namespace FineUIPro.Web.OfficeCheck.Check
/// </remarks>
protected global::FineUIPro.TextBox tWrongContent;
/// <summary>
/// drpHiddenHazardType 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList drpHiddenHazardType;
/// <summary>
/// hdHiddenHazardType 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdHiddenHazardType;
/// <summary>
/// tRequirement 控件。
/// </summary>

View File

@ -204153,6 +204153,8 @@ namespace Model
private string _States;
private string _HiddenHazardType;
private EntityRef<ProjectSupervision_Rectify> _ProjectSupervision_Rectify;
#region
@ -204175,6 +204177,8 @@ namespace Model
partial void OnIsRectifyChanged();
partial void OnStatesChanging(string value);
partial void OnStatesChanged();
partial void OnHiddenHazardTypeChanging(string value);
partial void OnHiddenHazardTypeChanged();
#endregion
public ProjectSupervision_RectifyItem()
@ -204347,6 +204351,26 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HiddenHazardType", DbType="NVarChar(50)")]
public string HiddenHazardType
{
get
{
return this._HiddenHazardType;
}
set
{
if ((this._HiddenHazardType != value))
{
this.OnHiddenHazardTypeChanging(value);
this.SendPropertyChanging();
this._HiddenHazardType = value;
this.SendPropertyChanged("HiddenHazardType");
this.OnHiddenHazardTypeChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_ProjectSupervision_RectifyItem_ProjectSupervision_Rectify", Storage="_ProjectSupervision_Rectify", ThisKey="RectifyId", OtherKey="RectifyId", IsForeignKey=true)]
public ProjectSupervision_Rectify ProjectSupervision_Rectify
{