<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 th:href="@{/sys/fx/deviceActCountList.html}">批次统计</a></li>
		<li><a href="#">批次明细列表</a></li>
	</ul>
</div>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/fx/deviceActDetailsList.html}" method="post">
	  <input type="hidden" name="reportType" id="reportType" />
		<ul class="seachform">
		    <li>
			  <label>批次编号</label>
			  <input name="batchCode" type="text" class="scinput" th:value="${search.get('batchCode')}"/>
		    </li>
			<li>
				<label>物流状态</label>
				<select class="scinput select_width"  name="type"   style="width: 150px;" >
					<option th:selected="${search.get('type') eq '1' ? true : false}" value="1">分配下级</option>
					<option th:selected="${search.get('type') eq '2' ? true : false}" value="2">退回上级</option>
					<option th:selected="${search.get('type') eq '3' ? true : false}" value="3">设备入库</option>
					<option th:selected="${search.get('type') eq '4' ? true : false}" value="4">退回入库</option>
				</select>
			</li>
			<li>
				<input type="button" class="scbtn" value="查询" />
			</li>
			<li>
				<a href="javascript:history.go(-1);" style="line-height: 35px;color: red;font-size: 14px;">&lt&lt返回上一级</a> 
			</li>
		</ul>
	</form>
	<ul style="margin-bottom: 10px;">
		<li>
			<input type="button" id="button" class="scbtn" value="导出" />
		</li>
	</ul>

	<table class="tablelist">
		<thead>
		    <tr>
		    	<th>物流状态</th>
		    	<th>批次编号</th>
		    	
		    	<th>imei号</th>
		    	<th>设备名称</th>
		    	<th>设备颜色</th>
		    	<th>小塾号</th>
		    	<th>simcard</th>
		    	<th>设备状态</th>
		    	<th>流通类型</th>

				<th>至商户</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:switch="${item.type}">
					<span th:case="1" style="color:red;">分配下级</span>
					<span th:case="2">退回上级 </span>
					<span th:case="3">设备入库</span>
					<span th:case="4">退回入库</span>
				</td>
					<td style="color:red"  th:text="${item.batch_code}"></td>
					<td style="color:red"  th:text="${item.imei}"></td>
					
					<td th:text="${item.device_name}"></td>
					<td th:text="${item.device_color}"></td>
					<td th:text="${item.device_number}"></td>
					<td th:text="${item.device_sn}"></td>
					<td  th:switch="${item.status}">
					   <span th:case="1">待收货(现商户)</span>
					   <span th:case="2">已收货(现商户) </span>
					   <span th:case="3" style="color: red">待收货(退回)</span>
					   <span th:case="4" style="color: red">已收货(退回)</span>
					   <span th:case="5">无效</span>
					</td>
					<td style="color: red" th:switch="${item.dtype}">
					   <span th:case="1">出售</span>
					   <span th:case="2">租赁 </span>
					   <span th:case="3">损坏</span>
					   <span th:case="4">留存 </span>
					</td>
					
					<td th:text="${item.pos_code}"></td>
					<td th:text="${item.unit_name}"></td>
					<td th:text="${item.ems_number}"></td>
					<td th:text="${item.ems_username}"></td>
					<td th:text="${item.ems_telephone}"></td>
					<td th:text="${item.ems_address}"></td>
					<td>
						<a th:if="${item.ems_img!=null && item.ems_img!='' }" th:href="${imgUrl+item.ems_img}" style="color:red"  target="_blank" >点击查看凭证</a>
						<span th:if="${item.ems_img==null || item.ems_img=='' }">未上传凭证</span>
					</td>
					<td th:text="${item.remarks}"></td>
					<td th:text="${item.create_time}"></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(){
	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/exportDeviceActDetailsList.html";
	$("#seachform").submit();
	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/deviceActDetailsList.html";
});
</script>

</html>