<!-- include '../header' -->
<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>/js/humanResource.js"></script>
<link rel=stylesheet href="<?= WEB_SITE_GLOBAL ?>css/jquery.validator.css"> 
<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/jquery.validator.min.js"></script>
<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/zh-CN.js"></script>
<script src="<?= WEB_SITE_GLOBAL ?>js/hr.validator.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">
				
				<form action="/hrEmployee" id="hrEmployee" method="get" >
					<ul class="cateList">
						<li>
							<select name="pendStatus" node-pendStatus  class="select">
								<option <!-- if {{pendStatus}} == 'OTJOB'  --> selected <!-- endif --> value="OTJOB">在职</option>
								<option <!-- if {{pendStatus}} == 'LVJOB'  --> selected <!-- endif --> value="LVJOB" >离职</option>
								<option <!-- if {{pendStatus}} == 'ALL'  --> selected <!-- endif --> value="ALL" >全部</option>
							</select>
						</li>
						<li>
							<select name="nature" node-nature class="select">
								<option <!-- if {{nature}} == 'ALL'  --> selected <!-- endif --> value="ALL">全部</option>
								<option <!-- if {{nature}} == 'FORMAL'  --> selected <!-- endif --> value="FORMAL">正式</option>
								<option <!-- if {{nature}} == 'TRIAL'  --> selected <!-- endif --> value="TRIAL">试用</option>
								<option <!-- if {{nature}} == 'PRACTICE'  --> selected <!-- endif --> value="PRACTICE">实习</option>
							</select>
						</li>
						<li>
							<select name='cid_did'  node-cid_did class="select">
								<option <!-- if 'ALL' == {{cid_did}}  --> selected <!-- endif --> value="ALL">所有组织</option>
								<!-- loop categoryList -->
								<option <!-- if {{categoryList' value.cidKey}}.'_'.{{categoryList' value.didKey}} == {{cid_did}}  --> selected <!-- endif -->  value="{{categoryList' value.cidKey}}_<!-- if !empty({{categoryList' value.did}}) -->{{categoryList' value.didKey}}<!-- endif -->">{{categoryList' value.title}}<!-- if !empty({{categoryList' value.did}}) -->/{{categoryList' value.departmentName}}<!-- endif --></option>
								<!-- endloop -->
							</select>
						</li>
						<li>
							<div class="search">
								<div class="input-append">
									<input class="span3" name="MebSea" value='{{MebSea}}' placeholder="姓名、工号" type="text" style="width:100px">
									<button class="btn btn-small" node-irmmebsea="" type="submit">搜索</button>
								</div>
							</div>
						</li>
						<li>
							本月({{monthstart}}-{{monthend}})：在职{{onJobCount}}&nbsp;入职&nbsp;<a href="#">{{inJobCount}}</a>&nbsp;离职&nbsp;<a>{{leaveJobCount}}</a>
						</li>
						<li>
							<label class="checkbox"><input type="checkbox" node-setApproval> 设置权限</label>
						</li>
						<li style="float:right">
							<a href="#add-employee" data-toggle="modal" class="button">+员工</a>
						</li>
	  			</ul>
	  			</form>
	  			
	  		</div>
	  		
				<div class="saeaList">
					<table class="table table-hover">
						<tbody>
						<tr class="thead"><th width="80">工号</th><th>姓名</th><th>手机</th><th>QQ</th><th>办事处/部门</th><th>岗位</th><th>聘用状态</th><th>入职时间</th><th>操作</th></tr>
						
						<!-- loop stafflist -->
						<tr>
						<td>{{stafflist' value.jobNumber}}</td>
						<td><a href="#employeeInfo" node-employeeInfo node-sidKey="{{staffList' value.sidKey}}" data-toggle="modal">{{stafflist' value.username}}</a></td>
						<td>{{stafflist' value.telephone}}</td>
						<td>{{stafflist' value.qq}}</td>
						<td>{{stafflist' value.category}}
						<!-- if {{stafflist' value.departmentID}}!=0  -->
						/{{stafflist' value.departmentName.departmentName}}
						<!-- endif -->
						</td>
						<td>{{stafflist' value.position}}</td>
						<td>
							
							<!-- if {{stafflist' value.nature}}==1 -->
							正式
							<!-- elseif {{stafflist' value.nature}}==2 -->
							实习
							<!-- elseif {{stafflist' value.nature}}==3 -->
							试用
							<!-- elseif {{stafflist' value.nature}}==4 -->
							离职
							<!-- endif -->
							
						</td>
						<td>{{stafflist' value.hiredate}}</td>
						<td>
						
						
						<!-- if {{stafflist' value.pendStatus}}==0 -->
							<!-- if {{stafflist' value.nature}}==2 -->
							<a href="#do-probation" node-Transfer node-sidKey="{{stafflist' value.sidKey}}" data-toggle="modal">转试用</a>
							<!-- elseif {{stafflist' value.nature}}==3 -->
							<a href="#do-hire" node-TransferFORMAL node-sidKey="{{stafflist' value.sidKey}}" data-toggle="modal">转正式</a>
							<!-- endif -->
							<!-- if {{stafflist' value.nature}}!=4 -->
							<a href="#do-promotion" node-Promotion node-sidKey="{{stafflist' value.sidKey}}" data-toggle="modal">晋升</a>
							<a href="#do-dismiss" node-TransferDimission node-sidKey="{{stafflist' value.sidKey}}" data-toggle="modal">离职</a>
							<!-- endif -->
						<!-- elseif {{stafflist' value.pendStatus}}==2 -->
							待入职
						<!-- elseif {{stafflist' value.pendStatus}}==3 -->
							待离职
						<!-- elseif {{stafflist' value.pendStatus}}==5 -->
							待转正
						<!-- elseif {{stafflist' value.pendStatus}}==4 -->
							<!-- if {{stafflist' value.nature}}!=4 -->
							<a href="#do-dismiss" node-TransferDimission node-sidKey="{{stafflist' value.sidKey}}" data-toggle="modal">离职</a>
							<!-- elseif {{stafflist' value.nature}}==4 -->
							<a href="#do-return" node-TransferReentry node-sidKey="{{stafflist' value.sidKey}}" data-toggle="modal">再入职</a>
							<!-- endif -->
						<!-- endif -->
						</td>
						</tr>
						<!-- endloop -->
						</tbody>
					</table>
					
				</div>
				<div class="demandPage" style='display:none'>
					<ul class="pagination fL">
						<li><a href="#">&lt;</a></li>
						<li><a href="#">1</a></li>
						<li class="active"><a href="#">2</a></li>
						<li><a href="#">3</a></li>
						<li><a href="#">4</a></li>
						<li><a href="#">5</a></li>
						<li><a href="#">&gt;</a></li>
					</ul>
			  	</div>
			</div>
		</div>
	</div>
	<!--弹出（更新员工信息）-->
	<div class="modal hide fade" id="employeeInfo">
	<form method="post" action="/staffUpdate" id="staffUpdate">
	<input type="hidden" name="sidKey" id='sidKeyEmployeeInfo'  value="">
	<input type="hidden" name="employeeInfo"   value="hrEmployee">
		<div class="modal-dialog modal-xlg">
			<div class="modal-content">
			<div id='EMPLOYEENC'>
			</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 hide fade" id="add-employee">
		<form  action="/staffAdd" method="post" id="staffAdd" >
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<h3>添加员工</h3>
				</div>
				<div class="modal-body saeaList">
					<table class="table table-bordered table-condensed">
							<tbody>
							<tr>
								<th class="taC" width="150">聘用状态</th><td width="260">
								<select name='nature' id='nature' node-hrNature >
								<option value='2'>实习</option>
								<option value='3'>试用</option>
								
								</select>
								</td>
								<th class="taC" width="150">工号</th>
								<td>
								<input type="text" id='internStaff' value="{{jobNumber.internStaff}}" disabled>
								<input type="text" id='regularStaff' value="{{jobNumber.regularStaff}}" style='display:none' disabled>
										
								</td>
							</tr>
							<tr>
								<th class="taC">姓名</th>
								<td><input type="text" name='username' id='username' value=""></td>
								<th class="taC" width="150">性别</th>
								<td width="260">
									<label class="radio inline"><input type="radio"  name='gender'  value='男'>男</label>
									<label class="radio inline"><input type="radio" name='gender' value='女' >女</label>
								</td>
							</tr>
							
							<tr>
								<th class="taC" width="150">办事处/部门</th>
								<td>
								<select name='cid_did' id='cid_did'>
								<!-- loop categoryList -->
								<option value="{{categoryList' value.cidKey}}_<!-- if !empty({{categoryList' value.did}}) -->{{categoryList' value.didKey}}<!-- endif -->">{{categoryList' value.title}}<!-- if !empty({{categoryList' value.did}}) -->/{{categoryList' value.departmentName}}<!-- endif --></option>
								<!-- endloop -->
								</select>
								</td>
								<th class="taC" width="150">岗位</th>
								<td>
								
								<select name='position' id='positionStaffAddSelect'>
								<!-- loop listPosition -->
								<option value="{{categoryList' value.pidKey}}_{{categoryList' value.positionName}}" node-wages='{{categoryList' value.baseWage}}_{{categoryList' value.postWage}}_{{categoryList' value.achievementBonus}}' >{{categoryList' value.positionName}}</option>
								<!-- endloop -->
								</select>
								
								</td>
							</tr>
							
							<tr>
								<th class="taC" width="150">入职日期</th>
								<td><input type="date" name='hiredate' id='hiredate' value='' ></td>
								<th class="taC" width="150">手机</th>
								<td><input type="text" name='telephone' value=""></td>
							</tr>
							</tbody>
						</table>
						<table class="table table-bordered table-condensed">
							<tr>
								<th class="taC" width="150">基本工资</th>
								<td width="210"><input name='baseWage' id='promotionAddBaseWage' value="{{listPosition.0.baseWage}}" type="number"></td>
								<th class="taC" width="150">岗位工资</th>
								<td><input name='postWage' id='promotionAddpostWage' value="{{listPosition.0.postWage}}" type="number"></td>
							</tr>
							<tr>
								<th class="taC" width="150">绩效奖金</th>
								<td width="210"><input name='achievementBonus' id='promotionAddAchievementBonus' value="{{listPosition.0.achievementBonus}}" type="number"></td>
								<th class="taC" width="150"></th><td></td>
							</tr>
						</table>
						<p class="alert alert-">短信通知例子：「张三，欢迎加入纵横大家庭，请电脑打开cld.smartcost.com.cn，使用账号“张三”登录（免密码）CLD进行入职申请。」</p>
				</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 hide fade" id="do-probation">
	<form  action="/staffTransfer" method="post" id="staffTransfer" >
	<input type="hidden" name="sidKey" id='sidKeyTRIAL'  value="">
	<input type="hidden" name="nature" id='nature'  value="TRIAL">
		<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 class="taC" width="100">工号</th><td id="transferJobNumber" ></td>
						</tr>
						<tr>
							<th class="taC" width="100">姓名</th><td id="transferUsername" ></td>
						</tr>
						<tr>
							<th class="taC" width="100">办事处/部门</th><td id="transferCategory"></td>
						</tr>
						<tr>
							<th class="taC" width="100">岗位</th><td id="transferPosition"></td>
						</tr>
						<tr>
							<th class="taC" width="100">入职日期</th>
							<td ><span id="transferHiredate"></span><span class="colGray" id="transferHiredate2" ></span></td>
						</tr>
					</table>
					<p class="alert">确认该员工实习转试用。</p>
				</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 hide fade" id="do-hire">
	
	<form  action="/staffTransfer" method="post" id="staffTransfer" >
	<input type="hidden" name="sidKey" id='sidKeyREGULARS'  value="">
	<input type="hidden" name="nature" id='nature'  value="REGULARS">
		<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 class="taC" width="100">工号</th><td id="formalJobNumber" ></td>
						</tr>
						<tr>
							<th class="taC" width="100">姓名</th><td id="formalUsername"></td>
						</tr>
						<tr>
							<th class="taC" width="100">办事处/部门</th><td id="formalCategory"></td>
						</tr>
						<tr>
							<th class="taC" width="100">岗位</th><td id="formalPosition"></td>
						</tr>
						<tr>
							<th class="taC" width="100">入职日期</th>
							<td ><span id="formalHiredate"></span><span class="colGray" id="formalHiredate2" ></span></td>
						</tr>
						<tr>
							<th class="taC" width="100">试用日期</th><td id="formalProbationaryDate"></td>
						</tr>
					</table>
					<p class="alert">确认该员工试用转正式。</p>
				</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 hide fade" id="do-dismiss">
	<form  action="/employeeDismiss" method="post" id="staffDismiss" >
		<input type="hidden" name="sidKey" id='sidKeyDismiss'  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 class="taC" width="100">工号</th><td id="DimissionJobNumber" ></td>
						</tr>
						<tr>
							<th class="taC" width="100">姓名</th><td id="DimissionUsername" ></td>
						</tr>
						<tr>
							<th class="taC" width="100">办事处/部门</th><td id="DimissionCategory"></td>
						</tr>
						<tr>
							<th class="taC" width="100">岗位</th><td id="DimissionPosition"></td>
						</tr>
						<tr>
							<th class="taC" width="100">入职日期</th>
							<td ><span id="DimissionHiredate"></span><span class="colGray" id="DimissionHiredate2" ></span></td>
						</tr>
						
						<tr>
							<th class="taC" width="100">离职日期</th>
							<td ><input type="date" name='applyLeaveDate' id='applyLeaveDate2' value='' ></td>
						</tr>
						
					</table>
					<p class="alert alert-erro">确认该员工离职。</p>
				</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 hide fade" id="do-return">
	<form  action="/employeeReentryApply" method="post" id="staffReentry" >
		<input type="hidden" name="sidKey" id='sidKeyReentry'  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 class="taC" width="100">工号</th><td id="ReentryJobNumber" ></td>
						</tr>
						<tr>
							<th class="taC" width="100">姓名</th><td id="ReentryUsername" ></td>
						</tr>
						<tr>
							<th class="taC" width="100">办事处/部门</th><td id="ReentryCategory"></td>
						</tr>
						<tr>
							<th class="taC" width="100">岗位</th><td id="ReentryPosition"></td>
						</tr>
						<tr>
							<th class="taC" width="100">离职日期</th>
							<td ><span id="ReentryHiredate"></span><span class="colGray" id="ReentryHiredate2" ></span></td>
						</tr>
						
					</table>
					<p class="alert">申请该员工再入职。</p>
				</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 hide fade" id="authority">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<h3>设置主权限</h3>
				</div>
				<div class="modal-body saeaList">
					<label class="checkbox inline"><input type="checkbox"> 信息中心</label>
					<label class="checkbox inline"><input type="checkbox"> 通讯录</label>
					<label class="checkbox inline"><input type="checkbox"> 在线锁库</label>
					<label class="checkbox inline"><input type="checkbox"> 报销单</label>
					<label class="checkbox inline"><input type="checkbox"> 发票申请</label>
					<label class="checkbox inline"><input type="checkbox"> 人资管理 </label>
				</div>
				<div class="modal-footer">
					<a href="#" class="button">确定</a>
					<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
				</div>
			</div>
		</div>
	</div>
	<!--弹出（设置主权限）-->
	<div class="modal hide fade" id="province">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<h3>设置通讯录 权限</h3>
				</div>
				<div class="modal-body saeaList">
					<label class="checkbox inline"><input type="checkbox"> 广东省</label>
					<label class="checkbox inline"><input type="checkbox"> 广西自治区</label>
					<label class="checkbox inline"><input type="checkbox"> 湖南省</label>
					<label class="checkbox inline"><input type="checkbox"> 湖北省</label>
				</div>
				<div class="modal-footer">
					<a href="#" class="button">确定</a>
					<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
				</div>
			</div>
		</div>
	</div>
	
	
	<!--弹出（晋升）-->
	<div class="modal hide fade" id="do-promotion">
	<form  action="/appliedPromote" method="post" id="staffReentry" >
		<input type="hidden" name="sidKey" id='sidKeyPromote'  value="">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<h3>员工晋升</h3>
				</div>
				<div class="modal-body saeaList">
					<div id="staffPromotionHtml">
					
					</div>
					
					
					<table class="table table-bordered table-condensed">
						<tr>
							<th class="taC" width="150">晋升岗位</th><td colspan="3">
							<select name='position' id='positionStaffSelect'>
								<!-- loop listPosition -->
								<option value="{{categoryList' value.pidKey}}_{{categoryList' value.positionName}}" node-wages='{{categoryList' value.baseWage}}_{{categoryList' value.postWage}}_{{categoryList' value.achievementBonus}}'>{{categoryList' value.positionName}}</option>
								<!-- endloop -->
								</select>
							</td>
						</tr>
						<tr>
							<th class="taC" width="150">基本工资</th><td><input value="" id="promotionBaseWage" name='baseWage' type="number" style="width:150px"></td>
							<th class="taC" width="150">岗位工资</th><td><input value="" id="promotionpostWage" name='postWage' type="number" style="width:150px"></td>
						</tr>
						<tr>
							<th class="taC" width="150">绩效奖金</th><td><input value="" id="promotionAchievementBonus" name='achievementBonus' type="number" style="width:150px"></td>
							<th class="taC" width="150"></th><td></td>
						</tr>
					</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>	
	
<script type="text/javascript">autoFlashHeight();</script>
</body>
