btgxq-dashuju/static/html/list-case-info-ajlx.html
2023-08-08 16:15:54 +08:00

433 lines
21 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" type="text/css" href="assets/js/vendor/swiper3/css/swiper.min.css"/>
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
<!-- 图片 -->
<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">
<style>
.layui-table-cell{
height: auto;
}
.layui-table-body td{
height: 210px;
}
.layui-table img{
max-width: 100%;
}
.info-row {border-bottom: 1px dotted;}
.info-row:last-child {border: none;}
.info-row .col-left {width:30%;height:28px;text-align:center;border-right:1px dotted;display:inline-block;padding:5px;vertical-align:top;}
.info-row .col-right {width:70%;display:inline-block;padding:5px;vertical-align:top;}
.info-row .col-line {width:100%;color:black;text-align:center;display:block;padding:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.info-row .col-line .fa {color: red; margin-right: 5px;}
.info-row .col-content {width:100%;display:inline-block;padding:5px;height:86px;overflow:auto;white-space:normal;word-break:break-all;word-wrap:break-word;vertical-align:top;}
</style>
</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" style="width: 150px;">
<select id="caseFlowType" name="caseFlowType">
<option value="1">职能部门案件</option>
<option value="2">街镇案件</option>
</select>
</div>
<div class="layui-inline" id="areaSelectTemplateBox" style="width: 150px;"></div>
<script id="areaSelectTemplate" type="text/html">
<select id="areaId" name="areaId" lay-filter="changeArea">
<option value="">选择街镇</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dict_id}}">{{item.dict_name}}</option>
{{# } }}
</select>
</script>
<div class="layui-inline" id="communityBox" style="width: 150px;"></div>
<script id="communityTemplate" type="text/html">
<select id="communityId" name="communityId">
<option value="">选择社区()</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.community_id}}">{{item.community_name}}</option>
{{# } }}
</select>
</script>
<div class="layui-inline" id="caseTypeSelectTemplateBox" style="width: 100px;"></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.dict_id}}">{{item.dict_name}}</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.dict_id}}">{{item.dict_name}}</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>
<div class="layui-inline">
<input type="text" id="caseNumber" class="layui-input search-item" placeholder="案件编号" style="height: 38px;width:150px;" 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" src="assets/js/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="assets/js/restajax.js"></script>
<script type="text/javascript" src="assets/js/vendor/swiper3/js/swiper.min.js"></script>
<script type="text/javascript" src="assets/js/vendor/viewer/viewer.min.js"></script>
<!-- 图片 -->
<script type="text/javascript">
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laytpl', 'form','laydate', 'dialog'], 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 dialog = layui.dialog;
var tableUrl = 'app/data-external-release/list-page-report-case';
function init() {
laydate.render({
elem: '#startTime'
,value: ''
});
laydate.render({
elem: '#endTime'
,value: ''
});
initArea();
initCommunity('');
initCaseType();
initChildCaseType('');
initTable();
}
init();
$(document).on('click', '#search', function() {
reloadTable(1);
});
// 初始化地区
function initArea(){
restAjax.get('app/data-external-release/get-area-info-city-dict', {dictParentId: '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) {
dialog.msg(data.msg);
});
}
form.on('select(changeArea)', function(data){
initCommunity(data.value);
});
// 初始化社区村
function initCommunity(areaId){
if(typeof (areaId) === 'undefined' || areaId == ''){
laytpl(document.getElementById('communityTemplate').innerHTML).render([], function(html) {
document.getElementById('communityBox').innerHTML = html;
});
form.render('select');
return;
}
restAjax.get('app/data-external-release/get-community-info', {areaId : areaId}, null, function(code, data) {
laytpl(document.getElementById('communityTemplate').innerHTML).render(data, function(html) {
document.getElementById('communityBox').innerHTML = html;
});
form.render('select');
}, function(code, data) {
dialog.msg(data.msg);
});
}
// 初始化案件类型
function initCaseType(){
restAjax.get('app/data-external-release/get-area-info-city-dict', {dictParentId: '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) {
dialog.msg(data.msg);
});
}
form.on('select(changeCaseType)',function(data){
initChildCaseType(data.value);
});
//初始化子案件类型
function initChildCaseType(parentId){
if(typeof(parentId) === 'undefined' || '' == parentId){
laytpl(document.getElementById('childCaseTypeSelectTemplate').innerHTML).render([], function(html) {
document.getElementById('childCaseTypeSelectTemplateBox').innerHTML = html;
});
form.render('select');
return;
}
restAjax.get('app/data-external-release/get-area-info-city-dict', {dictParentId: 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) {
dialog.msg(data.msg);
});
}
// 初始化表格
function initTable() {
table.render({
elem: '#dataTable',
id: 'dataTable',
url: restAjax.path(tableUrl, []),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 100,
where :{
caseFlowType : $('#caseFlowType').val(),
caseStatus : 6
},
limit: 10,
limits: [10, 20, 40, 80, 100, 200],
request: {
pageName: 'page',
limitName: 'rows'
},
cols: [[
{field:'rowNum', width:60, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
{width: 300, title: '案件图片', align:'center',
templet: function(row) {
var photos = row.casePhotos.split(',')
var value = '<div id="photo_'+ row.reportCaseId +'" class="swiper-container" style="width:100%;">' +
'<div class="swiper-wrapper" style="width:100%">';
for(var i = 0, item = photos[i]; item = photos[i++];) {
value += '<div class="swiper-slide" style="width:100%;">' +
'<img class="swiper-lazy" src="route/file/downloadfile/true/'+ item +'" style="width:270px;height:180px;cursor:pointer;"/>' +
'<div class="swiper-lazy-preloader"></div>' +
'</div>';
}
value += '</div><div id="photo_swiper_'+ row.reportCaseId +'" class="swiper-pagination"></div></div>';
setTimeout(function() {
new Swiper('#photo_'+ row.reportCaseId, {
lazyLoading: true,
autoplay: 3000,
pagination : '#photo_swiper_'+ row.reportCaseId,
paginationClickable :true,
});
new Viewer(document.getElementById('photo_'+ row.reportCaseId));
}, 50);
return value;
}
},
{width: 450, title: '案件信息', align: 'center',
templet: function (row) {
var caseFlowType = row.caseFlowType;
if(caseFlowType == '1'){
caseFlowType = '(职能部门案件)';
} else {
caseFlowType = '(街镇案件)'
}
var value = '<div style="text-align: left">'+
'<div class="info-row"><span class="col-left">案件编号</span><span class="col-right">'+ row.caseNumber +'</span></div>'+
'<div class="info-row"><span class="col-left">所在地区</span><span class="col-right">'+ row.areaName +'</span></div>'+
'<div class="info-row"><span class="col-left">所在社区</span><span class="col-right">'+ row.communityName +'</span></div>'+
'<div class="info-row"><span class="col-left">案件类型</span><span class="col-right">'+ caseFlowType + row.caseTypeName +'</span></div>'+
'<div class="info-row"><span class="col-left">操作</span>' +
'<span class="col-right">'+
'<div class="btn-group btn-group-xs">' +
'<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="showEvent">详情</button>'+
'<button type="button" class="layui-btn layui-btn-warm layui-btn-sm" lay-event="caseFlowEvent">流程查看</button>'+
'</div>'+
'</span>'+
'</div>'+
'</div>'
return value;
}
},
{width: 300, title: '案件内容', align: 'center',
templet: function (row) {
var value = '<div style="text-align: left">'+
'<div class="info-row"><span class="col-left">案件来源</span><span class="col-right">'+ sourceFormatter(row.caseSource) +'</span></div>'+
'<div class="info-row"><a href="javascript:;" class="col-line" lay-event="showLocation"><i class="fa fa-map-marker"></i>'+ row.casePosition +'</a></div>'+
'<div class="info-row"><span class="col-content">'+ row.caseContent +'</span></div>'+
'</div>';
return value;
}
},
{width: 250, title: '案件状态', align: 'center',
templet: function (row) {
var value = '<div style="text-align: left">'+
'<div class="info-row"><span class="col-left">上报时间</span><span class="col-right">'+ row.reportDate +'</span></div>'+
'<div class="info-row"><span class="col-left">上报人员</span><span class="col-right">'+ row.caseReporter +'</span></div>'+
'<div class="info-row"><span class="col-left">案件状态</span><span class="col-right">'+ caseStatusFormatter(row.caseStatus) +'</span></div>'+
'<div class="info-row"><span class="col-left"></span><span class="col-right" style="color: red;">'+ ((row.overDays != null && row.overDays >= 1) ? '【超过'+ row.overDays +'天未处理】' : '') +'</span></div>'+
'<div class="info-row"><span class="col-left"></span><span class="col-right"></span></div>'+
'</div>';
return value;
}
}
]],
page: true,
parseData: function(data) {
return {
'code': 0,
'msg': '',
'count': data.total,
'data': data.rows
};
},
done: function(){
}
});
}
// 重载表格
function reloadTable(currentPage) {
table.reload('dataTable', {
url: restAjax.path(tableUrl, []),
where:{
caseFlowType : $('#caseFlowType').val(),
areaId : $('#areaId').val(),
communityId : $('#communityId').val(),
caseTypeId : $('#childCaseTypeId').val(),
caseTypeId : $('#childCaseTypeId').val(),
caseStatus : 6,
startTime : $('#startTime').val(),
endTime : $('#endTime').val(),
caseNumber : $('#caseNumber').val()
},
page: {
curr: currentPage
},
height: $win.height() - 100
});
}
// 来源格式化
function sourceFormatter(val) {
var value;
switch (val) {
case '1':
value = '群众举报';
break;
case '2':
value = '巡检采集';
break;
case '3':
value = '专管员上报';
break;
default:
value = '未知';
}
return value;
}
// 案件状态
function caseStatusFormatter(val) {
var value;
switch (val) {
case '0':
value = '待受理';
break;
case '1':
value = '待立案';
break;
case '2':
value = '待转派';
break;
case '3':
value = '待处理';
break;
case '4':
value = '待检查';
break;
case '5':
value = '待结案';
break;
case '6':
value = '已归档';
break;
default:
value = '异常';
}
return value;
}
table.on('tool(dataTable)', function(obj) {
if(obj.event === 'showEvent'){
layer.open({
type: 2,
title: '详情',
closeBtn: 1,
area: ['70%', '80%'],
shadeClose: true,
anim: 2,
content: restAjax.path('route/bigdata/show.html?reportCaseId={id}',
[obj.data.reportCaseId]),
end: function() {
}
});
}
if(obj.event === 'caseFlowEvent'){
layer.open({
type: 2,
title: '案件流程',
closeBtn: 1,
area: ['70%', '80%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/bigdata/list_case_log.html?reportCaseId={id}',
[obj.data.reportCaseId]),
end: function() {
}
});
}
});
})
</script>
</body>
</html>