report日期选择方式更改

This commit is contained in:
chenjinsong
2018-07-10 10:08:36 +08:00
parent 74246e1f1f
commit 8f95c95b82
2 changed files with 132 additions and 113 deletions

View File

@@ -6,6 +6,7 @@ import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
@@ -139,7 +140,7 @@ public class NtcTagReportController extends BaseController {
// // TODO: handle exception
// e.printStackTrace();
// }
HashMap<String,List<Long>> showData=new HashMap<>();//构造数据展示集合
HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
for(ServiceDictInfo label:labels){
List<Long> line= new ArrayList<Long>();
long total=0l;

View File

@@ -7,6 +7,11 @@
$(document).ready(function() {
//筛选功能初始化
filterActionInit();
//日期类型初始化
changeReportType("${bean.reportType}", true);
$("#reportType").change(function(){
changeReportType($("#reportType", false).val());
});
//reset
$("#resetBtn").on("click",function(){
$("select.selectpicker").each(function(){
@@ -44,6 +49,20 @@
}
});
});
function changeReportType(reportType, init) {
$("#intype").remove();
if(reportType == 1){//需删除元素后重新添加直接更改onclick会出现缓存问题
$("#reportTypeDiv").append('<input id="intype" class="form-control input-medium" type="text" value="" readonly="readonly" onclick=WdatePicker({dateFmt:"yyyy-MM-dd",isShowClear:true});>');
} else if(reportType == 2){
$("#reportTypeDiv").append('<input id="intype" class="form-control input-medium" type="text" value="" readonly="readonly" onclick=WdatePicker({dateFmt:"yyyy-MM",isShowClear:true});>');
} else if(reportType == 3){
$("#reportTypeDiv").append('<input id="intype" class="form-control input-medium" type="text" value="" readonly="readonly" onclick=WdatePicker({dateFmt:"yyyy",isShowClear:true});>');
}
if (init) {
}
}
var ajaxGetLabelReport=function(){
$.ajax({
type:'post',
@@ -94,7 +113,6 @@ var ajaxGetLwhhReport=function(){
<small><spring:message code="report_list"/></small>
</h3>
<h5 class="page-header"></h5>
<div class="row">
<div class="col-md-12">
<div class="portlet">
<div class="portlet-body">
@@ -210,7 +228,7 @@ var ajaxGetLwhhReport=function(){
<%@include file="/WEB-INF/views/report/entranceId.jsp" %>
</div>
</div>
</div>
</div>
</div>
</div>