Features: - Implement two fee types: entrance fee and annual fee (both NT$1,000) - Add 50% discount for disability certificate holders - Add disability certificate upload in member profile - Integrate disability verification into cashier approval workflow - Add membership fee settings in system admin Document permissions: - Fix hard-coded role logic in Document model - Use permission-based authorization instead of role checks Additional features: - Add announcements, general ledger, and trial balance modules - Add income management and accounting entries - Add comprehensive test suite with factories - Update UI translations to Traditional Chinese 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
201 lines
16 KiB
PHP
201 lines
16 KiB
PHP
<x-app-layout>
|
|
<x-slot name="header">
|
|
<h2 class="text-xl font-semibold leading-tight text-gray-800 dark:text-gray-200">
|
|
任務管理 (任務追蹤)
|
|
</h2>
|
|
</x-slot>
|
|
|
|
<div class="py-12">
|
|
<div class="mx-auto max-w-7xl sm:px-6 lg:px-8">
|
|
@if (session('status'))
|
|
<div class="mb-4 rounded-md bg-green-50 p-4 dark:bg-green-900/30 border-l-4 border-green-400" role="status" aria-live="polite">
|
|
<p class="text-sm text-green-800 dark:text-green-200">{{ session('status') }}</p>
|
|
</div>
|
|
@endif
|
|
|
|
@if (session('error'))
|
|
<div class="mb-4 rounded-md bg-red-50 p-4 dark:bg-red-900/30 border-l-4 border-red-400" role="alert">
|
|
<p class="text-sm text-red-800 dark:text-red-200">{{ session('error') }}</p>
|
|
</div>
|
|
@endif
|
|
|
|
<div class="bg-white shadow sm:rounded-lg dark:bg-gray-800 px-4 py-5 sm:p-6">
|
|
<!-- Header -->
|
|
<div class="sm:flex sm:items-center sm:justify-between mb-6">
|
|
<div>
|
|
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100">任務追蹤器</h3>
|
|
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">管理工作項目、任務和會員請求</p>
|
|
</div>
|
|
<div class="mt-4 sm:mt-0">
|
|
<a href="{{ route('admin.issues.create') }}" class="inline-flex items-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:bg-indigo-500 dark:hover:bg-indigo-400 dark:focus:ring-offset-gray-800">
|
|
<svg class="-ml-0.5 mr-1.5 h-5 w-5" fill="currentColor" viewBox="0 0 20 20"><path d="M10.75 4.75a.75.75 0 00-1.5 0v4.5h-4.5a.75.75 0 000 1.5h4.5v4.5a.75.75 0 001.5 0v-4.5h4.5a.75.75 0 000-1.5h-4.5v-4.5z"/></svg>
|
|
新增任務
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Summary Stats -->
|
|
<div class="grid grid-cols-1 gap-4 sm:grid-cols-4 mb-6">
|
|
<div class="bg-blue-50 dark:bg-blue-900/30 rounded-lg p-4 border-l-4 border-blue-400">
|
|
<dt class="text-sm font-medium text-blue-800 dark:text-blue-200">總開啟數</dt>
|
|
<dd class="mt-1 text-2xl font-semibold text-blue-900 dark:text-blue-100">{{ $stats['total_open'] }}</dd>
|
|
</div>
|
|
<div class="bg-purple-50 dark:bg-purple-900/30 rounded-lg p-4 border-l-4 border-purple-400">
|
|
<dt class="text-sm font-medium text-purple-800 dark:text-purple-200">指派給我</dt>
|
|
<dd class="mt-1 text-2xl font-semibold text-purple-900 dark:text-purple-100">{{ $stats['assigned_to_me'] }}</dd>
|
|
</div>
|
|
<div class="bg-red-50 dark:bg-red-900/30 rounded-lg p-4 border-l-4 border-red-400">
|
|
<dt class="text-sm font-medium text-red-800 dark:text-red-200">逾期</dt>
|
|
<dd class="mt-1 text-2xl font-semibold text-red-900 dark:text-red-100">{{ $stats['overdue'] }}</dd>
|
|
</div>
|
|
<div class="bg-orange-50 dark:bg-orange-900/30 rounded-lg p-4 border-l-4 border-orange-400">
|
|
<dt class="text-sm font-medium text-orange-800 dark:text-orange-200">高優先級</dt>
|
|
<dd class="mt-1 text-2xl font-semibold text-orange-900 dark:text-orange-100">{{ $stats['high_priority'] }}</dd>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Filters -->
|
|
<form method="GET" class="mb-6 space-y-4" role="search">
|
|
<div class="grid grid-cols-1 gap-4 sm:grid-cols-4">
|
|
<div>
|
|
<label for="issue_type" class="block text-sm font-medium text-gray-700 dark:text-gray-300">類型</label>
|
|
<select name="issue_type" id="issue_type" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100">
|
|
<option value="">所有類型</option>
|
|
<option value="work_item" @selected(request('issue_type') === 'work_item')>工作項目</option>
|
|
<option value="project_task" @selected(request('issue_type') === 'project_task')>專案任務</option>
|
|
<option value="maintenance" @selected(request('issue_type') === 'maintenance')>維護</option>
|
|
<option value="member_request" @selected(request('issue_type') === 'member_request')>會員請求</option>
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label for="status" class="block text-sm font-medium text-gray-700 dark:text-gray-300">狀態</label>
|
|
<select name="status" id="status" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100">
|
|
<option value="">所有狀態</option>
|
|
<option value="new" @selected(request('status') === 'new')>新</option>
|
|
<option value="assigned" @selected(request('status') === 'assigned')>已指派</option>
|
|
<option value="in_progress" @selected(request('status') === 'in_progress')>進行中</option>
|
|
<option value="review" @selected(request('status') === 'review')>審查</option>
|
|
<option value="closed" @selected(request('status') === 'closed')>已結案</option>
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label for="priority" class="block text-sm font-medium text-gray-700 dark:text-gray-300">優先級</label>
|
|
<select name="priority" id="priority" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100">
|
|
<option value="">所有優先級</option>
|
|
<option value="low" @selected(request('priority') === 'low')>低</option>
|
|
<option value="medium" @selected(request('priority') === 'medium')>中</option>
|
|
<option value="high" @selected(request('priority') === 'high')>高</option>
|
|
<option value="urgent" @selected(request('priority') === 'urgent')>緊急</option>
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label for="assigned_to" class="block text-sm font-medium text-gray-700 dark:text-gray-300">指派對象</label>
|
|
<select name="assigned_to" id="assigned_to" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100">
|
|
<option value="">所有指派對象</option>
|
|
@foreach($users as $user)
|
|
<option value="{{ $user->id }}" @selected(request('assigned_to') == $user->id)>{{ $user->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="flex gap-4">
|
|
<div class="flex-1">
|
|
<label for="search" class="block text-sm font-medium text-gray-700 dark:text-gray-300">搜尋</label>
|
|
<input type="text" name="search" id="search" value="{{ request('search') }}" placeholder="任務編號、標題或描述..." class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100">
|
|
</div>
|
|
<div class="flex items-end gap-2">
|
|
<button type="submit" class="inline-flex justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 dark:bg-gray-700 dark:text-gray-100 dark:ring-gray-600 dark:hover:bg-gray-600">篩選</button>
|
|
<label class="inline-flex items-center">
|
|
<input type="checkbox" name="show_closed" value="1" @checked(request('show_closed') === '1') class="rounded border-gray-300 text-indigo-600 shadow-sm focus:ring-indigo-500 dark:bg-gray-700 dark:border-gray-600">
|
|
<span class="ml-2 text-sm text-gray-700 dark:text-gray-300">顯示已結案</span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<!-- Issues Table -->
|
|
<div class="overflow-hidden shadow ring-1 ring-black ring-opacity-5 sm:rounded-lg dark:ring-gray-700">
|
|
<table class="min-w-full divide-y divide-gray-300 dark:divide-gray-600">
|
|
<caption class="sr-only">任務列表及其目前狀態與指派</caption>
|
|
<thead class="bg-gray-50 dark:bg-gray-700">
|
|
<tr>
|
|
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 dark:text-gray-100">任務</th>
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-100">類型</th>
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-100">狀態</th>
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-100">優先級</th>
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-100">指派對象</th>
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-100">截止日期</th>
|
|
<th scope="col" class="relative py-3.5 pl-3 pr-4"><span class="sr-only">操作</span></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-200 bg-white dark:divide-gray-700 dark:bg-gray-800">
|
|
@forelse($issues as $issue)
|
|
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700">
|
|
<td class="py-4 pl-4 pr-3 text-sm">
|
|
<div class="font-medium text-gray-900 dark:text-gray-100">
|
|
<a href="{{ route('admin.issues.show', $issue) }}" class="hover:underline">{{ $issue->issue_number }}</a>
|
|
</div>
|
|
<div class="text-gray-500 dark:text-gray-400 line-clamp-1">{{ $issue->title }}</div>
|
|
@if($issue->labels->count() > 0)
|
|
<div class="mt-1 flex gap-1 flex-wrap">
|
|
@foreach($issue->labels as $label)
|
|
<span class="inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium" style="background-color: {{ $label->color }}20; color: {{ $label->color }}">
|
|
{{ $label->name }}
|
|
</span>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
</td>
|
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $issue->issue_type_label }}
|
|
</td>
|
|
<td class="whitespace-nowrap px-3 py-4 text-sm">
|
|
<x-issue.status-badge :status="$issue->status" :label="$issue->status_label" />
|
|
</td>
|
|
<td class="whitespace-nowrap px-3 py-4 text-sm">
|
|
<x-issue.priority-badge :priority="$issue->priority" :label="$issue->priority_label" />
|
|
</td>
|
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $issue->assignee?->name ?? __('Unassigned') }}
|
|
</td>
|
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-900 dark:text-gray-100">
|
|
@if($issue->due_date)
|
|
<span class="{{ $issue->is_overdue ? 'text-red-600 dark:text-red-400 font-semibold' : '' }}">
|
|
{{ $issue->due_date->format('Y-m-d') }}
|
|
@if($issue->is_overdue)
|
|
<span class="text-xs">(逾期)</span>
|
|
@endif
|
|
</span>
|
|
@else
|
|
<span class="text-gray-400">—</span>
|
|
@endif
|
|
</td>
|
|
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium">
|
|
<a href="{{ route('admin.issues.show', $issue) }}" class="text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300">檢視</a>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="7" class="px-3 py-8 text-center text-sm text-gray-500 dark:text-gray-400">
|
|
<p>找不到任務</p>
|
|
<div class="mt-4">
|
|
<a href="{{ route('admin.issues.create') }}" class="inline-flex items-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 dark:bg-indigo-500 dark:hover:bg-indigo-400">
|
|
+ 新增第一個任務
|
|
</a>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Pagination -->
|
|
@if($issues->hasPages())
|
|
<div class="mt-6">{{ $issues->links() }}</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|