瀏覽代碼

人资晋升,岗位,转正上传更新

caipin 6 年之前
父節點
當前提交
fefd108f20
共有 38 個文件被更改,包括 2369 次插入476 次删除
  1. 22 3
      global/js/humanResource.js
  2. 2 2
      global/js/index.js
  3. 44 16
      global/js/invoice.js
  4. 4 1
      global/js/receipt.js
  5. 1 1
      protected/class/client.php
  6. 36 0
      protected/config/acl.conf.php
  7. 12 1
      protected/config/routes.conf.php
  8. 8 3
      protected/controller/AdminController.php
  9. 435 221
      protected/controller/HumanResourceController.php
  10. 161 7
      protected/controller/InvoiceController.php
  11. 6 2
      protected/controller/MainController.php
  12. 1322 81
      protected/controller/ReceiptController.php
  13. 16 6
      protected/controller/SettingController.php
  14. 118 81
      protected/model/receipt.php
  15. 60 1
      protected/model/staff.php
  16. 7 1
      protected/model/staffManage.php
  17. 23 3
      protected/plugin/TemplateTag.php
  18. 1 1
      protected/view/admin/approvalExpenses.html
  19. 1 1
      protected/view/admin/expenses.html
  20. 37 3
      protected/view/admin/implement.html
  21. 4 2
      protected/view/admin/invoiceAS.html
  22. 2 2
      protected/view/admin/invoiceAchieve.html
  23. 2 2
      protected/view/admin/invoiceElement.html
  24. 8 4
      protected/view/admin/invoiceReceivables.html
  25. 2 0
      protected/view/admin/receipt_menu.html
  26. 0 1
      protected/view/admin/receiptburEdi.html
  27. 1 1
      protected/view/admin/remittanceHky.html
  28. 1 1
      protected/view/admin/saeaCollectArticles.html
  29. 1 1
      protected/view/admin/saeaCompanyCollect.html
  30. 1 1
      protected/view/admin/saea_slist_collect.html
  31. 2 1
      protected/view/admin/year.html
  32. 1 1
      protected/view/humanResource/hr.html
  33. 5 5
      protected/view/humanResource/hrEmployee.html
  34. 10 5
      protected/view/humanResource/hrMenu.html
  35. 1 1
      protected/view/lock_look.html
  36. 1 1
      protected/view/login.html
  37. 1 1
      protected/view/setting/settingCredentialInfo.html
  38. 10 11
      protected/view/setting/settingEmployeeInfo.html

+ 22 - 3
global/js/humanResource.js

@@ -144,7 +144,7 @@ $(function() {
 			success : function(data) {
 				if (data.status == 1) {
 					$("#sidKeyDimission").val(data.sidKey);
-					$("#staffDetailAD").html(data.html);
+					$("#staffDetailDi").html(data.html);
 				} else
 					$("div[loading-msg='true']").html("illegal request");
 			},
@@ -499,6 +499,8 @@ $(function() {
 			success : function(data) {
 				if (data.status == 1) {
 					
+					
+					$("#positionNameHtml").html(data.positionName);
 					$("#positionStaffHTMl").html(data.html);
 				} else
 					$("#positionStaffHTMl").html("illegal request");
@@ -552,13 +554,30 @@ $(function() {
 		//var nodeWages=$(this).attr('node-wages');
 		//console.log(nw);
 		
-		$("#promotionBaseWage").val(nw[1]);
+		$("#promotionBaseWage").val(nw[0]);
 		$("#promotionpostWage").val(nw[1]);
-		$("#promotionAchievementBonus").val(nw[1]);
+		$("#promotionAchievementBonus").val(nw[2]);
 		
 	
 	});
 	
+	$("#positionStaffAddSelect").change(function(){
+		
+		var nodeWages=$("option:selected", this).attr("node-wages");
+		var nw=nodeWages.split("_");
+		
+		//var nodeWages=$(this).attr('node-wages');
+		//console.log(nw);
+		
+		$("#promotionAddBaseWage").val(nw[0]);
+		$("#promotionAddpostWage").val(nw[1]);
+		$("#promotionAddAchievementBonus").val(nw[2]);
+		
+	
+	});
+	
+	
+	
 	
 })
 

+ 2 - 2
global/js/index.js

@@ -113,8 +113,8 @@ function RLongMsg(){
 	var giftClient=$("input[name='giftClient']").val();
 	var newProduct=$("#newProduct").val();
 	var key_num=$("input[name='key_num']").val();
-	var mark=$("#mark").val();
-	
+	var mark=$("#marks").val();
+//	console.log($("#marks").text());
 	var url="/addDoLockLog";
 	
 	$.ajax({

+ 44 - 16
global/js/invoice.js

@@ -2,19 +2,19 @@
 var notify = null;
 var isNotifyShowing = false;
 var isError = false;
-$(function() {
-    Notification.requestPermission(function(status) {});
-
-	// 轮询查找是否有未处理的审批
-    var permission = Notification.permission;
-    if (permission === 'granted') {
-        var interval = setInterval(checkNotify, 90000);//
-        if (isError) {
-            clearInterval(interval);
-        }
-
-    }
-});
+//$(function() {
+//    Notification.requestPermission(function(status) {});
+//
+//	// 轮询查找是否有未处理的审批
+//    var permission = Notification.permission;
+//    if (permission === 'granted') {
+//        var interval = setInterval(checkNotify, 90000);//
+//        if (isError) {
+//            clearInterval(interval);
+//        }
+//
+//    }
+//});
 /**
  * 获取未审批数量
  */
@@ -136,6 +136,13 @@ function invoiceReceivblesDivShow(postData,type){
 
 }
 
+function padding1(num, length) {
+    for(var len = (num + "").length; len < length; len = num.length) {
+        num = "0" + num;            
+    }
+    return num;
+}
+
 
 
 $(function() {
@@ -143,16 +150,37 @@ $(function() {
 	$('#invoiceNoStart').keyup(function() {
 		
 		var start=$(this).val();
+		
 		var total=$('#invoiceNoTotal').val();
-		var s=Number(start)+Number(total); 
-		$('#invoiceNoEnd').val('No.'+s);
+		
+		var stLenght=start.length;
+		
+		var s=Number(start)+Number(total);
+		
+		
+		//padding1(s,kl);
+		
+		$('#invoiceNoEnd').val('No.'+padding1(s,stLenght));
 	});
 	
 	$('#invoiceNoTotal').keyup(function() {
 		var start=$(this).val();
+		
 		var total=$('#invoiceNoStart').val();
+		
+		
+		
+		
 		var s=Number(start)+Number(total); 
-		$('#invoiceNoEnd').val('No.'+s);
+		
+		var k=Number(total);
+		var stLenght=total.length;
+		
+		
+		stLenght=Number(s.toString().length)+Number(stLenght)-Number(k.toString().length);
+		
+		
+		$('#invoiceNoEnd').val('No.'+padding1(s,stLenght));
 	});
 	
 	$('a[node-claim="receivables"]').click(function() {

+ 4 - 1
global/js/receipt.js

@@ -77,11 +77,14 @@ function updateApprovalReceipt(status,rid){
 function setExeReceipt(tr,rid){
 	 var form = $('#implement'+tr);
 	 var amount=$('#amount'+tr).val();
+	 
+	 var accountBank=$('#accountBankSelect'+tr).val();
+	 
 	 console.log(amount);
 	 if(amount=='')
 		 return alert('请填写汇款金额');
 	 $("#amountInp"+tr).val(amount);
-	 
+	 $("#accountBank"+tr).val(accountBank);
 	 form.submit(); 
 }
 

+ 1 - 1
protected/class/client.php

@@ -407,7 +407,7 @@ EOF;
         stream_set_timeout($fp, $timeout);
         @fwrite($fp, $out);
         $status = stream_get_meta_data($fp);
-
+        
 //         if ($status['timed_out'])
 //             return '';
 //         while (!feof($fp)) {

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

@@ -310,6 +310,7 @@ $acl ['DIRECTORIES'] ['allow'] = array (
 				'ajaxDeleteTag',
 				'ajaxDeleteTagCompany',
 				'remindCL',
+				'DoEdiTag',
 		)
 );
 
@@ -423,6 +424,11 @@ $acl ['RECEIPTS'] ['allow'] = array (
 				'paymentsDelDo',
 				'paymentsCollect',
 				'paymentsCollectDay',
+				'ajaxGetWasteReceipt',
+				'wasteBook',
+				'ajaxGetWasteinvoiceReceivables',
+				'wasteBookIncome',
+				'wasteBookExpenditure',
 		)
 );
 //人资
@@ -451,12 +457,42 @@ $acl ['HR'] ['allow'] = array (
 				'ajaxGetStaffInfoByType',
 				'ajaxGetStaffInfoBySid',
 				'ajaxGetDistrictByLv1',
+				'ajaxGetPromotionStaffByPid',
 				'hrEmployeeApprovalsSetting',
 				'hrEmployeeAccess',
 				'regularApprovals',
 				'addUserDistrictAuthor',
+				'employeePromoteApprovals',
+				'position',
+				'positionAdd',
+				'positionUpdate',
+				'positionDelete',
+				'promoteApprovals',
+				'promoteApprovalsAdd',
+				'promoteApprovalsCCAdd',
+				'appliedRegular',
+				'appliedPromote',
+				'employeeRegularApprovals',
+				'ajaxGetPositionByPid',
+				'ajaxGetStaffByPid',
 				
 		)
 );
 
+//建筑
+$acl ['BUILD'] ['allow'] = array (
+		'BuildingController' => array (
+				'index',
+				'getStaffMsg',
+				'getBuildMsg',
+				'getClientMsg',
+				'checkMobile',
+				'getBuildList',
+				'setUserCompilation',
+				'setUserClient',
+				
+
+		)
+);
+
 ?>

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

@@ -209,7 +209,13 @@ $route['post']['/paymentsDelDo'] = array('ReceiptController', 'paymentsDelDo');
 $route['*']['/paymentsCollect'] = array('ReceiptController', 'paymentsCollect');
 $route['*']['/paymentsCollectDay'] = array('ReceiptController', 'paymentsCollectDay');
 
+//公司流水
+$route['*']['/wasteBook'] = array('ReceiptController', 'wasteBook');
+$route['*']['/ajaxGetWasteReceipt'] = array('ReceiptController', 'ajaxGetWasteReceipt');
+$route['*']['/ajaxGetWasteinvoiceReceivables'] = array('ReceiptController', 'ajaxGetWasteinvoiceReceivables');
 
+$route['*']['/wasteBookIncome'] = array('ReceiptController', 'wasteBookIncome');
+$route['*']['/wasteBookExpenditure'] = array('ReceiptController', 'wasteBookExpenditure');
 
 
 //邮件群发
@@ -579,6 +585,10 @@ $route['get']['/regularApprovals'] = array('HumanResourceController', 'regularAp
 $route['post']['/employeRegularApprovalsAdd'] = array('HumanResourceController', 'employeRegularApprovalsAdd');
 $route['post']['/employeRegularCCAdd'] = array('HumanResourceController', 'employeRegularCCAdd');
 
+$route['post']['/employeeRegularApprovals'] = array('HumanResourceController', 'employeeRegularApprovals');
+
+
+
 $route['get']['/promoteApprovals'] = array('HumanResourceController', 'promoteApprovals');
 $route['post']['/promoteApprovalsAdd'] = array('HumanResourceController', 'promoteApprovalsAdd');
 $route['post']['/promoteApprovalsCCAdd'] = array('HumanResourceController', 'promoteApprovalsCCAdd');
@@ -605,9 +615,10 @@ $route['*']['/positionAdd'] = array('HumanResourceController', 'positionAdd');
 $route['*']['/positionUpdate'] = array('HumanResourceController', 'positionUpdate');
 $route['*']['/positionDelete'] = array('HumanResourceController', 'positionDelete');
 
+$route['*']['/employeePromoteApprovals'] = array('HumanResourceController', 'employeePromoteApprovals');
 
 
-
+$route['*']['/loadCVS'] = array('AdminController', 'loadCVS');
 
 
 $route['*']['/ajaxGetStaffByPid'] = array('HumanResourceController', 'ajaxGetStaffByPid');

+ 8 - 3
protected/controller/AdminController.php

@@ -1564,20 +1564,25 @@ class AdminController extends DooController {
 		die ();
 	}
 	function loadCVS() {
+		$key = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
+		
 		Doo::loadModel ( 'longle' );
 		$longle = new longle ();
 		$list = $longle->find ( array (
+				'where'=>'SerialNumber=""',
 				'select' => 'key_num',
 				'asArray' => TRUE 
 		) );
 		
-		$file = fopen ( DOO::conf ()->SITE_PATH . "upload/key2.csv", 'r' );
+		$file = fopen ( DOO::conf ()->SITE_PATH . "upload/".$key.".csv", 'r' );
 		
 		while ( $data = fgetcsv ( $file ) ) {
 			$goods_list [$data [0]] = $data [1];
 		}
 		fclose ( $file );
 		
+		//print_r($goods_list);
+		
 		$sqlArray = array ();
 		$sql = 'UPDATE CLD_longle SET SerialNumber = CASE key_num ';
 		foreach ( $list as $key => $value ) {
@@ -1593,9 +1598,9 @@ class AdminController extends DooController {
 			}
 		}
 		$sql .= 'END WHERE key_num IN (' . implode ( ',', $sqlArray ) . ')';
-		echo $sql . '<br/>--------------------------------<br/>';
+		echo $sql ;//. '<br/>--------------------------------<br/>';
 		foreach ( $goods_list as $key => $value ) {
-			echo $key . ',' . $value . '<br/>';
+			//echo $key . ',' . $value . '<br/>';
 		}
 	}
 	private function getRandChar($length) {

+ 435 - 221
protected/controller/HumanResourceController.php

@@ -6,50 +6,52 @@
 class HumanResourceController extends DooController {
 	public $data;
 	public function beforeRun($resource, $action) {
-		$this->data ['isHR'] = false;
-		$this->data ['isALLHR'] = false;
-		
-		if ($action == 'appliedEntry' || $action == 'appliedDimission') {
-			return '';
-		}
-		
-		Doo::loadModel ( "staffManage" );
-		$staffManage = new staffManage ();
-		$smList = $staffManage->getInvoiceCMByStaff ( $_COOKIE ["staff"] );
-		if (! empty ( $smList )) {
-			$this->data ['isHR'] = true;
-		}
+		$this->data ['exempt'] = false;
 		
 		Doo::loadModel ( 'staff' );
 		$staff = new staff ();
 		$detail = $staff->getStaffBySid ( $_COOKIE ["staff"] );
 		
-		if ($detail ['sid'] != superHR) {
-			$accessModular = 'HR';
-			$flag = true;
-			if (empty ( $detail ['cldAccessArray'] ))
-				die ( 'illegal request1' );
-			else {
-				
-				if (in_array ( $accessModular, $detail ['cldAccessArray'] )) {
-					if (Doo::acl ()->isAllowed ( $accessModular, $resource, $action )) {
-						$flag = true;
-						$this->data ['isALLHR'] = true;
-					} else {
-						$flag = false;
-					}
+		// 拥有豁免权限
+		if ($action == 'appliedEntry' || $action == 'appliedDimission' || $action == 'appliedRegular' || $detail ['sid'] == superHR) {
+			return '';
+		}
+		
+		// 全员权限判定
+		$accessModular = 'HR';
+		if (empty ( $detail ['cldAccessArray'] )) {
+			$flag = false;
+		} else {
+			if (in_array ( $accessModular, $detail ['cldAccessArray'] )) {
+				if (Doo::acl ()->isAllowed ( $accessModular, $resource, $action )) {
+					$flag = true;
 				} else {
-					if ($this->data ['isHR'])
-						return '';
-					else
-						die ( 'illegal request2' );
+					$flag = false;
 				}
+			} else {
+				$flag = false;
 			}
-			
-			if ($flag)
-				die ( 'illegal request3' );
-		} else {
-			$this->data ['isALLHR'] = true;
+		}
+		
+		// 个别审批人临时访问首页权限
+		if (! $flag) {
+			$list = $staff->getApprovalData ( $detail ['sid'] );
+			// $staff->find ( array (
+			// 'asc' => 'sid',
+			// 'where' => "(pendStatus= '2' or pendStatus='3' or pendStatus='5') and ( pendingApprovalsLeave='" . $detail ['sid'] . "' or pendingApprovals='" . $detail ['sid'] . "') ",
+			// 'asArray' => TRUE
+			// ) );
+			$isVisit = count ( $list );
+			if ($isVisit > 0) { // 未做强制不能访问
+				
+				if ($action == 'hrEmployee' || $action == 'position' || $action == 'employeeApprovals') {
+					die ( 'illegal request' );
+				}
+				
+				$this->data ['exempt'] = true;
+				return '';
+			} else
+				die ( 'illegal request' );
 		}
 	}
 	function __construct() {
@@ -162,10 +164,11 @@ class HumanResourceController extends DooController {
 			$staff->InductionDate = date ( "Y-m-d H:i:s" );
 			
 			if ($staffDetail ['nature'] == 2)
-				$staffDetail->practiceDate = date ( "Y-m-d H:i:s" );
+				$staff->practiceDate = date ( "Y-m-d H:i:s" );
 			if ($staffDetail ['nature'] == 3)
-				$staffDetail->probationaryDate = date ( "Y-m-d H:i:s" );
+				$staff->probationaryDate = date ( "Y-m-d H:i:s" );
 			
+			//发送短信
 			$passwork = mt_rand ( 100000, 999999 );
 			$staff->passwork = md5 ( $passwork );
 			
@@ -174,36 +177,71 @@ class HumanResourceController extends DooController {
 				$msg = $staffDetail ['username'] . ',' . $passwork;
 				send_sms ( 17280, $staffDetail ['telephone'], '{"%msg%":"' . $msg . '"}' );
 			}
+			
+			// 操作日志
+			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' => "员工 入职审批通过",
+					'status' => 3,
+					'img' => $this->staff ['avatar'],
+					'username' => $this->staff['username'],
+					'uid' => $staffDetail ['sid'],
+					'category' => $this->staff ['category'],
+					'sid'=>$this->staff ['sid'],
+			);
+			
+			$staffOperationLog->setInvoiceOperationLog ( $item );
+			
+			//发送微信抄送
+			$msg = '[抄送]'.$staffDetail['category'].'-'.$staffDetail['username'].'申请入职成功\n入职时间:'.$staffDetail['hiredate'];
+			
+			$cidmode=$staffDetail['cid'];
+			if(!empty($staffDetail['departmentID']))
+				$cidmode=$staffDetail['cid'].'-'.$staffDetail['departmentID'];
+			$InductionCC=$staffManage->getStaffManageByCid($cidmode);
+			$InductionCC = json_decode ( $InductionCC ['CC'], true );
+			
+			foreach ($InductionCC as $value){
+				$this->setWXMsg ( $value[0],$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';
+		
+		// 权限跳转
+		$staff = new staff ();
+		$CAAdetail = $staff->getStaffBySid ( $_COOKIE ["staff"] );
+		$accessModular = 'HR';
+		if (in_array ( $accessModular, $CAAdetail ['cldAccessArray'] )) {
+			return '/hr';
+		} else {
+			$list = $staff->getApprovalData ( $CAAdetail ['sid'] );
+			
+			$isVisit = count ( $list );
+			if ($isVisit > 0) { // 未做强制不能访问
+				return '/hr';
+			} else {
+				header ( 'Content-Type:text/html;charset=utf-8' );
+				echo "审批成功 <a href='/'>点击跳转首页</a>";
+				die ();
+			}
+		}
 	}
 	
 	/**
@@ -266,8 +304,26 @@ class HumanResourceController extends DooController {
 		
 		if (count ( $processApprovals ) == count ( $invoiceManage )) {
 			$staff->pendStatus = 4;
+			// $staff->nature=4;//离职后需要在人员页面确认离职不用在这改状态
 			// $staff->dimissionDate = date ( "Y-m-d" );
 			$staff->pendingApprovalsLeave = 0;
+			
+			
+			// 操作日志
+			Doo::loadModel ( 'staffOperationLog' );
+			$staffOperationLog = new staffOperationLog ();
+			$item = array (
+					'date' => date ( "Y-m-d H:i:s" ),
+					'operation' => "员工 离职审批通过",
+					'status' => 2,
+					'img' => $this->staff ['avatar'],
+					'username' => $this->staff['username'],
+					'uid' => $staffDetail ['sid'],
+					'category' => $this->staff ['category'],
+					'sid'=>$this->staff ['sid'],
+			);
+			$staffOperationLog->setInvoiceOperationLog ( $item );
+			
 		}
 		
 		$staff->updateDate = date ( "Y-m-d H:i:s" );
@@ -275,21 +331,26 @@ class HumanResourceController extends DooController {
 				'where' => 'sid=' . $sid 
 		) );
 		
-		// 操作日志
-		Doo::loadModel ( 'staffOperationLog' );
-		$staffOperationLog = new staffOperationLog ();
-		$item = array (
-				'date' => date ( "Y-m-d H:i:s" ),
-				'operation' => $this->staff ['username'] . "离职 审批通过" . $staffDetail ['username'],
-				'status' => 2,
-				'img' => $staffDetail ['avatar'],
-				'username' => $staffDetail ['username'],
-				'uid' => $staffDetail ['sid'],
-				'category' => $staffDetail ['category'] 
-		);
-		$staffOperationLog->setInvoiceOperationLog ( $item );
 		
-		return '/hr';
+		
+		// 权限跳转
+		$staff = new staff ();
+		$CAAdetail = $staff->getStaffBySid ( $_COOKIE ["staff"] );
+		$accessModular = 'HR';
+		if (in_array ( $accessModular, $CAAdetail ['cldAccessArray'] )) {
+			return '/hr';
+		} else {
+			$list = $staff->getApprovalData ( $CAAdetail ['sid'] );
+			
+			$isVisit = count ( $list );
+			if ($isVisit > 0) { // 未做强制不能访问
+				return '/hr';
+			} else {
+				header ( 'Content-Type:text/html;charset=utf-8' );
+				echo "审批成功 <a href='/'>点击跳转首页</a>";
+				die ();
+			}
+		}
 	}
 	
 	/**
@@ -352,8 +413,33 @@ class HumanResourceController extends DooController {
 		
 		if (count ( $processApprovals ) == count ( $invoiceManage )) {
 			$staff->pendStatus = 0;
+			$staff->nature = 1;
+			// 工号
+			// 生成工号
+			$jobNumber = $this->createJobNumber ();
+			$staff->jobNumber = $jobNumber ['regularStaff'];
 			// $staff->dimissionDate = date ( "Y-m-d" );
 			$staff->pendingApprovalsLeave = 0;
+			
+			// 操作日志
+			Doo::loadModel ( 'staffOperationLog' );
+			$staffOperationLog = new staffOperationLog ();
+			$item = array (
+					'date' => date ( "Y-m-d H:i:s" ),
+					'operation' =>"员工 转正审批通过",
+					'status' => 2,
+					
+					'img' => $this->staff ['avatar'],
+					'username' => $this->staff['username'],
+					'uid' => $staffDetail ['sid'],
+					'category' => $this->staff ['category'],
+					'sid'=>$this->staff ['sid'],
+					
+			);
+			$staffOperationLog->setInvoiceOperationLog ( $item );
+			
+			
+			
 		}
 		
 		$staff->updateDate = date ( "Y-m-d H:i:s" );
@@ -361,21 +447,26 @@ class HumanResourceController extends DooController {
 				'where' => 'sid=' . $sid 
 		) );
 		
-		// 操作日志
-		Doo::loadModel ( 'staffOperationLog' );
-		$staffOperationLog = new staffOperationLog ();
-		$item = array (
-				'date' => date ( "Y-m-d H:i:s" ),
-				'operation' => $this->staff ['username'] . "转正 审批通过" . $staffDetail ['username'],
-				'status' => 2,
-				'img' => $staffDetail ['avatar'],
-				'username' => $staffDetail ['username'],
-				'uid' => $staffDetail ['sid'],
-				'category' => $staffDetail ['category'] 
-		);
-		$staffOperationLog->setInvoiceOperationLog ( $item );
 		
-		return '/hr';
+		
+		// 权限跳转
+		$staff = new staff ();
+		$CAAdetail = $staff->getStaffBySid ( $_COOKIE ["staff"] );
+		$accessModular = 'HR';
+		if (in_array ( $accessModular, $CAAdetail ['cldAccessArray'] )) {
+			return '/hr';
+		} else {
+			$list = $staff->getApprovalData ( $CAAdetail ['sid'] );
+			
+			$isVisit = count ( $list );
+			if ($isVisit > 0) { // 未做强制不能访问
+				return '/hr';
+			} else {
+				header ( 'Content-Type:text/html;charset=utf-8' );
+				echo "审批成功 <a href='/'>点击跳转首页</a>";
+				die ();
+			}
+		}
 	}
 	
 	/**
@@ -388,106 +479,133 @@ class HumanResourceController extends DooController {
 		$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 = '试用';
+		
+		$staffDetail = $staff->getOne ( array (
+				'where' => 'pendStatus=6 and sid=' . $sid . ' and pendingApprovalsLeave=' . $this->staff ['sid'],
+				'asArray' => true 
+		) );
+		
+		if (empty ( $staffDetail ))
+			die ( 'illegal request' );
+		
+		$processApprovals = json_decode ( $staffDetail ['processApprovalsLeave'], true );
+		$invoiceManage = json_decode ( $staffDetail ['staffManageLeave'], 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->pendingApprovalsLeave = $nextInvoiceManage [0];
+			$staff->processApprovalsLeave = 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;
 				}
-	
-				$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 );
-	
+			}
+			
+			if (! empty ( $pendingApprovals ))
+				$staff->pendingApprovalsLeave = $pendingApprovals;
+			$staff->processApprovalsLeave = json_encode ( $processApprovals );
+		}
+		
+		$appliedPromote = $staffDetail ['appliedPromote'];
+		$appliedPromote = explode ( '_', $appliedPromote );
+		if (count ( $processApprovals ) == count ( $invoiceManage )) {
+			$staff->pendStatus = 0;
+			$staff->pendingApprovalsLeave = 0;
+			// 岗位薪资调整
+			
+			$appliedPromote [4];
+			
+			$staff->baseWage = $appliedPromote [2];
+			$staff->postWage = $appliedPromote [3];
+			$staff->achievementBonus = $appliedPromote [4];
+			$staff->positionId = $XDeode->decode ( $appliedPromote [0] );
+			
+			
+			//发送微信抄送
+			
+			$msg = '[抄送]'.$staffDetail['category'].'-'.$staffDetail['username'].'申请晋升成功\n晋升时间:'.date ( "Y-m-d" );
+			
+			$cidmode=$staffDetail['cid'];
+			if(!empty($staffDetail['departmentID']))
+				$cidmode=$staffDetail['cid'].'-'.$staffDetail['departmentID'];
+			$InductionCC=$staffManage->getStaffManageByCid($cidmode);
+			$InductionCC = json_decode ( $InductionCC ['CC'], true );
+			
+			foreach ($InductionCC as $value){
+				$this->setWXMsg ( $value[0],$msg );
+			}
+			
+			// 操作日志
+			Doo::loadModel ( 'staffOperationLog' );
+			$staffOperationLog = new staffOperationLog ();
+			$nature = $appliedPromote [1];
+			
+			$item = array (
+					'date' => date ( "Y-m-d H:i:s" ),
+					'operation' => "员工 晋升审批通过",
+					'status' => 3,
+					
+					'img' => $this->staff ['avatar'],
+					'username' => $this->staff['username'],
+					'uid' => $staffDetail ['sid'],
+					'category' => $this->staff ['category'],
+					'sid'=>$this->staff ['sid'],
+			);
+			
+			$staffOperationLog->setInvoiceOperationLog ( $item );
+			
+		}
+		
+		$staff->updateDate = date ( "Y-m-d H:i:s" );
+		$staff->update ( array (
+				'where' => 'sid=' . $sid 
+		) );
+		
+		
+		
+		// 权限跳转
+		$staff = new staff ();
+		$CAAdetail = $staff->getStaffBySid ( $_COOKIE ["staff"] );
+		$accessModular = 'HR';
+		if (in_array ( $accessModular, $CAAdetail ['cldAccessArray'] )) {
+			return '/hr';
+		} else {
+			$list = $staff->getApprovalData ( $CAAdetail ['sid'] );
+			
+			$isVisit = count ( $list );
+			if ($isVisit > 0) { // 未做强制不能访问
 				return '/hr';
+			} else {
+				header ( 'Content-Type:text/html;charset=utf-8' );
+				echo "审批成功 <a href='/'>点击跳转首页</a>";
+				die ();
+			}
+		}
 	}
 	
-	
 	/**
 	 * 员工信息
 	 */
@@ -594,7 +712,7 @@ class HumanResourceController extends DooController {
 		$this->data ['nature'] = $nature;
 		$this->data ['MebSea'] = $MebSea;
 		$this->data ['cid_did'] = $cid_did;
-		
+		// print_r($stafflist[43]);
 		$this->data ['categoryList'] = $categoryList;
 		$this->data ['jobNumber'] = $jobNumber;
 		$this->data ['stafflist'] = $stafflist;
@@ -642,7 +760,7 @@ class HumanResourceController extends DooController {
 			$position = explode ( '_', $position );
 			
 			$staff->position = $position [1];
-			$staff->positionId = $position [0];
+			$staff->positionId = $XDeode->decode ( $position [0] );
 			
 			$department = explode ( '_', $cid_did );
 			
@@ -733,10 +851,11 @@ class HumanResourceController extends DooController {
 					'date' => date ( "Y-m-d H:i:s" ),
 					'status' => 1,
 					'img' => '/global/img/avtra',
-					'username' => $username,
+					'username' =>$this->staff['username'] ,
 					'uid' => $id,
+					'sid'=>$this->staff['sid'],
 					'operation' => "添加新员工",
-					'category' => $cagegory [0] ['title'] 
+					'category' =>$this->staff['category'] 
 			);
 			$staffOperationLog->setInvoiceOperationLog ( $item );
 			
@@ -782,6 +901,24 @@ class HumanResourceController extends DooController {
 						'jobNumber' => $jobNumber ['regularStaff'],
 						'regularsDate' => date ( "Y-m-d H:i:s" ) 
 				);
+				
+				
+				//发送微信抄送
+				Doo::loadModel ( 'staffRegularManage' );
+				$staffLeaveManage = new staffRegularManage ();
+				$msg = '[抄送]'.$staffDetail['category'].'-'.$staffDetail['username'].'申请转正成功\n转正时间:'.date ( "Y-m-d" );
+				
+				$cidmode=$staffDetail['cid'];
+				if(!empty($staffDetail['departmentID']))
+					$cidmode=$staffDetail['cid'].'-'.$staffDetail['departmentID'];
+					$InductionCC=$staffLeaveManage->getStaffManageByCid($cidmode);
+					$InductionCC = json_decode ( $InductionCC ['CC'], true );
+						
+					foreach ($InductionCC as $value){
+						$this->setWXMsg ( $value[0],$msg );
+					}
+				
+				
 			}
 			$staff->setStaffByCondition ( $item );
 			
@@ -791,10 +928,11 @@ class HumanResourceController extends DooController {
 			$item = array (
 					'date' => date ( "Y-m-d H:i:s" ),
 					'status' => 1,
-					'img' => $staffDetail ['avatar'],
-					'username' => $staffDetail ['username'],
+					'img' => $this->staff ['avatar'],
+					'username' => $this->staff['username'],
 					'uid' => $staffDetail ['sid'],
-					'category' => $staffDetail ['category'] 
+					'category' => $this->staff ['category'],
+					'sid'=>$this->staff ['sid'],
 			);
 			if ($nature == 'TRIAL')
 				$item += array (
@@ -891,11 +1029,15 @@ class HumanResourceController extends DooController {
 			$item = array (
 					'date' => date ( "Y-m-d H:i:s" ),
 					'status' => 2,
-					'img' => $staffDetail ['avatar'],
-					'username' => $staffDetail ['username'],
+					
 					'operation' => "申请入职",
+					
+					'img' => $staffDetail ['avatar'],
+					'username' => $staffDetail['username'],
 					'uid' => $staffDetail ['sid'],
-					'category' => $staffDetail ['category'] 
+					'category' => $staffDetail ['category'],
+					'sid'=>$staffDetail ['sid'],
+					
 			);
 			$staffOperationLog->setInvoiceOperationLog ( $item );
 			
@@ -957,7 +1099,10 @@ class HumanResourceController extends DooController {
 				'username' => $this->staff ['username'],
 				'operation' => "申请离职",
 				'uid' => $this->staff ['sid'],
-				'category' => $this->staff ['category'] 
+				'category' => $this->staff ['category'] ,
+				
+				'sid'=>$this->staff ['sid'],
+				
 		);
 		$staffOperationLog->setInvoiceOperationLog ( $item );
 		
@@ -997,17 +1142,35 @@ class HumanResourceController extends DooController {
 				// 计算工龄天数
 				// echo $staff->seniorityFormula;
 			$day = $this->getSeniority ( $seniorityFormula );
-			
+			$dimissionDate=date ( "Y-m-d " );
 			$item = array (
 					'sid' => $sid,
 					'nature' => 4,
 					'pendStatus' => 4,
 					'seniorityFormula' => json_encode ( $seniorityFormula ),
 					'hireBiasDate' => $day,
-					'dimissionDate' => date ( "Y-m-d H:i:s" ) 
+					'dimissionDate' =>  $dimissionDate
 			);
 			$staff->setStaffByCondition ( $item );
 			
+			
+			
+			//发送微信抄送
+			Doo::loadModel ( 'staffLeaveManage' );
+			$staffLeaveManage = new staffLeaveManage ();
+			$msg = '[抄送]'.$detail['category'].'-'.$detail['username'].'申请离职成功\n离职时间:'.$dimissionDate;
+			
+			$cidmode=$detail['cid'];
+			if(!empty($detail['departmentID']))
+				$cidmode=$detail['cid'].'-'.$detail['departmentID'];
+			$InductionCC=$staffLeaveManage->getStaffManageByCid($cidmode);
+			$InductionCC = json_decode ( $InductionCC ['CC'], true );
+					
+			foreach ($InductionCC as $value){
+				$this->setWXMsg ( $value[0],$msg );
+			}
+			
+			
 			return '/hrEmployee';
 		}
 		die ( 'illegal request' );
@@ -1063,7 +1226,10 @@ class HumanResourceController extends DooController {
 				'username' => $this->staff ['username'],
 				'operation' => "申请转正",
 				'uid' => $this->staff ['sid'],
-				'category' => $this->staff ['category'] 
+				'category' => $this->staff ['category'] ,
+				
+				
+				'sid'=>$this->staff ['sid'],
 		);
 		$staffOperationLog->setInvoiceOperationLog ( $item );
 		
@@ -1074,11 +1240,10 @@ 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;
@@ -1095,29 +1260,30 @@ class HumanResourceController extends DooController {
 		
 		$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'];
+		
+		$cidMode = $detail ['cid'];
+		if (! empty ( $detail ['departmentID'] ))
+			$cidMode = $detail ['cid'] . '_' . $detail ['departmentID'];
 		
 		$staffManageDetail = $staffLeaveManage->getStaffManageByCid ( $cidMode );
-		if (empty ( $staffManageDetail ))
+		if (empty ( $staffManageDetail ['staffList'] ))
 			die ( 'illegal request ' );
 		
 		$pendingApprovalsSid = current ( $staffManageDetail ['staffList'] ) [0];
 		if (empty ( $pendingApprovalsSid ))
 			die ( 'illegal request ' );
 		
+		$item = array (
+				'sid' => $sid,
+				'appliedPromote' => $position . '_' . $baseWage . '_' . $postWage . '_' . $achievementBonus,
+				// 状态改成申请晋升
+				'pendStatus' => 6 
+		);
+		$staff->setStaffByCondition ( $item );
+		
+		$staff = new staff ();
 		$staff->pendingApprovalsLeave = $pendingApprovalsSid;
 		$staff->staffManageLeave = $staffManageDetail ['staff'];
 		$staff->processApprovalsLeave = '';
@@ -1127,17 +1293,25 @@ class HumanResourceController extends DooController {
 		$staff->processLeaveCC = $staffManageDetail ['CC'];
 		$staff->update ();
 		
+		$pDetail = explode ( '_', $position );
+		
 		// 操作日志
 		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' => "申请晋升",
+				
+				'operation' => "申请晋升" . $pDetail [1],
+				
+				
+				'img' => $this->staff ['avatar'],
+				'username' => $this->staff['username'],
 				'uid' => $detail ['sid'],
-				'category' => $detail ['category'] 
+				'category' => $this->staff ['category'],
+				'sid'=>$this->staff ['sid'],
+				
+				
 		);
 		$staffOperationLog->setInvoiceOperationLog ( $item );
 		
@@ -2092,8 +2266,8 @@ class HumanResourceController extends DooController {
 		$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;
-		
-		if (! empty ( $positionName ) && ! empty ( $positionDescribe ) && ! empty ( $baseWage ) && ! empty ( $postWage ) && ! empty ( $achievementBonus )) {
+		// && ! empty ( $postWage ) && ! empty ( $achievementBonus )
+		if (! empty ( $positionName ) && ! empty ( $positionDescribe ) && ! empty ( $baseWage )) {
 			
 			Doo::loadClass ( 'XDeode' );
 			$XDeode = new XDeode ( 5 );
@@ -2123,8 +2297,8 @@ class HumanResourceController extends DooController {
 		$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;
-		
-		if (! empty ( $pidkey ) && ! empty ( $positionName ) && ! empty ( $positionDescribe ) && ! empty ( $baseWage ) && ! empty ( $postWage ) && ! empty ( $achievementBonus )) {
+		// && ! empty ( $postWage ) && ! empty ( $achievementBonus )
+		if (! empty ( $pidkey ) && ! empty ( $positionName ) && ! empty ( $positionDescribe ) && ! empty ( $baseWage )) {
 			
 			Doo::loadClass ( 'XDeode' );
 			$XDeode = new XDeode ( 5 );
@@ -2198,7 +2372,13 @@ class HumanResourceController extends DooController {
 		$XDeode = new XDeode ( 5 );
 		Doo::loadModel ( 'staff' );
 		$staff = new staff ();
-		$list = $staff->getStaffByPositionId ();
+		
+		Doo::loadModel ( 'position' );
+		$position = new position ();
+		
+		$detail = $position->getPositionByPid ( $pidkey );
+		
+		$list = $staff->getStaffByPositionId ( $pidkey );
 		$html = '<tr><th class="taC">办事处</th><th class="taC">姓名</th><th class="taC">入职时间</th></tr>';
 		foreach ( $list as $key => $value ) {
 			
@@ -2212,6 +2392,7 @@ class HumanResourceController extends DooController {
 		}
 		echo json_encode ( array (
 				'status' => 1,
+				'positionName' => $detail ['positionName'],
 				'html' => $html 
 		) );
 		die ();
@@ -2449,10 +2630,20 @@ class HumanResourceController extends DooController {
 									';
 				
 				foreach ( $categoryList as $key => $value ) {
-					$html .= '<option value="' . $value ['cidKey'] . '_';
+					$html .= '<option value="' . $value ['cidKey'];
 					if (! empty ( $value ['did'] ))
-						$html .= $value ['didKey'];
-					$html .= '">' . $value ['title'];
+						$html .= '_' . $value ['didKey'];
+					$html .= '" ';
+					
+					if (isset ( $value ['did'] )) {
+						if ($detail ['cid'] == $value ['cid'] && $detail ['departmentID'] == $value ['did'])
+							$html .= 'selected';
+					} else {
+						if ($detail ['cid'] == $value ['cid'])
+							$html .= 'selected';
+					}
+					
+					$html .= '>' . $value ['title'];
 					if (! empty ( $value ['did'] ))
 						$html .= '/' . $value ['departmentName'] . '</option>';
 				}
@@ -2460,7 +2651,7 @@ class HumanResourceController extends DooController {
 				$html .= '	</select>	
 						</td>
 							<th class="taC  " width="150">岗位</th><td >
-						<select name="position" id="position">
+						<select name="position_disabled" disabled id="position">
 						';
 				
 				foreach ( $listPosition as $key => $value ) {
@@ -2956,6 +3147,7 @@ target="_blank">反面(照片)</a>
 		
 		$listPosition = $position->getPositionByAll ();
 		$detail = $staff->getStaffBySid ( $sidkey );
+		
 		// print_r($deta);
 		$html = '<table class="table table-bordered table-condensed">
 						<tr>
@@ -3024,6 +3216,28 @@ target="_blank">反面(照片)</a>
 	}
 	
 	/**
+	 * 微信抄送功能
+	 * @param unknown $rid
+	 * @param string $typeMsg
+	 */
+	function setWXMsg($sid, $msg = '',$msgtype='text') {
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		$staffmsg = $staff->getOne ( array (
+				'where' => "sid='" . $sid . "'",
+				'asArray' => TRUE 
+		) );
+		
+		if (! empty ( $staffmsg ['wxid'] )) {
+			require_once (SITE_PATH . '/protected/class/client.php');
+			$client = new client ( 'http://m.cld.smartcost.com.cn/' );
+			$user = $staffmsg ['wxid'];
+			
+			$result = $client->SendMsg ( $user, $msg, $msgtype );
+		}
+	}
+	
+	/**
 	 * 获取get或者POST值
 	 *
 	 * @param string $name 属性名称

+ 161 - 7
protected/controller/InvoiceController.php

@@ -2772,9 +2772,22 @@ class InvoiceController extends DooController {
 					);
 					$invoiceStatistics->setInvoiceStatisticsByCondition ( $item );
 				}
+				
+				//解绑时删除收入流水
+				Doo::loadModel ( 'wasteBook' );
+				$wasteBook = new wasteBook ();
+				$wasteBook->delete ( array (
+						'where' => 'dataID=' . $value.' and accountType=7',
+						'limit' => 1
+				) );
+				
 			}
+			
+			
 		}
 		
+		
+		
 		return "/invoiceUntread";
 	}
 	
@@ -3222,15 +3235,52 @@ class InvoiceController extends DooController {
 			);
 			$invoiceStatistics->setInvoiceStatisticsByCondition ( $item );
 			
+			
+			
+			
+			//公司流水记录
+			Doo::loadModel ( 'wasteBook' );
+			$wasteBook = new wasteBook ();
+				
+			$abDetail = $wasteBook->getAccountBookByAid (2,7,$irid );
+			
+			$accountBank='';
+			if ($receivablesBank=='纵横广发'){
+				$accountBank='CGBDeposit';
+			}elseif($receivablesBank=='纵横工行'){
+				$accountBank='ICBCDeposit';
+			}elseif($receivablesBank=='华润银行'){
+				$accountBank='HUADeposit';
+			}elseif($receivablesBank=='个人广发'){
+				$accountBank='PersonalDeposit';
+			}
+			
+			//银行
+			if (empty($abDetail)){
+				$item = array (
+						'dataID' => $irid,
+						'expensesType' => 1,
+						'accountType' => 7,
+						'accountPrice'=>$receivablesPrice,
+						'accountPriceShow'=>$receivablesPrice,
+						'accountBank'=>$accountBank,
+						'category'=>$this->staff[0]['category'],
+						'cid'=>$this->staff[0]['cid'],
+						'name'=>$this->staff[0]['username'],
+						'sid'=>$this->staff[0]['sid'],
+						'inputDate'=>date ( "Y-m-d H:i:s" )
+				);
+				$wasteBook->setAccountBookStatistics($item);
+			}
+			
 			Doo::db ()->commit ();
+			
 		}
 		
 		return '/invoiceReceivables';
 	}
 	
-	/**
-	 * 检索未入账发票数据 function sir() { }
-	 */
+	
 	
 	/**
 	 * 录入收款数据
@@ -3736,6 +3786,15 @@ class InvoiceController extends DooController {
 			if (empty ( $sum ))
 				die ( 'illegal request' );
 			
+			
+			//echo $invoiceNoStart;
+// 			echo $sum;
+// 			echo strlen((int)$invoiceNoStart);
+			
+			
+			$sumLenght=strlen($invoiceNoStart)-strlen((int)$invoiceNoStart);
+			
+				
 			Doo::db ()->beginTransaction ();
 			// 批量存储纸质发票
 			$date = date ( "Y-m-d H:i:s" );
@@ -3743,12 +3802,23 @@ class InvoiceController extends DooController {
 				  VALUES ';
 			$paperList = array ();
 			for($invoiceNoStart; $invoiceNoStart <= $sum - 1; $invoiceNoStart ++) {
-				$paperSql = '(' . $invoiceType . ',"' . $invoiceCode . '","' . $invoiceNoStart . '","' . $date . '")';
+				
+				
+				//数字前面自加0
+				$INLENGHT=strlen((int)$invoiceNoStart)+$sumLenght;
+				$var=sprintf("%0".$INLENGHT."d", $invoiceNoStart);
+				
+				
+				$paperSql = '(' . $invoiceType . ',"' . $invoiceCode . '","' . $var . '","' . $date . '")';
 				array_push ( $paperList, $paperSql );
 			}
+			
+			
 			if (empty ( $paperList ))
 				die ( 'illegal request' );
 			$sql = $sql . implode ( ',', $paperList );
+			
+			
 			Doo::db ()->query ( $sql );
 			Doo::db ()->commit ();
 			return 'invoicePaper';
@@ -3757,7 +3827,7 @@ class InvoiceController extends DooController {
 	}
 	
 	/**
-	 * 收款绑定发票 ,一个收款只能绑定一个发票
+	 * 收款绑定发票 ,//一个收款只能绑定一个发票
 	 */
 	function invoiceBindReceivables() {
 		$claimKey = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
@@ -3784,6 +3854,7 @@ class InvoiceController extends DooController {
 			// 修改 绑定状态改为 金额
 		$invoiceReceivables = new invoiceReceivables ();
 		
+		
 		$invoicePrice = $detail ['invoicePrice'] + $detailM ['bindPrice'];
 		if ($detailM ['receivablesPrice'] > $invoicePrice) {
 			$item = array (
@@ -3875,6 +3946,44 @@ class InvoiceController extends DooController {
 		);
 		$invoiceStatistics->setInvoiceStatisticsByCondition ( $item );
 		
+		
+		//公司流水记录
+		Doo::loadModel ( 'wasteBook' );
+		$wasteBook = new wasteBook ();
+		
+		$abDetail = $wasteBook->getAccountBookByAid (1,8,$detail ['iid'] );
+		
+		$accountBank='';
+		if ($detailM ['receivablesBank']=='纵横广发'){
+			$accountBank='CGBDeposit';
+		}elseif($detailM ['receivablesBank']=='纵横工行'){
+			$accountBank='ICBCDeposit';
+		}elseif($detailM ['receivablesBank']=='华润银行'){
+			$accountBank='HUADeposit';
+		}elseif($detailM ['receivablesBank']=='个人广发'){
+			$accountBank='PersonalDeposit';
+		}
+		
+		//银行
+		if (empty($abDetail)){
+			$item = array (
+					'dataID' => $detail ['iid'],
+					'expensesType' => 1,
+					'accountType' => 8,
+					
+					'accountPriceShow'=>$detail ['invoicePrice'],
+					
+					'accountPrice'=>$detail ['invoicePrice'],
+					'accountBank'=>$accountBank,
+					'category'=>$this->staff[0]['category'],
+					'cid'=>$this->staff[0]['cid'],
+					'name'=>$this->staff[0]['username'],
+					'sid'=>$this->staff[0]['sid'],
+					'inputDate'=>date ( "Y-m-d H:i:s" )
+			);
+			$wasteBook->setAccountBookStatistics($item);
+		}
+		
 		return "/invoiceReceivables";
 	}
 	
@@ -4552,7 +4661,7 @@ class InvoiceController extends DooController {
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
 		$sid = $XDeode->decode ( $_COOKIE ["staff"] );
-		$MebSea = isset ( $this->params ['MebSea'] ) ? urldecode ( $this->params ['MebSea'] ) : '';
+		$MebSea = $this->get_args ( 'MebSea' ) ? $this->get_args ( 'MebSea' ) : "";
 		
 		$page_size = 18;
 		$page = isset ( $this->params ['page'] ) && is_numeric ( $this->params ['page'] ) ? $this->params ['page'] : 1;
@@ -4593,6 +4702,10 @@ class InvoiceController extends DooController {
 		$this->data ['receiptMemu'] = 'invoice';
 		$this->render ( "/admin/invoiceAchieve", $this->data );
 	}
+	
+	/**
+	 * 
+	 */
 	function invoiceMyUnAccountAchieve() {
 		Doo::loadModel ( 'invoice' );
 		$invoice = new invoice ();
@@ -4832,6 +4945,47 @@ class InvoiceController extends DooController {
 		);
 		$invoiceOperationLog->setInvoiceOperationLog ( $item );
 		
+		//公司流水-解绑时删除流水
+		Doo::loadModel ( 'wasteBook' );
+		$wasteBook = new wasteBook ();
+			
+		$wasteBook->delete ( array (
+				'where' => 'dataID=' . $irDetails ['irid'].' and accountType=7',
+				'limit' => 1
+		) );
+		
+		
+		//银行
+		
+		/*
+		$abDetail = $wasteBook->getAccountBookByAid (2,7,$irDetails ['irid'] );
+		$accountBank='';
+		if ($irDetails ['receivablesBank']=='纵横广发'){
+			$accountBank='CGBDeposit';
+		}elseif($irDetails ['receivablesBank']=='纵横工行'){
+			$accountBank='ICBCDeposit';
+		}elseif($irDetails ['receivablesBank']=='华润银行'){
+			$accountBank='HUADeposit';
+		}elseif($irDetails ['receivablesBank']=='个人广发'){
+			$accountBank='PersonalDeposit';
+		}
+		
+		if (empty($abDetail)){
+			$item = array (
+				'dataID' => $irDetails ['irid'],
+				'expensesType' => 2,
+				'accountType' => 7,
+				'accountPriceShow'=>$irDetails ['receivablesPrice'],
+				'accountPrice' => -$irDetails ['receivablesPrice'],
+				'accountBank'=>$accountBank,
+				'cid'=>$this->staff[0]['cid'],
+				'name'=>$this->staff[0]['username'],
+				'sid'=>$this->staff[0]['sid'],
+				'inputDate'=>date ( "Y-m-d H:i:s" )
+			);
+			$wasteBook->setAccountBookStatistics($item);
+		}
+		*/
 		return "/invoiceReceivablesAS";
 	}
 	
@@ -5704,7 +5858,7 @@ class InvoiceController extends DooController {
 		elseif ($date == 'MONTHT')
 			$con = ' and updateTime>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)';
 		elseif ($date == 'MONTHY')
-			$con = ' and updateTime>DATE_SUB(CURDATE(), INTERVAL 1 YEAR)';
+			$con =' and YEAR(updateTime) = YEAR(NOW())';//$con = ' and updateTime>DATE_SUB(CURDATE(), INTERVAL 1 YEAR)';
 		
 		if ($invoiceType == 'ORDINARY')
 			$con .= ' and invoiceType=0 ';

+ 6 - 2
protected/controller/MainController.php

@@ -208,7 +208,7 @@ class MainController extends DooController {
 		$data ['login'] = "";
 		if (! empty ( $passwork ))
 			$data ['login'] = "inputErrow";
-		
+			
 		$this->render ( "/login", $data );
 	}
 	function out() {
@@ -599,7 +599,7 @@ class MainController extends DooController {
 		// echo $staffCondition;
 		// Doo::db()->beginTransaction();
 		$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 
 		) );
 		
@@ -710,6 +710,10 @@ class MainController extends DooController {
 			$redisCid = '';
 		}
 		
+		//if(!empty($did))
+		//	$categoryCondition=$categoryCondition.' and departmentID='.$did;
+		
+		
 		$redisKey = date ( 'Y-m-d' ) . 'SL_' . $redisCid . '_' . $redisSid;
 		$redisValue = $redis->get ( $redisKey );
 		if (empty ( $redisValue )) {

文件差異過大導致無法顯示
+ 1322 - 81
protected/controller/ReceiptController.php


+ 16 - 6
protected/controller/SettingController.php

@@ -61,6 +61,8 @@ class SettingController extends DooController {
 		if ($detail ['emergencyContacts'] == "")
 			$isShowMsg = true;
 		
+		
+			
 		$this->data ['isShowMsg'] = $isShowMsg;
 		$this->data ['staff'] = $this->staff;
 		$this->data ['memu'] = "adminmyinfo";
@@ -219,7 +221,7 @@ class SettingController extends DooController {
 		
 		$username = $this->get_args ( 'username' ) ? $this->get_args ( 'username' ) : "";
 		$cid_did = $this->get_args ( 'cid_did' ) ? $this->get_args ( 'cid_did' ) : '';
-		$position = $this->get_args ( 'position' ) ? $this->get_args ( 'position' ) : '';
+		//$position = $this->get_args ( 'position' ) ? $this->get_args ( 'position' ) : '';
 		$hiredate = $this->get_args ( 'hiredate' ) ? $this->get_args ( 'hiredate' ) : '';
 		$telephone = $this->get_args ( 'telephone' ) ? $this->get_args ( 'telephone' ) : '';
 		// $baseWage = is_numeric ( $this->get_args ( 'baseWage' ) ) ? $this->get_args ( 'baseWage' ) : 0;
@@ -284,11 +286,11 @@ class SettingController extends DooController {
 				// $staff->username = $username;
 			if (! empty ( $hiredate ))
 				$staff->hiredate = $hiredate;
-			if (! empty ( $position )){
-				$position = explode ( '_', $position );
-				$staff->position = $position[1];
-				$staff->positionId = $position[0];
-			}
+// 			if (! empty ( $position )){
+// 				$position = explode ( '_', $position );
+// 				$staff->position = $position[1];
+// 				$staff->positionId = $position[0];
+// 			}
 				
 				// 办事处-部门
 			if (! empty ( $cid_did )) {
@@ -299,6 +301,7 @@ class SettingController extends DooController {
 					die ( 'illegal request' );
 				$cagegory = $L_category->getCategoryById ( $cid );
 				// 部门
+				$staff->departmentID =0;
 				if (! empty ( $department [1] )) {
 					$did = $XDeode->decode ( $department [1] );
 					if (! is_numeric ( $did ))
@@ -400,6 +403,9 @@ class SettingController extends DooController {
 		$diploma = $this->get_args ( 'diploma' ) ? $this->get_args ( 'diploma' ) : '';
 		$professionalTitle = $this->get_args ( 'professionalTitle' ) ? $this->get_args ( 'professionalTitle' ) : '';
 		
+		$IDcardsValidity = $this->get_args ( 'IDcardsValidity' ) ? $this->get_args ( 'IDcardsValidity' ) : '';
+		
+		
 		Doo::loadModel ( 'staff' );
 		$staff = new staff ();
 		
@@ -459,6 +465,10 @@ class SettingController extends DooController {
 				$staff->professionalTitle = json_encode ( $professionalTitleArray );
 		}
 		
+		if(!empty($IDcardsValidity)){
+			$staff->IDcardsValidity = $IDcardsValidity;
+		}
+		
 		$staff->update ( array (
 				'where' => 'sid=' . $this->staff ['sid'] 
 		) );

+ 118 - 81
protected/model/receipt.php

@@ -1,93 +1,130 @@
 <?php
-
-Doo::loadCore('db/DooModel');
-
+Doo::loadCore ( 'db/DooModel' );
 class receipt extends DooModel {
-
-    public $rid;
-    public $accountItem;
-    
-    public $loanItem;
-    
-    public $staff;
-    
-    public $sum;
-    public $date;
-    public $pastDate;
-    public $executeDate;
-    public $loanDate;
-    
-    
-    public $cid;
-    public $status;
-    public $Rtype;
-    public $isBK;
-    
-    public $loanSum;
-    public $loanRid;
-    
-    public $reviseDetail;
-    public $revisePrice;
-    public $receiptOrder;
-    public $verify;
-   	public $verifyStaff;
-   	
-   	public $executeCopy;
-   	public $executeStaff;
-   	
-   	public $verifyBreakup;
-   	
-   	public $nowStaff;
-   	
-    public $explanation;
-    public $implementOpinions;
-    public $notice;
-    public $amount;
-    public $remittanceName;
-    public $bankName;
-    public $bankNumber;
-    public $coupletNumber;
-    public $remittanceBankType;
-    
-    public $_table = 'CLD_receipt';
-    public $_primarykey = 'rid';
-    
-    public $_fields = array('aid', 'accountItem', 'staff', 'sum', 'date','pastDate' ,'cid', 'status', 'reviseDetail', 'revisePrice', 'verify','verifyStaff',
-    'nowStaff','receiptOrder','explanation','notice','Rtype','loanItem','loanRid','loanSum','implementOpinions','isBK','executeCopy','executeStaff','verifyBreakup','executeDate'
-    		,'amount','loanDate','remittanceName',
+	public $rid;
+	public $accountItem;
+	public $loanItem;
+	public $staff;
+	public $sum;
+	public $date;
+	public $pastDate;
+	public $executeDate;
+	public $loanDate;
+	public $cid;
+	public $status;
+	public $Rtype;
+	public $isBK;
+	public $loanSum;
+	public $loanRid;
+	public $reviseDetail;
+	public $revisePrice;
+	public $receiptOrder;
+	public $verify;
+	public $verifyStaff;
+	public $executeCopy;
+	public $executeStaff;
+	public $verifyBreakup;
+	public $nowStaff;
+	public $explanation;
+	public $implementOpinions;
+	public $notice;
+	public $amount;
+	public $remittanceName;
+	public $bankName;
+	public $bankNumber;
+	public $coupletNumber;
+	public $remittanceBankType;
+	public $_table = 'CLD_receipt';
+	public $_primarykey = 'rid';
+	public $_fields = array (
+			'aid',
+			'accountItem',
+			'staff',
+			'sum',
+			'date',
+			'pastDate',
+			'cid',
+			'status',
+			'reviseDetail',
+			'revisePrice',
+			'verify',
+			'verifyStaff',
+			'nowStaff',
+			'receiptOrder',
+			'explanation',
+			'notice',
+			'Rtype',
+			'loanItem',
+			'loanRid',
+			'loanSum',
+			'implementOpinions',
+			'isBK',
+			'executeCopy',
+			'executeStaff',
+			'verifyBreakup',
+			'executeDate',
+			'amount',
+			'loanDate',
+			'remittanceName',
 			'bankName',
 			'bankNumber',
-			'coupletNumber','remittanceBankType');
-
-	function receiptByYear($dateCondition,$sid){
-    	$sql = "select sum(sum) as sum from " . $this->_table . " where staff= '".$sid."' ".$dateCondition." and status=2 ";
-    	//echo '<div style="display:none">'.$sql.'</div>';
-    	$query = Doo::db ()->query ( $sql );
+			'coupletNumber',
+			'remittanceBankType' 
+	);
+	function receiptByYear($dateCondition, $sid) {
+		$sql = "select sum(sum) as sum from " . $this->_table . " where staff= '" . $sid . "' " . $dateCondition . " and status=2 ";
+		// echo '<div style="display:none">'.$sql.'</div>';
+		$query = Doo::db ()->query ( $sql );
 		$result = $query->fetch ();
 		
 		return $result;
-    }
-    
-    function getReceiptBySid($sid='',$year='',$month=''){
-    	Doo::loadClass ( 'XDeode' );
-    	$XDeode = new XDeode ( 5 );
-    	
-    	if(empty($sid))
-    		return array();
-    	$sql = 'select a.*
+	}
+	function getReceiptBySid($sid = '', $year = '', $month = '') {
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		
+		if (empty ( $sid ))
+			return array ();
+		$sql = 'select a.*
 				from ' . $this->_table . ' as a left join CLD_receiptDetail as b on b.rid=a.rid
-				where b.staff =' . $sid . ' and Month(b.pastDate)=' . $month . ' and Year(b.pastDate)=' . $year.' and b.status=1
+				where b.staff =' . $sid . ' and Month(b.pastDate)=' . $month . ' and Year(b.pastDate)=' . $year . ' and b.status=1
 				GROUP BY b.rid';
-    	
-    	$query = Doo::db ()->query ( $sql );
-    	$list = $query->fetchAll ();
-    	
-    	foreach ($list as $key=>$value){
-    		$list  [$key] ['ridKey'] = $XDeode->encode ( $value ['rid'] );
-    	}
-    	return $list;	
-    }
-   
+		
+		$query = Doo::db ()->query ( $sql );
+		$list = $query->fetchAll ();
+		
+		foreach ( $list as $key => $value ) {
+			$list [$key] ['ridKey'] = $XDeode->encode ( $value ['rid'] );
+		}
+		return $list;
+	}
+	function getReceiptByRid($rid = '') {
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		
+		Doo::loadModel ( 'L_category' );
+		$Lcategory = new L_category ();
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		
+		if (! is_numeric ( $rid ))
+			$rid = $XDeode->decode ( $rid );
+		
+		
+		$rinfo = $this->getOne ( array (
+				'where' => 'rid=' . $rid,
+				'asArray' => true 
+		) );
+		
+		$rinfo['ridKey']=$XDeode->encode ( $rinfo ['rid'] );
+		
+		$rinfo['category']=$Lcategory->getCategoryById($rinfo['cid']);
+		$rinfo['staffDetail']=$staff->getStaffBySid($rinfo['staff']);
+		
+		return $rinfo;
+	}
+	
+	
 }
 
 ?>

+ 60 - 1
protected/model/staff.php

@@ -91,6 +91,8 @@ class staff extends DooModel {
 	
 	public $appliedPromote;
 	
+	public $departmentID;
+	
 	public $_table = 'CLD_staff';
 	public $_primarykey = 'sid';
 	public $_fields = array (
@@ -176,6 +178,8 @@ class staff extends DooModel {
 			'seniorityFormula',
 			'cldAccess',
 
+			'departmentID',
+			
 			'didName',
 			'positionId',
 			'appliedPromote'
@@ -189,12 +193,24 @@ class staff extends DooModel {
 		) );
 	}
 	public function getStaffByName($username = '') {
+		
+		if (empty($username))
+			return array();
 		$detail=$this->getOne ( array (
 				'asc' => 'sid',
 				'where' => "username= '" . $username . "'",
 				'asArray' => TRUE 
 		) );
 		
+		if (empty($detail))
+			return array();
+		Doo::loadModel ( 'department' );
+		$department = new department ();
+		$detail ['departmentName']=array();
+		if($detail['departmentID']!=0){
+			$detail ['departmentName'] =$department->getDepartmentByDid($detail['departmentID']);
+		}
+		
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
 		if (!empty($detail))
@@ -254,12 +270,23 @@ class staff extends DooModel {
 		$XDeode = new XDeode ( 5 );
 		Doo::loadModel ( 'department' );
 		$department = new department ();
+		
+		Doo::loadModel ( 'position' );
+		$position = new position ();
+		
 		$list = $this->find ( array (
 				'where' => $con,
 				'desc' => 'jobNumber',
 				'asArray' => TRUE
 		) );
 		foreach ( $list as $key => $value ) {
+			
+			$list [$key] ['position'] ='';
+			$pdetail=$position->getPositionByPid($value['positionId']);
+			if (!empty($pdetail))
+				$list [$key] ['position'] =$pdetail['positionName'];
+			
+			
 			$list [$key] ['departmentName'] ='';
 			if($value['departmentID']!=0){
 				$list [$key] ['departmentName'] =$department->getDepartmentByDid($value['departmentID']);
@@ -302,6 +329,12 @@ class staff extends DooModel {
 	 */
 	public function getStaffByPositionId($pid=0){
 		
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		
+		if (! is_numeric ( $pid ))
+			$pid = $XDeode->decode ( $pid );
+		
 		$list = $this->find ( array (
 				'where' => "positionId= '" . $pid . "' and username!='admin'",
 				'asArray' => TRUE
@@ -344,8 +377,16 @@ class staff extends DooModel {
 		) );
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
+		Doo::loadModel ( 'position' );
+		$position = new position ();
 		foreach ( $list as $key => $value ) {
 			$list [$key] ['sidKey'] = $XDeode->encode ( $value ['sid'] );
+			
+			$list [$key] ['position'] ='';
+			$pdetail=$position->getPositionByPid($value['positionId']);
+			if (!empty($pdetail))
+				$list [$key] ['position'] =$pdetail['positionName'];
+			
 		}
 		
 		return $list;
@@ -522,6 +563,8 @@ class staff extends DooModel {
 			$positionIdKey=$XDeode->encode ( $detail ['positionId'] );
 			$detail ['positionIdKey']=$positionIdKey;
 			$positionDetail=$position->getPositionByPid($detail ['positionId']);
+			//print_r('/'.$detail ['positionId'].'/');
+			
 			if(empty($positionDetail)){
 				$positionDetail['baseWage']=0;
 				$positionDetail['postWage']=0;
@@ -539,7 +582,10 @@ class staff extends DooModel {
 			$d2 = 1 + ceil((time()-$d1)/60/60/24);
 			$detail['workforceDimission']=$d2;
 			
-			$detail ['cldAccessArray'] = json_decode($detail['cldAccess']);
+			$detail ['cldAccessArray'] =array();
+			if (!empty($detail['cldAccess']))
+			 $detail ['cldAccessArray'] =json_decode($detail['cldAccess']);
+			
 			$detail['sidKey']=$XDeode->encode ( $detail ['sid'] );
 			
 			
@@ -579,6 +625,16 @@ class staff extends DooModel {
 		}
 		return $detail;
 	}
+	
+	public function getApprovalData($sid=0){
+		$list = $this->find ( array (
+				'asc' => 'sid',
+				'where' => "(pendStatus= '2' or pendStatus='3' or pendStatus='5' or pendStatus='6') and ( pendingApprovalsLeave='" . $sid . "' or pendingApprovals='" . $sid . "') ",
+				'asArray' => TRUE
+		) );
+		return $list;
+	}
+	
 	public function getStaffByWxid($wxid = '') {
 		// echo "wxid in ( " . $wxid . ")";
 		if (empty ( $wxid ))
@@ -601,6 +657,9 @@ class staff extends DooModel {
 
 		return $list;
 	}
+	
+	
+	
 }
 
 ?>

+ 7 - 1
protected/model/staffManage.php

@@ -53,7 +53,7 @@ class staffManage extends DooModel {
 	public function getInvoiceCMByStaff($sid = 0) {
 		$lsit = array ();
 		
-		if (!is_numeric($sid)){
+		if (! is_numeric ( $sid )) {
 			Doo::loadClass ( 'XDeode' );
 			$XDeode = new XDeode ( 5 );
 			
@@ -85,6 +85,12 @@ class staffManage extends DooModel {
 			$detail ['staffList'] = array ();
 		else
 			$detail ['staffList'] = json_decode ( $detail ['staff'], true );
+		
+		if (empty ( $detail ['CC'] ))
+			$detail ['staffList'] = array ();
+		else
+			$detail ['staffList'] = json_decode ( $detail ['staff'], true );
+		
 		return $detail;
 	}
 }

+ 23 - 3
protected/plugin/TemplateTag.php

@@ -34,6 +34,8 @@ function isStaffCompleteMsg(){
 	Doo::loadModel ( 'staff' );
 	$staff = new staff ();
 	$isStaffCompleteMsg=false;
+	if (!isset($_COOKIE ["staff"]))
+		return false;
 	$detail = $staff->checkStaffInfoIsComplete ( $_COOKIE ["staff"] );
 	if(!empty($detail))
 		$isStaffCompleteMsg=true;
@@ -48,7 +50,8 @@ function forMatAccess($access=array()){
 			'LOCK' => '在线锁库',
 			'RECEIPTS' => '报销单',
 			'INVOICE' => '发票申请',
-			'HR' => '人资管理'
+			'HR' => '人资管理',
+			'BUILD'=>'建筑计价'
 	);
 	if (empty($access))
 		return '';
@@ -84,8 +87,20 @@ function isShowMenu($menu=''){
 		$staffManage = new staffManage ();
 		$smList=$staffManage->getInvoiceCMByStaff($_COOKIE ["staff"]);
 		
+		//是否有登陆者需要审批的员工
+		$list=array();
+		if ($menu=='HR'){
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		$uid = $XDeode->decode ( $_COOKIE ["staff"] );
+		$list=$staff->find ( array (
+				'asc' => 'sid',
+				'where' => "(pendStatus= '2' or pendStatus='3' or pendStatus='5') and ( pendingApprovalsLeave='".$uid."' or pendingApprovals='".$uid."') ",
+				'asArray' => TRUE
+		) );
+		}
 		
-		if (in_array($menu,$cldAccess)||($st['sid']==superHR&&$menu=='HR')||(!empty($smList)&&$menu=='HR')){
+		if (in_array($menu,$cldAccess)||($st['sid']==superHR&&$menu=='HR')||(count($list)>0&&$menu=='HR')){
 			
 			return true;
 		}
@@ -102,9 +117,14 @@ function isHRNew(){
 	Doo::loadModel ( 'staff' );
 	$staff = new staff ();
 	
+	Doo::loadClass ( 'XDeode' );
+	$XDeode = new XDeode ( 5 );
+	
+	$uid = $XDeode->decode ( $_COOKIE ["staff"] );
+	
 	$list=$staff->find ( array (
 			'asc' => 'sid',
-			'where' => "(pendStatus= '2' or pendStatus='3' or pendStatus='5') ",
+			'where' => "(pendStatus= '2' or pendStatus='3' or pendStatus='5' or pendStatus='6') and ( pendingApprovalsLeave='".$uid."' or pendingApprovals='".$uid."') ",
 			'asArray' => TRUE
 	) );
 	

+ 1 - 1
protected/view/admin/approvalExpenses.html

@@ -65,7 +65,7 @@
 	  					
 	  					<li >
 						<select name="year" id="Y" onChange="receiptYear();">
-	  					<!-- include 'year' -->
+	  					{{dateHtml}}
 	  					</select>
 	  					<select name="month" id="M" onChange="receiptMoth();">
 	  					<option value="">所有月份</option>

+ 1 - 1
protected/view/admin/expenses.html

@@ -34,7 +34,7 @@
 					
 	  					<li>
 	  					<select name="year" id="Y" onchange="receiptYear();">
-	  					<!-- include 'year' -->
+	  					{{dateHtml}}
 	  					</select> 
 	  					<select name="moth" id="M" onchange="receiptMoth();">
 	  					<option value="">所有月份</option>

+ 37 - 3
protected/view/admin/implement.html

@@ -211,9 +211,20 @@
 								
 								
 								</td></tr>
+								
+								<tr><th>支付银行</th><td class="taR" width="200">
+								<select name="accountBank" id="accountBankSelectLoan">
+									<option value="CGBDeposit">纵横广发</option>
+									<option value="ICBCDeposit">纵横工行</option>
+									<option value="HUADeposit">华润银行</option>
+									<option value="PersonalDeposit">个人广发</option>
+									</select>
+									</td></tr>
+								
 							</tbody>
 						</table>
 	  				
+	  				
 					</div>
 	  			
 	  			
@@ -222,6 +233,9 @@
 	  					<form method="post" action="/implementDo" id="implementLoan" >
 	  					<input type="hidden" name='rid' value="{{receiptList' value.rid}}" >
 	  					<input type="hidden" name="amount" id="amountInpLoan" value="{{receiptList' value.amount}}">
+	  					
+	  					<input type="hidden" name="accountBank" id="accountBankLoan" value="">
+	  					
 	  					<div class="title">
 	  					{{receiptDetail' value.receiptOrder}}
 	  					</div>
@@ -361,14 +375,21 @@
 								<tr><th>汇款金额(用于生成汇款单)</th>
 								<td class="taR" width="200">¥
 								
-								
-								
 								<input placeholder="输入汇款金额" pattern="[0-9]" data-tm="{{receiptDetail' value.sum}}" id="amountPublic" step="1" min="0" value="{{receiptList' value.amount}}" class="span2" type="number">
 								<button class="btn btn-small" node-qmk="tm" data='amountPublic'  type="button">取值</button>
 								
+								</td></tr>
 								
 								
-								</td></tr>
+								<tr><th>支付银行</th><td class="taR" width="200">
+								<select name="accountBank" id="accountBankSelectPublic">
+									<option value="CGBDeposit">纵横广发</option>
+									<option value="ICBCDeposit">纵横工行</option>
+									<option value="HUADeposit">华润银行</option>
+									<option value="PersonalDeposit">个人广发</option>
+									</select>
+									</td></tr>
+								
 							</tbody>
 						</table>
 	  					
@@ -380,6 +401,9 @@
 	  					<form method="post" action="/implementDo" id="implementPublic" >
 	  					<input type="hidden" name='rid' value="{{receiptList' value.rid}}" >
 	  					<input type="hidden" name="amount" id="amountInpPublic" value="{{receiptList' value.amount}}">
+	  					
+	  					<input type="hidden" name="accountBank" id="accountBankPublic" value="">
+	  					
 	  					<div class="title">
 	  					{{receiptDetail' value.receiptOrder}}
 	  					</div>
@@ -556,6 +580,15 @@
 								<button class="btn btn-small" node-qmk="tm" data='amountReceipt'  type="button">取值</button>
 								
 								
+								<tr><th>支付银行</th><td class="taR" width="200">
+								<select name="accountBank" id="accountBankSelectReceipt">
+									<option value="CGBDeposit">纵横广发</option>
+									<option value="ICBCDeposit">纵横工行</option>
+									<option value="HUADeposit">华润银行</option>
+									<option value="PersonalDeposit">个人广发</option>
+									</select>
+									</td></tr>
+								
 								
 								</td></tr>
 							</tbody>
@@ -570,6 +603,7 @@
 	  					<input type="hidden" name='rid' value="{{receiptList' value.rid}}" >
 	  					<input type="hidden" name="amount" id="amountInpReceipt" value="{{receiptList' value.amount}}">
 	  					
+	  					<input type="hidden" name="accountBank" id="accountBankReceipt" value="">
 	  					
 	  					<div class="title">
 	  					{{receiptDetail' value.receiptOrder}}

+ 4 - 2
protected/view/admin/invoiceAS.html

@@ -183,8 +183,10 @@
 					<tr>
 						<th class="taC">收款银行</th><td>
 						<select name="receivablesBank">
-								<option value="公司广发">公司广发</option>
-								<option value="其他">其他</option>
+								<option value="纵横广发">纵横广发</option>
+									<option value="纵横工行">纵横工行</option>
+									<option value="华润银行">华润银行</option>
+									<option value="个人广发">个人广发</option>
 							</select>
 							</td>
 					</tr>

+ 2 - 2
protected/view/admin/invoiceAchieve.html

@@ -30,8 +30,8 @@
 							<div class="search">
 							<div class="input-append">
 								<form action="/invoiceAchieve/1/{{date}}" id="ira" method="get" >
-								<input class="span3" type="text"  data-irmMebSea value="{{MebSeaEn}}" placeholder="发票抬头、开票金额">
-								<button class="btn btn-small" node-iramMebSea type="button">搜索</button>
+								<input class="span3" type="text" name="MebSea"  data-irmMebSea value="{{MebSeaEn}}" placeholder="发票抬头、开票金额">
+								<button class="btn btn-small" node-iramMebSea type="submit">搜索</button>
 								</form>
 							</div>
 						</li>

+ 2 - 2
protected/view/admin/invoiceElement.html

@@ -4,7 +4,7 @@
 <option <!-- if {{invoiceDetail.invoiceElement}}=='纵横公路工程设计数量表算量软件V3.3' --> selected <!-- endif --> value="纵横公路工程设计数量表算量软件V3.3">纵横公路工程设计数量表算量软件V3.3</option>
 <option <!-- if {{invoiceDetail.invoiceElement}}=='纵横公路工程计量支付决算一体化软件V3.3' --> selected <!-- endif --> value="纵横公路工程计量支付决算一体化软件V3.3">纵横公路工程计量支付决算一体化软件V3.3</option>
 <option <!-- if {{invoiceDetail.invoiceElement}}=='纵横公路造价编审软件V9.0' --> selected <!-- endif --> value="纵横公路造价编审软件V9.0">纵横公路造价编审软件V9.0</option>
-<option <!-- if {{invoiceDetail.invoiceElement}}=='纵横公路养护造价管理软件V10.1' --> selected <!-- endif --> value="纵横公路养护造价管理软件V10.1">纵横公路养护造价管理软件V10.1</option>
+<!-- <option <!-- if {{invoiceDetail.invoiceElement}}=='纵横公路养护造价管理软件V10.1' --> selected <!-- endif --> value="纵横公路养护造价管理软件V10.1">纵横公路养护造价管理软件V10.1</option> -->
 <option <!-- if {{invoiceDetail.invoiceElement}}=='纵横公路工程计量支付决算一体化云版软件V3.3' --> selected <!-- endif --> value="纵横公路工程计量支付决算一体化云版软件V3.3">纵横公路工程计量支付决算一体化云版软件V3.3</option>
 <option <!-- if {{invoiceDetail.invoiceElement}}=='培训费' --> selected <!-- endif --> value="培训费">培训费</option>
 <option <!-- if {{invoiceDetail.invoiceElement}}=='服务费' --> selected <!-- endif --> value="服务费">服务费</option>
@@ -16,7 +16,7 @@
 <option value="纵横公路工程设计数量表算量软件V3.3">纵横公路工程设计数量表算量软件V3.3</option>
 <option value="纵横公路工程计量支付决算一体化软件V3.3">纵横公路工程计量支付决算一体化软件V3.3</option>
 <option value="纵横公路造价编审软件V9.0">纵横公路造价编审软件V9.0</option>
-<option value="纵横公路养护造价管理软件V10.1">纵横公路养护造价管理软件V10.1</option>
+<!-- <option value="纵横公路养护造价管理软件V10.1">纵横公路养护造价管理软件V10.1</option>  -->
 <option value="纵横公路工程计量支付决算一体化云版软件V3.3">纵横公路工程计量支付决算一体化云版软件V3.3</option>
 <option value="培训费">培训费</option>
 <option value="服务费">服务费</option>

+ 8 - 4
protected/view/admin/invoiceReceivables.html

@@ -334,8 +334,10 @@
 					<tr>
 						<th class="taC">收款银行</th><td>
 						<select name="receivablesBank">
-								<option value="公司广发">公司广发</option>
-								<option value="其他">其他</option>
+								<option value="纵横广发">纵横广发</option>
+									<option value="纵横工行">纵横工行</option>
+									<option value="华润银行">华润银行</option>
+									<option value="个人广发">个人广发</option>
 							</select>
 							</td>
 					</tr>
@@ -428,8 +430,10 @@
 						<tr>
 							<th class="taC">收款银行</th><td>
 							<select name="receivablesBank">
-								<option value="公司广发">公司广发</option>
-								<option value="其他">其他</option>
+								<option value="纵横广发">纵横广发</option>
+									<option value="纵横工行">纵横工行</option>
+									<option value="华润银行">华润银行</option>
+									<option value="个人广发">个人广发</option>
 							</select>
 							</td>
 						</tr>

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

@@ -32,6 +32,8 @@
 	
 	<li><a href="/paymentsCollect" <!-- if {{receiptMemu}}=="paymentsCollect" --> class="selected" <!-- endif --> >日常收支汇总</a></li>
 	
+	<li><a href="/wasteBook" <!-- if {{receiptMemu}}=="wasteBook" --> class="selected" <!-- endif --> >公司流水</a></li>
+	
 	<li class="topLine"><a href="#welcome" data-toggle="modal">使用帮助</a></li>
 
 	</ul>

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

@@ -52,7 +52,6 @@
 	  							<tr><th>{{receiptList' value' value.name}}</th><td  width="140" class="taR">¥{{receiptList' value' value.price}}</td></tr>
 	  						<!-- endloop -->
 							
-							
 							<tr><th class="taC" colspan="2">产生费用所在办事处</th></tr>
 							<tr><th style="text-align:center" colspan="2">{{receiptDetail' value.category}}</th></tr>
 							<tr><th class="taC" colspan="2">费用说明</th>

+ 1 - 1
protected/view/admin/remittanceHky.html

@@ -28,7 +28,7 @@
 					<ul class="cateList">
 	  					<li>
 	  					<select  id="Y" onchange="receiptYear();">
-	  					<!-- include 'year' -->
+	  					{{dateHtml}}
 	  					</select> 
 	  					<select  id="M" onchange="receiptMoth()">
 	  					<option value="MONTH" <!-- if {{moth}}=='MONTH' --> selected <!-- endif --> >月</option>

+ 1 - 1
protected/view/admin/saeaCollectArticles.html

@@ -26,7 +26,7 @@
 	<li><a href="/personalCollect">汇总</a><a href="/personalCollectDetail" class="now">细则</a></li>
 	<li>
 <select name="year" id="Y" onchange="receiptYear();">
-	  					<!-- include 'year' --></select>
+	  					{{dateHtml}}</select>
 	</li>
 	<li>报销总计:¥{{stList.rePrice}}</li>
 	<li>同意支付:<span class="colGreen">¥{{stList.agPrice}}</span></li>

+ 1 - 1
protected/view/admin/saeaCompanyCollect.html

@@ -25,7 +25,7 @@
 	<li><a href="/companyCategoryCollect" class="now">按办事处</a><a
 		href="/staffCollect">按员工</a></li>
 	<li><select name="year" id="Y" onchange="receiptYear();">
-		<!-- include 'year' -->
+		{{dateHtml}}
 	</select>
 	
 	<select onchange="javascript:location.href=this.value;">

+ 1 - 1
protected/view/admin/saea_slist_collect.html

@@ -28,7 +28,7 @@
 		href="/personalCollectDetail">细则</a></li>
 	<li>		
 	<select name="year" id="Y" onchange="receiptYear();">
-	  					<!-- include 'year' -->
+	  					{{dateHtml}}
 	  					</select>
 	</li>
 	<li>报销总计:¥{{stList.rePrice}}</li>

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

@@ -2,4 +2,5 @@
 <option <!-- if {{year}}==2015 --> selected <!-- endif --> value="2015">2015</option>
 <option <!-- if {{year}}==2016 --> selected <!-- endif --> value="2016">2016</option>
 <option <!-- if {{year}}==2017 --> selected <!-- endif --> value="2017">2017</option>
-<option <!-- if {{year}}==2018 --> selected <!-- endif --> value="2018">2018</option>
+<option <!-- if {{year}}==2018 --> selected <!-- endif --> value="2018">2018</option>
+<option <!-- if {{year}}==2019 --> selected <!-- endif --> value="2019">2019</option>

+ 1 - 1
protected/view/humanResource/hr.html

@@ -162,7 +162,7 @@
 			<div class="modal-header">
 					<h3>员工离职审批</h3>
 				</div>
-			<div id='staffDetailAD'>
+			<div id='staffDetailDi'>
 			</div>
 			
 			

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

@@ -219,9 +219,9 @@
 								<th class="taC" width="150">岗位</th>
 								<td>
 								
-								<select name='position' id='position'>
+								<select name='position' id='positionStaffAddSelect'>
 								<!-- loop listPosition -->
-								<option value="{{categoryList' value.pidKey}}_{{categoryList' value.positionName}}">{{categoryList' value.positionName}}</option>
+								<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>
 								
@@ -239,13 +239,13 @@
 						<table class="table table-bordered table-condensed">
 							<tr>
 								<th class="taC" width="150">基本工资</th>
-								<td width="210"><input name='baseWage' id='baseWage' value="" type="number"></td>
+								<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='postWage' value="" type="number"></td>
+								<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='achievementBonus' value="" type="number"></td>
+								<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>

+ 10 - 5
protected/view/humanResource/hrMenu.html

@@ -1,12 +1,15 @@
 
 <ul>
 	<li class="staffTitle">人资管理</li>
-	<!-- if {{isHR}}||{{isALLHR}} -->
-	<li><a <!-- if {{hrMemu}}=="hr" -->
-	 class="selected <!-- if isHRNew() --> news <!-- endif --> " <!-- endif --> href="/hr">首页</a></li>
-	<!-- endif -->
 	
-	<!-- if {{isALLHR}} -->
+	
+	
+	<li><a 
+	 class=" <!-- if {{hrMemu}}=="hr" --> selected <!-- endif --> <!-- if isHRNew() --> news <!-- endif --> "  href="/hr">首页</a></li>
+	
+	
+	
+	<!-- if !{{exempt}} -->
 	
 	<!-- 
 	<li><a href="staff-organization.html">组织</a></li>
@@ -37,6 +40,8 @@
 			>审批流程设置
 	</a></li>
 	
+	
 	<!-- endif -->
+	
 </ul>
 

+ 1 - 1
protected/view/lock_look.html

@@ -202,7 +202,7 @@
 						  <div class="control-group">
 						    <label class="control-label" for="inputPassword">备注</label>
 						    <div class="controls">
-						      <textarea style="width:95%" rows="5" name="mark" id="mark"></textarea>
+						      <textarea id="marks" style="width:95%" rows="5" name="mark" >123</textarea>
 						    </div>
 						  </div>
 					</div>

+ 1 - 1
protected/view/login.html

@@ -65,7 +65,7 @@
 								<th class="taC" width="150">办事处/部门</th>
 								<td>
 								<select disabled>
-								<option>{{staff.category}}</option>
+								<option>{{staff.category}} <!-- if !empty({{{staff.departmentName}}) --> {{staff.departmentName.departmentName}}<!-- endif --></option>
 								</select></td>
 								<th class="taC" width="150">岗位</th><td><input type="text" value="{{staff.position}}" disabled></td>
 							</tr>

+ 1 - 1
protected/view/setting/settingCredentialInfo.html

@@ -167,7 +167,7 @@
 						</tr>
 						<tr>
 							<th class="taC" width="150"><b class="colRed">* </b>身份证有效期</th>
-							<td <!-- if {{staff.IDcardsValidity}}='0000-00-00' --> class="alert-warning" <!-- endif --> colspan="3">
+							<td <!-- if {{staff.IDcardsValidity}}=='0000-00-00' --> class="alert-warning" <!-- endif --> colspan="3">
 							<input type="date" name="IDcardsValidity" value="{{staff.IDcardsValidity}}"></td>
 						</tr>
 						<tr>

+ 10 - 11
protected/view/setting/settingEmployeeInfo.html

@@ -36,7 +36,7 @@
 						<a href="#resignation" data-toggle="modal" class="button fR">离职申请</a>
 						
 					<!-- endif -->
-					<!-- if {{staff.nature}}==2||{{staff.nature}}==3 -->
+					<!-- if ({{staff.nature}}==2||{{staff.nature}}==3)&&{{staff.pendStatus}}!=5 -->
 					<a href="#turn" data-toggle="modal" class="button fR">转正申请</a>
 					<!-- endif -->
 					
@@ -65,7 +65,7 @@
 							<td>
 							{{staff.category}}<!-- if !empty({{staff.departmentID}}) -->/{{staff.department.departmentName}}<!-- endif -->
 							</td>
-							<th class="taC" width="150"><b class="colRed">* </b>岗位</th><td><input type="text" value="{{staff.position}}" disabled></td>
+							<th class="taC" width="150"><b class="colRed">* </b>岗位</th><td><input type="text" value="{{staff.positionDetail.positionName}}" disabled></td>
 						</tr>
 						<tr>
 							<th class="taC" width="150"><b class="colRed">* </b>入职日期</th><td><input type="date" value="{{staff.hiredate}}" disabled></td>
@@ -98,7 +98,7 @@
 							<th class="taC" width="150">民族</th><td<!-- if empty({{staff.nation}}) --> class="alert-warning" <!-- endif -->><input type="text" name='nation' id='nation' value='{{staff.nation}}'></td>
 							<th class="taC" width="150"><b class="colRed">* </b>婚姻状况</th>
 							<td>
-							<select name='marriage' id='marriage' <!-- if empty({{staff.marriage}}) --> class="alert-warning" <!-- endif -->>
+							<select name='marriage' id='marriage' <!-- if {{staff.marriage}}=='' --> class="alert-warning" <!-- endif -->>
 							<option <!-- if {{staff.marriage}}=='' -->selected<!-- endif --> value='请选择'>请选择</option>
 							<option <!-- if {{staff.marriage}}=='1' -->selected<!-- endif --> value='1'>已婚</option>
 							<option <!-- if {{staff.marriage}}=='0' -->selected<!-- endif --> value='0'>未婚</option>
@@ -121,16 +121,15 @@
 							<th class="taC" width="150">毕业学历</th>
 							<td<!-- if empty({{staff.education}}) --> class="alert-warning" <!-- endif -->>
 							<select name='education' id='education' >
-							<option value=''>请选择</option>
-							<option value='初中'>初中</option>
-							<option value='高中'>高中</option>
-							<option value='中专'>中专</option>
-							<option value='大专'>大专</option>
-							<option value='本科'>本科</option>
-							<option value='硕士'>硕士</option>
+							<option <!-- if {{staff.education}}=='初中' -->selected<!-- endif --> value='初中'>初中</option>
+							<option <!-- if {{staff.education}}=='高中' -->selected<!-- endif --> value='高中'>高中</option>
+							<option <!-- if {{staff.education}}=='中专' -->selected<!-- endif --> value='中专'>中专</option>
+							<option <!-- if {{staff.education}}=='大专' -->selected<!-- endif --> value='大专'>大专</option>
+							<option <!-- if {{staff.education}}=='本科' -->selected<!-- endif --> value='本科'>本科</option>
+							<option <!-- if {{staff.education}}=='硕士' -->selected<!-- endif --> value='硕士'>硕士</option>
 							</select></td>
 							<th class="taC" width="150">毕业时间</th>
-							<td<!-- if {{staff.graduationTime}}='0000-00-00' --> class="alert-warning" <!-- endif -->>
+							<td<!-- if {{staff.graduationTime}}=='0000-00-00' --> class="alert-warning" <!-- endif -->>
 							<input type="date" name='graduationTime' id='graduationTime' value='{{staff.graduationTime}}'></td>
 						</tr>
 						<tr>