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