<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>
<link href="sys/css/jquery.searchableSelect.css" th:href="@{/static/sys/css/jquery.searchableSelect.css}" rel="stylesheet"/>
<script src="js/layer/layer.js" th:src="@{/static/sys/js/jquery.searchableSelect.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/award/consume/list.html}" method="post">
	<ul class="seachform">
	
		<li>
			<label>始/至商户</label>
			<select class="scinput select_width"  id="merchantId" name="merchantId"   style="width: 150px;" >
				<option value="">全部</option>
				<option th:each="item:${subMerchants}"  th:selected="${search.get('merchantId') eq item.id ? true : false}" th:value="${item.id}">[[${item.unitName}]]</option>
			</select>
		</li>
		
		<li>
			<label>操作类型</label>
			<select class="scinput select_width"  id="type" name="type"   style="width: 150px;" >
				<option value="1" th:selected="${search.get('type')+'' eq '1' ? true : false}" >我向下配送</option>
				<option value="2" th:selected="${search.get('type')+'' eq '2' ? true : false}" >上级向我配送</option>
				<option value="3" th:selected="${search.get('type')+'' eq '3' ? true : false}" >创建活动消耗</option>
<!-- 				<option value="4" th:selected="${search.get('type')+'' eq '4' ? true : false}" >奖品兑换消耗</option> -->
				<option value="5" th:selected="${search.get('type')+'' eq '5' ? true : false}" >取消活动返库</option>
				<option value="6" th:selected="${search.get('type')+'' eq '6' ? true : false}" >奖品入库</option>
				<option value="" th:selected="${search.get('type')+'' eq '' ? true : false}">全部</option>
			</select>
		</li>
		<li>
			<label>奖品：</label>
			<select class="scinput select_width"  id="awardMaterialId" name="awardMaterialId"   style="width: 150px;" >
				<option value="">全部</option>
				<option th:each="item:${awardMaterials}"  th:selected="${search.get('awardMaterialId') eq item.id ? true : false}" th:value="${item.id}">[[${item.name}]]</option>
			</select>
		</li>
		
		<li>
			<label>开始时间</label>
			<input type="text" id="startTime" name="startTime" autocomplete="off" onclick="WdatePicker()" th:value="${search.get('startTime')}"   class="scinput date_width " placeholder="开始时间">
		</li>
		<li>
			<label>结束时间</label>
			<input type="text" id="endTime" name="endTime" autocomplete="off"  onclick="WdatePicker()"  th:value="${search.get('endTime')}" class="scinput date_width " placeholder="结束时间">
		</li>
		<li>
			<input type="button" class="scbtn" value="查询" />
		</li>
		
		<li>
			<ul class="toolbar">
				<a href="javascript:;" onclick="list_export()">
					<li class="click"><span><img th:src="@{/static/sys/images/t04.png}"></span>导出明细</li>
				</a>
			</ul>
		</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>
		    </tr>
		</thead>
		<tbody>
			<tr th:each="item:${list}" >
					<td th:text="${itemStat.count}"></td>
					<td th:text="${item.get('fm_unit_name')}"></td>
					<td th:text="${item.get('tm_unit_name')}"></td>
					<td  th:switch="${item.type}">
					   <span th:case="1" style="color:red">我向下配送</span>
					   <span th:case="2" style="color:red">上级向我配送</span>
					   <span th:case="3" style="color:red">活动消耗</span>
					   <span th:case="4" style="color:red">兑换消耗</span>
					   <span th:case="5" style="color:red">取消活动返库</span>
					   <span th:case="6" style="color:red">奖品入库</span>
					</td>
					<td th:text="${item.get('number')}"></td>
					<td th:text="${item.get('material_name')}"></td>
					<td  th:switch="${item.material_level}">
					   <span th:case="1" style="color:red">一等奖</span>
					   <span th:case="2" style="color:red">二等奖</span>
					   <span th:case="3" style="color:red">三等奖</span>
					</td>
					<td th:text="${item.get('create_time')}"></td>
					<td th:text="${item.get('remarks')}"></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">
	
	$(function(){
		$('#merchantId').searchableSelect();
	});

	function list_export(){
		document.getElementById("seachform").action = "[[${sysUrl}]]/sys/award/consume/list_export";
		$("#seachform").submit();
		window.setTimeout(function(){
			document.getElementById("seachform").action = "[[${sysUrl}]]/sys/award/consume/list.html";
		},3000);
	};
	
</script>



</html>