- Employee, Position 모델 생성 (tenant_user_profiles, positions 테이블) - EmployeeService 생성 (CRUD, 통계, 필터/검색/페이지네이션) - 뷰 컨트롤러(HR/EmployeeController) + API 컨트롤러 생성 - Blade 뷰: index(통계카드+HTMX테이블), create, edit, show, partials/table - 라우트: web.php(/hr/employees/*), api.php(/admin/hr/employees/*)
153 lines
8.6 KiB
PHP
153 lines
8.6 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', '사원 상세')
|
|
|
|
@section('content')
|
|
<div class="container mx-auto px-4 py-6 max-w-3xl">
|
|
{{-- 페이지 헤더 --}}
|
|
<div class="mb-6">
|
|
<a href="{{ route('hr.employees.index') }}" class="text-sm text-gray-500 hover:text-gray-700 inline-flex items-center gap-1 mb-2">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"/>
|
|
</svg>
|
|
사원 목록으로
|
|
</a>
|
|
<div class="flex items-center justify-between">
|
|
<h1 class="text-2xl font-bold text-gray-800">사원 상세</h1>
|
|
<a href="{{ route('hr.employees.edit', $employee->id) }}"
|
|
class="inline-flex items-center gap-2 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-lg transition-colors">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/>
|
|
</svg>
|
|
수정
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- 프로필 카드 --}}
|
|
<div class="bg-white rounded-lg shadow-sm p-6 mb-6">
|
|
<div class="flex items-center gap-5">
|
|
<div class="shrink-0 w-16 h-16 rounded-full bg-blue-100 text-blue-600 flex items-center justify-center text-2xl font-bold">
|
|
{{ mb_substr($employee->display_name ?? $employee->user?->name ?? '?', 0, 1) }}
|
|
</div>
|
|
<div>
|
|
<h2 class="text-xl font-bold text-gray-900">
|
|
{{ $employee->display_name ?? $employee->user?->name ?? '-' }}
|
|
</h2>
|
|
<div class="flex flex-wrap items-center gap-2 mt-1">
|
|
@if($employee->employee_code)
|
|
<span class="text-sm text-gray-500">{{ $employee->employee_code }}</span>
|
|
<span class="text-gray-300">|</span>
|
|
@endif
|
|
@if($employee->department)
|
|
<span class="text-sm text-gray-500">{{ $employee->department->name }}</span>
|
|
<span class="text-gray-300">|</span>
|
|
@endif
|
|
<span class="text-sm text-gray-500">{{ $employee->position_label ?? '-' }}</span>
|
|
@if($employee->job_title_label)
|
|
<span class="text-gray-300">|</span>
|
|
<span class="text-sm text-gray-500">{{ $employee->job_title_label }}</span>
|
|
@endif
|
|
</div>
|
|
<div class="mt-2">
|
|
@switch($employee->employee_status)
|
|
@case('active')
|
|
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-emerald-100 text-emerald-700">재직</span>
|
|
@break
|
|
@case('leave')
|
|
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-amber-100 text-amber-700">휴직</span>
|
|
@break
|
|
@case('resigned')
|
|
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-700">퇴직</span>
|
|
@break
|
|
@endswitch
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- 상세 정보 --}}
|
|
<div class="bg-white rounded-lg shadow-sm overflow-hidden">
|
|
<div class="px-6 py-4 border-b border-gray-200">
|
|
<h3 class="text-lg font-semibold text-gray-800">상세 정보</h3>
|
|
</div>
|
|
<div class="divide-y divide-gray-100">
|
|
{{-- 기본 정보 --}}
|
|
<div class="px-6 py-3 flex" style="flex-wrap: wrap;">
|
|
<div class="shrink-0 text-sm font-medium text-gray-500" style="width: 140px;">이름</div>
|
|
<div class="text-sm text-gray-900">{{ $employee->user?->name ?? '-' }}</div>
|
|
</div>
|
|
<div class="px-6 py-3 flex" style="flex-wrap: wrap;">
|
|
<div class="shrink-0 text-sm font-medium text-gray-500" style="width: 140px;">표시 이름</div>
|
|
<div class="text-sm text-gray-900">{{ $employee->display_name ?? '-' }}</div>
|
|
</div>
|
|
<div class="px-6 py-3 flex" style="flex-wrap: wrap;">
|
|
<div class="shrink-0 text-sm font-medium text-gray-500" style="width: 140px;">사번</div>
|
|
<div class="text-sm text-gray-900">{{ $employee->employee_code ?? '-' }}</div>
|
|
</div>
|
|
<div class="px-6 py-3 flex" style="flex-wrap: wrap;">
|
|
<div class="shrink-0 text-sm font-medium text-gray-500" style="width: 140px;">이메일</div>
|
|
<div class="text-sm text-gray-900">{{ $employee->user?->email ?? '-' }}</div>
|
|
</div>
|
|
<div class="px-6 py-3 flex" style="flex-wrap: wrap;">
|
|
<div class="shrink-0 text-sm font-medium text-gray-500" style="width: 140px;">연락처</div>
|
|
<div class="text-sm text-gray-900">{{ $employee->user?->phone ?? '-' }}</div>
|
|
</div>
|
|
|
|
{{-- 근무 정보 --}}
|
|
<div class="px-6 py-4 bg-gray-50">
|
|
<span class="text-sm font-semibold text-gray-600">근무 정보</span>
|
|
</div>
|
|
<div class="px-6 py-3 flex" style="flex-wrap: wrap;">
|
|
<div class="shrink-0 text-sm font-medium text-gray-500" style="width: 140px;">부서</div>
|
|
<div class="text-sm text-gray-900">{{ $employee->department?->name ?? '-' }}</div>
|
|
</div>
|
|
<div class="px-6 py-3 flex" style="flex-wrap: wrap;">
|
|
<div class="shrink-0 text-sm font-medium text-gray-500" style="width: 140px;">직급</div>
|
|
<div class="text-sm text-gray-900">{{ $employee->position_label ?? '-' }}</div>
|
|
</div>
|
|
<div class="px-6 py-3 flex" style="flex-wrap: wrap;">
|
|
<div class="shrink-0 text-sm font-medium text-gray-500" style="width: 140px;">직책</div>
|
|
<div class="text-sm text-gray-900">{{ $employee->job_title_label ?? '-' }}</div>
|
|
</div>
|
|
<div class="px-6 py-3 flex" style="flex-wrap: wrap;">
|
|
<div class="shrink-0 text-sm font-medium text-gray-500" style="width: 140px;">입사일</div>
|
|
<div class="text-sm text-gray-900">{{ $employee->hire_date ?? '-' }}</div>
|
|
</div>
|
|
<div class="px-6 py-3 flex" style="flex-wrap: wrap;">
|
|
<div class="shrink-0 text-sm font-medium text-gray-500" style="width: 140px;">재직상태</div>
|
|
<div class="text-sm text-gray-900">
|
|
@switch($employee->employee_status)
|
|
@case('active') 재직 @break
|
|
@case('leave') 휴직 @break
|
|
@case('resigned') 퇴직 @break
|
|
@default {{ $employee->employee_status }} @break
|
|
@endswitch
|
|
</div>
|
|
</div>
|
|
|
|
{{-- 추가 정보 --}}
|
|
<div class="px-6 py-4 bg-gray-50">
|
|
<span class="text-sm font-semibold text-gray-600">추가 정보</span>
|
|
</div>
|
|
<div class="px-6 py-3 flex" style="flex-wrap: wrap;">
|
|
<div class="shrink-0 text-sm font-medium text-gray-500" style="width: 140px;">주소</div>
|
|
<div class="text-sm text-gray-900">{{ $employee->address ?? '-' }}</div>
|
|
</div>
|
|
<div class="px-6 py-3 flex" style="flex-wrap: wrap;">
|
|
<div class="shrink-0 text-sm font-medium text-gray-500" style="width: 140px;">비상연락처</div>
|
|
<div class="text-sm text-gray-900">{{ $employee->emergency_contact ?? '-' }}</div>
|
|
</div>
|
|
<div class="px-6 py-3 flex" style="flex-wrap: wrap;">
|
|
<div class="shrink-0 text-sm font-medium text-gray-500" style="width: 140px;">등록일</div>
|
|
<div class="text-sm text-gray-900">{{ $employee->created_at?->format('Y-m-d H:i') ?? '-' }}</div>
|
|
</div>
|
|
<div class="px-6 py-3 flex" style="flex-wrap: wrap;">
|
|
<div class="shrink-0 text-sm font-medium text-gray-500" style="width: 140px;">수정일</div>
|
|
<div class="text-sm text-gray-900">{{ $employee->updated_at?->format('Y-m-d H:i') ?? '-' }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|