btxtgxq-system-city/src/main/resources/static/route/reportcase/case-statistic.html

293 lines
13 KiB
HTML

<!doctype html>
<html lang="zh-CN">
<head>
<base href="/servicecity/">
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11,chrome=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<link rel="stylesheet" href="assets/js/vendor/zTree3/css/metroStyle/metroStyle.css"/>
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<div class="test-table-reload-btn layui-form" style="margin-bottom: 5px;">
<div class="layui-inline" id="areaSelectTemplateBox" style="width: 150px;"></div>
<script id="areaSelectTemplate" type="text/html">
<select id="areaId" name="areaId" lay-filter="areaChange">
<option value="">请选择地区</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dictId}}">{{item.dictName}}</option>
{{# } }}
</select>
</script>
<!-- <div class="layui-inline" id="communitySelectTemplateBox" style="width: 150px;"></div>-->
<!-- <script id="communitySelectTemplate" type="text/html">-->
<!-- <select id="communityId" name="communityId">-->
<!-- <option value="">请选择社区</option>-->
<!-- {{# for(var i = 0, item; item = d[i++];) { }}-->
<!-- <option value="{{item.communityId}}">{{item.communityName}}</option>-->
<!-- {{# } }}-->
<!-- </select>-->
<!-- </script>-->
<div class="layui-inline" id="caseTypeSelectTemplateBox" style="width: 150px;"></div>
<script id="caseTypeSelectTemplate" type="text/html">
<select id="caseTypeId" name="caseTypeId" lay-filter="changeCaseType">
<option value="">案件类型</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dictId}}">{{item.dictName}}</option>
{{# } }}
</select>
</script>
<div class="layui-inline" id="childCaseTypeSelectTemplateBox" style="width: 150px;"></div>
<script id="childCaseTypeSelectTemplate" type="text/html">
<select id="childCaseTypeId" name="childCaseTypeId">
<option value="">案件子类型</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dictId}}">{{item.dictName}}</option>
{{# } }}
</select>
</script>
<div class="layui-inline">
<input type="text" id="startTime" class="layui-input search-item"
readonly="readonly" placeholder="开始时间" style="height: 38px;width:150px;cursor: pointer" autocomplete="off">
</div>
<div class="layui-inline">
<input type="text" id="endTime" class="layui-input search-item"
readonly="readonly" placeholder="结束时间" style="height: 38px;width:150px;cursor: pointer" autocomplete="off">
</div>
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
</div>
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
</div>
</div>
</div>
</div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script type="text/javascript">
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laytpl', 'form','laydate', 'selecttree'], function() {
var $ = layui.$;
var $win = $(window);
var laytpl = layui.laytpl;
var table = layui.table;
var admin = layui.admin;
var form = layui.form;
var laydate = layui.laydate;
var selecttree = layui.selecttree;
var tableUrl = 'api/reportcase/listcasestatisticratio';
var dataLoading = false;
function init(){
initArea();
// initCommunity();
}
init();
//初始化地区
function initArea(){
top.restAjax.get('api/dict/listdict/9d179f05-3ea0-48f7-853c-d3b7124b791c', {}, null, function(code, data) {
laytpl(document.getElementById('areaSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('areaSelectTemplateBox').innerHTML = html;
});
form.render('select');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
form.on('select(areaChange)',function(data){
var areaId = data.value;
// initCommunity(areaId);
});
//初始化社区
function initCommunity(areaId){
if(typeof (areaId) == 'undefined' || areaId == ''){
laytpl(document.getElementById('communitySelectTemplate').innerHTML).render([], function(html) {
document.getElementById('communitySelectTemplateBox').innerHTML = html;
});
form.render('select');
return;
}
top.restAjax.get('api/community/listcommunity', {areaId : areaId}, null, function(code, data) {
laytpl(document.getElementById('communitySelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('communitySelectTemplateBox').innerHTML = html;
});
form.render('select');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化表格
function initTable() {
dataLoading = true;
table.render({
elem: '#dataTable',
id: 'dataTable',
url: top.restAjax.path(tableUrl, []),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 100,
toolbar: true,
defaultToolbar: ['print', 'exports'],
cols: [[
{field:'areaName', width:180, title: '地区', align:'center'},
{field:'communityName', width:180, title: '社区', align:'center'},
{field:'caseTotalCount', width:100, title: '案件总数', align:'center',
templet: function(row) {
var rowData = row[this.field];
return rowData + '件';
}
},
{field:'assign', width:180, title: '下派数/下派率', align:'center',
templet: function(row) {
var assignCount = row['assignCount'];
var assignRatio = row['assignRatio'];
return assignCount + '件 / ' + assignRatio + '%';
}
},
{field:'inspect', width:180, title: '检查数/检查率', align:'center',
templet: function(row) {
var inspectCount = row['inspectCount'];
var inspectRatio = row['inspectRatio'];
return inspectCount + '件 / ' + inspectRatio + '%';
}
},
{field:'close', width:180, title: '结案数/结案率', align:'center',
templet: function(row) {
var closeCount = row['closeCount'];
var closeRatio = row['closeRatio'];
return closeCount + '件 / ' + closeRatio + '%';
}
},
{field:'file', width:180, title: '归档数/归档率', align:'center',
templet: function(row) {
var fileCount = row['fileCount'];
var fileRatio = row['fileRatio'];
return fileCount + '件 / ' + fileRatio + '%';
}
},
]],
page: false,
parseData: function(data) {
return {
'code': 0,
'msg': '',
'count': data.total,
'data': data.rows
};
},
done: function(){
dataLoading = false;
}
});
}
setTimeout(function(){
initTable();
},500);
// 重载表格
function reloadTable() {
dataLoading = true;
var caseTypeId = $('#caseTypeId').val();
var childCaseTypeId = $('#childCaseTypeId').val();
if(childCaseTypeId) {
caseTypeId = childCaseTypeId;
}
table.reload('dataTable', {
url: top.restAjax.path(tableUrl, []),
where: {
areaId : $('#areaId').val(),
communityId : $('#communityId').val(),
caseTypeId : caseTypeId,
startTime : $('#startTime').val(),
endTime : $('#endTime').val(),
},
height: $win.height() - 100,
done:function(){
dataLoading = false;
}
});
}
//初始化案件类型
function initCaseType(){
top.restAjax.get('api/dict/listdict/46d108b2-4ef9-4f6f-b30c-0c700e3ee852', {}, null, function(code, data) {
laytpl(document.getElementById('caseTypeSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('caseTypeSelectTemplateBox').innerHTML = html;
});
form.render('select');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
initCaseType();
//初始化子案件类型
function initChildCaseType(parentId){
if(typeof(parentId) === 'undefined' || '' == parentId){
laytpl(document.getElementById('childCaseTypeSelectTemplate').innerHTML).render([], function(html) {
document.getElementById('childCaseTypeSelectTemplateBox').innerHTML = html;
});
}
top.restAjax.get('api/dict/listdict/' + parentId, {}, null, function(code, data) {
laytpl(document.getElementById('childCaseTypeSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('childCaseTypeSelectTemplateBox').innerHTML = html;
});
form.render('select');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
initChildCaseType();
//初始化时间
function initDateTime(){
laydate.render({
elem: '#startTime'
,value: ''
});
laydate.render({
elem: '#endTime'
,value: ''
});
}
initDateTime();
form.on('select(changeCaseType)',function(data){
if(data.value == ''){
$('#childCaseTypeId').val('');
initChildCaseType();
} else {
initChildCaseType(data.value);
}
});
$(document).on('click', '#search', function() {
if(dataLoading){
layer.msg('数据加载中,请稍等...');
return;
}
reloadTable(1);
});
})
</script>
</body>
</html>