<%@page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ include file="header.jsp"%>
<script type="text/javascript" src="<%=webpath%>/js/business/balance.js"></script>
<script type="text/javascript" src="<%=webpath%>/js/DatePicker/WdatePicker.js"></script>
<style>
	.mainCon {
		/* width:80%;
		margin:100px auto auto; */
	}
	/* .mainCon a {
		width:15%;
		margin-right:5%;
		display: block;
    	float: left;
    	text-align:center;
    	padding: 30px 0;
    	border: 1px solid #ffffff;
    	border-radius:10px;
	}
	.mainCon a:hover {
		border:1px dashed #9c9c9e;
		color:rgb(51, 51, 51);
	}
	.mainCon a:nth-last-child(1){
		margin-right:2.5%;
	}
	.mainCon a:nth-first-child(1){
		margin-left:2.5%
	} */
	.Icon {
		width: 64px;
	    margin: 0 auto;
	    display: block;
	    margin-bottom: 20px;
	}
	.dialog_con .datagrid .panel-body {
		border-bottom:1px solid #D3D3D3;
	}
	.dialog_default {
		margin: 30px auto auto;
	}
	.aColor {
		color: rgb(66, 139, 202); 
	}
</style>

<%
BalanceCountVo balanceCount = (BalanceCountVo)request.getAttribute("balanceCount");
 
%>
 
<script type="text/javascript">
function query(){
	var fromDate=$("#query_fromDate").val();
	var toDate=$("#query_toDate").val();
	if((fromDate==null||fromDate=='')&&(toDate==null||toDate=='')){
		alert("查询条件不能为空");
		return;
	} 
	var path=$("#paths").val();
/* 	var url=path+"/balance/balance.do?fromDate="+fromDate+"&toDate="+toDate;
	  window.location.href=url; */
	  
	  var params={};
		params["fromDate"]=fromDate;
		params["toDate"]=toDate;
		queryBalance(path+'/balance/balance_count.do',params);
		/* var result = ajaxgetresultpost(path
					+ '/balance/balance_count.do',params );
		if(result!=null&&result.coupon!=null){
				$("#coupon").html(result.coupon);
				$("#deliverwater").html(result.deliverwater);
				$("#roadrepair").html(result.roadrepair);
				$("#scooter").html(result.scooter);
				$("#rescuecabinet").html(result.rescuecabinet);
			
			}else{
			
			//alert(result.msg);
			
		} */
}

$(".opera").bind("click",function(){
	$(".order_undo").show();
});

$(document).on('click','.cancel',function(){  
     $(".order_undo").hide();
 });
 
 /* $("#coupon").bind("click",function(){

 	var html=$("#coupon").html();
 	if(html!=null&&html!=""&&html>0){
 		$("#deletail_dialog").show();
 	}
	
});
 $("#deliverwater").bind("click",function(){
 	var html=$("#deliverwater").html();
 	if(html!=null&&html!=""&&html>0){
 		$("#deletail_dialog").show();
 	}
	
}); */
 function showDetailbylist(extraServer,val){
	  if(val!=null&&val!=""&&val>0){
	  
	  $("#extraServer").val(extraServer);
	  	submitDetail(extraServer,val);
	  	
	  	
	  }
 }
 
 function showDetail(extraServer,val){
 //'1001 路修；1002代步车；1003送水；1004 救援柜';
	  if(extraServer==-1&&(val!=null&&val!=""&&val>0)){
	  	submitDetail(-1,val);
	  }
	
	  if(extraServer==1001&&(val!=null&&val!=""&&val>0)){
	  	submitDetail(1001,val);
	  }
	  
	  if(extraServer==1002&&(val!=null&&val!=""&&val>0)){
	  	submitDetail(1002,val);
	  } 
	  if(extraServer==1003&&(val!=null&&val!=""&&val>0)){
	  	submitDetail(1003,val);
	  }
	  if(extraServer==1004&&(val!=null&&val!=""&&val>0)){
	  	submitDetail(1004,val);
	  }
 }
 function submitDetail(extraServer,val){
 	var path=$("#paths").val();
 		
	var fromDate=$("#query_fromDate").val();
	var toDate=$("#query_toDate").val();
	
 	var params={};
 	params["cid"]=val;
	params["extraServer"]=extraServer;
	params["fromDate"]=fromDate;
	params["toDate"]=toDate;
	
	var urls =path+ '/balance/balanceDetailList.do';
	$("#deletail_dialog").show();
	if(extraServer==-1){
	queryCouponBalanceList(urls,params);
	}else{
	queryBalanceList(urls,params);	
	}
		
 	
 }
/* $(".cancel").bind("click",function(){
	alert(1);
	$(".order_undo").hide();
}) */
  	$(document).ready(function(){ 
			queryBalance("","");
		}) 
</script>
<input type="hidden" id="paths" value="<%=path%>"/>
<div id="main">
	<div class="search">
	<table class="searchTable">
		<tr>
			<td>
				<span class="inputTitle">开始日期:</span>
				<input type="text" id="query_fromDate" name="query_fromDate" class="Wdate" readonly="readonly" onfocus="WdatePicker({errDealMode:2,readOnly:true,startDate:'%y-%M-%d %H:%m:%s',dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'query_toDate\')||\'%y-%M-%d\'}'})" style="cursor:pointer;"/>
			</td>
			
			<td>
				<span class="inputTitle">结束日期:</span>
				<input type="text" id="query_toDate" name="query_toDate" class="Wdate" readonly="readonly" onfocus="WdatePicker({errDealMode:2,readOnly:true,startDate:'%y-%M-%d %H:%m:%s',dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-%d',minDate:'#F{$dp.$D(\'query_fromDate\')}'})" style="cursor:pointer;"/>
			</td>
			<td>
				<!-- <button class="t-button" id="CaseInfoList2btnCtSearch" type="button" onclick="query();"><font><font>&nbsp;&nbsp;搜 索&nbsp;&nbsp;</font></font></button> -->
			
			
				<button class="t-button searchBtn" id="CaseInfoList2btnCtClear" type="button" onclick="clearVal();"><img class="searchIcon" src="../images/clear.png">清空</button>
	     		
	     		<button class="t-button searchBtn" style="margin-right:10px;" id="CaseInfoList2btnCtSearch" type="button" onclick="query();"><img class="searchIcon" src="../images/search.png">搜索</button>
                    
			</td>
			<td></td>
			
		</tr>
	</table>
	</div>
	
	<div class="mainCon">
		<%-- <a onclick="showDetail(-1)">
			<img src="<%=path%>/images/replaceMoney.png" class="Icon" style="margin-top:1px;" />
		代金劵：
			<span id="coupon">
			</span>
		</a>
		<a onclick="showDetail(1003)">
			<img src="/JLR/images/sendWater.png" class="Icon" />
			送水：<span id="deliverwater"></span>
		</a>
		<a onclick="showDetail(1001)">
			<img src="/JLR/images/roadRepair.png" class="Icon" style="margin-top:3px;margin-bottom:23px;" />
		路修：
			<span id="roadrepair">
			</span>
		</a>
		<a onclick="showDetail(1002)">
			<img src="/JLR/images/replaceWalkCar.png" class="Icon" style="width:90px;margin-top:14px;margin-bottom:33px;" />
		代步车：
			<span id="scooter">
			</span>
		</a>
		<a onclick="showDetail(1004)">
			<img src="/JLR/images/save.png" class="Icon" style="margin-top:3px;" />
		救援柜：
			<span id="rescuecabinet">
			</span>
		</a>
	</div>
  --%>
		
			<table id="datatable"></table>
    
	
</div>





<div class="order_undo" id="deletail_dialog" style="display: none;">
<input type="hidden" value="" id="enterpriseid" name="id">
<input type="hidden" value="" id="extraServer" name="extraServer">

				<div class="dialog_default">
					<div class="dialog_title">
						详细记录
					</div>
					
					<div class="dialog_con">
							<table id="deletail_datatable"></table>	
							
					
						<input type="button" onclick="tableChangeSettlementState(10);" value="同意付款"/>
						<input type="button" onclick="tableChangeSettlementState(100);" value="已付款"/>
						<div class="confirm_cancel clearfix">
							<a href="javascript:void(0);" class="btn1 cancel">取&nbsp;&nbsp;消</a>
						</div>
					</div>
				</div>
			</div>


<%@ include file="footer.jsp"%>