feat(HJGL): 焊接任务打印功能支持多模板选择

- 为组件打印新增60x162标签模板选项
  - 为焊口打印新增80x42标签模板选项
  - API接口返回数据增加焊口位置和焊点坐标字段
  - 优化打印模板选择逻辑,支持A4和标签模板切换
This commit is contained in:
李鹏飞 2026-03-11 16:20:22 +08:00
parent 24cbcc97f8
commit b9548a967d
9 changed files with 490 additions and 53 deletions

View File

@ -361,6 +361,7 @@ namespace BLL
WeldingMethodCode = db.Base_WeldingMethod.First(y => y.WeldingMethodId == x.WeldingMethodId).WeldingMethodCode,
DetectionRate = GetDetectionRate(x.PipelineId),
IsHotProess = x.IsHotProess == true ? "是" : "否",
WeldingLocation=x.WeldingLocationId,
AttachUrl = x.AttachUrl
};
return getDateInfo.FirstOrDefault();

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="12/29/2021 10:56:08" ReportInfo.Modified="02/14/2025 15:25:56" ReportInfo.CreatorVersion="2017.1.16.0">
<Report ScriptLanguage="CSharp" ReportInfo.Created="12/29/2021 10:56:08" ReportInfo.Modified="03/11/2026 16:08:06" ReportInfo.CreatorVersion="2017.1.16.0">
<ScriptText>using System;
using System.Collections;
using System.Collections.Generic;
@ -99,7 +99,7 @@ namespace FastReport
}
</ScriptText>
<Dictionary>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqvJIqZbrmqGn7L0P56UFhaUHihKXxbhpqie4wmZgM2ymDKry7UxzO5md9ybQlkfKpN2rHYbp9GtH1LDQPa7z2vVu/kEnNnTKeHt9obmaC7TQDh0IvsUBSuzhGZdfAIK7YyBqykCgeZm5rvA6K5b7zHGdA+7pUpJ/9ZLpp1NuxWRFMchzse3CjVTAfySORKU+B"/>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqvJIqZbrmqGn7L0P56UFhaUHihKXxbhpqie4wmZgM2ymDKry7UxzO5md9ybQlkfKpN2rHYbp9GtH1LDQPa7z2vVu/kEnNnTKeHt9obmaC7TQDh0IvsUBSuzhGZdfAIK7YyBqykCgeZm5rvA6K5b7zHGdA+7pUpJ/9ZLpp1NuxWRHdfEL3zoMqqXEOl38L7vmw"/>
<TableDataSource Name="Table1" ReferenceName="Table1" DataType="System.Int32" Enabled="true">
<Column Name="pipelineCode" DataType="System.String" PropName="PipelineComponentId"/>
<Column Name="Mat" DataType="System.String" PropName="PipelineComponentCode"/>
@ -107,6 +107,7 @@ namespace FastReport
<Column Name="Spec" DataType="System.String" PropName="UnitWorkName"/>
<Column Name="SortIndex" DataType="System.String" PropName="PipelineId"/>
<Column Name="PipelineCode" DataType="System.String"/>
<Column Name="WeldJointPoint" DataType="System.String"/>
</TableDataSource>
<TableDataSource Name="Data" ReferenceName="Data.Data" DataType="System.Int32" Enabled="true">
<Column Name="CH_TrustID" DataType="System.String"/>

View File

@ -0,0 +1,167 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="12/29/2021 10:56:08" ReportInfo.Modified="03/11/2026 16:13:59" ReportInfo.CreatorVersion="2017.1.16.0">
<ScriptText>using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
using System.Data;
using FastReport;
using FastReport.Data;
using FastReport.Dialog;
using FastReport.Barcode;
using FastReport.Table;
using FastReport.Utils;
namespace FastReport
{
public class ReportScript
{
/**
private void Table3_ManualBuild(object sender, EventArgs e)
{
// get the data source by its name
DataSourceBase rowData = Report.GetDataSource(&quot;Data&quot;);
// init the data source
rowData.Init();
// print the first table row - it is a header
Tabel_Data.PrintRow(0);
// each PrintRow call must be followed by either PrintColumn or PrintColumns call
// to print cells on the row
Tabel_Data.PrintColumns();
// now enumerate the data source and print the table body
while (rowData.HasMoreRows)
{
// print the table body
Tabel_Data.PrintRow(0);
Tabel_Data.PrintColumns();
// go next data source row
rowData.Next();
}
// print the last table row - it is a footer
//Tabel_Data.PrintRow(2);
//Table3.PrintColumns();
}
private void Table4_ManualBuild(object sender, EventArgs e)
{
DataSourceBase rowData = Report.GetDataSource(&quot;Table1&quot;);
// init the data source
rowData.Init();
// print the first table row - it is a header
Table4.PrintRow(0);
// each PrintRow call must be followed by either PrintColumn or PrintColumns call
// to print cells on the row
Table4.PrintColumns();
// now enumerate the data source and print the table body
// print the table body
Table4.PrintRow(1);
Table4.PrintColumns();
Table4.PrintRow(2);
Table4.PrintColumns();
Table4.PrintRow(3);
Table4.PrintColumns();
Table4.PrintRow(4);
Table4.PrintColumns();
Table4.PrintRow(5);
Table4.PrintColumns();
Table4.PrintRow(6);
Table4.PrintColumns();
// go next data source row
rowData.Next();
}
private void Table5_ManualBuild(object sender, EventArgs e)
{
Table5.PrintRow(0);
Table5.PrintColumns();
Table5.PrintRow(1);
Table5.PrintColumns();
}
**/
}
}
</ScriptText>
<Dictionary>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqvJIqZbrmqGn7L0P56UFhaUHihKXxbhpqie4wmZgM2ymDKry7UxzO5md9ybQlkfKpN2rHYbp9GtH1LDQPa7z2vVu/kEnNnTKeHt9obmaC7TQDh0IvsUBSuzhGZdfAIK7YyBqykCgeZm5rvA6K5b7zHGdA+7pUpJ/9ZLpp1NuxWRF3o/LeJFRC5FM7f/mM4Wzy"/>
<TableDataSource Name="Table1" ReferenceName="Table1" DataType="System.Int32" Enabled="true">
<Column Name="pipelineCode" DataType="System.String" PropName="PipelineComponentId"/>
<Column Name="Mat" DataType="System.String" PropName="PipelineComponentCode"/>
<Column Name="WeldJointId" DataType="System.String" PropName="BoxNumber"/>
<Column Name="Spec" DataType="System.String" PropName="UnitWorkName"/>
<Column Name="SortIndex" DataType="System.String" PropName="PipelineId"/>
<Column Name="PipelineCode" DataType="System.String"/>
<Column Name="WeldJointPoint" DataType="System.String" PropName="Column"/>
</TableDataSource>
<TableDataSource Name="Data" ReferenceName="Data.Data" DataType="System.Int32" Enabled="true">
<Column Name="CH_TrustID" DataType="System.String"/>
<Column Name="ISO_IsoNo" DataType="System.Int32" PropName="Column" Calculated="true" Expression=""/>
<Column Name="ISO_IsoNumber" DataType="System.Int32" PropName="Column" Calculated="true" Expression=""/>
<Column Name="JOT_JointNo" DataType="System.Int32" PropName="Column1" Calculated="true" Expression=""/>
<Column Name="WED_Code2" DataType="System.Int32" PropName="Column2" Calculated="true" Expression=""/>
<Column Name="JOT_JointDesc" DataType="System.Int32" PropName="Column3" Calculated="true" Expression=""/>
<Column Name="STE_Name1" DataType="System.Int32" PropName="Column" Calculated="true" Expression=""/>
<Column Name="Remark" DataType="System.Int32" PropName="Column1" Calculated="true" Expression=""/>
</TableDataSource>
<TableDataSource Name="Products" ReferenceName="NorthWind.Products" DataType="System.Int32" Enabled="true">
<Column Name="ProductID" DataType="System.Int32"/>
<Column Name="ProductName" DataType="System.String"/>
<Column Name="SupplierID" DataType="System.Int32"/>
<Column Name="CategoryID" DataType="System.Int32"/>
<Column Name="QuantityPerUnit" DataType="System.String"/>
<Column Name="UnitPrice" DataType="System.Decimal"/>
<Column Name="UnitsInStock" DataType="System.Int16"/>
<Column Name="UnitsOnOrder" DataType="System.Int16"/>
<Column Name="ReorderLevel" DataType="System.Int16"/>
<Column Name="Discontinued" DataType="System.Boolean" BindableControl="CheckBox"/>
<Column Name="EAN13" DataType="System.String"/>
</TableDataSource>
<Parameter Name="CH_TrustID" DataType="System.Single"/>
<Parameter Name="supUnit" DataType="System.String"/>
<Parameter Name="totalUnit" DataType="System.String"/>
<Parameter Name="ConUnit" DataType="System.String"/>
<Parameter Name="CheckUnit" DataType="System.String"/>
</Dictionary>
<ReportPage Name="Page1" PaperWidth="80" PaperHeight="42" LeftMargin="0" TopMargin="0" RightMargin="0" BottomMargin="0" MirrorMargins="true">
<PageHeaderBand Name="PageHeader1" Width="302.4"/>
<DataBand Name="Data1" Top="2.7" Width="302.4" Height="158.76" Guides="198.45" DataSource="Table1" Columns.Count="1">
<TableObject Name="Table2" Left="3.78" Top="3.78" Width="294.84" Height="151.2" Border.Lines="All">
<TableColumn Name="Column3" Width="128.51"/>
<TableColumn Name="Column1" Width="166.33"/>
<TableRow Name="Row1" Height="37.8">
<TableCell Name="Cell23" Text="管线号:[Table1.pipelineCode]" VertAlign="Center" Font="宋体, 11pt" ColSpan="2"/>
<TableCell Name="Cell1" VertAlign="Center" Font="宋体, 11pt"/>
</TableRow>
<TableRow Name="Row2" Height="37.8">
<TableCell Name="Cell24" Text="规格:[Table1.Spec]" VertAlign="Center" Font="宋体, 11pt"/>
<TableCell Name="Cell6" Text="材质:[Table1.Mat]" VertAlign="Center" Font="宋体, 11pt"/>
</TableRow>
<TableRow Name="Row5" Height="75.6">
<TableCell Name="Cell35">
<BarcodeObject Name="Barcode1" Left="22.68" Width="83.16" Height="75.6" AutoSize="false" Text="https://sggl.sedin.com.cn/StaticPage/HJGL/index.html?id=[Table1.WeldJointId]&amp;weldjoint=1" ShowText="false" AllowExpressions="true" Barcode="QR Code" Barcode.ErrorCorrection="L" Barcode.Encoding="UTF8" Barcode.QuietZone="true"/>
<TextObject Name="Text2" Left="103.95" Top="56.7" Width="406.35" Height="18.9" Text="[Table1.WeldJointPoint]" VertAlign="Center" Font="黑体, 6pt"/>
</TableCell>
<TableCell Name="Cell36" VertAlign="Center" Font="宋体, 11pt">
<TextObject Name="Text1" Left="9.45" Width="151.2" Height="56.7" Text="[Table1.SortIndex]#" VertAlign="Center" Font="黑体, 36pt, style=Bold"/>
</TableCell>
</TableRow>
</TableObject>
</DataBand>
</ReportPage>
</Report>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -17006,7 +17006,7 @@
</COMReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v18.0\WebApplications\Microsoft.WebApplication.targets" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">

View File

@ -10,7 +10,7 @@
<style type="text/css">
.Green {
background-color: Green;
color:white;
color: white;
}
</style>
</head>
@ -85,20 +85,33 @@
<f:Button runat="server" ID="btnSearch" Icon="SystemSearch" ToolTip="查询" Text="查询" OnClick="btnSearch_Click">
</f:Button>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnPrint" runat="server" Icon="Printer" EnableAjax="false" Text="预制组件打印" ToolTip="预制组件打印" OnClick="btnPrint_Click"></f:Button>
<f:Button ID="btnPassMaster" Text="专工审核" Icon="ArrowRefresh" runat="server" OnClick="btnPassMaster_OnClick" >
<f:Button ID="btnPassMaster" Text="专工审核" Icon="ArrowRefresh" runat="server" OnClick="btnPassMaster_OnClick">
</f:Button>
<f:Button ID="btnPrintTask" runat="server" Icon="Printer" EnableAjax="false" Text="焊接任务单打印" ToolTip="焊接任务单打印" OnClick="btnPrintTask_Click"></f:Button>
<f:DatePicker ID="txtTaskDate" Label="计划焊接日期" runat="server"
DateFormatString="yyyy-MM-dd" LabelAlign="Left" LabelWidth="110px" Hidden="true">
</f:DatePicker>
<%-- <f:Button runat="server" ID="ckSelect" Icon="Find" ToolTip="查找" Text="查找" OnClick="ckSelect_Click" Hidden="true">
</f:Button>--%>
<f:Button ID="btnGenOutPlanMaster" Text="生成出库申请单" Icon="ArrowRefresh" runat="server" OnClick="btnGenOutPlanMaster_Click" >
<f:Button ID="btnGenOutPlanMaster" Text="生成出库申请单" Icon="ArrowRefresh" runat="server" OnClick="btnGenOutPlanMaster_Click">
</f:Button>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存" OnClick="btnSave_Click" Hidden="True">
</f:Button>
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar3" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:Button ID="btnPrintTask" runat="server" Icon="Printer" EnableAjax="false" Text="焊接任务单打印" ToolTip="焊接任务单打印" OnClick="btnPrintTask_Click"></f:Button>
<f:DropDownList ID="ddlPrintTemplate" Label="预制组件打印模板" LabelWidth="140px" Width="270px" runat="server">
<f:ListItem Text="60MM*162MM" Value="60x162" Selected="true" />
<f:ListItem Text="A4" Value="A4" />
</f:DropDownList>
<f:Button ID="btnPrint" runat="server" Icon="Printer" EnableAjax="false" Text="预制组件打印" ToolTip="预制组件打印" OnClick="btnPrint_Click"></f:Button>
<f:DropDownList ID="ddlPrintJointTemplate" Label="焊口打印模板" LabelWidth="120px" Width="240px" runat="server">
<f:ListItem Text="80MM*42MM" Value="80x42" Selected="true" />
<f:ListItem Text="A4" Value="A4" />
</f:DropDownList>
<f:Button ID="btnPrintJoint" Text="打印焊口贴纸" Icon="Printer" runat="server"
OnClick="btnPrintJoint_Click">
</f:Button>

View File

@ -1243,8 +1243,21 @@ namespace FineUIPro.Web.HJGL.WeldingManage
BLL.FastReportService.AddFastreportTable(tb);
string initTemplatePath = "";
string rootPath = Server.MapPath("~/");
// 根据选择的打印模板加载不同的模板文件
string templateValue = ddlPrintTemplate.SelectedValue;
if (templateValue == "60x162")
{
initTemplatePath = "File\\Fastreport\\组件打印_60x162.frx";
}
else if (templateValue == "A4")
{
initTemplatePath = "File\\Fastreport\\组件打印.frx";
}
else
{
// 默认使用60x162模板
initTemplatePath = "File\\Fastreport\\组件打印_60x162.frx";
}
if (File.Exists(rootPath + initTemplatePath))
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
@ -1325,6 +1338,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
WeldJointId = x.WeldJointId,
Spec = x.Specification,
SortIndex = x.WeldJointCode.Replace(x.PipelineCode + "/", ""),
WeldJointPoint=x.WeldJointPoint
}).OrderBy(x => x.pipelineCode).ThenBy(x => x.SortIndex).ToList();
var tb = LINQToDataTable(result);
if (tb != null && tb.Rows.Count > 0)
@ -1334,7 +1348,23 @@ namespace FineUIPro.Web.HJGL.WeldingManage
BLL.FastReportService.AddFastreportTable(tb);
string initTemplatePath = "";
string rootPath = Server.MapPath("~/");
// 根据选择的打印模板加载不同的模板文件
string templateValue = ddlPrintJointTemplate.SelectedValue;
if (templateValue == "80x42")
{
initTemplatePath = "File\\Fastreport\\焊口打印_80x42.frx";
}
else if (templateValue == "A4")
{
initTemplatePath = "File\\Fastreport\\焊口打印.frx";
}
else
{
// 默认使用80x42模板
initTemplatePath = "File\\Fastreport\\焊口打印_80x42.frx";
}
if (File.Exists(rootPath + initTemplatePath))
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));

View File

@ -212,15 +212,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// </remarks>
protected global::FineUIPro.Button btnSearch;
/// <summary>
/// btnPrint 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnPrint;
/// <summary>
/// btnPassMaster 控件。
/// </summary>
@ -230,15 +221,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// </remarks>
protected global::FineUIPro.Button btnPassMaster;
/// <summary>
/// btnPrintTask 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnPrintTask;
/// <summary>
/// txtTaskDate 控件。
/// </summary>
@ -266,6 +248,51 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// Toolbar3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar3;
/// <summary>
/// btnPrintTask 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnPrintTask;
/// <summary>
/// ddlPrintTemplate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPrintTemplate;
/// <summary>
/// btnPrint 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnPrint;
/// <summary>
/// ddlPrintJointTemplate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPrintJointTemplate;
/// <summary>
/// btnPrintJoint 控件。
/// </summary>