diff --git a/app/Http/Controllers/Sales/SalesDashboardController.php b/app/Http/Controllers/Sales/SalesDashboardController.php index 0f64fc80..c548cafb 100644 --- a/app/Http/Controllers/Sales/SalesDashboardController.php +++ b/app/Http/Controllers/Sales/SalesDashboardController.php @@ -15,6 +15,26 @@ class SalesDashboardController extends Controller * 대시보드 화면 */ public function index(Request $request): View + { + $data = $this->getDashboardData($request); + + return view('sales.dashboard.index', $data); + } + + /** + * HTMX 부분 새로고침용 데이터 반환 + */ + public function refresh(Request $request): View + { + $data = $this->getDashboardData($request); + + return view('sales.dashboard.partials.data-container', $data); + } + + /** + * 대시보드 데이터 조회 + */ + private function getDashboardData(Request $request): array { // 기간 설정 $period = $request->input('period', 'month'); // month or custom @@ -73,7 +93,7 @@ public function index(Request $request): View 'confirmed_commission' => 0, // 확정 가입비 수당 ]; - return view('sales.dashboard.index', compact( + return compact( 'stats', 'commissionByRole', 'totalCommissionRatio', @@ -83,6 +103,6 @@ public function index(Request $request): View 'month', 'startDate', 'endDate' - )); + ); } } diff --git a/resources/views/sales/dashboard/index.blade.php b/resources/views/sales/dashboard/index.blade.php index d3c15742..b6b7cb4f 100644 --- a/resources/views/sales/dashboard/index.blade.php +++ b/resources/views/sales/dashboard/index.blade.php @@ -2,6 +2,20 @@ @section('title', '영업관리 대시보드') +@push('styles') + +@endpush + @section('content')
₩{{ number_format($stats['total_membership_fee']) }}
-전체 누적 가입비
-₩{{ number_format($stats['total_commission']) }}
-지급 승인 완료 기준 ({{ $stats['commission_rate'] }}%)
-{{ number_format($stats['total_contracts']) }}건
-전체 계약 건수
-{{ number_format($stats['pending_membership_approval']) }}건
-조직 내 가입 승인 대기
-{{ number_format($stats['pending_payment_approval']) }}건
-조직 내 지급 승인 대기
-₩{{ number_format($role['amount']) }}
- @else -운영팀 산정
- @endif -₩{{ number_format($totalCommissionRatio) }}
-총 가입비 대비 수당
-선택한 기간 내에 등록된 계약 정보나 조직 구성 데이터가 없습니다.
-아직 실적이 발생하지 않았거나, 시스템 동기화 중일 수 있습니다.
- -{{ number_format($tenantStats['total_tenants'] ?? 0) }}개
-등록된 총 업체 수
-₩{{ number_format($tenantStats['total_membership_revenue'] ?? 0) }}
-전체 가입비 합계
-₩{{ number_format($tenantStats['total_commission_accumulated'] ?? 0) }}
-전체 가입비 수당 합계
-₩{{ number_format($tenantStats['confirmed_commission'] ?? 0) }}
-운영팀 승인 완료된 금액 (지급: 계약 익월 말일)
-₩{{ number_format($role['amount']) }}
+ @else +운영팀 산정
+ @endif +₩{{ number_format($totalCommissionRatio) }}
+총 가입비 대비 수당
+선택한 기간 내에 등록된 계약 정보나 조직 구성 데이터가 없습니다.
+아직 실적이 발생하지 않았거나, 시스템 동기화 중일 수 있습니다.
+ +₩{{ number_format($stats['total_membership_fee']) }}
+전체 누적 가입비
+₩{{ number_format($stats['total_commission']) }}
+지급 승인 완료 기준 ({{ $stats['commission_rate'] }}%)
+{{ number_format($stats['total_contracts']) }}건
+전체 계약 건수
+{{ number_format($stats['pending_membership_approval']) }}건
+조직 내 가입 승인 대기
+{{ number_format($stats['pending_payment_approval']) }}건
+조직 내 지급 승인 대기
+{{ number_format($tenantStats['total_tenants'] ?? 0) }}개
+등록된 총 업체 수
+₩{{ number_format($tenantStats['total_membership_revenue'] ?? 0) }}
+전체 가입비 합계
+₩{{ number_format($tenantStats['total_commission_accumulated'] ?? 0) }}
+전체 가입비 수당 합계
+₩{{ number_format($tenantStats['confirmed_commission'] ?? 0) }}
+운영팀 승인 완료된 금액 (지급: 계약 익월 말일)
+