레거시 sales 시스템에서 MNG로 마이그레이션: - 마이그레이션: sales_managers, sales_prospects, sales_records 등 6개 테이블 - 모델: SalesManager, SalesProspect, SalesRecord 등 6개 모델 - 컨트롤러: SalesManagerController, SalesProspectController, SalesRecordController - 뷰: managers, prospects, records CRUD 화면 - 라우트: /sales/* 경로 추가 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
138 lines
7.6 KiB
PHP
138 lines
7.6 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', '영업담당자 관리')
|
|
|
|
@section('content')
|
|
<div class="flex flex-col h-full">
|
|
<!-- 페이지 헤더 -->
|
|
<div class="flex flex-col sm:flex-row sm:justify-between sm:items-center gap-4 mb-6 flex-shrink-0">
|
|
<div>
|
|
<h1 class="text-2xl font-bold text-gray-800">영업담당자 관리</h1>
|
|
<p class="text-sm text-gray-500 mt-1">영업 담당자 및 매니저를 관리합니다</p>
|
|
</div>
|
|
<a href="{{ route('sales.managers.create') }}"
|
|
class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg transition text-center w-full sm:w-auto flex items-center justify-center gap-2">
|
|
<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 4v16m8-8H4" />
|
|
</svg>
|
|
담당자 등록
|
|
</a>
|
|
</div>
|
|
|
|
<!-- 통계 카드 -->
|
|
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 mb-6 flex-shrink-0">
|
|
<div class="bg-white rounded-lg shadow-sm p-4">
|
|
<div class="text-sm text-gray-500">전체</div>
|
|
<div class="text-2xl font-bold text-gray-800">{{ number_format($stats['total']) }}명</div>
|
|
</div>
|
|
<div class="bg-purple-50 rounded-lg shadow-sm p-4">
|
|
<div class="text-sm text-purple-600">운영자</div>
|
|
<div class="text-2xl font-bold text-purple-800">{{ number_format($stats['operators']) }}명</div>
|
|
</div>
|
|
<div class="bg-blue-50 rounded-lg shadow-sm p-4">
|
|
<div class="text-sm text-blue-600">영업관리</div>
|
|
<div class="text-2xl font-bold text-blue-800">{{ number_format($stats['sales_admins']) }}명</div>
|
|
</div>
|
|
<div class="bg-green-50 rounded-lg shadow-sm p-4">
|
|
<div class="text-sm text-green-600">매니저</div>
|
|
<div class="text-2xl font-bold text-green-800">{{ number_format($stats['managers']) }}명</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 필터 영역 -->
|
|
<div class="flex-shrink-0 mb-4">
|
|
<form method="GET" class="flex flex-wrap gap-2 sm:gap-4 items-center bg-white p-4 rounded-lg shadow-sm">
|
|
<div class="flex-1 min-w-0 w-full sm:w-auto">
|
|
<input type="text"
|
|
name="search"
|
|
value="{{ request('search') }}"
|
|
placeholder="이름, 아이디, 이메일로 검색..."
|
|
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
|
|
</div>
|
|
<div class="w-full sm:w-40">
|
|
<select name="role" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
|
|
<option value="">전체 역할</option>
|
|
<option value="operator" {{ request('role') === 'operator' ? 'selected' : '' }}>운영자</option>
|
|
<option value="sales_admin" {{ request('role') === 'sales_admin' ? 'selected' : '' }}>영업관리</option>
|
|
<option value="manager" {{ request('role') === 'manager' ? 'selected' : '' }}>매니저</option>
|
|
</select>
|
|
</div>
|
|
<button type="submit" class="bg-gray-600 hover:bg-gray-700 text-white px-6 py-2 rounded-lg transition w-full sm:w-auto">
|
|
검색
|
|
</button>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- 테이블 -->
|
|
<div class="bg-white rounded-lg shadow-sm overflow-hidden flex-1 flex flex-col min-h-0">
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full divide-y divide-gray-200">
|
|
<thead class="bg-gray-50">
|
|
<tr>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">이름</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">아이디</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">역할</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">연락처</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">상위관리자</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">등록일</th>
|
|
<th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">관리</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="bg-white divide-y divide-gray-200">
|
|
@forelse($managers as $manager)
|
|
<tr class="hover:bg-gray-50">
|
|
<td class="px-6 py-4 whitespace-nowrap">
|
|
<div class="font-medium text-gray-900">{{ $manager->name }}</div>
|
|
@if($manager->email)
|
|
<div class="text-sm text-gray-500">{{ $manager->email }}</div>
|
|
@endif
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
|
{{ $manager->member_id }}
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap">
|
|
<span class="px-2 py-1 text-xs font-medium rounded-full {{ $manager->role_color }}">
|
|
{{ $manager->role_label }}
|
|
</span>
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
|
{{ $manager->phone ?? '-' }}
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
|
{{ $manager->parent?->name ?? '-' }}
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
|
{{ $manager->created_at->format('Y-m-d') }}
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
|
<a href="{{ route('sales.managers.show', $manager->id) }}" class="text-blue-600 hover:text-blue-900 mr-3">상세</a>
|
|
<a href="{{ route('sales.managers.edit', $manager->id) }}" class="text-indigo-600 hover:text-indigo-900 mr-3">수정</a>
|
|
<form action="{{ route('sales.managers.destroy', $manager->id) }}" method="POST" class="inline"
|
|
onsubmit="return confirm('정말 비활성화하시겠습니까?')">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="text-red-600 hover:text-red-900">삭제</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="7" class="px-6 py-12 text-center text-gray-500">
|
|
등록된 담당자가 없습니다.
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- 페이지네이션 -->
|
|
@if($managers->hasPages())
|
|
<div class="px-6 py-4 border-t border-gray-200">
|
|
{{ $managers->withQueryString()->links() }}
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@endsection
|