@extends('layouts.app') @section('title', '我的請假') @push('styles') @endpush @section('content')
{{-- 標題列 --}}

請假管理

申請請假、查看狀態與假期餘額
@foreach(['success','error','info'] as $t) @if(session($t))
{{ session($t) }}
@endif @endforeach
{{-- 左欄:假期餘額 --}}
{{ $year }} 年假期餘額
@if($balances->isEmpty())
尚無假期配額資料
@else
    @foreach($balances as $b)
  • {{ $b->leaveType->name }} {{ $b->remaining_days }} / {{ $b->total_days }} 天
    @php $pct = $b->total_days > 0 ? min(100, round($b->used_days / $b->total_days * 100)) : 0; @endphp
    已用 {{ $b->used_days }} 天
  • @endforeach
@endif
{{-- 年份切換 --}}
@foreach($years as $y) {{ $y }} @endforeach
{{-- 右欄:申請紀錄 --}}
{{ $year }} 年請假紀錄 共 {{ $myRequests->count() }} 筆
@if($myRequests->isEmpty())
本年度尚無請假紀錄
立即申請
@else
@foreach($myRequests as $r) @endforeach
假別 期間 天數 狀態 操作
{{ $r->leaveType->name }}
{{ $r->start_date->format('m/d') }} @if($r->start_half)(下午)@endif @if($r->start_date->ne($r->end_date)) — {{ $r->end_date->format('m/d') }} @if($r->end_half)(上午)@endif @endif
{{ Str::limit($r->reason, 30) }}
{{ $r->days }} {{ $r->statusLabel() }} 詳情 @if($r->status === 'pending')
@csrf @method('DELETE')
@endif
@endif
@endsection