<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>私塾家</title>
<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
<script th:include="sys/common/metaJS" th:remove="tag"></script> 
<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
</head>
<style>
	.tablelink{margin-right:10px;}
	.stylecss{
	      color: red;
	}
	.select_width{
	     width: 220px;
	}
	.date_width{
	     width: 150px;
	}
</style>
<body>
<div class="place">
	<span>位置：</span>
	<ul class="placeul">
		<li><a href="#">财务管理</a></li>
		<li><a href="#">一对一销售分成管理</a></li>
	</ul>
</div>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/order/lessonCourseOrderList.html}" method="post">
	  <input type="hidden" name="reportType" id="reportType" />
	<ul class="seachform">
			<li>
				<label>开始时间</label>
				<input type="text" id="beginDate" name="beginDate"  onclick="WdatePicker({readOnly:true,maxDate:'#F{$dp.$D(\'endDate\')}'})" th:value="${search.beginDate }" class="scinput date_width " placeholder="开始时间">
			</li>
		
			<li>
				<label>结束时间</label>
				<input type="text" id="endDate" name="endDate"  onclick="WdatePicker({minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'%y-%M-%d'})" th:value="${search.endDate }" class="scinput date_width" placeholder="结束时间">
			</li>
			<li>
			 <label>订单编号</label>
			  <input name="order_no" type="text" class="scinput" th:value="${search.get('order_no')}"/>
		    </li>
			<li>
				<label>图书馆</label>
					<select class="scinput select_width"  name="libId"   style="width: 220px;" >
						<option value=""   >全部</option>
						<option th:each="item:${libList}"  th:value="${item.id}"  th:selected="${ search.get('libId') eq item.id }"  th:text="${item.leagueName}"></option>
					</select>
			</li>
			
		<li>
			<input type="button" class="scbtn" value="查询" />
		</li>
		
		
	</ul>
	<ul class="seachform" style="margin-left:60px;">
	  	<li th:if="${ #httpSession.getAttribute('admin') !=null   &&  #lists.contains(#httpSession.getAttribute('admin').orgcodeList,'SSJ-SSJ-CW')  }">
			<input type="button" id="button" style="width: 100px;" class="scbtnbution" value="课耗明细表" />
		</li>
		<li th:if="${ #httpSession.getAttribute('admin') !=null  &&  #lists.contains(#httpSession.getAttribute('admin').orgcodeList,'SSJ-SSJ-CW') }">
			<input type="button" id="detailbutton" style="width: 120px;" class="scbtnbution" value="老师业绩表" />
		</li>
	</ul>
	</form>
	<table class="tablelist">
		<thead>
		    <tr>
		        <th style="width: 50px;">序号</th>
		        <th>订单编号</th>
		        <th>校长姓名</th>
		        <th>老师姓名</th>
		        <th>家长姓名</th>
		        <th>宝宝姓名</th>
		        <th>上课时间</th>
		        <th>结算时间</th>
		        <th>上课状态</th>
		        <th>金额</th>
		        <th>师资类型</th>
		        <th>教师分成</th>
		        <th>公司分成</th>
		        <th>所属馆分成</th>
		        <th>SD分成</th>
		       
		    </tr>
		</thead>
		<tbody>
			<tr th:each="item:${list}" >
				<td th:text="${itemStat.count}" ></td>
					<td th:text="${item.get('order_no')}"></td>
					<td th:text="${item.get('master_name')}"></td>
					<td th:text="${item.get('t_name')}"></td>
					<td th:text="${item.get('parent_name')}"></td>
					<td th:text="${item.get('child_name')}"></td>
					<td th:text="${item.get('course_time')+' '+item.get('start_time')+'-'+item.get('end_time')}"></td>
					<td th:text="${item.get('finish_time')}"></td>
					<td  th:switch="${item.get('plan_status')}">
					   <span th:case="1" >未支付</span>
					   <span th:case="2" >已支付</span>
					   <span th:case="3" >确定上课意向</span>
					   <span th:case="4" >上课</span>
					   <span th:case="5" >反馈</span>
					   <span th:case="*">其他</span>
					</td>
					
					
					<td th:text=" ${#strings.contains(item.get('price'),'.00')} ?  ${#numbers.formatDecimal(item.get('price'),1,0)} :  ${#numbers.formatDecimal(item.get('price'),1,2)} " style="color:  red;"></td>
			        <td th:text="${(item.get('teacher_lever')!=null ? item.get('teacher_lever') : '') +'/'+(item.get('teacher_type')!=null ? item.get('teacher_type') :'')}"></td>
					<td th:text=" ${#strings.contains(item.get('t_price'),'.00')} ?  ${#numbers.formatDecimal(item.get('t_price'),1,0)} :  ${#numbers.formatDecimal(item.get('t_price'),1,2)} " style="color:  red;"></td>
					<td th:text=" ${#strings.contains(item.get('s_price'),'.00')} ?  ${#numbers.formatDecimal(item.get('s_price'),1,0)} :  ${#numbers.formatDecimal(item.get('s_price'),1,2)} " style="color:  red;"></td>
					<td th:text=" ${#strings.contains(item.get('l_price'),'.00')} ?  ${#numbers.formatDecimal(item.get('l_price'),1,0)} :  ${#numbers.formatDecimal(item.get('l_price'),1,2)} " style="color:  red;"></td>
					<td th:text=" ${#strings.contains(item.get('sd_price'),'.00')} ?  ${#numbers.formatDecimal(item.get('sd_price'),1,0)} :  ${#numbers.formatDecimal(item.get('sd_price'),1,2)} " style="color:  red;"></td>
			</tr>
		</tbody>
	</table>
	<!-- 分页 -->
	<div class="pagin">
    	<div class="message">共<i class="blue">[[${page.rowCnt}]]</i>条记录，当前显示第&nbsp;<i class="blue">[[${page.pageNo }]]&nbsp;</i>页</div>
    	<div th:utext='${listNavigatHtml}' th:remove="tag" ></div>
   	</div>
</div>
</body>
<script type="text/javascript">
$("#button").on('click',function(){
	$('#reportType').val(10);
	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/report/exportReport";
	$("#seachform").submit();
	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/order/lessonCourseOrderList.html";
});
$("#detailbutton").on('click',function(){
	$('#reportType').val(11);
	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/report/exportReport";
	$("#seachform").submit();
	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/order/lessonCourseOrderList.html";
});

</script>

</html>