<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="contextPath" value="${pageContext.request.contextPath}"></c:set>
<script>
	
</script>
<!-- ajax layout which only needs content area -->
<div class="page-header">
	<h1>
		诉讼担保
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			实时数据
		</small>
	</h1>
</div><!-- /.page-header -->
<div class="row" style="height: 42px;">
	<div class="col-xs-12">
		<label>日报：</label>
	</div>
</div>
<div class="row" style="height: 50px;"> <%--日报--%>
	<div class="col-xs-12">
		<table id="grid-table"></table>
		<div id="grid-pager"></div>
		<script type="text/javascript">
            var $path_base = "${contextPath}/static";//in Ace demo this will be used for editurl parameter
		</script>

	</div>
</div>

<div class="row" style="height: 50px;"> <%--日报--%>
	<div class="col-xs-12">
		<table id="grid-table11"></table>
		<div id="grid-pager11"></div>
		<script type="text/javascript">
			var $path_base = "${contextPath}/static";//in Ace demo this will be used for editurl parameter
		</script>

	</div>
</div>


<div class="row" style="height: 42px;">
	<div class="col-xs-12">
		周报 月报：<span  style="font-size: 16px"></span>
		</br>
		<input type="text" class="input-sm datapicker" placeholder="选择开始日期" id="startDate1"/>
		<input type="text" class="input-sm datapicker" placeholder="选择结束日期" id="endDate1"/>
		<button type="button" class="btn btn-primary btn-sm" id="searchd1">统计</button>
	</div>
</div>
<div class="row" style="height: 50px; margin-top: 10px ;margin-bottom: 20px"> <%--日报--%>
	<div class="col-xs-12">
		<table id="grid-table1"></table>
		<div id="grid-pager1"></div>
		<script type="text/javascript">
            var $path_base = "${contextPath}/static";//in Ace demo this will be used for editurl parameter
		</script>

	</div>
</div>


<div class="row">
	<div class="col-xs-12">
		筛选人数：<span id="count1" style="font-size: 16px"></span>
		，筛选次数：<span id="count11" style="font-size: 16px"></span>
		| 申请人数：<span id="count2" style="font-size: 16px"></span>
		，申请次数：<span id="count22" style="font-size: 16px"></span>
		</br>
		<input type="text" class="input-sm datapicker" placeholder="选择开始日期" id="startDate"/>
      <input type="text" class="input-sm datapicker" placeholder="选择结束日期" id="endDate"/>
      <button type="button" class="btn btn-primary btn-sm" id="searchd">统计</button>      
		<div class="row">
			<div class="col-sm-6">
				<div class="widget-box">
					<div class="widget-header">
						<h4 class="widget-title lighter smaller">
							<i class="ace-icon fa fa-comment blue"></i>
							诉保筛选
						</h4>
						<div class="widget-toolbar no-border">
						<!--  <input type="text" class="input-sm" placeholder="开始日期" id="startDate1"/>
							<input type="text" class="input-sm" placeholder="结束日期" id="endDate1"/>
							<select class="select" id="needLevelParameter">
								<option value="0" selected = "selected">全部</option>
								<option value="1">强需求</option>
								<option value="2">有需求</option>
								<option value="3">没需求</option>
							</select>  -->
							<button class="btn btn-xs "id="searchExcel">
								导出Excel
							</button>
							<button class="btn btn-xs prev_search">
								<i class="ace-icon fa fa-arrow-left"></i>
								上一页
							</button>

							<button class="btn btn-xs next_search">
								下一页
								<i class="ace-icon fa fa-arrow-right"></i>
							</button>

						</div>
					</div>

					<div class="widget-body">
						<div class="widget-main no-padding">
							<!-- #section:pages/dashboard.conversations -->
							<div class="dialogs" id="ssdb-search"></div>
						</div><!-- /.widget-main -->
					</div><!-- /.widget-body -->
				</div><!-- /.widget-box -->
			</div><!-- /.col -->

		
			<div class="col-sm-6">
				<div class="widget-box">
					<div class="widget-header">
						<h4 class="widget-title lighter smaller">
							<i class="ace-icon fa fa-comment blue"></i>
							诉保申请
						</h4>
						<div class="widget-toolbar no-border">
						<!-- 	<input type="text" class="input-sm" placeholder="开始日期" id="startDate2"/>
							<input type="text" class="input-sm" placeholder="结束日期" id="endDate2"/>
							<select class="select" id="needLevelParameter1">
								<option value="0" selected = "selected">全部</option>
								<option value="1">强需求</option>
								<option value="2">有需求</option>
								<option value="3">没需求</option>
							</select>  -->
							<button class="btn btn-xs "id="applyExcel">
								导出Excel
							</button>
							<button class="btn btn-xs prev_apply">
								<i class="ace-icon fa fa-arrow-left"></i>
								上一页
							</button>

							<button class="btn btn-xs next_apply">
								下一页
								<i class="ace-icon fa fa-arrow-right"></i>
							</button>

						</div>
					</div>

					<div class="widget-body">
						<div class="widget-main no-padding">
							<!-- #section:pages/dashboard.conversations -->
							<div class="dialogs" id="ssdb-apply"></div>
						</div><!-- /.widget-main -->
					</div><!-- /.widget-body -->
				</div><!-- /.widget-box -->
			</div><!-- /.col -->
			
		</div><!-- /.row -->
		

		<!-- PAGE CONTENT ENDS -->
	</div><!-- /.col -->
</div><!-- /.row -->

<div id="modal-apply" class="modal fade" tabindex="-1" data-backdrop="static">
	<div class="modal-dialog" style="min-width: 800px;">
			<div class="modal-content">
				<div class="modal-header no-padding">
						<div class="table-header">
							<button type="button" class="close" data-dismiss="modal"
							aria-hidden="true">
							<span class="white">&times;</span>
							</button>
						尝试申请详情
						</div>
					</div>
				<div class="modal-body"	style="max-height: 500px; overflow-y: scroll;">
					<div class="container-fluid">
						<input type="hidden" id="applyLawyerId">
						<table class="table" id="lawyerTab">
							<tr>
								<td>律师信息:</td>
								<td colspan="3"><span id="lawyerPro"></span></td>
							</tr>
							<tr>
								<td>跟进记录:</td>
								<td colspan="3" id="applyHandleList">
								
								</td>
							</tr>
							<tr>
								<td>点击申请:</td>
								<td colspan="3" id="applyList">
								
								</td>
							</tr>
						</table>
					</div>
				</div>
				<div class="modal-footer no-margin-top">
				<div class="text-center">
					<select class="select" id="needLevel1">
						<option value="0"> </option>
						<option value="1">强需求</option>
						<option value="2" selected = "selected">有需求</option>
						<option value="3">没需求</option>
					</select>
					<input type="text" id="followUpApplyContent" style="width: 500px;max-width: 100%;" class="search-query"></input>&emsp;&emsp;
					<button id="submitApplyButton" type="button" class="btn btn-success btn-sm">处理</button>
					<button class="btn btn-sm" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
		
	</div>
	<!-- /.modal-dialog -->
</div>

<div id="modal-search" class="modal fade" tabindex="-1" data-backdrop="static">
	<div class="modal-dialog" style="min-width: 800px;">
			<div class="modal-content">
				<div class="modal-header no-padding">
						<div class="table-header">
							<button type="button" class="close" data-dismiss="modal"
							aria-hidden="true">
							<span class="white">&times;</span>
							</button>
						筛选详情
						</div>
					</div>
				<div class="modal-body"	style="max-height: 500px; overflow-y: scroll;">
					<div class="container-fluid">
						<input type="hidden" id="searchLawyerId">
						<table class="table" id="lawyerTab">
							<tr>
								<td>律师信息:</td>
								<td><span id="lawyerPro1"></span></td>
							</tr>
							<tr>
								<td>跟进记录:</td>
								<td colspan="3" id="searchHandleList">
								
								</td>
							</tr>
							<tr>
								<td>筛选记录:</td>
								<td colspan="3" id="searchList">
								
								</td>
							</tr>
						</table>
					</div>
				</div>
				<div class="modal-footer no-margin-top">
				<div class="text-right">
					<select class="select" id="needLevel">
						<option value="0"> </option>
						<option value="1">强需求</option>
						<option value="2" selected = "selected">有需求</option>
						<option value="3">没需求</option>
					</select>
					<input type="text" id="followUpSearchContent" style="width: 500px;max-width: 100%;" class="search-query"></input>&emsp;&emsp;
					<button id="submitSearchButton" type="button" class="btn btn-success btn-sm">处理</button>
					<button class="btn btn-sm" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
		
	</div>
	<!-- /.modal-dialog -->
</div>

<!-- page specific plugin scripts -->

<!--[if lte IE 8]>
  <script src="${contextPath}/static/assets/js/excanvas.js"></script>
<![endif]-->
<script type="text/javascript">
var page1 = 1;
var rows1 = 20;
var needLevel = 0;
var needLevel1 = 0;
var page2 = 1;
var rows2 = 20;

function freshSsdbSearchs(){
	page1=1;
	getSsdbSearchs();
}

$("#searchd").click(function(){
	getSsdbTotal();
	getSsdbSearchs();
	getSsdbApplys();
});



function getSsdbTotal(){
	   var startDate = $("#startDate").val();
	   //默认查询7天记录
	   if(startDate==""){
	      var date = new Date((+new Date()));
	      startDate = date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate();
	      $("#startDate").val(startDate);
	   }
	   var endDate = $("#endDate").val();
	   if(endDate ==""){
         var date = new Date((+new Date()));
         endDate = date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate();		   
	      $("#endDate").val(endDate);
	   }
	   var param = "?startDate=" + startDate + "&endDate=" + endDate;
	   $.getJSON("${contextPath}/sys/ssdbCompany/getStaticTotal" + param, function(res){
		   $("#count1").html(res.searchTotalLawyer);
		   $("#count11").html(res.searchTotal);
		   $("#count2").html(res.applyTotalLawyer);
		   $("#count22").html(res.applyTotal);
	   });
}
function getSsdbSearchs(){
	
	var startDate = $("#startDate").val();
   //默认查询7天记录
   if(startDate==""){
      var date = new Date((+new Date())-7*24*3600*1000);
      startDate = date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate();
      $("#startDate").val(startDate);
   }
   
   var endDate = $("#endDate").val();
   if(endDate ==""){
      var date = new Date((+new Date()));
      endDate = date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate();         
      $("#endDate").val(endDate);
   }
	
	var param = "?page="+page1+"&rows="+rows1+"&needLevel="+needLevel +"&startDate=" + startDate + "&endDate=" + endDate;
	$.getJSON("${contextPath}/sys/ssdbCompany/searchStatic" + param, function(res){
		var sec='';
		var info='';
		var remark = '';
		$.each(res, function(i,r){     
			  sec+='<div class="itemdiv dialogdiv">';
		      sec+='<div class="user"><img src="${duowenapp_c}'+r.head+'" /></div>';
		      sec+='<div class="body">';
		      sec+='<div class="time"><i class="ace-icon fa fa-clock-o"></i><span class="green">'+r.time+'</span></div>';
		      info=r.lawyerName+'('+r.lawyerPhone+')';
		      sec+='<div class="name"><a href="javascript:ssdbSearchDetail(\''+r.lawyer_id+'\',\''+info+'\');">'+info+'</a></div>';
		      remark = r.needLevel;
		      if(remark.length > 0){
		    	  remark = '<font color="red">&emsp;&emsp;备注为' + remark + '</font>';
		      }
		      sec+='<div class="text">'+r.courtName+'['+r.stage+'] '+r.sqbd+'元 '+r.bdCode+remark+'</div>';
		      sec+='<div class="tools"><a href="javascript:ssdbSearchDetail(\''+r.lawyer_id+'\',\''+info+'\');" class="btn btn-minier btn-info"><i class="icon-only ace-icon fa fa-search"></i></a></div>';
		      sec+='</div></div>';
		  });		
		
		//$("#count1").html(res[0]!=null?res[0].total:0);
		$('#ssdb-search').html(sec);
	});
}

function freshSsdbApplys(){
	page2=1;
	getSsdbApplys();
}


function getSsdbApplys(){

	var startDate = $("#startDate").val();
	//默认查询7天记录
	if(startDate==""){
		var date = new Date((+new Date())-7*24*3600*1000);
		startDate = date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate();
	}

   var endDate = $("#endDate").val();
   if(endDate ==""){
      var date = new Date((+new Date()));
      endDate = date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate();         
      $("#endDate").val(endDate);
   }
	   
	var param = "?page="+page2+"&rows="+rows2+"&needLevel="+needLevel1 +"&startDate=" + startDate + "&endDate=" + endDate;
	$.getJSON("${contextPath}/sys/ssdbCompany/applyStatic"+param, function(res){
		var sec='';
		var info='';
		var remark = '';
		$.each(res, function(i,r){     
			  sec+='<div class="itemdiv dialogdiv">';
		      sec+='<div class="user"><img src="${duowenapp_c}'+r.head+'" /></div>';
		      sec+='<div class="body">';
		      sec+='<div class="time"><i class="ace-icon fa fa-clock-o"></i><span class="green">'+r.time+'</span></div>';
		      info=r.lawyerName+'('+r.lawyerPhone+')';
		      sec+='<div class="name"><a href="javascript:ssdbApplyDetail(\''+r.lawyer_id+'\',\''+info+'\');">'+info+' -> '+r.companyName+'</a></div>';
		      remark = r.needLevel;
		      if(remark.length > 0){
		    	  remark = '<font color="red">&emsp;&emsp;' + remark + '</font>';
		      }
		      sec+='<div class="text">法院：'+r.courtName+' 标的：'+r.sqbd+'元 '+remark+'</div>';
		      sec+='<div class="tools"><a href="javascript:ssdbApplyDetail(\''+r.lawyer_id+'\',\''+info+'\');" class="btn btn-minier btn-info"><i class="icon-only ace-icon fa fa-search"></i></a></div>';
		      sec+='</div></div>';
		  });
		//$("#count2").html(res[0]!=null?res[0].total:0);
		$('#ssdb-apply').html(sec);
		
	});
}


//保存跟进记录
function saveFollowUpContent(modalId, lawyerId, contentId, type){//type:0筛选，1申请
	var needLevel = 0;
	if(type == 0){
		needLevel = $('#needLevel').val();
	}else{
		needLevel = $('#needLevel1').val();
	}
	var data = {
		lawyerId : $("#" + lawyerId).val(),
		content : $("#" + contentId).val(),
		needLevel : needLevel
	};
 	$.getJSON("${contextPath}/sys/ssdbCompany/saveFollowUpContent",data,function(result){
 		if(result.success){
			$("#" + modalId).modal("toggle");
			getSsdbSearchs();
			getSsdbApplys();
			getSsdbTotal();
		}else{
			alert(result.message);
		}
   	});
}

function ssdbApplyDetail(lawyerId,info){
	$('#followUpApplyContent').val('');
	$('#lawyerPro').html(info);
	$.getJSON("${contextPath}/sys/ssdbCompany/applyDetail?lawyerId="+lawyerId,function(res){
		var han = '<table class="table"><tr><td></td><td>内容</td><td>操作人</td><td>日期</td></tr>';
		$.each(res.handles, function(i,r){
			han += '<tr>';
			han += '<td>'+(i+1)+'</td>';
			han += '<td>'+r.content+'</td>';
			han += '<td>'+r.operatorName+'</td>';
			han += '<td>'+r.createDate+'</td>';
			han += '</tr>';
		});
		han += '</table>';
		$('#applyHandleList').html(han);
		var sec='<table class="table"><tr><td></td><td>担保公司</td><td>法院</td><td>标的</td><td>阶段/编码</td><td>保费/积分</td><td>日期</td></tr>';
		$.each(res.searchs, function(i,r){     
		      sec+='<tr>';
		      sec+='<td>'+(i+1)+'</td>';
		      sec+='<td>'+r.companyName+'</td>';
		      sec+='<td>'+r.courtName+'</td>';
		      sec+='<td>'+r.sqbd+'</td>';
		      sec+='<td>'+r.stage+'/'+r.bdCode+'</td>';
		      sec+='<td>'+r.bf+'元/'+r.jf+'</td>';
		      sec+='<td>'+r.createDate+'</td>';
		      sec+='</tr>';
		  });
		sec+='</table>';
		$('#applyList').html(sec);
		
	});
	$('#applyLawyerId').val(lawyerId);
	$("#modal-apply").modal("toggle");
}

function ssdbSearchDetail(lawyerId,info){
	$('#followUpSearchContent').val('');
	$('#lawyerPro1').html(info);
	$.getJSON("${contextPath}/sys/ssdbCompany/searchDetail?lawyerId="+lawyerId,function(res){
		var han = '<table class="table"><tr><td></td><td>内容</td><td>操作人</td><td>日期</td></tr>';
		$.each(res.handles, function(i,r){
			han += '<tr>';
			han += '<td>'+(i+1)+'</td>';
			han += '<td>'+r.content+'</td>';
			han += '<td>'+r.operatorName+'</td>';
			han += '<td>'+r.createDate+'</td>';
			han += '</tr>';
		});
		han += '</table>';
		$('#searchHandleList').html(han);
		var sec='<table class="table"><tr><td></td><td>法院</td><td>阶段</td><td>标的</td><td>编码</td><td>日期</td></tr>';
		$.each(res.searchs, function(i,r){     
		      sec+='<tr>';
		      sec+='<td>'+(i+1)+'</td>';
		      sec+='<td>'+r.courtName+'</td>';
		      sec+='<td>'+r.stage+'</td>';
		      sec+='<td>'+r.sqbd+'</td>';
		      sec+='<td>'+r.bdCode+'</td>';
		      sec+='<td>'+r.createDate+'</td>';
		      sec+='</tr>';
		  });
		sec+='</table>';
		
		$('#searchList').html(sec);
		
	});
	$('#searchLawyerId').val(lawyerId);
	$("#modal-search").modal("toggle");
}

function statics(){
	$.getJSON("${contextPath}/sys/lawyer/statistics",function(result){
		$('#a').html(result.a);
		$('#a1').html(result.a1);
		$('#aa1').html(result.aa1+"%");
		
		$('#b').html(result.b);
		$('#b1').html(result.b1);
		$('#bb1').html(result.bb1+"%");
		
		$('#c').html(result.c);
		$('#c1').html(result.c1);
		
		$('#d').html(result.d);
		$('#d1').html(result.d1);
		
		$('#e').html(result.e);
		$('#e1').html(result.e1);
		$('#e2').html(result.e/10);
		
		});
}
		
var scripts = [ null,
	"${contextPath}/static/assets/js/date-time/bootstrap-datepicker.js",
	"${contextPath}/static/assets/js/date-time/locales/bootstrap-datepicker.zh-CN.js",
    "${contextPath}/static/assets/js/jqGrid/jquery.jqGrid.js",
    "${contextPath}/static/assets/js/jqGrid/i18n/grid.locale-cn.js",
	"${contextPath}/static/assets/js/jquery-ui.custom.js",
    "${contextPath}/static/js/fs/ssdbMonitor.js?v=3",
	"${contextPath}/static/assets/js/jquery.sparkline.js", null ];
       
$('.page-content-area').ace_ajax('loadScripts', scripts, function() {
	// inline scripts related to this page
	jQuery(function($) {

	    //日报
        var grid_selector = "#grid-table";
        var pager_selector = "#grid-pager";
        var grid_selector11 = "#grid-table11";
        var pager_selector11 = "#grid-pager11";

        //周报 月报
        var grid_selector1 = "#grid-table1";
        var pager_selector1 = "#grid-pager1";

        // resize to fit page size
        $(window).on('resize.jqGrid', function() {
            $(grid_selector).jqGrid('setGridWidth', $(".page-content").width());
        });
		$(window).on('resize.jqGrid', function() {
			$(grid_selector11).jqGrid('setGridWidth', $(".page-content").width());
		});
        $(window).on('resize.jqGrid', function() {
            $(grid_selector1).jqGrid('setGridWidth', $(".page-content").width());
        });
        // resize on sidebar collapse/expand
        var parent_column = $(grid_selector).closest('[class*="col-"]');
        $(document).on('settings.ace.jqGrid', function(ev, event_name, collapsed) {
            if (event_name === 'sidebar_collapsed' || event_name === 'main_container_fixed') {
                // setTimeout is for webkit only to give time for DOM changes and then redraw!!!
                setTimeout(function() {
                    $(grid_selector).jqGrid('setGridWidth', parent_column.width());
                }, 0);
            }
        });
        var parent_column11 = $(grid_selector11).closest('[class*="col-"]');
        $(document).on('settings.ace.jqGrid', function(ev, event_name, collapsed) {
            if (event_name === 'sidebar_collapsed' || event_name === 'main_container_fixed') {
                // setTimeout is for webkit only to give time for DOM changes and then redraw!!!
                setTimeout(function() {
                    $(grid_selector11).jqGrid('setGridWidth', parent_column.width());
                }, 0);
            }
        });

        myGrid = initLawALGrid(grid_selector, pager_selector, '${contextPath}/fs/report/getDayOrders', 'auto');
        myGrid11 = initLawALGrid11(grid_selector11, pager_selector11, '${contextPath}/fs/report/getDayOrders', 'auto');

        myGrid2 = initLawALGrid2(grid_selector1, pager_selector1, '${contextPath}/fs/report/getMonthOrders', 'auto');



        $("#searchd1").click(function(){
            var startDate1 = $("#startDate1").val();
            var endDate1 = $("#endDate1").val();
            myGrid2.setGridParam({postData:{'startDate':startDate1,'endDate':endDate1},
                url : '${contextPath}/fs/report/getMonthOrders'}).trigger('reloadGrid');
        });


		$(".prev_search").click(function(){
			page1=page1-1;
			if(page1<=0){
				page1=1;
				alert('已经到首页！');
				return;
			}
			getSsdbSearchs(); 
		});
		$(".next_search").click(function(){
			page1=page1+1;
			getSsdbSearchs(); 
		});
		$(".prev_apply").click(function(){
			page2=page2-1;
			if(page2<=0){
				page2=1;
				alert('已经到首页！');
				return;
			}
			getSsdbApplys(); 
		});
		$(".next_apply").click(function(){
			page2=page2+1;
			getSsdbApplys(); 
		});
		
		getSsdbSearchs(); 
		getSsdbApplys(); 
		getSsdbTotal();
		//statics();
		
		$('.sparkline').each(function() {
			var $box = $(this).closest('.infobox');
			var barColor = !$box.hasClass('infobox-dark') ? $box.css('color') : '#FFF';
			$(this).sparkline('html', {
				tagValuesAttribute : 'data-values',
				type : 'bar',
				barColor : barColor,
				chartRangeMin : $(this).data('min') || 0
			});
		});
		
		// Android's default browser somehow is confused when tapping on label which will lead to dragging the task
		// so disable dragging when clicking on label
		var agent = navigator.userAgent.toLowerCase();
		if ("ontouchstart" in document && /applewebkit/.test(agent) && /android/.test(agent))
			$('#tasks').on('touchstart', function(e) {
				var li = $(e.target).closest('#tasks li');
				if (li.length == 0)
					return;
				var label = li.find('label.inline').get(0);
				if (label == e.target || $.contains(label, e.target))
					e.stopImmediatePropagation();
			});

		setInterval("freshSsdbSearchs()", 3*60000); 
		setInterval("freshSsdbApplys()", 5*60000); 
		
		$('#needLevelParameter').change(function(){ 
			page1 = 1;
			needLevel = $('#needLevelParameter').val();
			getSsdbSearchs();
		});

		$('#needLevelParameter1').change(function(){ 
			page2 = 1;
			needLevel1 = $('#needLevelParameter1').val();
			getSsdbApplys();
		});
		
		$('#submitApplyButton').on('click', function() {
			saveFollowUpContent('modal-apply', 'applyLawyerId', 'followUpApplyContent', 1);
		});
	    
		$('#submitSearchButton').on('click', function() {
			saveFollowUpContent('modal-search', 'searchLawyerId', 'followUpSearchContent', 0);
		});
	});
	
	$('.datapicker').datepicker({
        language: 'zh-CN',
        pickTime: false,
        todayBtn: true,
        autoclose: true,
        minView: '2',
        forceParse: false,
        format:"yyyy-mm-dd"
    });
});

/*-----------------------------导出Excel start------------------------------*/
	$("#searchExcel").click(function () {
		var startDate = $("#startDate").val();
		var endDate = $("#endDate").val();
		var url = '${contextPath}/ssdb/excel/getSearchExcel?startDate=' + startDate +
				"&endDate="+endDate ;
		console.info(url);
		window.open(url);
	});
	$("#applyExcel").click(function () {
			var startDate = $("#startDate").val();
			var endDate = $("#endDate").val();
			var url = '${contextPath}/ssdb/excel/getApplyExcel?startDate=' + startDate +
					"&endDate="+endDate ;
			console.info(url);
			window.open(url);
	});
/*-----------------------------导出Excel end------------------------------*/

</script>
