{{-- resources/views/projects/time/index.blade.php --}} @extends('layouts.app') @push('styles') @endpush @section('content') @include('projects._nav')
工時紀錄
{{-- ── 上方三欄:工時總計 / 進度百分比 / 活動分佈 ── --}}
{{-- 工時總計 --}}
工時總計
{{ number_format($allHours, 2) }}
目前累計總工時(小時)
@if(request()->hasAny(['user_id','activity','contract_id','date_from','date_to']) || $activeContractId)
篩選小計:{{ number_format($totalHours, 2) }} 小時
@endif
@if($byUser->isNotEmpty())

依成員

@foreach($byUser as $row)
{{ $row['name'] }} {{ number_format($row['hours'], 2) }} h
@endforeach
@else
尚無工時紀錄
@endif
{{-- 進度百分比 --}}
進度百分比
@if($canSetProgress) 可編輯 @endif

實際進度(手動設定)

@if($project->progress >= 8){{ $project->progress }}%@endif
{{ $project->progress }}%
@if($canSetProgress)
@csrf %
@else
@endif

累積人天比(系統計算)

@if($totalEstMd > 0) @php $mdPct = min($manDaysRatio, 100); $mdOver = $manDaysRatio > 100; @endphp
@if($mdPct >= 8){{ $manDaysRatio }}%@endif
{{ $manDaysRatio }}%
實際 {{ number_format($totalActualMd, 2) }} 人天 / 評估 {{ number_format($totalEstMd, 1) }} 人天
@else
合約尚未設定評估人天
@endif
{{-- 活動分佈圖 --}}
活動分佈
@if($byActivity->isNotEmpty())
{{ number_format($totalHours, 1) }}
小時
@foreach($byActivity as $row)
{{ $row['label'] }} {{ number_format($row['hours'], 2) }} h
@endforeach
@else
尚無資料
@endif
{{-- /row 上方 --}} {{-- ── 下方:工時輸入 + 詳細紀錄 ── --}}
{{-- 工時紀錄輸入 --}}
記錄工時
@csrf @if($contracts->isEmpty())
此專案尚無合約,請先建立合約才能記錄工時。
@endif
最小 0.25 小時(15 分鐘)
{{-- 詳細工時紀錄 --}}
{{-- 篩選 --}}
清除
{{-- 工時紀錄表 --}}
工時紀錄({{ $entries->count() }} 筆)
合計 {{ number_format($totalHours, 2) }} 小時
@forelse($entries as $entry) @empty @endforelse
日期 成員 工時 活動 合約 議題 備註
{{ $entry->spent_on->format('Y/m/d') }} {{ $entry->user?->name }} {{ number_format($entry->hours, 2) }} 小時 {{ $entry->activity_label }} {{ $entry->contract?->name ?? '—' }} @if($entry->issue) #{{ $entry->issue_id }} {{ $entry->issue->title }} @else @endif {{ $entry->comments ?? '—' }} @if($entry->user_id === auth()->id() || auth()->user()->role === 'admin')
@csrf @method('DELETE')
@endif
尚無工時紀錄
{{-- /col-lg-8 --}}
{{-- /row 下方 --}}
{{-- /container --}} {{-- ── Edit Modal ── --}} @if($byActivity->isNotEmpty() || $byUser->isNotEmpty()) @endif @endsection