138 lines
5.2 KiB
Plaintext
138 lines
5.2 KiB
Plaintext
|
|
@{
|
|
ViewBag.Title = "Index";
|
|
}
|
|
|
|
<div class="l-clear"></div>
|
|
<table class="t1" style="width: 100%">
|
|
<tr>
|
|
<td class="ltd" width="100px">统计结果:</td>
|
|
<td class="rtd" style="width: 50%" id="balancecount">
|
|
|
|
</td>
|
|
<td class="ltd">日期:</td>
|
|
<td class="rtd"><input type="text" id="rq" value="@DateTime.Now.ToString("yyyy-MM-dd")" /></td>
|
|
<td class="rtd"><input type="button" id="btcx" value="查询" class="l-button" /></td>
|
|
<td class="rtd">
|
|
<input type="button" id="btBalance" value="结算" class="l-button" />
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div id="maingrid"></div>
|
|
<div class="dispReport">
|
|
<object classid="clsid:F6A015E2-092A-4006-93DA-4CBDE3AFF4B8" id="window.top.Formium.external.Print" width="300" height="50"></object>
|
|
</div>
|
|
<div style="display:none;"></div>
|
|
|
|
@section scripts{
|
|
<script type="text/javascript" src="@Url.Content("~/Scripts/public.js")"></script>
|
|
<script type="text/javascript">
|
|
//收款人
|
|
var skr = "";
|
|
var skrq = "";
|
|
function balance() {
|
|
var rows = liger.get("maingrid").getData();
|
|
if (rows.length == 0) {
|
|
$.ligerDialog.alert("请选择行!");
|
|
return;
|
|
}
|
|
var ids = "";
|
|
for (var i in rows) {
|
|
ids += rows[i].id + ",";
|
|
}
|
|
|
|
$.ajax({
|
|
url: "@Url.Action("SaveBalance")", type: "post", dataType: "json", data: { ids: ids },
|
|
success: function (d) {
|
|
$.ligerDialog.closeWaitting();
|
|
if (d.State == "1") {
|
|
$.ligerDialog.success(d.Message);
|
|
//初始化
|
|
liger.get("maingrid").reload();
|
|
}
|
|
else {
|
|
$.ligerDialog.error(d.Message);
|
|
}
|
|
},
|
|
beforeSend: function () {
|
|
$.ligerDialog.waitting("正在进行请稍后……");
|
|
}
|
|
});
|
|
|
|
//打印
|
|
var url = "@(Request.Url.Scheme + "://" + Request.Url.Authority + Url.Content("~/"))";
|
|
if (window.top.Formium.external.Print.finit( "rjs.frx")) {
|
|
window.top.Formium.external.Print.PrintRJS($("#balancecount").text(), skr, skrq);
|
|
}
|
|
}
|
|
function init() {
|
|
liger.get("maingrid").set("parms", { rq: $("#rq").val() });
|
|
liger.get("maingrid").reload();
|
|
skrq = $("#rq").val();
|
|
}
|
|
|
|
$(function () {
|
|
$("#maingrid").ligerGrid({
|
|
height: '100%',
|
|
columns: [
|
|
{ display: '收费类型', name: 'type', align: 'left', width: 100 },
|
|
{ display: '登记编号', name: 'register_num', align: 'left', width: 100 },
|
|
{ display: '缴费人', name: 'person', align: 'left', width: 100 },
|
|
{ display: '收费部门', name: 'department', width: 100 },
|
|
{ display: '收费方式', name: 'method', width: 100 },
|
|
{ display: '缴费状态', name: 'status', width: 100 },
|
|
{ display: '打印状态', name: 'isprint', width: 100 },
|
|
{ display: '缴费金额', name: 'money', width: 100,align:"right" },
|
|
{ display: '收费人', name: 'moneyperson', width: 100 },
|
|
{ display: '收费时间', name: 'moneydate', width: 100, render: function (r, i, v) { if (v) return formatTime(v) } }
|
|
],
|
|
url: "@Url.Action("getBalanceAll")",
|
|
pageSize: 30,
|
|
rownumbers: true,
|
|
fixedCellHeight: false,
|
|
usePager: false,
|
|
//checkbox: true,
|
|
//toolbar: {
|
|
// items: [
|
|
// { text: '结算', click: balance, icon: 'add' },
|
|
// ]
|
|
//}
|
|
onAfterShowData: function () {
|
|
var rows = liger.get("maingrid").getData();
|
|
var dic = new Array();
|
|
var have=false;
|
|
for (var i in rows) {
|
|
have = false;
|
|
for (var key in dic) {
|
|
if (rows[i].method == key) {
|
|
dic[key] += rows[i].money;
|
|
have = true;
|
|
break;
|
|
}
|
|
}
|
|
if (have == false) {
|
|
dic[rows[i].method] = rows[i].money;
|
|
}
|
|
}
|
|
|
|
var result = "";
|
|
for (var key in dic) {
|
|
result += key + ":【" + dic[key].toFixed(2) + "】";
|
|
}
|
|
$("#balancecount").text(result);
|
|
|
|
}
|
|
});
|
|
$("#rq").ligerDateEditor();
|
|
skr = "@ViewBag.skr";
|
|
skrq = "@DateTime.Now.ToString("yyyy-MM-dd")";
|
|
$("#btBalance").click(function () { balance(); })
|
|
$("#btcx").click(function () { init(); })
|
|
});
|
|
</script>
|
|
}
|
|
|
|
|
|
|
|
|