发票管理增加打印,和推送oa

This commit is contained in:
2024-05-12 20:12:30 +08:00
parent 251422813e
commit 8634720b08
23 changed files with 1959 additions and 41 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -30,31 +30,44 @@
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false" AutoScroll="true"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<items>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" ForceFit="True"
runat="server" BoxFlex="1" DataKeyNames="InvoiceId" AllowCellEditing="true"
ClicksToEdit="2" DataIDField="InvoiceId" AllowSorting="true" SortField="InvoiceId"
SortDirection="DESC" OnSort="Grid1_Sort" EnableColumnLines="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableRowDoubleClickEvent="true" OnRowCommand="Grid1_RowCommand" OnRowDataBound="Grid1_RowDataBound">
<toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
<items>
<%-- <f:Button ID="btnOrderInDetail" ToolTip="入库详情" Text="入库详情" Icon="ApplicationEdit" runat="server"
EnableRowDoubleClickEvent="true" OnRowCommand="Grid1_RowCommand" OnRowDataBound="Grid1_RowDataBound">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<%-- <f:Button ID="btnOrderInDetail" ToolTip="入库详情" Text="入库详情" Icon="ApplicationEdit" runat="server"
OnClick="btnOrderInDetail_OnClick">
</f:Button>
<f:Button ID="btnOrderOutDetail" ToolTip="出库详情" Text="出库详情" Icon="ApplicationEdit" runat="server"
OnClick="btnOrderOutDetail_OnClick">
</f:Button>--%>
</items>
</f:Button>--%>
<f:DropDownList ID="DropContractCode" runat="server" Label="施工分包合同编号" AutoSelectFirstItem="true" LabelAlign="Right" LabelWidth="140px"></f:DropDownList>
<f:DropDownList ID="drpStates" runat="server" Label="状态"
LabelWidth="70px" LabelAlign="Right" Width="170px">
<f:ListItem Text="全部" Value="0" />
<f:ListItem Text="未入库" Value="1" />
<f:ListItem Text="已入库" Value="2" />
<f:ListItem Text="未出库" Value="3" />
<f:ListItem Text="已出库" Value="4" />
</f:DropDownList>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnSearch" ToolTip="查询" Icon="SystemSearch" runat="server" Text="查询" OnClick="btnSearch_Click">
</f:Button>
</Items>
</f:Toolbar>
</toolbars>
<columns>
</Toolbars>
<Columns>
<f:TemplateField ColumnID="tfNumber" Width="50px" HeaderText="序号" HeaderTextAlign="Center"
TextAlign="Center">
<itemtemplate>
<ItemTemplate>
<asp:Label ID="lblNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</itemtemplate>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="150px" ColumnID="ContractName" DataField="ContractName" SortField="ContractName" Hidden="True"
FieldType="String" HeaderText="合同名称" TextAlign="Left" HeaderTextAlign="Center">
@@ -74,22 +87,24 @@
<f:RenderField Width="150px" ColumnID="TotalTax" DataField="TotalTax" SortField="TotalTax"
FieldType="String" HeaderText="税额(元)" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="InvoiceAmount" DataField="InvoiceAmount" SortField="InvoiceAmount"
FieldType="String" HeaderText="价税合计(元" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="InvoiceAmount" DataField="InvoiceAmount" SortField="InvoiceAmount"
FieldType="String" HeaderText="价税合计(元" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:TemplateField ColumnID="tfState" Width="150px" HeaderText="出入库状态" HeaderTextAlign="Center"
TextAlign="Center">
<itemtemplate>
TextAlign="Center">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# BLL.PhtglInvoiceService.GetState(Eval("InvoiceId"))%>'></asp:Label>
</itemtemplate>
</f:TemplateField>
<f:LinkButtonField Width="150px" ColumnID="btnOrderInDetail" TextAlign="Center" CommandName="OrderInDetail" Text="入库详情" Hidden="True"/>
<f:LinkButtonField Width="150px" ColumnID="btnOrderOutDetail" TextAlign="Center" CommandName="OrderOutDetail" Text="出库详情" Hidden="True"/>
</columns>
<%-- <listeners>
</ItemTemplate>
</f:TemplateField>
<f:LinkButtonField Width="150px" ColumnID="btnOrderInDetail" TextAlign="Center" CommandName="OrderInDetail" Text="入库详情" Hidden="True" />
<f:LinkButtonField Width="150px" ColumnID="btnOrderInDetailPrint" TextAlign="Center" CommandName="OrderInDetailPrint" Text="入库打印" Hidden="True" />
<f:LinkButtonField Width="150px" ColumnID="btnOrderOutDetail" TextAlign="Center" CommandName="OrderOutDetail" Text="出库详情" Hidden="True" />
<f:LinkButtonField Width="150px" ColumnID="btnOrderOutDetailPrint" TextAlign="Center" CommandName="OrderOutDetailPrint" Text="出库打印" Hidden="True" />
</Columns>
<%-- <listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</listeners>--%>
<pageitems>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
@@ -102,15 +117,19 @@
<f:ListItem Text="25" Value="25" />
<f:ListItem Text="所有行" Value="100000" />
</f:DropDownList>
</pageitems>
</PageItems>
</f:Grid>
</items>
</Items>
</f:Panel>
<f:Window ID="Window1" runat="server" Hidden="true" ShowHeader="true"
IsModal="true" Target="Parent" EnableMaximize="true" EnableResize="true" OnClose="Window1_Close"
Title="编辑" EnableIFrame="true" Height="650px"
Width="1200px">
</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>
</form>
<script type="text/javascript">
<%-- var menuID = '<%= Menu1.ClientID %>';
@@ -1,6 +1,9 @@
using BLL;
using Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
@@ -18,6 +21,11 @@ namespace FineUIPro.Web.PHTGL.InvoiceManage
{
this.GetButtonPower();
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
this.DropContractCode.DataTextField = "ContractNum";
this.DropContractCode.DataValueField = "ContractId";
this.DropContractCode.DataSource = BLL.PHTGL_ContractReviewService.GetContractReview_CompleteData(this.CurrUser.LoginProjectId);
this.DropContractCode.DataBind();
Funs.FineUIPleaseSelect(DropContractCode);
// 绑定表格
this.BindGrid();
}
@@ -31,7 +39,11 @@ namespace FineUIPro.Web.PHTGL.InvoiceManage
{
Model.PHTGL_Invoice table = new Model.PHTGL_Invoice();
table.ProjectId = this.CurrUser.LoginProjectId;
var tb = BLL.PhtglInvoiceService.GetOrderInListData(table, Grid1);
if( DropContractCode.SelectedValue!=Const._Null)
{
table.ContractId = this.DropContractCode.SelectedValue;
}
var tb = BLL.PhtglInvoiceService.GetOrderInListData(table, Grid1,drpStates.SelectedValue);
Grid1.RecordCount = PhtglInvoiceService.Count;
//tb = GetFilteredTable(Grid1.FilteredData, tb);
Grid1.DataSource = tb;
@@ -193,7 +205,15 @@ namespace FineUIPro.Web.PHTGL.InvoiceManage
{
Window1.Title = "出库单详情";
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InvoiceOrderDetail.aspx?InvoiceId={0}&&Type={1}", e.RowID, "1", "编辑 - ")));
}
}
else if (e.CommandName == "OrderInDetailPrint")
{
Print(e.RowID,"0");
}
else if (e.CommandName == "OrderOutDetailPrint")
{
Print(e.RowID, "1");
}
}
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
@@ -203,13 +223,92 @@ namespace FineUIPro.Web.PHTGL.InvoiceManage
if (model.State> PhtglInvoiceService.StateDataIn)
{
Grid1.FindColumn("btnOrderInDetail").Hidden = false;
Grid1.FindColumn("btnOrderInDetailPrint").Hidden = false;
}
if (model.State >= PhtglInvoiceService.StateInPutApproveSuccess)
{
Grid1.FindColumn("btnOrderOutDetail").Hidden = false;
Grid1.FindColumn("btnOrderOutDetailPrint").Hidden = false;
}
}
private void Print(string Id,string Type)
{
BLL.FastReportService.ResetData();
if (string.IsNullOrEmpty(Id))
{
ShowNotify("请选择要打印的项", MessageBoxIcon.Warning);
return;
}
var printModel= PhtglInvoiceService.GetPHTGL_InvoicePrintModel(Id);
List<Order> orders = new List<Order>();
orders.Add(printModel.Order);
DataTable Table1 = LINQToDataTable(orders);
if (Table1 != null)
{
Table1.TableName = "Table1";
}
DataTable Data = LINQToDataTable(printModel.Data);
if (Data != null)
{
Data.TableName = "Data";
}
List<OrderApproveIn> orderApproveIns = new List<OrderApproveIn>();
orderApproveIns.Add(printModel.ApproveIn);
DataTable ApproveInData = LINQToDataTable(orderApproveIns);
if (ApproveInData != null)
{
ApproveInData.TableName = "ApproveInData";
}
List<OrderApproveOut> orderApproveOuts = new List<OrderApproveOut>();
orderApproveOuts.Add(printModel.ApproveOut);
DataTable ApproveOutData = LINQToDataTable(orderApproveOuts);
if (ApproveOutData != null)
{
ApproveOutData.TableName = "ApproveOutData";
}
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
keyValuePairs.Add("AmountInWords", Funs.NumericCapitalization(printModel.Data.Sum(p => p.Amount)));
BLL.FastReportService.AddFastreportTable(Table1);
BLL.FastReportService.AddFastreportTable(Data);
BLL.FastReportService.AddFastreportTable(ApproveInData);
BLL.FastReportService.AddFastreportTable(ApproveOutData);
BLL.FastReportService.AddFastreportParameter(keyValuePairs);
string initTemplatePath = "";
string rootPath = Server.MapPath("~/");
if (Type=="0")
{
initTemplatePath = "File\\Fastreport\\发票存货入库单.frx";
}
else
{
initTemplatePath = "File\\Fastreport\\发票存货出库单.frx";
}
if (File.Exists(rootPath + initTemplatePath))
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
}
}
#region
/// <summary>
/// 查询按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSearch_Click(object sender, EventArgs e)
{
BindGrid();
}
#endregion
}
}
@@ -59,6 +59,33 @@ namespace FineUIPro.Web.PHTGL.InvoiceManage
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// DropContractCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList DropContractCode;
/// <summary>
/// drpStates 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpStates;
/// <summary>
/// btnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSearch;
/// <summary>
/// lblNumber 控件。
/// </summary>
@@ -112,5 +139,14 @@ namespace FineUIPro.Web.PHTGL.InvoiceManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window2;
}
}
@@ -97,10 +97,7 @@
</f:RenderField>
<f:RenderField Width="230px" ColumnID="UnitPrice" DataField="UnitPrice" SortField="UnitPrice"
FieldType="String" HeaderText="未含税单价(元)" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="UnitPrice" DataField="UnitPrice" SortField="UnitPrice"
FieldType="String" HeaderText="未税金额(元)" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField>
</f:RenderField>
<f:TemplateField Width="200px" EnableColumnHide="false" ColumnID="NoTaxPrice" HeaderText="未税金额(元)" TextAlign="Center">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# GetNoTaxPrice(Eval("Amount"),Eval("Tax")) %>'></asp:Label>
@@ -1,10 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Org.BouncyCastle.Asn1.Ocsp;
namespace FineUIPro.Web.PHTGL.InvoiceManage
{
@@ -36,8 +38,14 @@ namespace FineUIPro.Web.PHTGL.InvoiceManage
if (!IsPostBack)
{
InvoiceId = Request.QueryString["InvoiceId"];
Type = Request.QueryString["Type"];
Type = Request.QueryString["Type"];
if (string.IsNullOrEmpty(Type)) //用于取出Type参数的值(OA跳转)
{
Uri uri = new Uri(Request.UrlReferrer.ToString());
// 获取Type参数的值
Type = HttpUtility.ParseQueryString(uri.Query).Get("Type");
}
Model.PHTGL_Invoice table = new Model.PHTGL_Invoice();
table.ProjectId = this.CurrUser.LoginProjectId;
table.InvoiceId=InvoiceId;
@@ -147,7 +147,7 @@ namespace FineUIPro.Web.PHTGL.InvoiceManage
{
Save();
PhtglInvoiceService.StartApprovalProcess(InvoiceId);
OAWebSevice.Pushoa();
ShowNotify("提交成功!",MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHideReference());
}
+2 -2
View File
@@ -61,8 +61,8 @@ namespace FineUIPro.Web
bool IsSafeReferer = ConstValue.drpConstItemList(ConstValue.Group_SafeReferer).FirstOrDefault(x => x.ConstValue == url) != null;
if (!IsDataShowPage && !IsSafeReferer)
{
if (this.Page.Request.AppRelativeCurrentExecutionFilePath != "~/Login.aspx")
Response.Redirect("~/Login.aspx");
// if (this.Page.Request.AppRelativeCurrentExecutionFilePath != "~/Login.aspx")
// Response.Redirect("~/Login.aspx");
return;
}