feat: [attendance] 근태현황/근태관리 메뉴 분리

- 근태현황(/hr/attendances): 조회 전용 (목록/캘린더/요약)
- 근태관리(/hr/attendances/manage): CRUD + 승인 관리
- table-manage.blade.php: 관리용 테이블 (체크박스/수정/삭제)
- table.blade.php: 조회용 테이블 (GPS 포함, CRUD 제거)
- API 컨트롤러 view 파라미터로 테이블 분기
This commit is contained in:
김보곤
2026-02-26 22:20:48 +09:00
parent 4462646550
commit 5283487f7e
7 changed files with 978 additions and 709 deletions

View File

@@ -6,6 +6,8 @@
use App\Models\HR\Attendance;
use App\Services\HR\AttendanceService;
use Illuminate\Contracts\View\View;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class AttendanceController extends Controller
{
@@ -14,17 +16,35 @@ public function __construct(
) {}
/**
* 근태현황 목록 페이지
* 근태현황 목록 페이지 (조회 전용)
*/
public function index(): View
{
$stats = $this->attendanceService->getMonthlyStats();
$departments = $this->attendanceService->getDepartments();
$employees = $this->attendanceService->getActiveEmployees();
$statusMap = Attendance::STATUS_MAP;
return view('hr.attendances.index', [
'stats' => $stats,
'departments' => $departments,
'statusMap' => $statusMap,
]);
}
/**
* 근태관리 페이지 (등록/수정/삭제/승인)
*/
public function manage(Request $request): View|Response
{
if ($request->header('HX-Request')) {
return response('', 200)->header('HX-Redirect', route('hr.attendances.manage'));
}
$departments = $this->attendanceService->getDepartments();
$employees = $this->attendanceService->getActiveEmployees();
$statusMap = Attendance::STATUS_MAP;
return view('hr.attendances.manage', [
'departments' => $departments,
'employees' => $employees,
'statusMap' => $statusMap,