feat:영업관리 대시보드에 테넌트 및 계약 관리 섹션 추가
- 테넌트 목록 표시 (업체명, 담당자, 등록일) - 계약관리 버튼 (영업 진행, 상세계약 설정, 매니저 진행) - 행 클릭 시 상세 정보 토글 - 신규 테넌트 등록 버튼 제외 (가망고객 관리에서 처리) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\Sales;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Tenants\Tenant;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
@@ -93,11 +94,17 @@ private function getDashboardData(Request $request): array
|
||||
'confirmed_commission' => 0, // 확정 가입비 수당
|
||||
];
|
||||
|
||||
// 테넌트 목록 (HQ 제외)
|
||||
$tenants = Tenant::where('tenant_type', '!=', 'HQ')
|
||||
->orderBy('created_at', 'desc')
|
||||
->get();
|
||||
|
||||
return compact(
|
||||
'stats',
|
||||
'commissionByRole',
|
||||
'totalCommissionRatio',
|
||||
'tenantStats',
|
||||
'tenants',
|
||||
'period',
|
||||
'year',
|
||||
'month',
|
||||
|
||||
@@ -81,6 +81,9 @@ class="px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-
|
||||
{{-- 수익 및 테넌트 관리 --}}
|
||||
@include('sales.dashboard.partials.tenant-stats')
|
||||
|
||||
{{-- 테넌트 및 계약 관리 목록 --}}
|
||||
@include('sales.dashboard.partials.tenant-list')
|
||||
|
||||
<script>
|
||||
function toggleCustomPeriod() {
|
||||
const btnMonth = document.getElementById('btn-month');
|
||||
|
||||
150
resources/views/sales/dashboard/partials/tenant-list.blade.php
Normal file
150
resources/views/sales/dashboard/partials/tenant-list.blade.php
Normal file
@@ -0,0 +1,150 @@
|
||||
{{-- 테넌트 및 계약 관리 --}}
|
||||
<div class="bg-white rounded-xl shadow-sm p-6">
|
||||
<div class="flex items-center justify-between mb-6">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="p-2 bg-blue-100 rounded-lg">
|
||||
<svg class="w-6 h-6 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 10h16M4 14h16M4 18h16" />
|
||||
</svg>
|
||||
</div>
|
||||
<h2 class="text-xl font-bold text-gray-800">테넌트 및 계약 관리</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($tenants->isEmpty())
|
||||
<div class="text-center py-12 text-gray-500">
|
||||
<svg class="w-12 h-12 mx-auto mb-4 text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" />
|
||||
</svg>
|
||||
<p>등록된 테넌트가 없습니다.</p>
|
||||
</div>
|
||||
@else
|
||||
<!-- 테이블 헤더 -->
|
||||
<div class="hidden md:grid md:grid-cols-12 gap-4 px-4 py-3 text-sm font-medium text-gray-500 border-b border-gray-200">
|
||||
<div class="col-span-3">업체명</div>
|
||||
<div class="col-span-3">담당자 (영업/관리)</div>
|
||||
<div class="col-span-2">등록일</div>
|
||||
<div class="col-span-4 text-center">계약관리</div>
|
||||
</div>
|
||||
|
||||
<!-- 테넌트 목록 -->
|
||||
<div class="divide-y divide-gray-100">
|
||||
@foreach($tenants as $tenant)
|
||||
<div class="tenant-row" data-tenant-id="{{ $tenant->id }}">
|
||||
<!-- 메인 행 -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-12 gap-4 px-4 py-4 items-center hover:bg-gray-50 transition-colors">
|
||||
<!-- 업체명 -->
|
||||
<div class="col-span-3 flex items-center gap-3">
|
||||
<button type="button" class="toggle-detail text-gray-400 hover:text-gray-600 transition-colors">
|
||||
<svg class="w-5 h-5 transform transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
||||
</svg>
|
||||
</button>
|
||||
<div>
|
||||
<div class="font-semibold text-gray-900">{{ $tenant->company_name }}</div>
|
||||
<div class="text-sm text-gray-500">
|
||||
{{ $tenant->representative_name ?? '-' }} | {{ $tenant->phone ?? '-' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 담당자 (영업/관리) -->
|
||||
<div class="col-span-3 flex items-center gap-2">
|
||||
<span class="inline-flex items-center px-2.5 py-1 rounded text-xs font-medium bg-gray-100 text-gray-700">
|
||||
영업: {{ $tenant->salesManager->name ?? '영업담당자' }}
|
||||
</span>
|
||||
<div class="relative">
|
||||
<button type="button" class="inline-flex items-center gap-1 px-2.5 py-1 rounded text-xs font-medium bg-blue-50 text-blue-700 border border-blue-200 hover:bg-blue-100 transition-colors">
|
||||
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
||||
</svg>
|
||||
관리: {{ $tenant->adminManager->name ?? '본인' }}
|
||||
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 등록일 -->
|
||||
<div class="col-span-2 text-sm text-gray-600">
|
||||
{{ $tenant->created_at->format('Y-m-d') }}
|
||||
</div>
|
||||
|
||||
<!-- 계약관리 버튼들 -->
|
||||
<div class="col-span-4 flex items-center justify-center gap-2">
|
||||
<button type="button" class="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-blue-600 text-white hover:bg-blue-700 transition-colors">
|
||||
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7l5 5m0 0l-5 5m5-5H6" />
|
||||
</svg>
|
||||
영업 진행
|
||||
</button>
|
||||
<button type="button" class="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-gray-100 text-gray-700 border border-gray-300 hover:bg-gray-200 transition-colors">
|
||||
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
||||
</svg>
|
||||
상세계약 설정
|
||||
</button>
|
||||
<button type="button" class="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-white text-green-700 border border-green-500 hover:bg-green-50 transition-colors">
|
||||
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
|
||||
</svg>
|
||||
매니저 진행
|
||||
</button>
|
||||
|
||||
<!-- 수정/삭제 아이콘 -->
|
||||
<div class="flex items-center gap-1 ml-2">
|
||||
<button type="button" class="p-1.5 text-gray-400 hover:text-blue-600 transition-colors" title="수정">
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z" />
|
||||
</svg>
|
||||
</button>
|
||||
<button type="button" class="p-1.5 text-gray-400 hover:text-red-600 transition-colors" title="삭제">
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 상세 정보 (접힌 상태) -->
|
||||
<div class="tenant-detail hidden bg-gray-50 px-4 py-4 border-t border-gray-100">
|
||||
<div class="ml-8 grid grid-cols-1 md:grid-cols-3 gap-4 text-sm">
|
||||
<div>
|
||||
<span class="text-gray-500">사업자번호:</span>
|
||||
<span class="ml-2 text-gray-900">{{ $tenant->business_number ?? '-' }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-gray-500">이메일:</span>
|
||||
<span class="ml-2 text-gray-900">{{ $tenant->email ?? '-' }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-gray-500">주소:</span>
|
||||
<span class="ml-2 text-gray-900">{{ $tenant->address ?? '-' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// 상세보기 토글
|
||||
document.querySelectorAll('.toggle-detail').forEach(btn => {
|
||||
btn.addEventListener('click', function() {
|
||||
const row = this.closest('.tenant-row');
|
||||
const detail = row.querySelector('.tenant-detail');
|
||||
const icon = this.querySelector('svg');
|
||||
|
||||
detail.classList.toggle('hidden');
|
||||
icon.classList.toggle('rotate-90');
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user