From 6ca48c3f93a9bda20ec4ca87824efb9a76e44308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Mon, 2 Feb 2026 14:32:59 +0900 Subject: [PATCH] =?UTF-8?q?feat:=EC=98=81=EC=97=85/=EB=A7=A4=EB=8B=88?= =?UTF-8?q?=EC=A0=80=20=EB=B2=84=ED=8A=BC=20=EB=B0=8F=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EB=A0=88=EC=8A=A4=EB=B0=94=20=EC=97=AD=ED=95=A0?= =?UTF-8?q?=EB=B3=84=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 다른 매니저 지정 시: 등록자에게 매니저 버튼/프로그레스바 숨김 - 매니저로만 참여 시: 영업 버튼/프로그레스바 숨김 - 본인 역할에 해당하는 영역만 표시 Co-Authored-By: Claude Opus 4.5 --- .../dashboard/partials/tenant-list.blade.php | 52 ++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/resources/views/sales/dashboard/partials/tenant-list.blade.php b/resources/views/sales/dashboard/partials/tenant-list.blade.php index 11cfe1e8..4722095a 100644 --- a/resources/views/sales/dashboard/partials/tenant-list.blade.php +++ b/resources/views/sales/dashboard/partials/tenant-list.blade.php @@ -92,6 +92,17 @@ $prospectHqStatusOrder = \App\Models\Sales\SalesTenantManagement::$hqStatusOrder; $prospectCurrentHqStep = $prospectHqStatusOrder[$prospectManagement->hq_status ?? 'pending'] ?? 0; $isProspectHqEnabled = $prospectProgress['sales']['percentage'] >= 100 && $prospectProgress['manager']['percentage'] >= 100; + + // 현재 사용자의 역할 확인 + $currentUserId = auth()->id(); + $isRegistrar = $prospect->registered_by === $currentUserId; // 영업권 등록자 + $isManager = $prospectManagement->manager_user_id === $currentUserId; // 담당 매니저 + $hasDifferentManager = $prospectManagement->manager_user_id && $prospectManagement->manager_user_id !== $currentUserId; + + // 버튼 표시 여부 + $showSalesButton = $isRegistrar; // 등록자만 영업 버튼 + $showManagerButton = $isManager || (!$hasDifferentManager && $isRegistrar); // 매니저이거나, 다른 매니저 미지정 시 등록자 + $showManagerProgress = $showManagerButton; // 매니저 프로그레스바도 동일 @endphp
@@ -117,6 +128,7 @@
{{-- 영업/매니저 진행 버튼 --}}
+ @if($showSalesButton) + @endif
- {{-- 영업/매니저 프로그레스 바 (절반) --}} + {{-- 영업/매니저 프로그레스 바 --}}
- {{-- 영업 --}} + {{-- 영업 (등록자에게만 표시) --}} + @if($showSalesButton)
@@ -150,7 +166,9 @@ class="inline-flex items-center gap-1 px-2 py-1 rounded text-xs font-medium bg-g
{{ $prospectProgress['sales']['percentage'] }}%
- {{-- 매니저 --}} + @endif + {{-- 매니저 (매니저에게만 표시) --}} + @if($showManagerProgress)
@@ -158,6 +176,7 @@ class="inline-flex items-center gap-1 px-2 py-1 rounded text-xs font-medium bg-g
{{ $prospectProgress['manager']['percentage'] }}%
+ @endif
{{-- 구분선 --}} @@ -426,6 +445,19 @@ class="inline-flex items-center gap-1 px-3 py-1.5 rounded text-xs font-medium bg $totalRegFee = $contractTotals->total_registration_fee ?? 0; $totalSubFee = $contractTotals->total_subscription_fee ?? 0; $productCount = $contractTotals->product_count ?? 0; + + // 현재 사용자의 역할 확인 (tenant 기준 - registered_by는 연결된 prospect에서 확인) + $currentUserId = auth()->id(); + // 테넌트와 연결된 prospect 조회 + $linkedProspect = \App\Models\Sales\TenantProspect::where('tenant_id', $tenant->id)->first(); + $tenantIsRegistrar = $linkedProspect && $linkedProspect->registered_by === $currentUserId; + $tenantIsManager = $management->manager_user_id === $currentUserId; + $tenantHasDifferentManager = $management->manager_user_id && $management->manager_user_id !== $currentUserId; + + // 버튼 표시 여부 + $tenantShowSalesButton = $tenantIsRegistrar; + $tenantShowManagerButton = $tenantIsManager || (!$tenantHasDifferentManager && $tenantIsRegistrar); + $tenantShowManagerProgress = $tenantShowManagerButton; @endphp
@@ -448,6 +480,7 @@ class="inline-flex items-center gap-1 px-3 py-1.5 rounded text-xs font-medium bg
{{-- 영업/매니저 진행 버튼 --}}
+ @if($tenantShowSalesButton) + @endif
- {{-- 좌측: 영업/매니저 프로그레스 바 (절반) --}} + {{-- 좌측: 영업/매니저 프로그레스 바 --}}
- {{-- 영업 --}} + {{-- 영업 (등록자에게만 표시) --}} + @if($tenantShowSalesButton)
@@ -481,7 +518,9 @@ class="inline-flex items-center gap-1 px-2 py-1 rounded text-xs font-medium bg-g
{{ $progress['sales']['percentage'] }}%
- {{-- 매니저 --}} + @endif + {{-- 매니저 (매니저에게만 표시) --}} + @if($tenantShowManagerProgress)
@@ -489,6 +528,7 @@ class="inline-flex items-center gap-1 px-2 py-1 rounded text-xs font-medium bg-g
{{ $progress['manager']['percentage'] }}%
+ @endif
{{-- 구분선 --}}