caipin преди 6 години
родител
ревизия
35d7f84181

+ 20 - 11
global/css/global.css

@@ -3830,21 +3830,23 @@ td div.dlLev3{
   color:#fff;
   border-radius: 6px;
 }
-.tipFather{
+.tipContent{
   position:relative;
+  display:inline-block;
 }
-.tipContent{
+.tipContent .tipConactive{
+  display:none;
+}
+.tipContent:hover .tipConactive{
   position:absolute;
-  top:25px;
-  left:45px;
+  display:block;
+  top:20px;
+  left:0px;
+  width:250px;
   background:#fff;
-  border:1px solid #ccc;
-  padding:5px 8px;
-  border-radius: 3px;
-  z-index: 99px;
-}
-.tipConactive{
-  display:none;
+  padding:10px;
+  border:1px solid #eee;
+  z-index:99;
 }
 .globalNotice-staff{
   background-clip: padding-box;
@@ -3873,4 +3875,11 @@ td div.dlLev3{
   color: #856404;
   background-color: #fff3cd;
   border-color: #ffeeba;
+}
+.versionTabale{
+  width:100%;
+}
+.versionTabale tr th,.versionTabale tr td{
+  padding:8px 15px;
+  border-bottom: 1px solid #f1f1f1;
 }

+ 5 - 5
global/js/global.js

@@ -76,11 +76,11 @@ $("#closeST").click(function(){
 });
 
 
-$('.tipFather').hover(function() {
-    $(".tipContent").removeClass('tipConactive');
-    }, function() {
-    $(".tipContent").addClass('tipConactive');
-});
+// $('.tipFather').hover(function() {
+//     $(".tipContent").removeClass('tipConactive');
+//     }, function() {
+//     $(".tipContent").addClass('tipConactive');
+// });
 
 $(".sortAddup").hover(function () {
     $(this).siblings("ul,div").animate({opacity:'0.2'},0);

+ 80 - 0
global/js/humanResource.js

@@ -154,6 +154,35 @@ $(function() {
 		});
 	});
 	
+	//获得晋升审批数据
+	$("a[node-approvalsPromote]").click(function(){
+		var sidkey=$(this).attr('node-sidKey');
+		var type='STAFF';
+		
+		var url = "/ajaxGetStaffInfoByType";
+		$.ajax({
+			url : url,
+			type : "post",
+			cache : false,
+			dataType : "json",
+			data : {
+				serial : sidkey,
+				type:type
+			},
+			global : true,
+			success : function(data) {
+				if (data.status == 1) {
+					$("#sidKeyPromote").val(data.sidKey);
+					$("#staffDetailP").html(data.html);
+				} else
+					$("div[loading-msg='true']").html("illegal request");
+			},
+			error : function(err) {
+				$("div[loading-msg='true']").html("");
+			}
+		});
+	});
+	
 	//获得员工更新数据
 	$("a[node-employeeInfo]").click(function(){
 		var sidkey=$(this).attr('node-sidKey');
@@ -479,6 +508,57 @@ $(function() {
 		});
 	});
 	
+	$("a[node-Promotion]").click(function(){
+		var sidkey=$(this).attr('node-sidKey');
+		
+		var url = "/ajaxGetPromotionStaffByPid";
+		$.ajax({
+			url : url,
+			type : "post",
+			cache : false,
+			dataType : "json",
+			data : {
+				sidkey : sidkey
+			},
+			global : true,
+			success : function(data) {
+				if (data.status == 1) {
+					
+					
+					$("#sidKeyPromote").val(data.detail.sidKey);
+					$("#staffPromotionHtml").html(data.html);
+					//data.detail.positionId
+					//$("#positionStaffSelect").find("option[text='程序员']").attr("selected",true);
+					
+					$("#positionStaffSelect").find("option[value='"+data.detail.positionIdKey+"_"+data.detail.positionDetail.positionName+"']").attr("selected",'selected');
+					
+					$("#promotionBaseWage").val(data.detail.positionDetail.baseWage);
+					$("#promotionpostWage").val(data.detail.positionDetail.postWage);
+					$("#promotionAchievementBonus").val(data.detail.positionDetail.achievementBonus);
+				} else
+					$("#staffPromotionHtml").html("illegal request");
+			},
+			error : function(err) {
+			}
+		});
+	});
+	
+	
+	$("#positionStaffSelect").change(function(){
+		
+		var nodeWages=$("option:selected", this).attr("node-wages");
+		var nw=nodeWages.split("_");
+		
+		//var nodeWages=$(this).attr('node-wages');
+		//console.log(nw);
+		
+		$("#promotionBaseWage").val(nw[1]);
+		$("#promotionpostWage").val(nw[1]);
+		$("#promotionAchievementBonus").val(nw[1]);
+		
+	
+	});
+	
 	
 })
 

+ 7 - 1
protected/config/routes.conf.php

@@ -580,13 +580,19 @@ $route['post']['/employeRegularApprovalsAdd'] = array('HumanResourceController',
 $route['post']['/employeRegularCCAdd'] = array('HumanResourceController', 'employeRegularCCAdd');
 
 $route['get']['/promoteApprovals'] = array('HumanResourceController', 'promoteApprovals');
-
+$route['post']['/promoteApprovalsAdd'] = array('HumanResourceController', 'promoteApprovalsAdd');
+$route['post']['/promoteApprovalsCCAdd'] = array('HumanResourceController', 'promoteApprovalsCCAdd');
 
 
 $route['post']['/ajaxGetStaffInfoByType'] = array('HumanResourceController', 'ajaxGetStaffInfoByType');
 $route['post']['/ajaxGetStaffInfoBySid'] = array('HumanResourceController', 'ajaxGetStaffInfoBySid');
 $route['post']['/ajaxGetDistrictByLv1'] = array('HumanResourceController', 'ajaxGetDistrictByLv1');
 
+//晋升
+$route['post']['/ajaxGetPromotionStaffByPid'] = array('HumanResourceController', 'ajaxGetPromotionStaffByPid');
+$route['post']['/appliedPromote'] = array('HumanResourceController', 'appliedPromote');
+
+
 
 //人资权限管理
 $route['*']['/hrEmployeeApprovalsSetting'] = array('HumanResourceController', 'hrEmployeeApprovalsSetting');

+ 378 - 42
protected/controller/HumanResourceController.php

@@ -25,7 +25,8 @@ class HumanResourceController extends DooController {
 		$detail = $staff->getStaffBySid ( $_COOKIE ["staff"] );
 		
 		if ($detail ['sid'] != superHR) {
-			$accessModular = 'HR';$flag = true;
+			$accessModular = 'HR';
+			$flag = true;
 			if (empty ( $detail ['cldAccessArray'] ))
 				die ( 'illegal request1' );
 			else {
@@ -45,7 +46,7 @@ class HumanResourceController extends DooController {
 				}
 			}
 			
-			if ( $flag)
+			if ($flag)
 				die ( 'illegal request3' );
 		} else {
 			$this->data ['isALLHR'] = true;
@@ -378,6 +379,116 @@ class HumanResourceController extends DooController {
 	}
 	
 	/**
+	 * 员工晋升审批
+	 */
+	function employeePromoteApprovals() {
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		Doo::loadModel ( 'staffManage' );
+		$staffManage = new staffManage ();
+	
+		$sidKey = $this->get_args ( 'sidKey' ) ? $this->get_args ( 'sidKey' ) : "";
+	
+		$sid = $XDeode->decode ( $sidKey );
+		if (! is_numeric ( $sid ) || empty ( $sid ))
+			die ( 'illegal request' );
+	
+			$staffDetail = $staff->getOne ( array (
+					'where' => 'pendStatus=2 and sid=' . $sid . ' and pendingApprovals=' . $this->staff ['sid'],
+					'asArray' => true
+			) );
+	
+			if (empty ( $staffDetail ))
+				die ( 'illegal request' );
+	
+				$processApprovals = json_decode ( $staffDetail ['processApprovals'], true );
+				$invoiceManage = json_decode ( $staffDetail ['staffManage'], true );
+	
+				$staff = new staff ();
+				if (empty ( $processApprovals )) {
+					$processApprovals = array (
+							$this->staff ['sid'] => array (
+									'date' => date ( "Y-m-d H:i:s" )
+							)
+					);
+					$nextInvoiceManage = next ( $invoiceManage );
+						
+					if ($nextInvoiceManage !== false)
+						$staff->pendingApprovals = $nextInvoiceManage [0];
+						$staff->processApprovals = json_encode ( $processApprovals );
+				} else {
+					$processApprovals [$this->staff ['sid']] = array (
+							'date' => date ( "Y-m-d H:i:s" )
+					);
+						
+					$pendingApprovals = 0;
+					foreach ( $invoiceManage as $key => $value ) {
+						if ($value [0] == $this->staff ['sid']) {
+							if (isset ( $invoiceManage [$key + 1] ))
+								$pendingApprovals = $invoiceManage [$key + 1] [0];
+								break;
+						}
+					}
+						
+					if (! empty ( $pendingApprovals ))
+						$staff->pendingApprovals = $pendingApprovals;
+						$staff->processApprovals = json_encode ( $processApprovals );
+				}
+	
+				if (count ( $processApprovals ) == count ( $invoiceManage )) {
+					$staff->pendStatus = 0;
+					$staff->pendingApprovals = 0;
+					$staff->InductionDate = date ( "Y-m-d H:i:s" );
+						
+					if ($staffDetail ['nature'] == 2)
+						$staffDetail->practiceDate = date ( "Y-m-d H:i:s" );
+						if ($staffDetail ['nature'] == 3)
+							$staffDetail->probationaryDate = date ( "Y-m-d H:i:s" );
+								
+							$passwork = mt_rand ( 100000, 999999 );
+							$staff->passwork = md5 ( $passwork );
+								
+							if (! empty ( $staffDetail ['telephone'] ) && is_numeric ( $staffDetail ['telephone'] )) {
+								Doo::loadClass ( 'Human.func' );
+								$msg = $staffDetail ['username'] . ',' . $passwork;
+								send_sms ( 17280, $staffDetail ['telephone'], '{"%msg%":"' . $msg . '"}' );
+							}
+				}
+	
+				$staff->updateDate = date ( "Y-m-d H:i:s" );
+				$staff->update ( array (
+						'where' => 'sid=' . $sid
+				) );
+	
+				// 操作日志
+				Doo::loadModel ( 'staffOperationLog' );
+				$staffOperationLog = new staffOperationLog ();
+				$nature = '';
+				if ($staffDetail ['nature'] == 2) {
+					$nature = '实习';
+				} elseif ($staffDetail ['nature'] == 3) {
+					$nature = '试用';
+				}
+	
+				$item = array (
+						'date' => date ( "Y-m-d H:i:s" ),
+						'operation' => $this->staff ['username'] . "  审批通过" . $staffDetail ['username'] . $nature . "入职",
+						'status' => 3,
+						'img' => $staffDetail ['avatar'],
+						'username' => $staffDetail ['username'],
+						'uid' => $staffDetail ['sid'],
+						'category' => $staffDetail ['category']
+				);
+	
+				$staffOperationLog->setInvoiceOperationLog ( $item );
+	
+				return '/hr';
+	}
+	
+	
+	/**
 	 * 员工信息
 	 */
 	function hrEmployee() {
@@ -413,9 +524,9 @@ class HumanResourceController extends DooController {
 		elseif ($nature == 'FORMAL')
 			$con .= ' and  nature=1';
 		elseif ($nature == 'TRIAL')
-			$con .= ' and  nature=2';
-		elseif ($nature == 'PRACTICE')
 			$con .= ' and  nature=3';
+		elseif ($nature == 'PRACTICE')
+			$con .= ' and  nature=2';
 		
 		if ($cid_did != 'ALL') {
 			$department = explode ( '_', $cid_did );
@@ -465,15 +576,12 @@ class HumanResourceController extends DooController {
 		$jobNumber = $this->createJobNumber ();
 		// 获得办事和部门
 		$categoryList = $L_category->getCategoryDepartment ();
-		//获得岗位
+		// 获得岗位
 		$listPosition = $position->getPositionByAll ();
 		
-		
-		
 		$monthstart = date ( 'm.d', mktime ( 0, 0, 0, date ( 'm' ), 1, date ( 'Y' ) ) );
 		$monthend = date ( 'm.d', mktime ( 0, 0, 0, date ( 'm' ) + 1, 0, date ( 'Y' ) ) );
 		
-		
 		$this->data ['listPosition'] = $listPosition;
 		$this->data ['onJobCount'] = $onJobCount;
 		$this->data ['inJobCount'] = $inJobCount;
@@ -508,7 +616,7 @@ class HumanResourceController extends DooController {
 		$achievementBonus = is_numeric ( $this->get_args ( 'achievementBonus' ) ) ? $this->get_args ( 'achievementBonus' ) : 0;
 		$gender = $this->get_args ( 'gender' ) ? $this->get_args ( 'gender' ) : '';
 		
-		if (! empty ( $username ) && ! empty ( $nature ) && ! empty ( $cid_did ) && ! empty ( $position ) && ! empty ( $hiredate ) && ! empty ( $baseWage ) && ! empty ( $postWage )) {
+		if (! empty ( $username ) && ! empty ( $nature ) && ! empty ( $cid_did ) && ! empty ( $position ) && ! empty ( $hiredate ) && ! empty ( $baseWage )) {
 			
 			Doo::loadClass ( 'XDeode' );
 			$XDeode = new XDeode ( 5 );
@@ -533,8 +641,8 @@ class HumanResourceController extends DooController {
 			
 			$position = explode ( '_', $position );
 			
-			$staff->position = $position[1];
-			$staff->positionId = $position[0];
+			$staff->position = $position [1];
+			$staff->positionId = $position [0];
 			
 			$department = explode ( '_', $cid_did );
 			
@@ -963,6 +1071,80 @@ class HumanResourceController extends DooController {
 	}
 	
 	/**
+	 * 申请晋升
+	 */
+	function appliedPromote() {
+		
+		$sidKey = $this->get_args ( 'sidKey' ) ? $this->get_args ( 'sidKey' ) : "";
+		
+		$position = $this->get_args ( 'position' ) ? $this->get_args ( 'position' ) : '';
+	
+		$baseWage = is_numeric ( $this->get_args ( 'baseWage' ) ) ? $this->get_args ( 'baseWage' ) : 0;
+		$postWage = is_numeric ( $this->get_args ( 'postWage' ) ) ? $this->get_args ( 'postWage' ) : 0;
+		$achievementBonus = is_numeric ( $this->get_args ( 'achievementBonus' ) ) ? $this->get_args ( 'achievementBonus' ) : 0;
+		
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		Doo::loadModel ( 'promoteManage' );
+		$staffLeaveManage = new promoteManage ();
+		
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		
+		$sid = $XDeode->decode ( $sidKey );
+		
+		$detail = $staff->getStaffBySid ( $sid );
+		
+		$item = array (
+				'sid' => $sid,
+				'appliedPromote'=>$position.'_'.$baseWage.'_'.$postWage.'_'.$achievementBonus,
+				// 状态改成申请晋升
+				'pendStatus' => 6 
+		);
+		$staff->setStaffByCondition ( $item );
+		
+		// 离职审批组
+		// 获得审批组KEY
+		$staff = new staff ();
+		$cidMode = $this->staff ['cid'];
+		if (! empty ( $this->staff ['departmentID'] ))
+			$cidMode = $this->staff ['cid'] . '_' . $this->staff ['departmentID'];
+		
+		$staffManageDetail = $staffLeaveManage->getStaffManageByCid ( $cidMode );
+		if (empty ( $staffManageDetail ))
+			die ( 'illegal request ' );
+		
+		$pendingApprovalsSid = current ( $staffManageDetail ['staffList'] ) [0];
+		if (empty ( $pendingApprovalsSid ))
+			die ( 'illegal request ' );
+		
+		$staff->pendingApprovalsLeave = $pendingApprovalsSid;
+		$staff->staffManageLeave = $staffManageDetail ['staff'];
+		$staff->processApprovalsLeave = '';
+		$staff->sid = $sid;
+		
+		// 抄送组
+		$staff->processLeaveCC = $staffManageDetail ['CC'];
+		$staff->update ();
+		
+		// 操作日志
+		Doo::loadModel ( 'staffOperationLog' );
+		$staffOperationLog = new staffOperationLog ();
+		$item = array (
+				'date' => date ( "Y-m-d H:i:s" ),
+				'status' => 3,
+				'img' => $detail ['avatar'],
+				'username' => $detail ['username'],
+				'operation' => "申请晋升",
+				'uid' => $detail ['sid'],
+				'category' => $detail ['category'] 
+		);
+		$staffOperationLog->setInvoiceOperationLog ( $item );
+		
+		return '/hrEmployee';
+	}
+	
+	/**
 	 * 确认在入职
 	 */
 	function employeeReentry() {
@@ -1550,7 +1732,7 @@ class HumanResourceController extends DooController {
 	/**
 	 * 晋升流程设置
 	 */
-	function promoteApprovals(){
+	function promoteApprovals() {
 		Doo::loadModel ( 'staff' );
 		$staff = new staff ();
 		Doo::loadModel ( 'L_category' );
@@ -1562,7 +1744,7 @@ class HumanResourceController extends DooController {
 		$categoryList = $L_category->getCategoryDepartment ();
 		
 		$staffManageList = $staffManage->find ( array (
-				'asArray' => true
+				'asArray' => true 
 		) );
 		
 		foreach ( $staffManageList as $key => $value ) {
@@ -1575,7 +1757,7 @@ class HumanResourceController extends DooController {
 				}
 			}
 			$employeeApprovals = implode ( '->', $employeeApprovals );
-				
+			
 			// 抄送人员
 			$name = json_decode ( $value ['CC'] );
 			$CC = array ();
@@ -1585,23 +1767,23 @@ class HumanResourceController extends DooController {
 				}
 			}
 			$CC = implode ( ' ', $CC );
-				
+			
 			foreach ( $categoryList as $k => $v ) {
 				$cid = $v ['cid'];
 				if (isset ( $v ['did'] ))
 					$cid .= '_' . $v ['did'];
-					if ($cid == $value ['cid']) { // echo $cid.'//';echo $value['cid'].'<br/>';
-						$categoryList [$k] ['employeeApprovals'] = $employeeApprovals;
-						$categoryList [$k] ['CC'] = $CC;
-						break;
-					}
+				if ($cid == $value ['cid']) { // echo $cid.'//';echo $value['cid'].'<br/>';
+					$categoryList [$k] ['employeeApprovals'] = $employeeApprovals;
+					$categoryList [$k] ['CC'] = $CC;
+					break;
+				}
 			}
 		}
 		foreach ( $categoryList as $key => $value ) {
 			if (! isset ( $value ['employeeApprovals'] ))
 				$categoryList [$key] ['employeeApprovals'] = '';
-				if (! isset ( $value ['CC'] ))
-					$categoryList [$key] ['CC'] = '';
+			if (! isset ( $value ['CC'] ))
+				$categoryList [$key] ['CC'] = '';
 		}
 		
 		// print_r($categoryList);
@@ -1617,6 +1799,115 @@ class HumanResourceController extends DooController {
 	}
 	
 	/**
+	 * 添加晋升审批人员
+	 */
+	function promoteApprovalsAdd() {
+		$cidKey = $this->get_args ( 'cidKey' ) ? $this->get_args ( 'cidKey' ) : "";
+		$uidlist = $this->get_args ( 'uidlist' ) ? $this->get_args ( 'uidlist' ) : "";
+		$uidlist = explode ( ",", $uidlist );
+		
+		if (! empty ( $cidKey ) && ! empty ( $uidlist )) {
+			Doo::loadModel ( "promoteManage" );
+			$staffManage = new promoteManage ();
+			Doo::loadClass ( 'XDeode' );
+			$XDeode = new XDeode ( 5 );
+			
+			// 获得抄送内容
+			$approvalKey = explode ( '_', $cidKey );
+			$cidMode = array ();
+			foreach ( $approvalKey as $value ) {
+				$cid = $XDeode->decode ( $value );
+				array_push ( $cidMode, $cid );
+			}
+			
+			$cidMode = implode ( '_', $cidMode );
+			// echo $cidMode;die;
+			$staffManageInfo = $staffManage->getOne ( array (
+					'where' => 'cid ="' . $cidMode . '" ',
+					'asArray' => true 
+			) );
+			
+			// 审批人员
+			$list = array ();
+			foreach ( $uidlist as $key => $value ) {
+				$info = explode ( ":", $value );
+				array_push ( $list, $info );
+			}
+			
+			if (empty ( $staffManageInfo )) {
+				$staffManage = new promoteManage ();
+				
+				$staffManage->cid = $cidMode;
+				$staffManage->staff = json_encode ( $list );
+				
+				$staffManage->insert ();
+			} else {
+				$staffManage = new promoteManage ();
+				
+				$staffManage->staff = json_encode ( $list );
+				$staffManage->update ( array (
+						'where' => 'icid = ' . $staffManageInfo ['icid'] 
+				) );
+			}
+			return '/promoteApprovals';
+		}
+		die ( 'illegal request' );
+	}
+	
+	/**
+	 * 添加抄送员工,微信通知
+	 */
+	function promoteApprovalsCCAdd() {
+		$cidKey = $this->get_args ( 'cidKey' ) ? $this->get_args ( 'cidKey' ) : "";
+		$staff = $this->get_args ( 'staff' ) ? $this->get_args ( 'staff' ) : "";
+		
+		if (! empty ( $cidKey ) && ! empty ( $staff )) {
+			Doo::loadModel ( "promoteManage" );
+			$staffManage = new promoteManage ();
+			Doo::loadClass ( 'XDeode' );
+			$XDeode = new XDeode ( 5 );
+			
+			// 获得抄送内容
+			$approvalKey = explode ( '_', $cidKey );
+			$cidMode = array ();
+			foreach ( $approvalKey as $value ) {
+				$cid = $XDeode->decode ( $value );
+				array_push ( $cidMode, $cid );
+			}
+			
+			$cidMode = implode ( '_', $cidMode );
+			$staffManageInfo = $staffManage->getOne ( array (
+					'where' => 'cid ="' . $cidMode . '" ',
+					'asArray' => true 
+			) );
+			
+			$list = array ();
+			foreach ( $staff as $key => $value ) {
+				$info = explode ( ":", $value );
+				array_push ( $list, $info );
+			}
+			
+			if (empty ( $staffManageInfo )) {
+				$staffManage = new promoteManage ();
+				
+				$staffManage->cid = $cidMode;
+				$staffManage->CC = json_encode ( $list );
+				
+				$staffManage->insert ();
+			} else {
+				$staffManage = new promoteManage ();
+				
+				$staffManage->CC = json_encode ( $list );
+				$staffManage->update ( array (
+						'where' => 'icid = ' . $staffManageInfo ['icid'] 
+				) );
+			}
+			return '/promoteApprovals';
+		}
+		die ( 'illegal request' );
+	}
+	
+	/**
 	 * 员工权限管理
 	 */
 	function hrEmployeeApprovalsSetting() {
@@ -1908,21 +2199,20 @@ class HumanResourceController extends DooController {
 		Doo::loadModel ( 'staff' );
 		$staff = new staff ();
 		$list = $staff->getStaffByPositionId ();
-		$html ='<tr><th class="taC">办事处</th><th class="taC">姓名</th><th class="taC">入职时间</th></tr>';
+		$html = '<tr><th class="taC">办事处</th><th class="taC">姓名</th><th class="taC">入职时间</th></tr>';
 		foreach ( $list as $key => $value ) {
 			
 			// seniorityFormula
 			$seniorityFormula = json_decode ( $value ['seniorityFormula'], true );
-			if (!isset($seniorityFormula[0]))
-				$seniorityFormula[0]['InductionDate']=0;
+			if (! isset ( $seniorityFormula [0] ))
+				$seniorityFormula [0] ['InductionDate'] = 0;
 			$html .= '<tr>
-				<td>' . $value ['category'] . '</td><td>' . $value ['username'] . '</td><td>' . $seniorityFormula[0]['InductionDate'] . '</td>
+				<td>' . $value ['category'] . '</td><td>' . $value ['username'] . '</td><td>' . $seniorityFormula [0] ['InductionDate'] . '</td>
 			</tr>';
-			
 		}
 		echo json_encode ( array (
 				'status' => 1,
-				'html' => $html
+				'html' => $html 
 		) );
 		die ();
 	}
@@ -2128,7 +2418,7 @@ class HumanResourceController extends DooController {
 			
 			// 获得办事和部门
 			$categoryList = $L_category->getCategoryDepartment ();
-			//获得岗位
+			// 获得岗位
 			$listPosition = $position->getPositionByAll ();
 			
 			$sid = $XDeode->decode ( $serial );
@@ -2172,20 +2462,18 @@ class HumanResourceController extends DooController {
 							<th class="taC  " width="150">岗位</th><td >
 						<select name="position" id="position">
 						';
-						
-						foreach ($listPosition as $key=>$value){
-							
-							$positionPid=$XDeode->decode ( $value ['pidKey'] );
-							if($detail['positionId']==$positionPid){
-								$html .='<option selected value="'.$value['pidKey'].'_'.$value['positionName'].'">'.$value['positionName'].'</option>';
-							}else{
-								$html .='<option value="'.$value['pidKey'].'_'.$value['positionName'].'">'.$value['positionName'].'</option>';
-							}
-							
-						}
 				
-						
-						$html .= '
+				foreach ( $listPosition as $key => $value ) {
+					
+					$positionPid = $XDeode->decode ( $value ['pidKey'] );
+					if ($detail ['positionId'] == $positionPid) {
+						$html .= '<option selected value="' . $value ['pidKey'] . '_' . $value ['positionName'] . '">' . $value ['positionName'] . '</option>';
+					} else {
+						$html .= '<option value="' . $value ['pidKey'] . '_' . $value ['positionName'] . '">' . $value ['positionName'] . '</option>';
+					}
+				}
+				
+				$html .= '
 								</select>
 								</td>
 						</tr>
@@ -2657,6 +2945,54 @@ target="_blank">反面(照片)</a>
 	}
 	
 	/**
+	 */
+	function ajaxGetPromotionStaffByPid() {
+		$sidkey = $this->get_args ( 'sidkey' ) ? $this->get_args ( 'sidkey' ) : "";
+		
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		Doo::loadModel ( 'position' );
+		$position = new position ();
+		
+		$listPosition = $position->getPositionByAll ();
+		$detail = $staff->getStaffBySid ( $sidkey );
+		// print_r($deta);
+		$html = '<table class="table table-bordered table-condensed">
+						<tr>
+							<th class="taC" width="150">工号</th><td width="210">' . $detail ['jobNumber'] . '</td>
+							<th class="taC" width="150">姓名</th><td width="210">' . $detail ['username'] . '</td>
+						</tr>
+						<tr>
+							<th class="taC" width="150">办事处/部门</th><td>' . $detail ['category'];
+		
+		if (! empty ( $detail ['department'] ))
+			$html .= '/' . $detail ['department'] ['departmentName'];
+		
+		$html .= '						</td>
+							<th class="taC" width="150">岗位</th><td>' . $detail ['positionDetail'] ['positionName'] . '</td>
+						</tr>
+						<tr>
+							<th class="taC" width="150">入职日期</th><td>' . $detail ['hiredate'] . ' <span class="colGray">已入职' . $detail ['workforce'] . '天</span></td>
+							<th class="taC" width="150">试用日期</th><td>2013-07-01</td>
+						</tr>
+						<tr>
+								<th class="taC" width="150">基本工资</th><td>' . $detail ['baseWage'] . '</td>
+								<th class="taC" width="150">岗位工资</th><td>' . $detail ['postWage'] . '</td>
+							</tr>
+							<tr>
+								<th class="taC" width="150">绩效奖金</th><td>' . $detail ['achievementBonus'] . '</td>
+								<th class="taC" width="150"></th><td></td>
+							</tr>
+						</tbody>
+					</table>';
+		echo json_encode ( array (
+				'status' => 1,
+				'detail' => $detail,
+				'html' => $html 
+		) );
+	}
+	
+	/**
 	 * 生成工号
 	 */
 	function createJobNumber() {

+ 21 - 2
protected/model/staff.php

@@ -89,6 +89,7 @@ class staff extends DooModel {
 	public $IDcardsValidity;
 	public $positionId;
 	
+	public $appliedPromote;
 	
 	public $_table = 'CLD_staff';
 	public $_primarykey = 'sid';
@@ -176,7 +177,8 @@ class staff extends DooModel {
 			'cldAccess',
 
 			'didName',
-			'positionId'
+			'positionId',
+			'appliedPromote'
 	);
 	public function checkUser($uid, $passwork) {
 		return $this->find ( array (
@@ -337,7 +339,7 @@ class staff extends DooModel {
 		$list = $this->find ( array (
 				'asc' => 'sid',
 			
-				'where' => "(pendStatus= '2' or pendStatus='3' or pendStatus='5') and (pendingApprovals ='" . $sid . "' or pendingApprovalsLeave='" . $sid . "')",
+				'where' => "(pendStatus= '2' or pendStatus='3' or pendStatus='5' or pendStatus='6') and (pendingApprovals ='" . $sid . "' or pendingApprovalsLeave='" . $sid . "')",
 				'asArray' => TRUE
 		) );
 		Doo::loadClass ( 'XDeode' );
@@ -506,10 +508,27 @@ class staff extends DooModel {
 					'where' => "sid= '" . $sid . "'",
 					'asArray' => TRUE 
 			) );
+			
+			$detail['sidKey']=$XDeode->encode ( $detail ['sid'] );
+			
 			Doo::loadModel ( 'department' );
 			$department = new department ();
 			$detail ['department'] =$department->getDepartmentByDid($detail['departmentID']);
 			
+			//获得岗位信息
+			Doo::loadModel ( 'position' );
+			$position = new position ();
+			
+			$positionIdKey=$XDeode->encode ( $detail ['positionId'] );
+			$detail ['positionIdKey']=$positionIdKey;
+			$positionDetail=$position->getPositionByPid($detail ['positionId']);
+			if(empty($positionDetail)){
+				$positionDetail['baseWage']=0;
+				$positionDetail['postWage']=0;
+				$positionDetail['achievementBonus']=0;
+				$positionDetail['positionName']='';
+			}
+			$detail ['positionDetail'] =$positionDetail;
 			
 			
 			$d1 = strtotime($detail['hiredate']);//过去的某天,你来设定

+ 2 - 1
protected/plugin/TemplateTag.php

@@ -107,7 +107,8 @@ function isHRNew(){
 			'where' => "(pendStatus= '2' or pendStatus='3' or pendStatus='5') ",
 			'asArray' => TRUE
 	) );
-	echo count($list);
+	
+	return count($list);
 }
 
 function isInvoiceNew($type = "GLOBAL") {

+ 1 - 0
protected/view/humanResource/employeeApprovals.html

@@ -23,6 +23,7 @@
 					  <li class="active"><a href="#">入职审批</a></li>
 					  <li><a href="/leaveOfficeApprovals">离职审批</a></li>
 					  <li><a href="/regularApprovals">转正审批</a></li>
+					  <li><a href="/promoteApprovals">晋升审批</a></li>
 					</ul>
 				</div>
 				<!--入职审批-->

+ 30 - 0
protected/view/humanResource/hr.html

@@ -45,6 +45,8 @@
 									待离职
 									<!-- elseif {{staffList' value.pendStatus}}==5 -->
 									待转正
+									<!-- elseif {{staffList' value.pendStatus}}==6 -->
+									待晋升
 									<!-- endif -->
 									</td>
 									<td>
@@ -54,6 +56,8 @@
 									<a class="button btn-block" node-approvalsDimission node-sidKey="{{staffList' value.sidKey}}" href="#approvalDimission" data-toggle="modal">离职审批</a>
 									<!-- elseif {{staffList' value.pendStatus}}==5 -->
 									<a class="button btn-block" node-approvalsRegular node-sidKey="{{staffList' value.sidKey}}" href="#approvalRegular" data-toggle="modal">转正审批</a>
+									<!-- elseif {{staffList' value.pendStatus}}==6 -->
+									<a class="button btn-block" node-approvalsPromote node-sidKey="{{staffList' value.sidKey}}" href="#approvalPromote" data-toggle="modal">晋升审批</a>
 									<!-- endif -->
 									</td>
 									</tr>
@@ -172,6 +176,30 @@
 		</form>
 	</div>
 	
+	<!--弹出(审批员工晋升)-->
+	<div class="modal hide fade" id="approvalPromote">
+	<form method="post" action="/employeePromoteApprovals" name="group">
+	<input type="hidden" name="sidKey" id='sidKeyPromote'  value="">
+		
+		<div class="modal-dialog modal-xlg">
+			<div class="modal-content">
+			<div class="modal-header">
+					<h3>员工晋升审批</h3>
+				</div>
+			<div id='staffDetailP'>
+			</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="employeeInfo">
 	<form method="post" action="/staffUpdate" id="staffUpdate">
@@ -195,5 +223,7 @@
 	
 	
 	
+	
+	
 <script type="text/javascript">autoFlashHeight();</script>
 </body>

+ 50 - 0
protected/view/humanResource/hrEmployee.html

@@ -104,6 +104,8 @@
 						</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>
@@ -111,6 +113,7 @@
 							<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 -->
@@ -462,5 +465,52 @@
 			</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>

+ 2 - 1
protected/view/humanResource/hrMenu.html

@@ -2,7 +2,8 @@
 <ul>
 	<li class="staffTitle">人资管理</li>
 	<!-- if {{isHR}}||{{isALLHR}} -->
-	<li><a <!-- if {{hrMemu}}=="hr" --> class="selected" <!-- endif --> href="/hr">首页</a></li>
+	<li><a <!-- if {{hrMemu}}=="hr" -->
+	 class="selected <!-- if isHRNew() --> news <!-- endif --> " <!-- endif --> href="/hr">首页</a></li>
 	<!-- endif -->
 	
 	<!-- if {{isALLHR}} -->

+ 1 - 0
protected/view/humanResource/leaveOfficeApprovals.html

@@ -23,6 +23,7 @@
 					  <li ><a href="/employeeApprovals">入职审批</a></li>
 					  <li class="active"><a  href="#">离职审批</a></li>
 					  <li><a href="/regularApprovals">转正审批</a></li>
+					  <li ><a href="/promoteApprovals">晋升审批</a></li>
 					</ul>
 				</div>
 				<!--入职审批-->