<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> 
</head>
<style>
	.tablelink{margin-right:10px;}
	.stylecss{
	      color: red;
	}
	.select_width{
	     width: 70px;
	}
	.date_width{
	     width: 100px;
	}
</style>
<body>
<div class="place">
	<span>位置：</span>
	<ul class="placeul">
		<li><a href="#">后台系统管理</a></li>
		<li><a th:href="@{/sys/sales/libCommissionList}">销售提成配置</a></li>
	</ul>
</div>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/sales/libCommissionList}" method="post">
	<ul class="seachform">
		<li>
		<label>销售人类型</label>
					<select class="scinput" style="width: 200px;" name="EQ_type"   >
					    <option value=""  th:selected="${ search.get('EQ_type') eq '' }"  >全部</option>
						<option th:value="${sort.code}" th:each="sort:${sortlist}" th:selected="${ search.get('EQ_type') eq sort.code }" >[[${sort.name}]]</option>
					</select>
		</li>
		<li>
			<label>&nbsp;</label>
			<input type="button" class="scbtn" value="查询" />
		</li>
		<li>
				<ul class="toolbar">
					<a th:href="@{/sys/sales/libCommissionAdd.html}"><li class="click"><span><img th:src="@{/static/sys/images/t01.png}" /></span>新增</li></a>
				</ul>
		</li>
	</ul>
	</form>
	<table class="tablelist">
		<thead>
		    <tr>
		        <th style="width: 80px;">序号</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>
				       <span th:each="sort:${sortlist}" th:if="${sort.code eq item.type}" th:text="${sort.name}"></span>
				    </td>
					<td th:text="${item.newSign}" ></td>
					<td th:text="${item.xSign}" ></td>
					<td  th:text="${#calendars.format(item.createTime,'yyyy-MM-dd HH:mm:ss')}" ></td>
					<td >
					    <a th:href="@{/sys/sales/libCommissionAdd.html(id=${item.id})}"  class="tablelink" >修改</a>
						<a href="javascript:;" th:onclick="'deleteById(\''+${item.id}+'\')'"  class="tablelink" >删除</a>
				    </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 deleteById(id){
	layer.confirm("确定删除该销售提成吗？",
			{icon: 4, btn: ['确定','取消']
	}, function(){
		$.ajax({
			url: '[[${sysUrl}]]/sys/sales/libCommissionDelete',
			type: "post",
			data:{
				'id': id
			},
			dataType: "json",
			success:function(data){
					
					if(data.meta.success){
						layer.msg("删除成功",{icon:1});
				    	setTimeout(function(){
				    		location.reload();
						},1000);
					}else{
						layer.msg(data.meta.message,{icon:11});
					}
			}
		});
	});
}
</script>
</html>