86 lines
3.5 KiB
Plaintext
86 lines
3.5 KiB
Plaintext
|
|
@{
|
|
ViewBag.Title = "xmjfsytjQuery";
|
|
}
|
|
|
|
@section scripts{
|
|
<script type="text/javascript">
|
|
|
|
$(function () {
|
|
$("#start").ligerDateEditor();
|
|
$("#end").ligerDateEditor();
|
|
$("#start").ligerGetDateEditorManager().setValue(fun_date(-30));
|
|
$("#end").ligerGetDateEditorManager().setValue(fun_date(0));
|
|
|
|
cx();
|
|
})
|
|
|
|
function cx() {
|
|
var data = $("#searchForm").serializeArray();
|
|
$.ajax({
|
|
url: "@Url.Action("getXMJFSYTJ")", data: data, type: "post", dataType: "json",
|
|
success: function (data) {
|
|
$("#grid1").ligerGrid({
|
|
height: '100%',
|
|
width: '100%',
|
|
isScroll: true,
|
|
dataAction: "local",
|
|
selectRowButtonOnly: true,
|
|
data: data.data,
|
|
columns: [
|
|
{ name: "xmmc", display: "项目经费名称", width: 150, align: "left" },
|
|
{ name: "xmmc", display: "项目经费名称", width: 150, align: "left" },
|
|
{ name: "month", display: "月份", width: 80, align: "left" },
|
|
{
|
|
name: "zt", display: "是否启用", width: 80, align: "left", render: function (r, i, v) {
|
|
if (v == 1)
|
|
return "正常";
|
|
else
|
|
return "禁用";
|
|
}
|
|
},
|
|
{ name: "srje", display: "收入金额", width: 80, align: "right", totalSummary: { type: 'sum' } },
|
|
{ name: "hfje", display: "花费金额", width: 80, align: "right", totalSummary: { type: 'sum' } },
|
|
{ name: "kyje", display: "可用金额", width: 80, align: "right", totalSummary: { type: 'sum' } },
|
|
],
|
|
alternatingRow: false,
|
|
usePager: false,
|
|
rownumbers:true,
|
|
});
|
|
liger.get("grid1").reRender();
|
|
}
|
|
});
|
|
}
|
|
|
|
function fun_date(days) {
|
|
var date1 = new Date(),
|
|
time1 = date1.getFullYear() + "-" + (date1.getMonth() + 1) + "-" + date1.getDate();//time1表示当前时间
|
|
var date2 = new Date(date1);
|
|
date2.setDate(date1.getDate() + days);
|
|
|
|
var y = date2.getFullYear();
|
|
var m = date2.getMonth() + 1;
|
|
m = m < 10 ? '0' + m : m;
|
|
var d = date2.getDate();
|
|
d = d < 10 ? ('0' + d) : d;
|
|
var time2 = y + "-" + m + "-" + d;
|
|
return time2;
|
|
}
|
|
</script>
|
|
}
|
|
<form id="searchForm">
|
|
<table class="t1" style="width:100%">
|
|
<tr>
|
|
<td width="70" class="ltd">经费日期</td>
|
|
<td width="150" class="rtd"><input type="text" id="start" name="start"></td>
|
|
<td width="20" class="ltd">到</td>
|
|
<td width="150" class="rtd"><input type="text" id="end" name="end"></td>
|
|
<td width="70" class="ltd">经费名称</td>
|
|
<td width="150" class="rtd">@Html.TextBox("key", "", new { @class = "l-text" })</td>
|
|
<td width="100" class="rtd"><input type="button" value="查询" onclick="cx();" class="l-button" /></td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
<div id="grid1"></div>
|
|
|