tijian_tieying/web/dccdc/Views/QueryStatistics/JKZFZLJTJQuery.cshtml

117 lines
3.7 KiB
Plaintext
Raw Normal View History

2025-02-20 12:14:39 +08:00

@{
ViewBag.Title = "JKZFZLJTJQuery";
}
@section scripts{
<script>
var search = [
{ id: 'startdate', display: "发证日期", name: "startdate", newline: true, type: "date", format: "MM/dd/yyyy" },
{ id: 'enddate', display: "到", name: "enddate", newline: false, type: "date", format: "MM/dd/yyyy" },
{
display: "所属区域", name: "area_name", newline: false, type: "select", options: {
url: "@Url.Action("getSSQY")",
valueField: "area_name",
textField: "area_name"
}
}
];
$(function () {
$("#layout").ligerLayout({
topHeight: 60
});
$("#searchForm").ligerForm({
inputWidth: 140, labelWidth: 80, space: 10, labelAlign: "right", validate: true,
fields: search
});
liger.get("startdate").setValue(new Date());
liger.get("enddate").setValue(new Date());
$("#maingrid").ligerGrid({
height: '97%',
columns: [
{
display: '区域', name: 'areaName', align: 'left', width: 120,
totalSummary:
{
render: function (suminf, column, cell) {
return '<div>合计</div>';
},
align: 'left'
}
},
{
display: '公共场所', name: 'category1', align: 'right', width: 120,
totalSummary:
{
render: function (suminf, column, cell) {
return '<div>合计:' + suminf.sum + '</div>';
},
type: 'sum'
}
},
{
display: '食品从业', name: 'category2', align: 'right', width: 120,
totalSummary:
{
render: function (suminf, column, cell) {
return '<div>合计:' + suminf.sum + '</div>';
},
type: 'sum'
}
},
{
display: '药品从业', name: 'category3', align: 'right', width: 120,
totalSummary:
{
render: function (suminf, column, cell) {
return '<div>合计:' + suminf.sum + '</div>';
},
type: 'sum'
}
}
],
toolbar: {
items: [
{ text: "查询", click: fn_fetch }, { line: true },
{ text: "导出", click: fn_fetch }
]
}
});
});
function fn_fetch() {
var data = liger.get("searchForm").getData();
if(data.startdate==null||data.startdate==""||data.enddate==null||data.enddate==""){
alert("选择开始和结束时间!");
return;
}
$.ajax({
type: "post", cache: "false", async: true, dataType: "json",
url: "@Url.Action("GetJKZFZLJTJ")",
data:data,
success: function (result) {
liger.get("maingrid").options.data = result;
liger.get("maingrid").reload();
},
error: function (msg) {
return;
}
});
}
</script>
}
<div id="layout">
<div position="top">
<div id="searchForm">
</div>
</div>
<div position="center">
<div id="maingrid">
</div>
</div>
</div>