Files
sam-manage/resources/views/sales/prospects/create.blade.php
pro d39028d92a feat:영업관리 모듈 (salesmanagement) Laravel 마이그레이션
레거시 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>
2026-01-26 11:09:42 +09:00

122 lines
6.3 KiB
PHP

@extends('layouts.app')
@section('title', '가망고객 등록')
@section('content')
<div class="max-w-2xl mx-auto">
<!-- 페이지 헤더 -->
<div class="mb-6">
<a href="{{ route('sales.prospects.index') }}" class="text-gray-500 hover:text-gray-700 text-sm mb-2 inline-flex items-center">
<svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
</svg>
목록으로
</a>
<h1 class="text-2xl font-bold text-gray-800">가망고객 등록</h1>
</div>
<!-- -->
<form action="{{ route('sales.prospects.store') }}" method="POST" class="bg-white rounded-lg shadow-sm p-6 space-y-6">
@csrf
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">업체명 <span class="text-red-500">*</span></label>
<input type="text" name="company_name" value="{{ old('company_name') }}" required
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 @error('company_name') border-red-500 @enderror">
@error('company_name')
<p class="mt-1 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">사업자번호</label>
<input type="text" name="business_no" value="{{ old('business_no') }}" placeholder="000-00-00000"
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>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">대표자명</label>
<input type="text" name="representative" value="{{ old('representative') }}"
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>
<label class="block text-sm font-medium text-gray-700 mb-2">연락처</label>
<input type="text" name="contact_phone" value="{{ old('contact_phone') }}"
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>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">이메일</label>
<input type="email" name="email" value="{{ old('email') }}"
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>
<label class="block text-sm font-medium text-gray-700 mb-2">상태 <span class="text-red-500">*</span></label>
<select name="status" required
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="lead" {{ old('status') === 'lead' ? 'selected' : '' }}>리드</option>
<option value="prospect" {{ old('status') === 'prospect' ? 'selected' : '' }}>가망</option>
<option value="negotiation" {{ old('status') === 'negotiation' ? 'selected' : '' }}>협상중</option>
<option value="contracted" {{ old('status') === 'contracted' ? 'selected' : '' }}>계약완료</option>
</select>
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">주소</label>
<input type="text" name="address" value="{{ old('address') }}"
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="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">영업 담당자 <span class="text-red-500">*</span></label>
<select name="manager_id" required
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 @error('manager_id') border-red-500 @enderror">
<option value="">선택하세요</option>
@foreach($managers as $manager)
<option value="{{ $manager->id }}" {{ old('manager_id') == $manager->id ? 'selected' : '' }}>
{{ $manager->name }} ({{ $manager->role_label }})
</option>
@endforeach
</select>
@error('manager_id')
<p class="mt-1 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">담당 매니저</label>
<select name="sales_manager_id"
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>
@foreach($managers as $manager)
<option value="{{ $manager->id }}" {{ old('sales_manager_id') == $manager->id ? 'selected' : '' }}>
{{ $manager->name }} ({{ $manager->role_label }})
</option>
@endforeach
</select>
</div>
</div>
<div class="flex justify-end gap-3 pt-4 border-t">
<a href="{{ route('sales.prospects.index') }}"
class="px-6 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition">
취소
</a>
<button type="submit"
class="px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition">
등록
</button>
</div>
</form>
</div>
@endsection