视图代码:
<legend>应收情况</legend>
<%= Html.Kendo().Grid<Charge_PayConditionsQuery_En>()
.Name("grid_Charge_PayConditionsQuery_En")
.Columns(columns =>
{
columns.Bound(p => p.ItemName).Width(50);
//columns.Bound(p => p.InvoiceTypeName).Title("发票类型名称").Width(100);
columns.Bound(p => p.ShouldAmount).Width(50).Format("{0:N}").HtmlAttributes(new { style = "text-align: right;" })
.ClientGroupFooterTemplate("<span style=‘float: right;‘> 金额: #=kendo.toString(sum,‘N‘)# </span>") //分组的总金额
.ClientFooterTemplate("<span style=‘float: right;‘>总金额: #=kendo.toString(sum,‘N‘)# </span>"); //全部分组的总金额
columns.Bound(p => p.ReduceAmount).Width(50).Format("{0:N}").HtmlAttributes(new { style = "text-align: right;" })
.ClientGroupFooterTemplate("<span style=‘float: right;‘> 金额: #=kendo.toString(sum,‘N‘)# </span>")
.ClientFooterTemplate("<span style=‘float: right;‘>总金额: #=kendo.toString(sum,‘N‘)# </span>");
columns.Bound(p => p.BufferAmount).Width(50).Format("{0:N}").HtmlAttributes(new { style = "text-align: right;" })
.ClientGroupFooterTemplate("<span style=‘float: right;‘> 金额: #=kendo.toString(sum,‘N‘)# </span>")
.ClientFooterTemplate("<span style=‘float: right;‘>总金额: #=kendo.toString(sum,‘N‘)# </span>");
columns.Bound(p => p.OccurAmount).Width(50).Format("{0:N}").HtmlAttributes(new { style = "text-align: right;" })
.ClientGroupFooterTemplate("<span style=‘float: right;‘> 金额: #=kendo.toString(sum,‘N‘)# </span>")
.ClientFooterTemplate("<span style=‘float: right;‘>总金额: #=kendo.toString(sum,‘N‘)# </span>");
//.ClientGroupFooterTemplate("<div style=\"text-align:right;\">开票金额:#=kendo.toString(sum,‘N‘)#</div>");
columns.Bound(p => p.ArrearageAmount).Width(50).Format("{0:N}").HtmlAttributes(new { style = "text-align: right;" })
.ClientGroupFooterTemplate("<span style=‘float: right;‘> 金额: #=kendo.toString(sum,‘N‘)# </span>")
.ClientFooterTemplate("<span style=‘float: right;‘>总金额: #=kendo.toString(sum,‘N‘)# </span>");
columns.Bound(p => p.RefundAmount).Width(50).Format("{0:N}").HtmlAttributes(new { style = "text-align: right;" })
.ClientGroupFooterTemplate("<span style=‘float: right;‘> 金额: #=kendo.toString(sum,‘N‘)# </span>")
.ClientFooterTemplate("<span style=‘float: right;‘>总金额: #=kendo.toString(sum,‘N‘)# </span>");
columns.Bound(p => p.ReduceRemark).Width(50);
columns.Bound(p => p.BufferDate).Width(50);
columns.Bound(p => p.Remark).Width(50);
columns.Bound(p => p.LatoryName).Hidden(true);
//columns.Command(p =>
//{
// p.Custom("InvoiceReprint").Click("InvoiceReprint").Text("补打");
// p.Custom("InvoiceReplace").Click("InvoiceReplace").Text("替换");
//}).Width(200).Title("操作") ;
})
.Selectable(selectable => selectable
.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
//.Pageable()
.Sortable(p => p.SortMode(GridSortMode.SingleColumn))
//.Scrollable(p=>p.Virtual(true))
.Filterable()
.ColumnMenu()
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(p => p.OrderDetailID))
.Aggregates(p =>
{
p.Add(t => t.OccurAmount).Sum();
p.Add(t => t.ShouldAmount).Sum();
p.Add(t => t.ReduceAmount).Sum();
p.Add(t => t.BufferAmount).Sum();
p.Add(t => t.ArrearageAmount).Sum();
p.Add(t => t.RefundAmount).Sum();
}) //对字段(money类型)所对应的值进行相加
.Group(p =>
{
p.AddDescending(t => t.LatoryName);
}) //分组字段
.Read(read => read.Action("PersonChargeInfo_Read", "PersonalManager").Data("func_GetPersonidForRead"))
)