feat: [hr] 사원관리 영업팀 제외 및 강제 제외 기능 추가
- 영업팀 포함 부서 사원 기본 제외 (외부직원) - json_extra.is_excluded 플래그로 강제 제외/복원 토글 - 필터에 '제외 사원 표시' 체크박스 추가 - 제외 사원 시각적 구분 (주황 배경, 제외 뱃지)
This commit is contained in:
@@ -300,6 +300,38 @@ public function forceDestroy(Request $request, int $id): JsonResponse|Response
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 사원 제외/복원 토글
|
||||
*/
|
||||
public function toggleExclude(Request $request, int $id): JsonResponse|Response
|
||||
{
|
||||
$employee = $this->employeeService->toggleExclude($id);
|
||||
|
||||
if (! $employee) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => '사원 정보를 찾을 수 없습니다.',
|
||||
], 404);
|
||||
}
|
||||
|
||||
$isExcluded = $employee->getJsonExtraValue('is_excluded', false);
|
||||
|
||||
if ($request->header('HX-Request')) {
|
||||
$employees = $this->employeeService->getEmployees(
|
||||
$request->all(),
|
||||
$request->integer('per_page', 20)
|
||||
);
|
||||
|
||||
return response(view('hr.employees.partials.table', compact('employees')));
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => $isExcluded ? '사원이 목록에서 제외되었습니다.' : '사원이 목록에 복원되었습니다.',
|
||||
'is_excluded' => $isExcluded,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 사원 첨부파일 업로드 (로컬 + GCS 듀얼 저장)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user