123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- @{
- ViewBag.Title = "现金银行报表";
- Layout = "~/Views/Shared/_ReportIndex.cshtml";
- }
- <script>
- $(function () {
- GetGrid();
- })
- function GetGrid() {
- var $gridTable = $('#gridTable');
- $gridTable.jqGrid({
- url: "../../CustomerManage/CashBalanceReport/GetListJson",
- postData: { queryJson: JSON.stringify($("#filter-form").GetWebControls()) },
- datatype: "json",
- height: $(window).height() - 230.5,
- autowidth: true,
- colModel: [
- { label: "交易日期", name: "ExecutionDate", width: 100, align: 'left', sortable: true, formatter: "date", formatoptions: { newformat: 'Y-m-d' } },
- {
- label: "交易账户", name: "CashAccount", width: 130, align: "left",
- formatter: function (cellvalue, options, rowObject) {
- return top.clientdataItem["Client_PaymentAccount"][cellvalue];
- }
- },
- {
- label: "收入金额", name: "Receivable", width: 110, align: 'right',
- formatter: function (cellvalue, options, rowObject) {
- if (cellvalue != null) {
- return toDecimal(cellvalue);
- } else {
- return "";
- }
- }
- },
- {
- label: "支出金额", name: "Expenses", width: 110, align: 'right', formatter: function (cellvalue, options, rowObject) {
- if (cellvalue != null) {
- return toDecimal(cellvalue);
- } else {
- return "";
- }
- }
- },
- { label: "账户余额", name: "Balance", width: 110, align: 'right', formatter: 'number', formatoptions: { thousandsSeparator: "", decimalPlaces: 2 } },
- {
- label: '创建时间', name: 'CreateDate', index: 'CreateDate', width: 130, align: 'center',
- formatter: "date", formatoptions: { srcformat: 'Y-m-d H:i', newformat: 'Y-m-d H:i' }
- },
- { label: "摘要信息", name: "Abstract", width: 300, align: "left" }
- ],
- pager: false,
- rowNum: "1000",
- rownumbers: true,
- shrinkToFit: false,
- gridview: true,
- footerrow: true,
- gridComplete: function () {
- var totalreceivable = $(this).getCol("Receivable", false, "sum");
- var totalexpenses = $(this).getCol("Expenses", false, "sum");
- //合计
- $(this).footerData("set", {
- "ExecutionDate": "合计:",
- "Receivable": totalreceivable,
- "Expenses": totalexpenses,
- });
- $('table.ui-jqgrid-ftable td').prevUntil().css("border-right-color", "#fff");
- }
- });
- $gridTable.authorizeColModel();
- //点击时间范围(今天、近7天、近一个月、近三个月)
- $("#time_horizon a.btn-default").click(function () {
- $("#time_horizon a.btn-default").removeClass("active");
- $(this).addClass("active");
- switch ($(this).attr('data-value')) {
- case "1"://今天
- $("#StartTime").val("@DateTime.Now.ToString("yyyy-MM-dd")");
- $("#EndTime").val("@DateTime.Now.ToString("yyyy-MM-dd")");
- break;
- case "2"://近7天
- $("#StartTime").val("@DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd")");
- $("#EndTime").val("@DateTime.Now.ToString("yyyy-MM-dd")");
- break;
- case "3"://近一个月
- $("#StartTime").val("@DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd")");
- $("#EndTime").val("@DateTime.Now.ToString("yyyy-MM-dd")");
- break;
- case "4"://近三个月
- $("#StartTime").val("@DateTime.Now.AddMonths(-3).ToString("yyyy-MM-dd")");
- $("#EndTime").val("@DateTime.Now.ToString("yyyy-MM-dd")");
- break;
- default:
- break;
- }
- $("#SelectedStartTime").html($("#StartTime").val());
- $("#SelectedEndTime").html($("#EndTime").val());
- $('#btn_Search').trigger("click");
- });
- //查询点击事件
- $("#btn_Search").click(function () {
- if (!$(".ui-filter-text").next('.ui-filter-list').is(":hidden")) {
- $(".ui-filter-text").trigger("click");
- }
- $("#SelectedStartTime").html($("#StartTime").val());
- $("#SelectedEndTime").html($("#EndTime").val());
- var queryJson = $("#filter-form").GetWebControls();
- $gridTable.jqGrid('setGridParam', {
- postData: { queryJson: JSON.stringify(queryJson) },
- }).trigger('reloadGrid');
- });
- }
- //打印
- function btn_print() {
- $("#gridPanel").printTable();
- }
- //导出
- function btn_export() {
- dialogOpen({
- id: "ExcelIExportDialog",
- title: '导出现金银行报表',
- url: '/Utility/ExcelExportForm?gridId=gridTable',
- width: "500px",
- height: "380px",
- callBack: function (iframeId) {
- top.frames[iframeId].AcceptClick();
- }, btn: ['导出Excel', '关闭']
- });
- }
- </script>
- <div class="ui-report">
- <div class="titlePanel">
- <div class="title-search">
- <table>
- <tr>
- <td>查询条件</td>
- <td style="padding-left: 10px;">
- <div class="ui-filter" style="width: 200px;">
- <div class="ui-filter-text">
- <strong id="SelectedStartTime">@DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd")</strong> 至 <strong id="SelectedEndTime">@DateTime.Now.ToString("yyyy-MM-dd")</strong>
- </div>
- <div class="ui-filter-list" style="width: 350px;">
- <table class="form" id="filter-form">
- <tr>
- <th class="formTitle">交易日期:</th>
- <td class="formValue">
- <input id="Category" type="hidden" value="1" />
- <div style="float: left; width: 45%;">
- <input id="StartTime" readonly type="text" value="@DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd")" class="form-control input-wdatepicker" onfocus="WdatePicker({maxDate:'%y-%M-%d'})">
- </div>
- <div style="float: left; width: 10%; text-align: center;">至</div>
- <div style="float: left; width: 45%;">
- <input id="EndTime" readonly type="text" value="@LeaRun.Util.Time.GetToday()" class="form-control input-wdatepicker" onfocus="WdatePicker({maxDate:'%y-%M-%d'})">
- </div>
- </td>
- </tr>
- </table>
- <div class="ui-filter-list-bottom">
- <a id="btn_Reset" class="btn btn-default"> 重 置</a>
- <a id="btn_Search" class="btn btn-primary"> 查 询</a>
- </div>
- </div>
- </div>
- </td>
- <td style="padding-left: 10px;">
- <div id="time_horizon" class="btn-group">
- <a class="btn btn-default" data-value="1">今天</a>
- <a class="btn btn-default" data-value="2">近7天</a>
- <a class="btn btn-default active" data-value="3">近1个月</a>
- <a class="btn btn-default" data-value="4">近3个月</a>
- </div>
- </td>
- </tr>
- </table>
- </div>
- <div class="toolbar">
- <div class="btn-group">
- <a id="lr-replace" class="btn btn-default" onclick="reload();"><i class="fa fa-refresh"></i> 刷新</a>
- <a id="lr-print" class="btn btn-default" onclick="btn_print()"><i class="fa fa-print"></i> 打印</a>
- <a id="lr-export" class="btn btn-default" onclick="btn_export()"><i class="fa fa-sign-out"></i> 导出</a>
- </div>
- <script>$('.toolbar').authorizeButton()</script>
- </div>
- </div>
- <div class="gridPanel" id="gridPanel">
- <div class="printArea">
- <div class="grid-title">现金银行报表</div>
- <div class="grid-subtitle">日期: 2016-03-10 至 2016-04-10</div>
- <table id="gridTable"></table>
- </div>
- </div>
- </div>
|