feat(hjgl): 完善焊前检查和防腐检查流程

焊前检查需要同时覆盖下料、组对和防腐检查,并支持移动端查询与保存。
扩展焊前检查模型、服务和页面字段,补充检查结果、不合格原因、整改要求、
附件和防腐检查记录,便于按焊口和材料追溯检查过程。
This commit is contained in:
2026-07-07 10:40:21 +08:00
parent 02b524b895
commit bb6615ebb0
57 changed files with 5035 additions and 2057 deletions
@@ -0,0 +1,101 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AntiCorrosionCheckRecord.aspx.cs" Inherits="FineUIPro.Web.CLGL.AntiCorrosionCheckRecord" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>防腐检查记录</title>
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Items>
<f:Panel ID="Panel2" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="Region" BoxConfigAlign="Stretch">
<Items>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
Layout="VBox" ShowHeader="false" BodyPadding="5px" Title="防腐检查记录" AutoScroll="true">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="防腐检查记录"
runat="server" BoxFlex="1" EnableColumnLines="true" DataKeyNames="AntiCorrosionCheckId"
DataIDField="AntiCorrosionCheckId" AllowPaging="true" IsDatabasePaging="true" PageSize="15"
OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox ID="txtMaterialCode" runat="server" Label="材料编码" EmptyText="输入查询条件"
Width="220px" LabelWidth="80px" LabelAlign="Right" />
<f:TextBox ID="txtPaintCode" runat="server" Label="涂漆代码" EmptyText="输入查询条件"
Width="220px" LabelWidth="80px" LabelAlign="Right" />
<f:TextBox ID="txtIntermediatePaint" runat="server" Label="中间漆" EmptyText="输入查询条件"
Width="180px" LabelWidth="70px" LabelAlign="Right" />
<f:TextBox ID="txtTopcoat" runat="server" Label="面漆" EmptyText="输入查询条件"
Width="180px" LabelWidth="70px" LabelAlign="Right" />
<f:TextBox ID="txtFilmThickness" runat="server" Label="膜厚" EmptyText="输入查询条件"
Width="140px" LabelWidth="50px" LabelAlign="Right" />
<f:DropDownList ID="ddlCheckResult" runat="server" Label="结果" Width="150px"
LabelWidth="50px" LabelAlign="Right" />
<f:ToolbarFill ID="ToolbarFill1" runat="server" />
<f:Button ID="btnQuery" Text="查询" Icon="SystemSearch" EnablePostBack="true"
OnClick="btnQuery_Click" runat="server" />
<f:Button ID="btnNew" Text="新增" Icon="Add" EnablePostBack="true"
runat="server" OnClick="btnNew_Click" />
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar3" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DatePicker ID="dpStartTime" runat="server" Label="开始时间" DateFormatString="yyyy-MM-dd"
Width="200px" LabelWidth="80px" LabelAlign="Right" />
<f:DatePicker ID="dpEndTime" runat="server" Label="结束时间" DateFormatString="yyyy-MM-dd"
Width="200px" LabelWidth="80px" LabelAlign="Right" />
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField ID="rfMaterialCode" Width="180px" ColumnID="MaterialCode" DataField="MaterialCode" FieldType="String"
HeaderText="材料编码" HeaderTextAlign="Center" TextAlign="Left" />
<f:RenderField ID="rfMaterialName" Width="180px" ColumnID="MaterialName" DataField="MaterialName" FieldType="String"
HeaderText="材料名称" HeaderTextAlign="Center" TextAlign="Left" />
<f:RenderField ID="rfMaterialSpec" Width="180px" ColumnID="MaterialSpec" DataField="MaterialSpec" FieldType="String"
HeaderText="规格" HeaderTextAlign="Center" TextAlign="Left" />
<f:RenderField ID="rfPaintCode" Width="140px" ColumnID="PaintCode" DataField="PaintCode" FieldType="String"
HeaderText="涂漆代码" HeaderTextAlign="Center" TextAlign="Left" />
<f:RenderField ID="rfIntermediatePaint" Width="160px" ColumnID="IntermediatePaint" DataField="IntermediatePaint" FieldType="String"
HeaderText="中间漆" HeaderTextAlign="Center" TextAlign="Left" />
<f:RenderField ID="rfTopcoat" Width="160px" ColumnID="Topcoat" DataField="Topcoat" FieldType="String"
HeaderText="面漆" HeaderTextAlign="Center" TextAlign="Left" />
<f:RenderField ID="rfFilmThickness" Width="110px" ColumnID="FilmThickness" DataField="FilmThickness" FieldType="Double"
HeaderText="膜厚" HeaderTextAlign="Center" TextAlign="Right" />
<f:RenderField ID="rfCheckResult" Width="120px" ColumnID="CheckResult" DataField="CheckResult" FieldType="String"
HeaderText="检查结果" HeaderTextAlign="Center" TextAlign="Center" />
<f:RenderField ID="rfCheckPersonName" Width="160px" ColumnID="CheckPersonName" DataField="CheckPersonName" FieldType="String"
HeaderText="检查人" HeaderTextAlign="Center" TextAlign="Center" />
<f:RenderField ID="rfCheckTime" Width="170px" ColumnID="CheckTime" DataField="CheckTime" FieldType="Date"
RendererArgument="yyyy-MM-dd HH:mm" HeaderText="检查时间" HeaderTextAlign="Center" TextAlign="Center" />
</Columns>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server" />
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:" />
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="15" Value="15" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="25" Value="25" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="防腐检查记录" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Top" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
Width="860px" Height="600px" />
</form>
</body>
</html>
@@ -0,0 +1,85 @@
using BLL;
using System;
namespace FineUIPro.Web.CLGL
{
public partial class AntiCorrosionCheckRecord : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
ddlCheckResult.Items.Clear();
ddlCheckResult.Items.Add(new FineUIPro.ListItem("全部", string.Empty));
ddlCheckResult.Items.Add(new FineUIPro.ListItem("合格", "合格"));
ddlCheckResult.Items.Add(new FineUIPro.ListItem("不合格", "不合格"));
ddlCheckResult.SelectedIndex = 0;
BindGrid();
}
}
private void BindGrid()
{
var result = PreWeldInspectionService.GetAntiCorrosionCheckList(
CurrUser.LoginProjectId,
txtMaterialCode.Text.Trim(),
txtPaintCode.Text.Trim(),
txtIntermediatePaint.Text.Trim(),
txtTopcoat.Text.Trim(),
txtFilmThickness.Text.Trim(),
ddlCheckResult.SelectedValue,
dpStartTime.SelectedDate,
dpEndTime.SelectedDate,
Grid1.PageIndex,
Grid1.PageSize);
Grid1.RecordCount = result.Item2;
Grid1.DataSource = result.Item1;
Grid1.DataBind();
}
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageIndex = e.NewPageIndex;
BindGrid();
}
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
protected void btnQuery_Click(object sender, EventArgs e)
{
Grid1.PageIndex = 0;
BindGrid();
}
protected void btnNew_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, CurrUser.PersonId, Const.Tw_AntiCorrosionCheckRecordMenuId, Const.BtnAdd))
{
PageContext.RegisterStartupScript(Window1.GetShowReference("AntiCorrosionCheckRecordEdit.aspx"));
}
}
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
if (CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, CurrUser.PersonId, Const.Tw_AntiCorrosionCheckRecordMenuId, Const.BtnSee))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("AntiCorrosionCheckRecordView.aspx?AntiCorrosionCheckId={0}", Grid1.SelectedRowID)));
}
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid();
}
}
}
@@ -0,0 +1,47 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能会导致不正确的行为,如果重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.CLGL
{
public partial class AntiCorrosionCheckRecord
{
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
protected global::FineUIPro.PageManager PageManager1;
protected global::FineUIPro.Panel Panel1;
protected global::FineUIPro.Panel Panel2;
protected global::FineUIPro.Panel panelCenterRegion;
protected global::FineUIPro.Grid Grid1;
protected global::FineUIPro.Toolbar Toolbar2;
protected global::FineUIPro.TextBox txtMaterialCode;
protected global::FineUIPro.TextBox txtPaintCode;
protected global::FineUIPro.TextBox txtIntermediatePaint;
protected global::FineUIPro.TextBox txtTopcoat;
protected global::FineUIPro.TextBox txtFilmThickness;
protected global::FineUIPro.DropDownList ddlCheckResult;
protected global::FineUIPro.ToolbarFill ToolbarFill1;
protected global::FineUIPro.Button btnQuery;
protected global::FineUIPro.Button btnNew;
protected global::FineUIPro.Toolbar Toolbar3;
protected global::FineUIPro.DatePicker dpStartTime;
protected global::FineUIPro.DatePicker dpEndTime;
protected global::FineUIPro.RenderField rfMaterialCode;
protected global::FineUIPro.RenderField rfMaterialName;
protected global::FineUIPro.RenderField rfMaterialSpec;
protected global::FineUIPro.RenderField rfPaintCode;
protected global::FineUIPro.RenderField rfIntermediatePaint;
protected global::FineUIPro.RenderField rfTopcoat;
protected global::FineUIPro.RenderField rfFilmThickness;
protected global::FineUIPro.RenderField rfCheckResult;
protected global::FineUIPro.RenderField rfCheckPersonName;
protected global::FineUIPro.RenderField rfCheckTime;
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
protected global::FineUIPro.ToolbarText ToolbarText1;
protected global::FineUIPro.DropDownList ddlPageSize;
protected global::FineUIPro.Window Window1;
}
}
@@ -0,0 +1,103 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AntiCorrosionCheckRecordEdit.aspx.cs" Inherits="FineUIPro.Web.CLGL.AntiCorrosionCheckRecordEdit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>防腐检查记录</title>
<base target="_self" />
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:TextBox ID="txtMaterialCode" runat="server" Label="材料编码" Required="true"
ShowRedStar="true" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="drpPaintId" runat="server" Label="涂漆代码" Required="true"
ShowRedStar="true" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtAnticorrosionLevel" runat="server" Label="防腐等级" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:NumberBox ID="numFilmThickness" runat="server" Label="膜厚" LabelWidth="160px"
DecimalPrecision="2" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtSandBlasting" runat="server" Label="喷砂信息" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtRustSandBlasting" runat="server" Label="除锈喷砂信息" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="ddlCheckResult" runat="server" Label="检查结果" LabelWidth="160px" Required="true" ShowRedStar="true">
<f:ListItem Text="合格" Value="合格" />
<f:ListItem Text="不合格" Value="不合格" />
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="drpCheckPerson" runat="server" Label="检查人" LabelWidth="160px" Required="true"
ShowRedStar="true" EnableEdit="true" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DatePicker ID="dpCheckTime" runat="server" Label="检查时间" LabelWidth="160px"
DateFormatString="yyyy-MM-dd" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtUnqualifiedReason" runat="server" Label="不合格原因" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtRectifyRequirement" runat="server" Label="整改要求" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtRemark" runat="server" Label="备注" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:Button ID="btnAttachUrl" Text="附件" Icon="TableCell" runat="server" OnClick="btnAttachUrl_Click" />
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:Button ID="btnSave" Text="保存" Icon="SystemSave" runat="server" OnClick="btnSave_Click" ValidateForms="SimpleForm1" />
<f:Button ID="btnClose" EnablePostBack="false" Text="关闭" runat="server" Icon="SystemClose" />
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Window ID="WindowAtt" Title="附件上传" Hidden="true" EnableMaximize="true" EnableIFrame="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px" Height="420px" />
</form>
</body>
</html>
@@ -0,0 +1,119 @@
using BLL;
using System;
namespace FineUIPro.Web.CLGL
{
public partial class AntiCorrosionCheckRecordEdit : PageBase
{
public string AntiCorrosionCheckId
{
get { return (string)ViewState["AntiCorrosionCheckId"]; }
set { ViewState["AntiCorrosionCheckId"] = value; }
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
btnClose.OnClientClick = ActiveWindow.GetHideReference();
AntiCorrosionCheckId = Request.Params["AntiCorrosionCheckId"];
BindPaintCode();
BindCheckPerson();
if (!string.IsNullOrEmpty(AntiCorrosionCheckId))
{
BindData();
}
else
{
drpCheckPerson.SelectedValue = CurrUser.PersonId;
dpCheckTime.SelectedDate = DateTime.Now;
}
}
}
private void BindPaintCode()
{
drpPaintId.DataTextField = "PaintCode";
drpPaintId.DataValueField = "Id";
drpPaintId.DataSource = TwAntiCorrosionTrustService.GetPaintCodeList();
drpPaintId.DataBind();
Funs.FineUIPleaseSelect(drpPaintId);
}
private void BindCheckPerson()
{
Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpCheckPerson, CurrUser.LoginProjectId, null, null, true);
}
private void BindData()
{
var model = PreWeldInspectionService.GetAntiCorrosionCheckById(AntiCorrosionCheckId);
if (model == null)
{
return;
}
txtMaterialCode.Text = model.MaterialCode;
txtAnticorrosionLevel.Text = model.AnticorrosionLevel;
drpPaintId.SelectedValue = model.PaintId;
if (model.FilmThickness.HasValue)
{
numFilmThickness.Text = model.FilmThickness.Value.ToString();
}
txtSandBlasting.Text = model.SandBlasting;
txtRustSandBlasting.Text = model.RustSandBlasting;
ddlCheckResult.SelectedValue = model.CheckResult;
drpCheckPerson.SelectedValue = model.CheckPerson;
dpCheckTime.SelectedDate = model.CheckTime;
txtUnqualifiedReason.Text = model.UnqualifiedReason;
txtRectifyRequirement.Text = model.RectifyRequirement;
txtRemark.Text = model.Remark;
}
protected void btnSave_Click(object sender, EventArgs e)
{
if (!CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, CurrUser.PersonId, Const.Tw_AntiCorrosionCheckRecordMenuId, Const.BtnSave))
{
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
return;
}
var item = new Model.AntiCorrosionCheckRecordInput
{
AntiCorrosionCheckId = AntiCorrosionCheckId,
ProjectId = CurrUser.LoginProjectId,
MaterialCode = txtMaterialCode.Text.Trim(),
AnticorrosionLevel = txtAnticorrosionLevel.Text.Trim(),
PaintId = drpPaintId.SelectedValue,
FilmThickness = string.IsNullOrWhiteSpace(numFilmThickness.Text) ? (decimal?)null : Convert.ToDecimal(numFilmThickness.Text),
SandBlasting = txtSandBlasting.Text.Trim(),
RustSandBlasting = txtRustSandBlasting.Text.Trim(),
CheckResult = ddlCheckResult.SelectedValue,
CheckPerson = drpCheckPerson.SelectedValue,
CheckTime = dpCheckTime.SelectedDate ?? DateTime.Now,
UnqualifiedReason = txtUnqualifiedReason.Text.Trim(),
RectifyRequirement = txtRectifyRequirement.Text.Trim(),
Remark = txtRemark.Text.Trim(),
CreateUser = CurrUser.PersonId
};
AntiCorrosionCheckId = APIPreWeldInspectionService.SaveAntiCorrosionCheck(item);
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
protected void btnAttachUrl_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(AntiCorrosionCheckId))
{
Alert.ShowInTop("请先保存防腐检查记录后再上传附件!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(
string.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CLGL/AntiCorrosionCheckRecord&menuId={1}&edit=1&type=-1",
AntiCorrosionCheckId, Const.Tw_AntiCorrosionCheckRecordMenuId)));
}
}
}
@@ -0,0 +1,32 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.CLGL
{
public partial class AntiCorrosionCheckRecordEdit
{
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
protected global::FineUIPro.PageManager PageManager1;
protected global::FineUIPro.Form SimpleForm1;
protected global::FineUIPro.TextBox txtMaterialCode;
protected global::FineUIPro.TextBox txtAnticorrosionLevel;
protected global::FineUIPro.DropDownList drpPaintId;
protected global::FineUIPro.NumberBox numFilmThickness;
protected global::FineUIPro.TextArea txtSandBlasting;
protected global::FineUIPro.TextArea txtRustSandBlasting;
protected global::FineUIPro.DropDownList ddlCheckResult;
protected global::FineUIPro.DropDownList drpCheckPerson;
protected global::FineUIPro.DatePicker dpCheckTime;
protected global::FineUIPro.TextArea txtUnqualifiedReason;
protected global::FineUIPro.TextArea txtRectifyRequirement;
protected global::FineUIPro.TextArea txtRemark;
protected global::FineUIPro.Button btnAttachUrl;
protected global::FineUIPro.Toolbar Toolbar1;
protected global::FineUIPro.Button btnSave;
protected global::FineUIPro.Button btnClose;
protected global::FineUIPro.Window WindowAtt;
}
}
@@ -0,0 +1,95 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AntiCorrosionCheckRecordView.aspx.cs" Inherits="FineUIPro.Web.CLGL.AntiCorrosionCheckRecordView" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>防腐检查记录详情</title>
<base target="_self" />
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:TextBox ID="txtMaterialCode" runat="server" Label="材料编码" Readonly="true" LabelWidth="160px" />
<f:TextBox ID="txtMaterialName" runat="server" Label="材料名称" Readonly="true" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtMaterialSpec" runat="server" Label="规格" Readonly="true" LabelWidth="160px" />
<f:TextBox ID="txtMaterialMade" runat="server" Label="材质" Readonly="true" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtPaintCode" runat="server" Label="涂漆代码" Readonly="true" LabelWidth="160px" />
<f:TextBox ID="txtAnticorrosionLevel" runat="server" Label="防腐等级" Readonly="true" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtIntermediatePaint" runat="server" Label="中间漆" Readonly="true" LabelWidth="160px" />
<f:TextBox ID="txtTopcoat" runat="server" Label="面漆" Readonly="true" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtFilmThickness" runat="server" Label="膜厚" Readonly="true" LabelWidth="160px" />
<f:TextBox ID="txtCheckPerson" runat="server" Label="检查人" Readonly="true" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtSandBlasting" runat="server" Label="喷砂信息" Readonly="true" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtRustSandBlasting" runat="server" Label="除锈喷砂信息" Readonly="true" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtCheckResult" runat="server" Label="检查结果" Readonly="true" LabelWidth="160px" />
<f:TextBox ID="txtCheckTime" runat="server" Label="检查时间" Readonly="true" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtUnqualifiedReason" runat="server" Label="不合格原因" Readonly="true" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtRectifyRequirement" runat="server" Label="整改要求" Readonly="true" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtRemark" runat="server" Label="备注" Readonly="true" LabelWidth="160px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:Button ID="btnAttachUrl" Text="附件" Icon="TableCell" runat="server" OnClick="btnAttachUrl_Click" />
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:Button ID="btnClose" EnablePostBack="false" Text="关闭" runat="server" Icon="SystemClose" />
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Window ID="WindowAtt" Title="附件查看" Hidden="true" EnableMaximize="true" EnableIFrame="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px" Height="420px" />
</form>
</body>
</html>
@@ -0,0 +1,64 @@
using BLL;
using System;
namespace FineUIPro.Web.CLGL
{
public partial class AntiCorrosionCheckRecordView : PageBase
{
public string AntiCorrosionCheckId
{
get { return (string)ViewState["AntiCorrosionCheckId"]; }
set { ViewState["AntiCorrosionCheckId"] = value; }
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
btnClose.OnClientClick = ActiveWindow.GetHideReference();
AntiCorrosionCheckId = Request.Params["AntiCorrosionCheckId"];
BindData();
}
}
private void BindData()
{
var model = PreWeldInspectionService.GetAntiCorrosionCheckById(AntiCorrosionCheckId);
if (model == null)
{
return;
}
txtMaterialCode.Text = model.MaterialCode;
txtMaterialName.Text = model.MaterialName;
txtMaterialSpec.Text = model.MaterialSpec;
txtMaterialMade.Text = model.MaterialMade;
txtPaintCode.Text = model.PaintCode;
txtAnticorrosionLevel.Text = model.AnticorrosionLevel;
txtIntermediatePaint.Text = model.IntermediatePaint;
txtTopcoat.Text = model.Topcoat;
txtFilmThickness.Text = model.FilmThickness.HasValue ? model.FilmThickness.Value.ToString() : string.Empty;
txtSandBlasting.Text = model.SandBlasting;
txtRustSandBlasting.Text = model.RustSandBlasting;
txtCheckResult.Text = model.CheckResult;
txtCheckPerson.Text = model.CheckPersonName;
txtCheckTime.Text = model.CheckTime.HasValue ? string.Format("{0:yyyy-MM-dd HH:mm}", model.CheckTime.Value) : string.Empty;
txtUnqualifiedReason.Text = model.UnqualifiedReason;
txtRectifyRequirement.Text = model.RectifyRequirement;
txtRemark.Text = model.Remark;
}
protected void btnAttachUrl_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(AntiCorrosionCheckId))
{
Alert.ShowInTop("未找到防腐检查记录!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(
string.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CLGL/AntiCorrosionCheckRecord&menuId={1}&edit=0&type=-1",
AntiCorrosionCheckId, Const.Tw_AntiCorrosionCheckRecordMenuId)));
}
}
}
@@ -0,0 +1,36 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.CLGL
{
public partial class AntiCorrosionCheckRecordView
{
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
protected global::FineUIPro.PageManager PageManager1;
protected global::FineUIPro.Form SimpleForm1;
protected global::FineUIPro.TextBox txtMaterialCode;
protected global::FineUIPro.TextBox txtMaterialName;
protected global::FineUIPro.TextBox txtMaterialSpec;
protected global::FineUIPro.TextBox txtMaterialMade;
protected global::FineUIPro.TextBox txtPaintCode;
protected global::FineUIPro.TextBox txtAnticorrosionLevel;
protected global::FineUIPro.TextBox txtFilmThickness;
protected global::FineUIPro.TextBox txtIntermediatePaint;
protected global::FineUIPro.TextBox txtTopcoat;
protected global::FineUIPro.TextArea txtSandBlasting;
protected global::FineUIPro.TextArea txtRustSandBlasting;
protected global::FineUIPro.TextBox txtCheckResult;
protected global::FineUIPro.TextBox txtCheckPerson;
protected global::FineUIPro.TextBox txtCheckTime;
protected global::FineUIPro.TextArea txtUnqualifiedReason;
protected global::FineUIPro.TextArea txtRectifyRequirement;
protected global::FineUIPro.TextArea txtRemark;
protected global::FineUIPro.Button btnAttachUrl;
protected global::FineUIPro.Toolbar Toolbar1;
protected global::FineUIPro.Button btnClose;
protected global::FineUIPro.Window WindowAtt;
}
}
+52 -3
View File
@@ -33,9 +33,9 @@
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="材料库存表" EnableCollapse="true" ForceFit="true"
runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true"
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="Id"
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="Id" OnRowCommand="Grid1_RowCommand"
SortDirection="DESC" OnSort="Grid1_Sort" EnableColumnLines="true" EnableTextSelection="True"
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange">
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" AllowColumnLocking="true">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
@@ -91,6 +91,7 @@
<f:RenderField Width="150px" ColumnID="StockNum" DataField="StockNum" SortField="StockNum"
FieldType="String" HeaderText="库存数量" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:LinkButtonField Width="120px" ColumnID="btnBarCodePrint" TextAlign="Center" CommandName="btnBarCodePrint" Text="入库条码打印" Locked="true" />
</Columns>
<%-- <Listeners>
@@ -135,8 +136,56 @@
return false;
}--%>
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
__doPostBack(null, 'reloadGrid');
}
function printByHiddenFrame(url) {
var frameId = 'fastreport-print-frame-' + new Date().getTime();
var frame = document.createElement('iframe');
frame.id = frameId;
frame.name = frameId;
frame.style.position = 'fixed';
frame.style.left = '-10000px';
frame.style.top = '-10000px';
frame.style.width = '1px';
frame.style.height = '1px';
frame.style.border = '0';
frame.style.opacity = '0';
frame.onload = function() {
setTimeout(function() {
try {
frame.contentWindow.onafterprint = cleanupPrintFrame;
frame.contentWindow.focus();
frame.contentWindow.print();
} catch (e) {
window.print();
}
}, 500);
};
frame.src = url;
document.body.appendChild(frame);
var cleaned = false;
function cleanupPrintFrame() {
if (cleaned) {
return;
}
cleaned = true;
if (frame && frame.parentNode) {
frame.parentNode.removeChild(frame);
}
window.removeEventListener('afterprint', cleanupPrintFrame);
}
window.addEventListener('afterprint', cleanupPrintFrame);
setTimeout(cleanupPrintFrame, 300000);
}
window.addEventListener('message', function(event) {
if (!event.data || event.data.type !== 'fastreport-print-finished') {
return;
}
var frame = document.getElementById(event.data.frameId);
if (frame && frame.parentNode) {
frame.parentNode.removeChild(frame);
}
});
</script>
</body>
</html>
@@ -1,5 +1,8 @@
using BLL;
using Model;
using System;
using System.Data;
using System.IO;
using System.Text;
namespace FineUIPro.Web.CLGL
@@ -87,6 +90,48 @@ namespace FineUIPro.Web.CLGL
this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue);
this.BindGrid();
}
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "btnBarCodePrint")
{
PrintInputBarCode(e.RowID);
}
}
private void PrintInputBarCode(string Id)
{
if (string.IsNullOrEmpty(Id))
{
ShowNotify("请选择要打印的项", MessageBoxIcon.Warning);
return;
}
BLL.FastReportService.ResetData();
var MaterialCode=TwMaterialstockService.GetTw_MaterialStockById(Id).PipeLineMatCode;
var list = TwInputdetailBarCodeService.GetListData(MaterialCode);
if (list == null || list.Count == 0)
{
ShowNotify("未找到入库条码明细,请确认已生成入库单并已创建条码明细表。", MessageBoxIcon.Warning);
return;
}
DataTable table = LINQToDataTable(list);
if (table != null)
{
table.TableName = "Table1";
}
BLL.FastReportService.AddFastreportTable(table);
string rootPath = Server.MapPath("~/");
string initTemplatePath = "File\\Fastreport\\材料入库条码.frx";
if (File.Exists(rootPath + initTemplatePath))
{
//PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
string printUrl = ResolveUrl(BLL.FastReportService.ExportReport(rootPath + initTemplatePath));
PageContext.RegisterStartupScript(String.Format("printByHiddenFrame('{0}');", printUrl));
}
}
#endregion
#region