Files
sam-manage/resources/views/stats/dashboard/partials/_bottom-section.blade.php
권혁성 5dd580623e feat:통계 대시보드 페이지 신규 구현 (/stats/dashboard)
- 모델 7개: StatSalesDaily, StatFinanceDaily, StatProductionDaily,
  StatInventoryDaily, StatSystemDaily, StatSalesMonthly, StatFinanceMonthly
- DashboardStatService: 요약카드, 7일 추이차트, 알림, 월간요약 데이터
- StatDashboardController: HX-Redirect 패턴 적용
- 뷰: 요약카드 6개 + Chart.js 4개 차트 + 알림/월간요약 하단섹션
- 기존 대시보드 "통계 및 리포트" 바로가기 링크 연결
- 헤더 테넌트 선택 기준 전체/개별 테넌트 필터링 지원

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 14:03:58 +09:00

93 lines
5.3 KiB
PHP

{{-- 하단 2컬럼 --}}
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
{{-- : 최근 알림 --}}
<div class="bg-white rounded-lg shadow p-5">
<div class="flex items-center justify-between mb-4">
<h3 class="text-base font-semibold text-gray-900">최근 알림</h3>
<a href="{{ route('system.alerts.index') }}" class="text-sm text-blue-600 hover:underline">전체보기</a>
</div>
@if($recentAlerts->isEmpty())
<div class="text-center py-8 text-gray-400">
<svg class="w-10 h-10 mx-auto mb-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"/>
</svg>
<p class="text-sm">미해결 알림이 없습니다</p>
</div>
@else
<div class="space-y-3">
@foreach($recentAlerts as $alert)
<div class="flex items-start gap-3 p-3 rounded-lg bg-gray-50 border border-gray-100">
<span class="inline-flex items-center justify-center w-8 h-8 rounded-full text-xs font-medium shrink-0 {{ $alert->severity_color }}">
{{ mb_substr($alert->severity_label, 0, 1) }}
</span>
<div class="flex-1 min-w-0">
<div class="flex items-center gap-2 mb-1">
<span class="text-xs font-medium px-2 py-0.5 rounded bg-gray-200 text-gray-600">{{ $alert->domain_label }}</span>
<span class="text-xs text-gray-400">{{ $alert->created_at?->diffForHumans() }}</span>
</div>
<p class="text-sm text-gray-800 truncate">{{ $alert->title }}</p>
</div>
</div>
@endforeach
</div>
@endif
</div>
{{-- : 이번 요약 --}}
<div class="bg-white rounded-lg shadow p-5">
<h3 class="text-base font-semibold text-gray-900 mb-4">이번 요약 ({{ $monthlySummary['month'] }})</h3>
<table class="w-full text-sm">
<thead>
<tr class="border-b border-gray-200">
<th class="text-left py-2 font-medium text-gray-500">구분</th>
<th class="text-right py-2 font-medium text-gray-500">항목</th>
<th class="text-right py-2 font-medium text-gray-500">금액/수량</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100">
{{-- 매출 --}}
<tr>
<td class="py-2.5 text-gray-600" rowspan="3">
<span class="inline-flex items-center gap-1">
<span class="w-2 h-2 rounded-full bg-green-500"></span>
매출
</span>
</td>
<td class="py-2.5 text-right text-gray-600">주문건수</td>
<td class="py-2.5 text-right font-medium text-gray-900">{{ number_format($monthlySummary['sales']['order_count']) }}</td>
</tr>
<tr>
<td class="py-2.5 text-right text-gray-600">주문금액</td>
<td class="py-2.5 text-right font-medium text-gray-900">{{ number_format($monthlySummary['sales']['order_amount']) }}</td>
</tr>
<tr>
<td class="py-2.5 text-right text-gray-600">매출액</td>
<td class="py-2.5 text-right font-medium text-gray-900">{{ number_format($monthlySummary['sales']['sales_amount']) }}</td>
</tr>
{{-- 재무 --}}
<tr>
<td class="py-2.5 text-gray-600" rowspan="3">
<span class="inline-flex items-center gap-1">
<span class="w-2 h-2 rounded-full bg-blue-500"></span>
재무
</span>
</td>
<td class="py-2.5 text-right text-gray-600">입금</td>
<td class="py-2.5 text-right font-medium text-green-600">{{ number_format($monthlySummary['finance']['deposit_total']) }}</td>
</tr>
<tr>
<td class="py-2.5 text-right text-gray-600">출금</td>
<td class="py-2.5 text-right font-medium text-red-600">{{ number_format($monthlySummary['finance']['withdrawal_total']) }}</td>
</tr>
<tr>
<td class="py-2.5 text-right text-gray-600">순자금흐름</td>
<td class="py-2.5 text-right font-bold {{ $monthlySummary['finance']['net_cashflow'] >= 0 ? 'text-green-600' : 'text-red-600' }}">
{{ $monthlySummary['finance']['net_cashflow'] >= 0 ? '+' : '' }}{{ number_format($monthlySummary['finance']['net_cashflow']) }}
</td>
</tr>
</tbody>
</table>
</div>
</div>