|
|
|
@ -29,39 +29,14 @@ |
|
|
|
<div class="row"> |
|
|
|
<div class="col-sm-12 search-collapse"> |
|
|
|
<form id="formId"> |
|
|
|
<input type="hidden" id="timeType" name="timeType"/> |
|
|
|
<input type="hidden" id="bureauDeptId" name="bureauDeptId"/> |
|
|
|
<div class="select-list"> |
|
|
|
<ul> |
|
|
|
<li> |
|
|
|
<p>执法部门:</p> |
|
|
|
<input type="text" name="bureauDeptName"/> |
|
|
|
</li> |
|
|
|
<!--<li> |
|
|
|
<p>时段:</p> |
|
|
|
<select name="timeType" id="timeType" onchange="changeSelect()"> |
|
|
|
<option value="">所有</option> |
|
|
|
<option value="year">年度</option> |
|
|
|
<option value="quarter">季度</option> |
|
|
|
<option value="month">月度</option> |
|
|
|
</select> |
|
|
|
</li> |
|
|
|
<li class="select-time" id="yearDom"> |
|
|
|
<label>年度:</label> |
|
|
|
<input type="text" class="year-input" style="width: 150px" id="yearSearch" name="year"> |
|
|
|
<li> |
|
|
|
<li class="select-time" id="quarterDom"> |
|
|
|
<label>季度:</label> |
|
|
|
<select id="quarter" name="quarter"> |
|
|
|
<option value="">请选择</option> |
|
|
|
<option value="1">1季度</option> |
|
|
|
<option value="2">2季度</option> |
|
|
|
<option value="3">3季度</option> |
|
|
|
<option value="4">4季度</option> |
|
|
|
</select> |
|
|
|
<li> |
|
|
|
<li class="select-time" id="monthDom"> |
|
|
|
<label>月度:</label> |
|
|
|
<input type="text" class="month-input" style="width: 150px" id="monthSearch" name="month"> |
|
|
|
<li>--> |
|
|
|
<li> |
|
|
|
<p>时段:</p> |
|
|
|
<select id="year" name="year"> |
|
|
|
@ -124,10 +99,15 @@ |
|
|
|
</form> |
|
|
|
</div> |
|
|
|
<div class="col-sm-12 select-table table-bordered"> |
|
|
|
<div id="detail" class="detail-list" style="width:1300px"> |
|
|
|
<span id="closeComplaint" class="detail-close" onclick="closePlan()">×</span> |
|
|
|
<table id="bootstrap-table2"></table> |
|
|
|
</div> |
|
|
|
<table id="bootstrap-table"></table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div id="con_one_2" class="tab_item" style="height: 110%"> |
|
|
|
<form id="form2"> |
|
|
|
@ -191,6 +171,7 @@ |
|
|
|
$("#chart-box-3").hide(); |
|
|
|
echartsTotal(); |
|
|
|
$(".fixed-table-toolbar").hide(); |
|
|
|
$("#detail").hide(); |
|
|
|
}; |
|
|
|
|
|
|
|
function setTab(name, cursel, n) { |
|
|
|
@ -452,41 +433,152 @@ |
|
|
|
field : 'yearTotal', |
|
|
|
title : '年度计划', |
|
|
|
align : 'center', |
|
|
|
formatter:function (value,row,index) { |
|
|
|
return '<span style="cursor: pointer;color: blue;" onclick="planInfo(\'year\',\''+row.bureauDeptId+'\')">'+value+'</span>'; |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
field : 'quarterTotal', |
|
|
|
title : '季度计划', |
|
|
|
align : 'center', |
|
|
|
formatter:function (value,row,index) { |
|
|
|
return '<span style="cursor: pointer;color: blue;" onclick="planInfo(\'quarter\',\''+row.bureauDeptId+'\')">'+value+'</span>'; |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
field : 'monthTotal', |
|
|
|
title : '月度计划', |
|
|
|
align : 'center', |
|
|
|
formatter:function (value,row,index) { |
|
|
|
return '<span style="cursor: pointer;color: blue;" onclick="planInfo(\'month\',\''+row.bureauDeptId+'\')">'+value+'</span>'; |
|
|
|
} |
|
|
|
}] |
|
|
|
}; |
|
|
|
$.table.init(options); |
|
|
|
|
|
|
|
/*layui.use('laydate', function(){ |
|
|
|
var laydate = layui.laydate; |
|
|
|
laydate.render({ |
|
|
|
elem: '#yearSearch', |
|
|
|
type: 'year', |
|
|
|
trigger: 'click', |
|
|
|
change: function(value, date, endDate){ |
|
|
|
console.log(value); //得到日期生成的值,如:2017-08-18 |
|
|
|
console.log(date); //得到日期时间对象:{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0} |
|
|
|
console.log(endDate); //得结束的日期时间对象,开启范围选择(range: true)才会返回。对象成员同上。 |
|
|
|
$("#yearDate").text(value) |
|
|
|
var planOptions={ |
|
|
|
modalName: "详情", |
|
|
|
pagination: true, |
|
|
|
pageSize: 10, |
|
|
|
pageList: [10, 25, 50], |
|
|
|
columns: [ |
|
|
|
{ |
|
|
|
field : 'id', |
|
|
|
title : '主键ID', |
|
|
|
visible: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
field : 'planName', |
|
|
|
title : '计划名称', |
|
|
|
align : 'center', |
|
|
|
width:'350px' |
|
|
|
}, |
|
|
|
{ |
|
|
|
field : 'bureauDeptName', |
|
|
|
title : '执法部门', |
|
|
|
align : 'center' |
|
|
|
}, |
|
|
|
{ |
|
|
|
field : 'enforcementArea', |
|
|
|
title : '执法区域', |
|
|
|
align : 'center' |
|
|
|
}, |
|
|
|
{ |
|
|
|
field : 'enforcementTime', |
|
|
|
title : '上传时间', |
|
|
|
align : 'center' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title : '附件', |
|
|
|
align : 'center', |
|
|
|
formatter:function (value,row,index) { |
|
|
|
var actions = []; |
|
|
|
actions.push('<span style="cursor: pointer;color: blue;" onclick="previewFile(\'' + row.id + '\')">预览 </span>'); |
|
|
|
actions.push('<span style="cursor: pointer;color: blue;" onclick="downloadFile(\'' + row.id + '\')"> 下载</span>'); |
|
|
|
return actions.join(''); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
laydate.render({ |
|
|
|
elem: '#monthSearch', |
|
|
|
type: 'month', |
|
|
|
trigger: 'click' |
|
|
|
}) |
|
|
|
});*/ |
|
|
|
] |
|
|
|
} |
|
|
|
$("#bootstrap-table2").bootstrapTable(planOptions); |
|
|
|
}); |
|
|
|
|
|
|
|
// 计划列表 |
|
|
|
function planInfo(type,burDeptId){ |
|
|
|
$("#timeType").val(type) |
|
|
|
$("#bureauDeptId").val(burDeptId) |
|
|
|
$.ajax({ |
|
|
|
url:prefix+'/getPlanInfo', |
|
|
|
type:'post', |
|
|
|
data:$("#formId").serialize(), |
|
|
|
success: function (res) { |
|
|
|
$('#detail').show(); |
|
|
|
$('#bootstrap-table2').bootstrapTable('load', res); |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
function closePlan(){ |
|
|
|
$('#detail').hide(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* check 文件是否存在 |
|
|
|
* @param id |
|
|
|
* @returns {boolean} |
|
|
|
*/ |
|
|
|
function checkFile(id){ |
|
|
|
var result=true; |
|
|
|
$.ajax({ |
|
|
|
url:prefix+"/checkFile", |
|
|
|
type:"post", |
|
|
|
data:{id:id}, |
|
|
|
async:false, |
|
|
|
success:function (res){ |
|
|
|
result=res; |
|
|
|
} |
|
|
|
}) |
|
|
|
return result; |
|
|
|
} |
|
|
|
// 预览 |
|
|
|
function previewFile(id){ |
|
|
|
if(checkFile(id)){ |
|
|
|
var url=prefix+"/previewFile?id="+window.btoa(id); |
|
|
|
window.open(url); |
|
|
|
}else{ |
|
|
|
$.modal.alertWarning("无附件。"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 下载 |
|
|
|
function downloadFile(id){ |
|
|
|
if(checkFile(id)){ |
|
|
|
var xhr= new XMLHttpRequest(); |
|
|
|
var url=prefix+"/downloadFile?id="+window.btoa(id); |
|
|
|
xhr.open('POST',url,true); |
|
|
|
xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); |
|
|
|
xhr.responseType="blob"; |
|
|
|
xhr.onload=function (){ |
|
|
|
if(this.status === 200){ |
|
|
|
var blob = this.response; |
|
|
|
var reader = new FileReader(); |
|
|
|
reader.readAsDataURL(blob); |
|
|
|
reader.onload=function(e) { |
|
|
|
var a = document.createElement('a'); |
|
|
|
a.download ="附件.pdf"; |
|
|
|
a.href = e.target.result; |
|
|
|
$("body").append(a); |
|
|
|
a.click(); |
|
|
|
$(a).remove(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
xhr.send(); |
|
|
|
}else{ |
|
|
|
$.modal.alertWarning("无附件。"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 初始化 |
|
|
|
*/ |
|
|
|
|