2023-11-08

This commit is contained in:
2023-11-08 17:26:59 +08:00
parent 1b7463957c
commit 11357590c9
19 changed files with 389 additions and 135 deletions
@@ -68,7 +68,8 @@
<f:Button runat="server" ID="btnSearch" Icon="SystemSearch" ToolTip="查询" Text="查询" OnClick="btnSearch_Click">
</f:Button>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnPrint" runat="server" Icon="Printer" EnableAjax="false" Text="预制组件打印" ToolTip="预制组件打印" OnClick="btnPrint_Click"></f:Button>
<f:DatePicker ID="txtTaskDate" Label="计划焊接日期" runat="server"
DateFormatString="yyyy-MM-dd" LabelAlign="Left" LabelWidth="110px" Hidden="true">
</f:DatePicker>
@@ -214,6 +215,11 @@
EnableMaximize="true" Target="Top" EnableResize="false" runat="server"
IsModal="true" Width="1300px" Height="650px" OnClose="Window1_Close">
</f:Window>
<f:Window ID="Window2" Title="打印" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Top" EnableResize="false" runat="server"
IsModal="true" Width="1010px" Height="660px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuAdd" EnablePostBack="true" runat="server" Text="新增" Hidden="true" Icon="Add" OnClick="btnMenuAdd_Click">
</f:MenuButton>
@@ -3,6 +3,7 @@ using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Web.UI.WebControls;
@@ -1115,5 +1116,55 @@ namespace FineUIPro.Web.HJGL.WeldingManage
this.BindGrid(GetWeldingTaskList);
}
}
protected void btnPrint_Click(object sender, EventArgs e)
{
DateTime? taskTime = Funs.GetNewDateTime(tvControlItem.SelectedNodeID.Split('|')[1]);
if (taskTime != null)
{
var pipelines = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, tvControlItem.SelectedNode.ParentNode.NodeID, Convert.ToDateTime(taskTime)).Select(x=>x.PipelineId).Distinct().ToList();
if (pipelines.Any())
{
BLL.FastReportService.ResetData();
var result = HJGL_PipelineComponentService.GetPrintModelByPipelineComponentIds(null, pipelines.ToArray(),true);
var PipelineComponentIds = result.Select(x => x.PipelineComponentId).ToArray();
var tb = LINQToDataTable(result);
if (tb != null && tb.Rows.Count>0)
{
tb.TableName = "Table1";
}
else
{
ShowNotify("该管线已打印完成", MessageBoxIcon.Question);
return;
}
BLL.FastReportService.AddFastreportTable(tb);
string initTemplatePath = "";
string rootPath = Server.MapPath("~/");
initTemplatePath = "File\\Fastreport\\组件打印.frx";
if (File.Exists(rootPath + initTemplatePath))
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
HJGL_PipelineComponentService.UpdateIsPrint(PipelineComponentIds);
}
}
else
{
ShowNotify("无关联管线", MessageBoxIcon.Question);
}
}
else
{
ShowNotify("请选择任务单",MessageBoxIcon.Question);
}
}
}
}
@@ -176,6 +176,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// </remarks>
protected global::FineUIPro.Button btnSearch;
/// <summary>
/// btnPrint 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnPrint;
/// <summary>
/// txtTaskDate 控件。
/// </summary>
@@ -284,6 +293,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary>
/// Menu1 控件。
/// </summary>