- 모델 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>
94 lines
6.2 KiB
PHP
94 lines
6.2 KiB
PHP
{{-- 요약 카드 6개 --}}
|
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 gap-4 mb-6">
|
|
{{-- 오늘 주문 --}}
|
|
<div class="bg-white rounded-lg shadow p-5 border-l-4 border-blue-500">
|
|
<div class="flex items-center justify-between mb-2">
|
|
<h3 class="text-sm font-medium text-gray-500">오늘 주문</h3>
|
|
<span class="text-blue-500">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z"/>
|
|
</svg>
|
|
</span>
|
|
</div>
|
|
<div class="text-2xl font-bold text-gray-900">{{ number_format($summaryCards['orders']['count']) }}건</div>
|
|
<div class="text-sm text-gray-500 mt-1">{{ number_format($summaryCards['orders']['amount']) }}원</div>
|
|
@include('stats.dashboard.partials._delta', ['value' => $summaryCards['orders']['delta_count'], 'suffix' => '건'])
|
|
</div>
|
|
|
|
{{-- 오늘 매출 --}}
|
|
<div class="bg-white rounded-lg shadow p-5 border-l-4 border-green-500">
|
|
<div class="flex items-center justify-between mb-2">
|
|
<h3 class="text-sm font-medium text-gray-500">오늘 매출</h3>
|
|
<span class="text-green-500">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
|
</svg>
|
|
</span>
|
|
</div>
|
|
<div class="text-2xl font-bold text-gray-900">{{ number_format($summaryCards['sales']['amount']) }}원</div>
|
|
@include('stats.dashboard.partials._delta', ['value' => $summaryCards['sales']['delta'], 'suffix' => '원'])
|
|
</div>
|
|
|
|
{{-- 순자금흐름 --}}
|
|
<div class="bg-white rounded-lg shadow p-5 border-l-4 {{ $summaryCards['cashflow']['net'] >= 0 ? 'border-green-500' : 'border-red-500' }}">
|
|
<div class="flex items-center justify-between mb-2">
|
|
<h3 class="text-sm font-medium text-gray-500">순자금흐름</h3>
|
|
<span class="{{ $summaryCards['cashflow']['net'] >= 0 ? 'text-green-500' : 'text-red-500' }}">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"/>
|
|
</svg>
|
|
</span>
|
|
</div>
|
|
<div class="text-2xl font-bold {{ $summaryCards['cashflow']['net'] >= 0 ? 'text-green-600' : 'text-red-600' }}">
|
|
{{ $summaryCards['cashflow']['net'] >= 0 ? '+' : '' }}{{ number_format($summaryCards['cashflow']['net']) }}원
|
|
</div>
|
|
@include('stats.dashboard.partials._delta', ['value' => $summaryCards['cashflow']['delta'], 'suffix' => '원'])
|
|
</div>
|
|
|
|
{{-- 생산 효율 --}}
|
|
<div class="bg-white rounded-lg shadow p-5 border-l-4 border-purple-500">
|
|
<div class="flex items-center justify-between mb-2">
|
|
<h3 class="text-sm font-medium text-gray-500">생산 효율</h3>
|
|
<span class="text-purple-500">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"/>
|
|
</svg>
|
|
</span>
|
|
</div>
|
|
<div class="text-2xl font-bold text-gray-900">{{ number_format($summaryCards['production']['efficiency'], 1) }}%</div>
|
|
<div class="text-sm text-gray-500 mt-1">불량률 {{ number_format($summaryCards['production']['defect_rate'], 1) }}%</div>
|
|
@include('stats.dashboard.partials._delta', ['value' => $summaryCards['production']['delta_efficiency'], 'suffix' => '%p'])
|
|
</div>
|
|
|
|
{{-- 재고 경고 --}}
|
|
<div class="bg-white rounded-lg shadow p-5 border-l-4 border-yellow-500">
|
|
<div class="flex items-center justify-between mb-2">
|
|
<h3 class="text-sm font-medium text-gray-500">재고 경고</h3>
|
|
<span class="text-yellow-500">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"/>
|
|
</svg>
|
|
</span>
|
|
</div>
|
|
<div class="text-2xl font-bold {{ $summaryCards['inventory']['below_safety'] > 0 ? 'text-yellow-600' : 'text-gray-900' }}">
|
|
{{ number_format($summaryCards['inventory']['below_safety']) }}건
|
|
</div>
|
|
<div class="text-sm text-gray-500 mt-1">안전재고 미달</div>
|
|
@include('stats.dashboard.partials._delta', ['value' => $summaryCards['inventory']['delta'], 'suffix' => '건', 'inverse' => true])
|
|
</div>
|
|
|
|
{{-- 활성 사용자 --}}
|
|
<div class="bg-white rounded-lg shadow p-5 border-l-4 border-indigo-500">
|
|
<div class="flex items-center justify-between mb-2">
|
|
<h3 class="text-sm font-medium text-gray-500">활성 사용자</h3>
|
|
<span class="text-indigo-500">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"/>
|
|
</svg>
|
|
</span>
|
|
</div>
|
|
<div class="text-2xl font-bold text-gray-900">{{ number_format($summaryCards['system']['active_users']) }}명</div>
|
|
@include('stats.dashboard.partials._delta', ['value' => $summaryCards['system']['delta'], 'suffix' => '명'])
|
|
</div>
|
|
</div>
|