<!-- include '../header' -->
<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>/js/humanResource.js"></script>
<body>
	<div class="mainLayout">
		<div class="mainMenu">
			<div class="menuItem">
				<a href="#" class="mLogo">CLD</a>
				<ul>
					<!-- include '../menu' -->
				</ul>
			</div>
			
		</div>
		<div class="warpContent">
			<div class="subMenu fL">
				<div class="menuItem">
					<!-- include 'hrMenu' -->
				</div>
			</div>
			<div class="adminContent autoHeight">
				<legend>岗位设置</legend>
				<div class="demandCate">
					<ul class="cateList">
						<li>
							<a href="#add-job" data-toggle="modal" class="button">+岗位</a>
						</li>
	  			</ul>
	  		</div>
				<div class="saeaList">
					<table class="table table-bordered table-hover">
						<thead>
						<tr class="thead" rowspan="2"><th rowspan="2">岗位名称</th><th rowspan="2">包含员工</th><th colspan="3" class="taC">工资模板</th><th width="80" rowspan="2">操作</th></tr>
						<tr><th>绩效工资</th><th>基本工资</th><th>岗位工资</th></tr>
						</thead>
						<tbody>
						<!-- loop listPosition -->
						<tr><td>{{listPosition' value.positionName}}</td>
							<td><a href="#job-em" node-PositionStaff pidKey={{listPosition' value.pidKey}} data-toggle="modal" >{{listPosition' value.staffCount}}(点我)</a></td>
							<td>{{listPosition' value.achievementBonus}}</td>
							<td>{{listPosition' value.baseWage}}</td>
							<td>{{listPosition' value.postWage}}</td>
							<td><a href="#edi-job" node-ediPosition pidKey={{listPosition' value.pidKey}} data-toggle="modal">编辑</a>
							<!-- if {{listPosition' value.staffCount}}==0 -->
							<a href="#del" node-delPosition pidKey={{listPosition' value.pidKey}} data-toggle="modal"  class="colRed">删除</a>
							<!-- endif -->
							</td>
						</tr>
						<!-- endloop -->
						
						</tbody>
					</table>
				</div>
				
			</div>
		</div>
	</div>
	<!--添加岗位-->
	<div class="modal fade" id="add-job">
		<form method="post" action="/positionAdd" name="group">
		<div class="modal-dialog">
			<div class="modal-content">
			    <div class="modal-header">
			    	<h3>添加岗位</h3>
			    </div>
			    <div class="modal-body saeaList">
			    	<table class="table table-bordered table-condensed">
						<tr>
							<th colspan="2" class="taC">岗位信息</th>
						</tr>
						<tr>
							<th class="taC">岗位名称</th>
							<td><input name="positionName" id="positionName" value="" type="text"></td>
						</tr>
						<tr>
							<th class="taC">岗位描述</th>
							<td><textarea name="positionDescribe" id="positionDescribe"></textarea></td>
						</tr>
			    	</table>
					<table class="table table-bordered table-condensed">
						<tbody>
						<tr>
							<th colspan="4" class="taC">工资模板</th>
						</tr>
						<tr>
							<th class="taC" width="150">基本工资</th>
							<td><input name="baseWage" id="baseWage" value="" type="number" style="width:150px"></td>
							<th class="taC" width="150">岗位工资</th>
							<td><input name="postWage" id="postWage" value="" type="number" style="width:150px"></td>
						</tr>
						<tr>
							<th class="taC" width="150">绩效奖金</th>
							<td><input name="achievementBonus" id="achievementBonus" value="" type="number" style="width:150px"></td>
							<th class="taC" width="150"></th><td></td>
						</tr>
					</tbody>
					</table>
			    </div>
				<div class="modal-footer">
					<input type="submit" class="button" value="确定">
				    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
				</div>
			</div>
		</div>
		</form>
	</div>
	
	<!-- 编辑岗位 -->
	<div class="modal fade" id="edi-job">
		<form method="post" action="/positionUpdate" name="group">
		<input type="hidden" name="pidkey" id="pidkeyUpdate" value="">
		
		<div class="modal-dialog">
			<div class="modal-content">
			    <div class="modal-header">
			    	<h3>编辑岗位</h3>
			    </div>
			    <div class="modal-body saeaList">
			    	<table class="table table-bordered table-condensed">
						<tr>
							<th colspan="2" class="taC">岗位信息</th>
						</tr>
						<tr>
							<th class="taC">岗位名称</th>
							<td><input name="positionName" id="positionNameEdi" value="" type="text"></td>
						</tr>
						<tr>
							<th class="taC">岗位描述</th>
							<td><textarea name="positionDescribe" id="positionDescribeEdi"></textarea></td>
						</tr>
			    	</table>
					<table class="table table-bordered table-condensed">
						<tbody>
						<tr>
							<th colspan="4" class="taC">工资模板</th>
						</tr>
						<tr>
							<th class="taC" width="150">基本工资</th>
							<td><input name="baseWage" id="baseWageEdi" value="" type="number" style="width:150px"></td>
							<th class="taC" width="150">岗位工资</th>
							<td><input name="postWage" id="postWageEdi" value="" type="number" style="width:150px"></td>
						</tr>
						<tr>
							<th class="taC" width="150">绩效奖金</th>
							<td><input name="achievementBonus" id="achievementBonusEdi" value="" type="number" style="width:150px"></td>
							<th class="taC" width="150"></th><td></td>
						</tr>
					</tbody>
					</table>
			    </div>
				<div class="modal-footer">
					<input type="submit" class="button" value="确定">
				    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
				</div>
			</div>
		</div>
		</form>
	</div>
	
	
	<!--岗位下人员列表-->
	<div class="modal fade" id="job-em">
		<div class="modal-dialog">
			<div class="modal-content">
			    <div class="modal-header">
			    	<h3><span id="positionNameHtml">开发员</span> 所有员工</h3>
			    </div>
			    <div class="modal-body saeaList">
			    	<table class="table table-bordered table-condensed" id="positionStaffHTMl">
						
						
			    	</table>
			    </div>
				<div class="modal-footer">
				    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
				</div>
			</div>
		</div>
	</div>
	<!--删除确认-->
	<div class="modal fade" id="del">
	
	<form method="post" action="/positionDelete" name="group">
		<input type="hidden" name="pidkey" id="pidkeyDel" value="">
		<div class="modal-dialog">
			<div class="modal-content">
			    <div class="modal-header">
			    	<h3>删除岗位</h3>
			    </div>
			    <div class="modal-body saeaList">
			    	<h4 id="delPositionHtml">是否删除岗位“未知”</h4>
			    </div>
				<div class="modal-footer">
					<input type="submit" class="button" value="删除">
				    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
				</div>
			</div>
		</div>
		
		</form>
		
	</div>
<script type="text/javascript">autoFlashHeight();</script>
<script type="text/javascript">$('#need-data').modal('show2')</script>
</body>
