Files
sam-manage/resources/views/sales/prospects/edit.blade.php
pro e04cbcf1e0 feat:영업권(명함등록) 시스템 구현
- TenantProspect 모델, 서비스, 컨트롤러 추가
- 명함 등록 시 2개월 영업권 부여
- 만료 후 1개월 쿨다운 기간 적용
- 테넌트 전환 기능 구현
- 사업자번호 중복 체크 API 추가
- 명함 이미지 업로드 지원

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 22:39:42 +09:00

127 lines
6.4 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.show', $prospect->id) }}" 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>
<p class="text-sm text-gray-500 mt-1">{{ $prospect->company_name }} ({{ $prospect->business_number }})</p>
</div>
<!-- 알림 메시지 -->
@if(session('error'))
<div class="mb-4 p-4 bg-red-50 border border-red-200 rounded-lg text-red-700">
{{ session('error') }}
</div>
@endif
<!-- -->
<form action="{{ route('sales.prospects.update', $prospect->id) }}" method="POST" enctype="multipart/form-data" class="bg-white rounded-lg shadow-sm p-6 space-y-6">
@csrf
@method('PUT')
<!-- 사업자번호 (수정 불가) -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">사업자번호</label>
<input type="text" value="{{ $prospect->business_number }}" disabled
class="w-full px-4 py-2 border border-gray-300 rounded-lg bg-gray-100 text-gray-500">
<p class="mt-1 text-xs text-gray-500">사업자번호는 수정할 없습니다</p>
</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>
<input type="text" name="company_name" value="{{ old('company_name', $prospect->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="ceo_name" value="{{ old('ceo_name', $prospect->ceo_name) }}"
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="contact_phone" value="{{ old('contact_phone', $prospect->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>
<label class="block text-sm font-medium text-gray-700 mb-2">이메일</label>
<input type="email" name="contact_email" value="{{ old('contact_email', $prospect->contact_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>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">주소</label>
<input type="text" name="address" value="{{ old('address', $prospect->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>
<label class="block text-sm font-medium text-gray-700 mb-2">명함 이미지</label>
@if($prospect->hasBusinessCard())
<div class="mb-2 p-2 bg-gray-50 rounded-lg">
<img src="{{ $prospect->business_card_url }}" alt="현재 명함" class="max-h-32 rounded">
<p class="text-xs text-gray-500 mt-1"> 이미지를 업로드하면 기존 이미지가 교체됩니다</p>
</div>
@endif
<input type="file" name="business_card" accept="image/*"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<p class="mt-1 text-xs text-gray-500">JPG, PNG 형식 (최대 5MB)</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">메모</label>
<textarea name="memo" rows="3"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">{{ old('memo', $prospect->memo) }}</textarea>
</div>
<!-- 영업권 상태 정보 -->
<div class="bg-gray-50 border border-gray-200 rounded-lg p-4">
<h3 class="font-medium text-gray-800 mb-2">영업권 상태</h3>
<dl class="grid grid-cols-2 gap-2 text-sm">
<dt class="text-gray-500">상태</dt>
<dd class="font-medium">
<span class="px-2 py-1 text-xs font-medium rounded-full {{ $prospect->status_color }}">
{{ $prospect->status_label }}
</span>
</dd>
<dt class="text-gray-500">등록일</dt>
<dd class="font-medium">{{ $prospect->registered_at->format('Y-m-d') }}</dd>
<dt class="text-gray-500">만료일</dt>
<dd class="font-medium">{{ $prospect->expires_at->format('Y-m-d') }}</dd>
<dt class="text-gray-500">등록자</dt>
<dd class="font-medium">{{ $prospect->registeredBy?->name ?? '-' }}</dd>
</dl>
</div>
<div class="flex justify-end gap-3 pt-4 border-t">
<a href="{{ route('sales.prospects.show', $prospect->id) }}"
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