2023-03-30 报表升级

This commit is contained in:
2023-03-30 18:17:53 +08:00
parent 70bde21f2a
commit e7295249ff
185 changed files with 62531 additions and 1061 deletions
@@ -78,6 +78,8 @@
<Items>
<f:ToolbarFill ID="ToolbarFill2" runat="server">
</f:ToolbarFill>
<f:Button ID="btnAccept" Text="验收" ToolTip="验收" Icon="Accept" runat="server" OnClick="btnAccept_Click">
</f:Button>
<f:Button ID="btnImportQRCode" Text="导入二维码信息" ToolTip="导入二维码信息" Icon="PackageIn" runat="server" OnClick="btnImportQRCode_Click">
</f:Button>
<f:Button ID="btnBatchAdd" Text="批量增加" Icon="TableAdd" Hidden="true"
@@ -87,21 +89,23 @@
EnablePostBack="true" OnClick="btnSinglePreview_Click" runat="server">
</f:Button>
<f:Button ID="btnPrint" runat="server" Icon="Printer" EnableAjax="false" Text="打印" ToolTip="打印" OnClick="btnPrint_Click"></f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出"
Icon="TableGo" EnableAjax="false" EnablePostBack="true">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="组件信息" ForceFit="true"
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="组件信息" ForceFit="false"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="PipelineComponentId" AllowCellEditing="true"
AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="2" DataIDField="PipelineComponentId"
AllowSorting="true" SortField="PipelineComponentCode" SortDirection="ASC" OnSort="Grid1_Sort" OnRowCommand="Grid1_RowCommand"
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange" EnableCheckBoxSelect="true"
EnableTextSelection="True" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号"
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
<f:WindowField ColumnID="PipelineComponentCode" HeaderTextAlign="Center" TextAlign="Left"
<f:WindowField ColumnID="PipelineComponentCode" HeaderTextAlign="Center" TextAlign="Left"
Width="180px" WindowID="Window1" HeaderText="组件编号" DataTextField="PipelineComponentCode"
DataIFrameUrlFields="PipelineComponentId" DataIFrameUrlFormatString="PrePipelineEdit.aspx?PipelineComponentId={0}"
Title="组件编号" DataToolTipField="PipelineComponentCode" SortField="PipelineComponentCode"
@@ -118,13 +122,13 @@
<f:TemplateField ColumnID="tfState" Width="200px" HeaderText="组件状态" HeaderTextAlign="Center"
TextAlign="Left">
<ItemTemplate>
<asp:Label ID="lbstate" runat="server" Text='<%# ConvertState(Eval("State")) %>'></asp:Label>
<asp:Label ID="lbstate" runat="server" Text='<%# ConvertState(Eval("State"))%>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField ColumnID="tfState" Width="200px" HeaderText="生产状态" HeaderTextAlign="Center"
<f:TemplateField ColumnID="tfProductionState" Width="200px" HeaderText="生产状态" HeaderTextAlign="Center"
TextAlign="Left">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# ConvertProductionState(Eval("ProductionState")) %>'></asp:Label>
<asp:Label ID="lbProductionState" runat="server" Text='<%# ConvertProductionState(Eval("ProductionState"))%>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="200px" ColumnID="PlanStartDate" DataField="PlanStartDate" SortField="PlanStartDate"
@@ -1,4 +1,6 @@
using BLL;
using MiniExcelLibs;
using Model;
using System;
using System.Collections.Generic;
using System.Data;
@@ -14,6 +16,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
public partial class PrePipeline : PageBase
{
public int pageSize = 20;
public static DataTable GridDataTable=new DataTable ();
protected void Page_Load(object sender, EventArgs e)
{
@@ -284,7 +287,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
GridDataTable = tb;
// 2.获取当前分页数据
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
@@ -558,33 +561,32 @@ namespace FineUIPro.Web.HJGL.PreDesign
public string ConvertState(object state)
{
string StateName = string.Empty;
if (!string.IsNullOrEmpty(state.ToString()))
if (state != null)
{
if (state != null)
if (!string.IsNullOrEmpty(state.ToString()))
{
string txt = HJGL_PipelineComponentService.GetState().FirstOrDefault(x => x.Value == state.ToString()).Text;
return txt;
}
return "";
}
return StateName;
}
public string ConvertProductionState(object state)
{
string StateName = string.Empty;
if (!string.IsNullOrEmpty(state.ToString()))
if (state != null)
{
if (state != null)
if (!string.IsNullOrEmpty(state.ToString()))
{
string txt = HJGL_PipelineComponentService.GetProductionState().FirstOrDefault(x => x.Value == state.ToString()).Text;
return txt;
}
return "";
}
return StateName;
}
protected void btnImportQRCode_Click(object sender, EventArgs e)
@@ -619,6 +621,66 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
protected void btnAccept_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIDArray.Length>0)
{
foreach (var item in Grid1.SelectedRowIDArray)
{
var model = HJGL_PipelineComponentService.GetPipelineComponentById(item);
if (model.ProductionState==2)
{
BLL.APIPipelineComponentService.GetComponentConfirmArrival(PipelineComponentId: item, this.CurrUser.PersonId); ;
}
}
ShowNotify("操作成功",MessageBoxIcon.Success);
BindGrid();
}
else
{
ShowNotify("请选择需要验收的数据", MessageBoxIcon.Warning);
}
}
protected void btnOut_Click(object sender, EventArgs e)
{
if (GridDataTable!=null)
{
var q = (from x in GridDataTable.AsEnumerable()
select new
{
= x.Field<string>("PipelineComponentCode"),
= x.Field<string>("BoxNumber"),
= ConvertState(x.Field<object>("State")),
= ConvertProductionState(x.Field<object>("ProductionState")),
线 = x.Field<DateTime?>("PlanStartDate"),
= x.Field<string>("DrawingName"),
= x.Field<string>("PersonName"),
= x.Field<DateTime?>("ReceiveDate"),
});
string path = Funs.RootPath + @"File\Excel\Temp\PrePipeline.xlsx";
path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx");
MiniExcel.SaveAs(path, q);
string fileName = "组件信息.xlsx";
FileInfo info = new FileInfo(path);
long fileSize = info.Length;
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
System.Web.HttpContext.Current.Response.TransmitFile(path, 0, fileSize);
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.Close();
File.Delete(path);
}
}
}
}
@@ -203,6 +203,15 @@ namespace FineUIPro.Web.HJGL.PreDesign
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill2;
/// <summary>
/// btnAccept 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAccept;
/// <summary>
/// btnImportQRCode 控件。
/// </summary>
@@ -239,6 +248,15 @@ namespace FineUIPro.Web.HJGL.PreDesign
/// </remarks>
protected global::FineUIPro.Button btnPrint;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// Grid1 控件。
/// </summary>
@@ -258,13 +276,13 @@ namespace FineUIPro.Web.HJGL.PreDesign
protected global::System.Web.UI.WebControls.Label lbstate;
/// <summary>
/// Label1 控件。
/// lbProductionState 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label1;
protected global::System.Web.UI.WebControls.Label lbProductionState;
/// <summary>
/// ToolbarSeparator1 控件。