feat: [hr] 사원관리 영업팀 제외 및 강제 제외 기능 추가
- 영업팀 포함 부서 사원 기본 제외 (외부직원) - json_extra.is_excluded 플래그로 강제 제외/복원 토글 - 필터에 '제외 사원 표시' 체크박스 추가 - 제외 사원 시각적 구분 (주황 배경, 제외 뱃지)
This commit is contained in:
@@ -86,7 +86,13 @@ class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 f
|
||||
<option value="default" {{ request('sort_by') === 'default' ? 'selected' : '' }}>상태순</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="shrink-0">
|
||||
<div class="shrink-0 flex items-end gap-3">
|
||||
<label class="flex items-center gap-1.5 cursor-pointer py-2">
|
||||
<input type="checkbox" name="show_excluded" value="1"
|
||||
{{ request('show_excluded') ? 'checked' : '' }}
|
||||
class="rounded border-gray-300 text-blue-600 focus:ring-blue-500">
|
||||
<span class="text-xs text-gray-500 whitespace-nowrap">제외 사원 표시</span>
|
||||
</label>
|
||||
<button type="submit"
|
||||
hx-get="{{ route('api.admin.hr.employees.index') }}"
|
||||
hx-target="#employees-table"
|
||||
|
||||
@@ -40,7 +40,8 @@
|
||||
</thead>
|
||||
<tbody class="bg-white divide-y divide-gray-100">
|
||||
@forelse($employees as $employee)
|
||||
<tr class="hover:bg-gray-50 transition-colors {{ $employee->employee_status === 'resigned' ? 'opacity-50' : '' }}">
|
||||
@php $isExcludedRow = $employee->getJsonExtraValue('is_excluded', false) || ($employee->department && str_contains($employee->department->name, '영업팀')); @endphp
|
||||
<tr class="hover:bg-gray-50 transition-colors {{ $employee->employee_status === 'resigned' ? 'opacity-50' : '' }} {{ $isExcludedRow ? 'bg-orange-50 opacity-60' : '' }}">
|
||||
{{-- 사원 정보 --}}
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<a href="{{ route('hr.employees.show', $employee->id) }}"
|
||||
@@ -49,8 +50,11 @@ class="flex items-center gap-3 group">
|
||||
{{ mb_substr($employee->display_name ?? $employee->user?->name ?? '?', 0, 1) }}
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-sm font-medium text-gray-900 group-hover:text-blue-600">
|
||||
<div class="text-sm font-medium text-gray-900 group-hover:text-blue-600 flex items-center gap-1.5">
|
||||
{{ $employee->display_name ?? $employee->user?->name ?? '-' }}
|
||||
@if($isExcludedRow)
|
||||
<span class="inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-orange-100 text-orange-600">제외</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
@@ -129,6 +133,28 @@ class="text-blue-600 hover:text-blue-800" title="수정">
|
||||
</svg>
|
||||
</a>
|
||||
|
||||
{{-- 제외/복원 --}}
|
||||
@php $isExcluded = $employee->getJsonExtraValue('is_excluded', false); @endphp
|
||||
<button type="button"
|
||||
hx-post="{{ route('api.admin.hr.employees.toggle-exclude', $employee->id) }}"
|
||||
hx-headers='{"X-CSRF-TOKEN": "{{ csrf_token() }}"}'
|
||||
hx-target="#employees-table"
|
||||
hx-swap="innerHTML"
|
||||
hx-include="#employeeFilterForm"
|
||||
hx-confirm="{{ $isExcluded ? ($employee->display_name ?? $employee->user?->name) . '님을 사원 목록에 복원하시겠습니까?' : ($employee->display_name ?? $employee->user?->name) . '님을 사원 목록에서 제외하시겠습니까?' }}"
|
||||
class="{{ $isExcluded ? 'text-green-600 hover:text-green-800' : 'text-orange-500 hover:text-orange-700' }}"
|
||||
title="{{ $isExcluded ? '복원' : '제외' }}">
|
||||
@if($isExcluded)
|
||||
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
||||
</svg>
|
||||
@else
|
||||
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"/>
|
||||
</svg>
|
||||
@endif
|
||||
</button>
|
||||
|
||||
{{-- 퇴직 처리 --}}
|
||||
@if($employee->employee_status !== 'resigned')
|
||||
<button type="button"
|
||||
|
||||
Reference in New Issue
Block a user