<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/fx/deviceUnloadingList.html}" method="post">
	<ul class="seachform">
		 <li th:if="${merchant.orgCode eq 'SSJ-FX' }">
			<label>商户</label>
			<select class="scinput select_width"  name="merchantId" id="merchantId"   style="width: 150px;" >
				<option value="">全部</option>
				<option th:each="item:${poslist}" th:if="${item.orgCode !='SSJ-FX'}" th:selected="${search.get('merchantId') eq item.id}" th:value="${item.id}">[[${item.unitName}]]</option>
			</select>
		</li>
	
		 <li>
			<label>登记状态</label>
			<select class="scinput select_width"  name="status" id="status"   style="width: 150px;" >
				<option th:selected="${search.get('status') eq '1' ? true : false}" value="1">出入库登记</option>
				<option th:selected="${search.get('status') eq '2' ? true : false}" value="2">全新库存登记</option>
				<option th:selected="${search.get('status') eq '3' ? true : false}" value="3">二手库存登记</option>
			</select>
		</li>
		<li>
			<label>开始月份</label>
			<input type="text" id="startMonth" name="startMonth" autocomplete="off"   onclick=" WdatePicker({ dateFmt: 'yyyy-MM', isShowToday: false, isShowClear: false });" th:value="${search.startMonth }" class="scinput date_width " placeholder="开始月份">
		</li>
		<li>
			<label>结束月份</label>
			<input type="text" id="endMonth" name="endMonth" autocomplete="off"  onclick=" WdatePicker({ dateFmt: 'yyyy-MM', isShowToday: false, isShowClear: false });" th:value="${search.endMonth }" class="scinput date_width " placeholder="结束月份">
		</li>
		<li>
			<input type="button" class="scbtn" value="查询" />
		</li>
	</ul>
	</form>
	<ul class="seachform">
		<li>
			<input type="button" id="button" class="scbtn" value="导出" />
		</li>
	</ul>


	

	<table class="tablelist">
		<thead>
		    <tr>
		    	<th>年月份</th>
		    	<th>商户</th>
		    	<th style="color: red">入库单价</th>
		    	<th>入库数量</th>
		    	<th>入库金额</th>
		    	<th  style="color: red">出库单价</th>
				<th>出库数量</th>
		    	<th>出库金额</th>
		    	<th>结存数量</th>
		    </tr>
		</thead>
		<tbody>
			<tr th:each="item:${list}" >
					<td th:text="${item.get('time')}"></td>
					<td th:text="${item.get('unit_name')}"></td>
					<td th:text="${merchant.orgCode eq 'SSJ-FX' ? item.get('price') : '*'}"></td>
					<td th:text="${item.get('counta')}"></td>
					<td th:text="${merchant.orgCode eq 'SSJ-FX' ? item.get('counta')*item.get('price') : '*'}"></td>
					<td th:text="${merchant.orgCode eq 'SSJ-FX' ? item.get('out_price') : '*'}"></td>
					<td th:text="${item.get('countb')}"></td>
					<td th:text="${merchant.orgCode eq 'SSJ-FX' ? item.get('countb')*item.get('out_price') : '*'}"></td>
					<td th:text="${item.get('counta')-item.get('countb')}"></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();
});

	$("#button").on('click',function(){
		document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/exportDeviceUnloadingList";
		$("#seachform").submit();
		document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/deviceUnloadingList.html";
	});
</script>


</html>