@extends('layouts.app') @section('title', '工時評估 — ' . $project->name) @section('content') @include('projects._nav', ['project' => $project]) @php $fmtDays = fn ($v) => $v === null ? null : rtrim(rtrim(number_format((float) $v, 1), '0'), '.'); $showEdit = $errors->any(); @endphp
工時評估
@if($activeContract) {{ $activeContract->name }} @else 全部合約(未篩選) @endif
@if(!$activeContractId && $contracts->count() > 1)
此專案有多個合約,請從右上角切換合約後,再為各合約分別填寫工時評估。
@endif @if (session('success'))
{{ session('success') }}
@endif @if ($errors->any())
@endif {{-- ══════════ 檢視模式 ══════════ --}}
@if (!$hasSavedCategories)
@if($activeContract) 尚未設定「{{ $activeContract->name }}」的工時評估。 @else 尚未設定工時評估。 @endif 開始設定
@else @foreach ($categories as $cat)
{{ $cat->name }} 小計 {{ $fmtDays($cat->estimations->sum('estimated_man_days')) ?? 0 }} 天
@if ($cat->estimations->isEmpty())

此分類尚無項目。

@else
@foreach ($cat->estimations as $ii => $item) @endforeach
項次 功能 描述 評估人天 評估者 風險高低 備註
{{ $ii + 1 }} {{ $item->function }} {{ $item->description ?: '—' }} {{ $fmtDays($item->estimated_man_days) ?? '—' }} {{ $item->estimator?->name ?? '—' }} @if ($item->risk_level) {{ $item->risk_level }} @else @endif {{ $item->notes ?: '—' }}
@endif
@endforeach
合計評估人天:{{ $fmtDays($categories->flatMap->estimations->sum('estimated_man_days')) ?? 0 }}
@endif
{{-- ══════════ 編輯/新增模式 ══════════ --}}
@csrf @method('PUT')
@foreach ($categories as $ci => $cat)
name) }}"> 小計 0 天
@foreach ($cat->estimations as $ii => $item) @endforeach
項次 功能 描述 評估人天 評估者 風險高低 備註
{{ $ii + 1 }} function) }}"> description) }}"> estimated_man_days) }}"> notes) }}">
@endforeach
合計評估人天:0
取消
@push('scripts') @endpush @endsection