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