Browse Source

人资相关功能上传

caipin 6 years atrás
parent
commit
c5a500b112

+ 2 - 1
global/js/humanResource.js

@@ -348,6 +348,7 @@ $(function() {
 					$("#DimissionPosition").html(data.detail.position);
 					$("#DimissionHiredate").html(data.detail.hiredate);
 					$("#DimissionHiredate2").html(' 已入职 '+data.detail.workforce+' 天');
+					$("#applyLeaveDate2").val(data.detail.applyLeaveDate);
 					
 				} else
 					$("div[loading-msg='true']").html("illegal request");
@@ -384,7 +385,7 @@ $(function() {
 					$("#ReentryCategory").html(cateDepart);
 					
 					$("#ReentryPosition").html(data.detail.position);
-					$("#ReentryHiredate").html(data.detail.hiredate);
+					$("#ReentryHiredate").html(data.detail.dimissionDate);
 					$("#ReentryHiredate2").html(' 已离职 '+data.detail.workforceDimission+' 天');
 					
 				} else

+ 3 - 0
protected/config/acl.conf.php

@@ -476,6 +476,9 @@ $acl ['HR'] ['allow'] = array (
 				'employeeRegularApprovals',
 				'ajaxGetPositionByPid',
 				'ajaxGetStaffByPid',
+				'reentryApprovalsAdd',
+				'employeeReentryApply',
+				'employeeReentryApprovals',
 				
 		)
 );

+ 73 - 23
protected/controller/HumanResourceController.php

@@ -13,7 +13,7 @@ class HumanResourceController extends DooController {
 		$detail = $staff->getStaffBySid ( $_COOKIE ["staff"] );
 		
 		// 拥有豁免权限
-		if ($action == 'appliedEntry' || $action == 'appliedDimission' || $action == 'appliedRegular' || $detail ['sid'] == superHR) {
+		if ($action == 'appliedEntry' || $action == 'appliedDimission' || $action == 'appliedRegular'|| $action == 'reentryApprovals' || $detail ['sid'] == superHR) {
 			return '';
 		}
 		
@@ -1197,7 +1197,10 @@ class HumanResourceController extends DooController {
 	 */
 	function appliedDimission() {
 		$dimissionReason = $this->get_args ( 'dimissionReason' ) ? $this->get_args ( 'dimissionReason' ) : '';
-		if (empty ( $dimissionReason ))
+		$applyLeaveDate = $this->get_args ( 'applyLeaveDate' ) ? $this->get_args ( 'applyLeaveDate' ) : '';
+		
+		
+		if (empty ( $dimissionReason )||empty($applyLeaveDate))
 			die ( 'illegal request' );
 		Doo::loadModel ( 'staff' );
 		$staff = new staff ();
@@ -1230,7 +1233,7 @@ class HumanResourceController extends DooController {
 		$staff->staffManageLeave = $staffManageDetail ['staff'];
 		$staff->processApprovalsLeave = '';
 		$staff->sid = $this->staff ['sid'];
-		
+		$staff->applyLeaveDate=$applyLeaveDate;
 		// 抄送组
 		$staff->processLeaveCC = $staffManageDetail ['CC'];
 		$staff->update ();
@@ -1259,8 +1262,10 @@ class HumanResourceController extends DooController {
 	 */
 	function employeeDismiss() {
 		$sidKey = $this->get_args ( 'sidKey' ) ? $this->get_args ( 'sidKey' ) : "";
+		$applyLeaveDate = $this->get_args ( 'applyLeaveDate' ) ? $this->get_args ( 'applyLeaveDate' ) : "";
 		
-		if (! empty ( $sidKey )) {
+		
+		if (! empty ( $sidKey )&&!empty($applyLeaveDate)) {
 			
 			Doo::loadClass ( 'XDeode' );
 			$XDeode = new XDeode ( 5 );
@@ -1279,7 +1284,7 @@ class HumanResourceController extends DooController {
 			$key = end ( $arr );
 			
 			if (isset ( $seniorityFormula [$key] ['dimissionDate'] ) || empty ( $seniorityFormula [$key] ['dimissionDate'] ))
-				$seniorityFormula [$key] ['dimissionDate'] = date ( "Y-m-d" );
+				$seniorityFormula [$key] ['dimissionDate'] = $applyLeaveDate;//date ( "Y-m-d" );
 			else
 				die ( 'illegal request' );
 				
@@ -1287,13 +1292,14 @@ class HumanResourceController extends DooController {
 				// 计算工龄天数
 				// echo $staff->seniorityFormula;
 			$day = $this->getSeniority ( $seniorityFormula );
-			$dimissionDate = date ( "Y-m-d " );
+			$dimissionDate = $applyLeaveDate;//date ( "Y-m-d " );
 			$item = array (
 					'sid' => $sid,
 					'nature' => 4,
 					'pendStatus' => 4,
 					'seniorityFormula' => json_encode ( $seniorityFormula ),
 					'hireBiasDate' => $day,
+					'applyLeaveDate'=>$dimissionDate,
 					'dimissionDate' => $dimissionDate 
 			);
 			$staff->setStaffByCondition ( $item );
@@ -1475,7 +1481,7 @@ class HumanResourceController extends DooController {
 			$detail = $staff->getStaffBySid ( $sid );
 			if (empty ( $detail ))
 				die ( 'illegal request' );
-			
+				
 			$item = array (
 					'sid' => $sid,
 					'pendStatus' => 7 
@@ -1485,8 +1491,8 @@ class HumanResourceController extends DooController {
 			// 离职审批组
 			// 获得审批组KEY
 			$staff = new staff ();
-			$cidMode = $this->staff ['cid'];
-			if (! empty ( $this->staff ['departmentID'] ))
+			$cidMode = $detail ['cid'];
+			if (! empty ( $detail ['departmentID'] ))
 				$cidMode = $detail ['cid'] . '_' . $detail ['departmentID'];
 			
 			$staffManageDetail = $reentryManage->getStaffManageByCid ( $cidMode );
@@ -1601,7 +1607,7 @@ class HumanResourceController extends DooController {
 			$employeeApprovals = array ();
 			if (count ( $name ) != 0) {
 				foreach ( $name as $ve ) {
-					array_push ( $employeeApprovals, $ve [1] );
+					@array_push ( $employeeApprovals, $ve [1] );
 				}
 			}
 			$employeeApprovals = implode ( '->', $employeeApprovals );
@@ -2896,8 +2902,10 @@ class HumanResourceController extends DooController {
 								<th class="taC">邮箱</th><td>' . $detail ['email'] . '</td>
 							</tr>
 						</tbody>
-					</table>
-					<table class="table table-bordered table-condensed">
+					</table>';
+							
+				if($detail ['pendStatus']!=3){
+					$html .= '<table class="table table-bordered table-condensed">
 							<tbody><tr>
 								<th class="taC" width="150">性别</th><td width="210">' . $detail ['gender'] . '</td>
 								<th class="taC" width="150">出生日期</th><td>' . $detail ['birthday'] . '</td>
@@ -2905,15 +2913,15 @@ class HumanResourceController extends DooController {
 							<tr>
 								<th class="taC" width="150">最高学历</th><td>' . $detail ['qualifications'] . '</td>
 								<th class="taC" width="150">婚姻状况</th><td>
-										
+					
 										';
-				
-				if ($detail ['marriage'] == 0)
-					$html .= '未婚';
-				elseif ($detail ['marriage'] == 1)
-					$html .= '已婚';
-				
-				$html .= '
+					
+					if ($detail ['marriage'] == 0)
+						$html .= '未婚';
+						elseif ($detail ['marriage'] == 1)
+						$html .= '已婚';
+					
+						$html .= '
 												</td>
 							</tr>
 							<tr>
@@ -2934,11 +2942,30 @@ class HumanResourceController extends DooController {
 								<th class="taC" width="150"></th><td></td>
 							</tr>
 						</tbody>
-					</table>
-					</div>
+					</table>';
+					
+				}
 										
+					
+						
+										
+						if($detail ['pendStatus']==3){
+							$html .= '<table class="table table-bordered table-condensed">
+							<tbody>
+							<tr>
+								<th class="taC" width="150">离职原因</th><td>'.$detail ['dimissionReason'].'</td>
+							</tr>
+							<tr>
+								<th class="taC" width="150">离职时间</th><td>'.$detail ['applyLeaveDate'].'</td>
+							</tr>
+						</tbody>
+					</table>	';
+						}				
+								
 										
 										
+					$html .= '</div>
+												
 					<div class="fL staff-detail-side">
 						<!--入职试用 & 离职后再入职试用-->
 						';
@@ -3496,7 +3523,7 @@ target="_blank">反面(照片)</a>
 		
 		$did = explode ( ',', $detail ['did'] );
 		
-		$html = '';
+		$html = '<label class="checkbox inline"> <input type="checkbox" id="clickALL" >全选</label>';
 		foreach ( $districtList as $key => $value ) {
 			$falg = true;
 			foreach ( $did as $k => $v ) {
@@ -3515,6 +3542,29 @@ target="_blank">反面(照片)</a>
 					  <input type="checkbox" name="didKey[]"  value="' . $value ['didKey'] . '">' . $value ['name'] . '
 					</label>';
 		}
+		$html .='
+				<script type="text/javascript">
+				$(function() {
+				$(\'input[id="clickALL"]\').click(function(){
+				
+        		//console.log(this.checked);
+        		if(this.checked){
+	        			$(\'input[name="didKey[]"]\').each(function(){
+		        				//此处如果用attr,会出现第三次失效的情况
+					    			$(this).prop("checked",true);
+								});
+            }else{
+	            	$(\'input[name="didKey[]"]\').each(function(){
+					    			$(this).removeAttr("checked",false);
+								});
+            }
+	    			
+        });
+})
+				</script>
+				';
+		
+		
 		echo json_encode ( array (
 				'status' => 1,
 				'html' => $html 

+ 2 - 2
protected/controller/MainController.php

@@ -317,7 +317,7 @@ class MainController extends DooController {
 		 */
 		
 		$staffList = $staff->find ( array (
-				'where' => ' username!="admin" ' . $staffCondition,
+				'where' => ' username!="admin" ' . $staffCondition . $staffCondition.' and nature!=4 and pendStatus!=4 and pendStatus!=1 and pendStatus!=2 ',
 				'asArray' => true 
 		) );
 		
@@ -990,7 +990,7 @@ class MainController extends DooController {
 		}
 		
 		$staffList = $staff->find ( array (
-				'where' => ' username!="admin"' . $staffCondition,
+				'where' => ' username!="admin"' . $staffCondition.' and nature!=4 and pendStatus!=4 and pendStatus!=1 and pendStatus!=2 ',
 				'asArray' => true 
 		) );
 		

+ 46 - 6
protected/controller/ReceiptController.php

@@ -3328,7 +3328,7 @@ class ReceiptController extends DooController {
 				}
 			}
 			
-			$FC = $rolename ['name'];
+			$FC = @$rolename ['name'];
 			$rolename ['name'] = '';
 			if (! empty ( $roleId )) {
 				Doo::loadModel ( 'role' );
@@ -3443,7 +3443,7 @@ class ReceiptController extends DooController {
 			) );
 		}
 		
-		$RN = json_decode ( $rolename ['staff'] );
+		$RN = @json_decode ( $rolename ['staff'] );
 		
 		//
 		foreach ( $rlList as $key => $value ) {
@@ -4815,15 +4815,15 @@ class ReceiptController extends DooController {
 			
 			$abDetail = $wasteBook->getAccountBookByAid ( 2, $accountType, $rid );
 			// 银行
-			if (empty ( $abDetail )) {
+			if (empty ( $abDetail )&&!empty($amount)) {
 				$item = array (
 						'dataID' => $rid,
 						'expensesType' => 2,
 						'accountType' => $accountType,
 						
-						'accountPriceShow' => $rinfo ['sum'],
+						'accountPriceShow' => $amount,
 						
-						'accountPrice' => - $rinfo ['sum'],
+						'accountPrice' => - $amount,
 						'accountBank' => $accountBank,
 						'category' => $rinfo ['category'] [0] ['title'],
 						'cid' => $rinfo ['category'] [0] ['cid'],
@@ -5074,6 +5074,7 @@ class ReceiptController extends DooController {
 		}
 		
 		$htmlLoan = '';
+		$data ['loanReceiptDate'] = '';
 		if (isset ( $loanList [0] )) {
 			foreach ( $loanList [0] ['verifyList'] as $key => $value ) {
 				if ($value ['status'] == 1)
@@ -10137,6 +10138,13 @@ class ReceiptController extends DooController {
 	 */
 	function payments() {
 		//include Doo::conf ()->BASE_PATH . 'diagnostic/debug.php';
+		
+		Doo::loadModel ( "execute" );
+		$execute = new execute ();
+		if(!$execute->isPaymentsShow($this->staff [0] ['sid'])){
+			die ( 'illegal request' );
+		}
+		
 		Doo::loadModel ( "accountBook" );
 		$accountBook = new accountBook ();
 		
@@ -11288,6 +11296,7 @@ class ReceiptController extends DooController {
 			$accountType='';
 			if ($abDetail ['expensesType'] == 1) {
 				$accountType=6;
+				
 				if ($abDetail ['accountType'] != 7) {
 					$item += array (
 							'expensesType' => $abDetail ['expensesType'],
@@ -11313,6 +11322,25 @@ class ReceiptController extends DooController {
 					);
 				}
 			}
+			
+			
+			if (($abDetail ['expenditureType'] == 4||$abDetail ['expenditureType'] == 6)&&$abDetail ['expensesType'] == 2) {
+				if ($abDetail ['expenditureMsg']=='公司固定')
+				$accountType=9;
+				elseif($abDetail ['expenditureMsg']=='公司活期')
+				$accountType=10;
+			}
+			if (($abDetail ['accountType'] == 7||$abDetail ['accountType'] == 9)&&$abDetail ['expensesType'] == 1) {
+				if ($abDetail ['accountMsg']=='公司固定')
+				$accountType=9;
+				elseif($abDetail ['accountMsg']=='公司活期')
+				$accountType=10;
+			}
+			
+			if($abDetail['accountMsg']=='活期理财收益'){
+				$accountType=10;
+			}
+			
 			$accountBookStatistics->setAccountBookStatistics ( $item );
 			
 			$accountBook->delete ( array (
@@ -11333,6 +11361,13 @@ class ReceiptController extends DooController {
 		return '/paymentsAchieve';
 	}
 	function paymentsCollect() {
+		
+		Doo::loadModel ( "execute" );
+		$execute = new execute ();
+		if(!$execute->isPaymentsShow($this->staff [0] ['sid'])){
+			die ( 'illegal request' );
+		}
+		
 		$year = $this->get_args ( 'year' ) ? $this->get_args ( 'year' ) : date ( "Y" );
 		$moth = $this->get_args ( 'moth' ) ? $this->get_args ( 'moth' ) : "";
 		
@@ -11629,8 +11664,13 @@ class ReceiptController extends DooController {
 	
 	// 公司流水
 	function wasteBook() {
-		include './protected/config/wasteBook.conf.php';
+		Doo::loadModel ( "execute" );
+		$execute = new execute ();
+		if(!$execute->isPaymentsShow($this->staff [0] ['sid'])){
+			die ( 'illegal request' );
+		}
 		
+		include './protected/config/wasteBook.conf.php';
 		Doo::loadModel ( 'wasteBook' );
 		$wasteBook = new wasteBook ();
 		

+ 16 - 0
protected/model/execute.php

@@ -14,6 +14,22 @@ class execute extends DooModel {
     
     public $_fields = array('eid', 'description', 'staff','mold');
 
+    
+    /**
+     * 是否有查看日常收支的权限
+     */
+    function isPaymentsShow($sid){
+    	
+    	$list = $this->find ( array (
+    			'where' => '(staff like \'%["' . $sid . '%\'  ) and mold="日常收支"',
+    			'asArray' => true
+    	) );
+    	if (empty($list)){
+    		return false;
+    	}else {
+    		return true;
+    	}
+    }
     /*
     function getClientByCid($cid){
     	$sql = "select * from " . $this->_table . " as a left join CLD_staff as b on (a.sid=b.sid)  where a.cid= '".$cid."' " ;

+ 4 - 2
protected/model/staff.php

@@ -90,8 +90,8 @@ class staff extends DooModel {
 	public $positionId;
 	
 	public $appliedPromote;
-	
 	public $departmentID;
+	public $applyLeaveDate;
 	
 	public $_table = 'CLD_staff';
 	public $_primarykey = 'sid';
@@ -182,7 +182,9 @@ class staff extends DooModel {
 			
 			'didName',
 			'positionId',
-			'appliedPromote'
+			'appliedPromote',
+			
+			'applyLeaveDate',
 	);
 	public function checkUser($uid, $passwork) {
 		return $this->find ( array (

+ 5 - 3
protected/plugin/TemplateTag.php

@@ -26,7 +26,8 @@ Doo::conf ()->TEMPLATE_GLOBAL_TAGS = array (
 		'forMatAccess',
 		'isShowMenu',
 		'isStaffCompleteMsg',
-		'isInvoiceCategoryShow'
+		'isInvoiceCategoryShow',
+		'isPaymentsShow'
 );
 
 function isStaffCompleteMsg(){
@@ -279,10 +280,11 @@ function isPaymentsShow($sid){
 			'where' => '(staff like \'%["' . $sid . '%\'  ) and mold="日常收支"',
 				'asArray' => true
 		) );
-	if (empty($list))
+	if (empty($list)){
 		return false;
-	else 
+	}else {
 		return true;
+	}
 }
 
 /**

+ 1 - 0
protected/view/admin/adminReportGroupRole.html

@@ -25,6 +25,7 @@
 						<li class="active"><a href="/adminRole">审批角色</a></li>
 						<li><a href="/adminExecute">费用执行人</a></li>
 						<li ><a href="/adminReceiptAuthority">汇总权限</a></li>
+						<li><a href="/adminPaymentsAuthority">日常收支权限</a></li>
 					</ul>
 				</div>
 			

+ 1 - 0
protected/view/admin/admin_reportGroup.html

@@ -26,6 +26,7 @@
 						<li><a href="/adminRole">审批角色</a></li>
 						<li><a href="/adminExecute">费用执行人</a></li>
 						<li ><a href="/adminReceiptAuthority">汇总权限</a></li>
+						<li><a href="/adminPaymentsAuthority">日常收支权限</a></li>
 					</ul>
 				</div>
 					

+ 2 - 0
protected/view/admin/invoiceTrainingDetail.html

@@ -582,6 +582,8 @@ $(document).ready( function () {
 			
 		});
 	 
+	 autoFlashHeight();
+	 
 	 $("a[node-store=batchMail]").click(function() {
 			
 			var id_array=new Array();  

+ 2 - 1
protected/view/admin/receipt_menu.html

@@ -30,9 +30,10 @@
 	<li><a href="/companyCategoryCollect" <!-- if {{receiptMemu}}=="companyCategoryCollect" --> class="selected" <!-- endif --> >公司汇总</a></li>			
 	<!-- endif -->
 	
+	<!-- if isPaymentsShow({{staff.0.sid}}) -->	
 	<li><a href="/paymentsCollect" <!-- if {{receiptMemu}}=="paymentsCollect" --> class="selected" <!-- endif --> >日常收支汇总</a></li>
-	
 	<li><a href="/wasteBook" <!-- if {{receiptMemu}}=="wasteBook" --> class="selected" <!-- endif --> >公司流水</a></li>
+	<!-- endif -->	
 	
 	<li class="topLine"><a href="#welcome" data-toggle="modal">使用帮助</a></li>
 

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

@@ -373,6 +373,11 @@
 							<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>

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

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

+ 14 - 2
protected/view/setting/settingEmployeeInfo.html

@@ -222,8 +222,20 @@
 					<h3>申请离职</h3>
 				</div>
 				<div class="modal-body saeaList">
-						<textarea style="width:560px" name="dimissionReason" placeholder="简要填写离职原因"></textarea>
-						<p class="alert alert-">感谢您的付出与努力。</p>
+				
+				<table class="table table-bordered table-condensed">
+						<tbody><tr>
+							<th class="taC" width="100">离职原因</th>
+							<td><textarea  name="dimissionReason" placeholder="简要填写离职原因"></textarea></td>
+						</tr>
+						<tr>
+							<th class="taC" width="100">离职日期</th><td><input type="date" name='applyLeaveDate' value='' ></td>
+						</tr>
+					</tbody></table>
+				
+				
+						
+						<p class="alert alert-">请联系纵横人资(QQ:1430119431)办理离职手续。</p>
 				</div>
 				<div class="modal-footer">
 					<input type="submit" class="button" value="确定提交">