레거시 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>
121 lines
6.5 KiB
PHP
121 lines
6.5 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', '영업실적 수정')
|
|
|
|
@section('content')
|
|
<div class="max-w-2xl mx-auto">
|
|
<!-- 페이지 헤더 -->
|
|
<div class="mb-6">
|
|
<a href="{{ route('sales.records.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.records.update', $record->id) }}" method="POST" class="bg-white rounded-lg shadow-sm p-6 space-y-6">
|
|
@csrf
|
|
@method('PUT')
|
|
|
|
<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="date" name="record_date" value="{{ old('record_date', $record->record_date->format('Y-m-d')) }}" 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('record_date') border-red-500 @enderror">
|
|
@error('record_date')
|
|
<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">실적 유형 <span class="text-red-500">*</span></label>
|
|
<input type="text" name="record_type" value="{{ old('record_type', $record->record_type) }}" 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('record_type') border-red-500 @enderror">
|
|
@error('record_type')
|
|
<p class="mt-1 text-sm text-red-500">{{ $message }}</p>
|
|
@enderror
|
|
</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">담당자 <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', $record->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="prospect_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($prospects as $prospect)
|
|
<option value="{{ $prospect->id }}" {{ old('prospect_id', $record->prospect_id) == $prospect->id ? 'selected' : '' }}>
|
|
{{ $prospect->company_name }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
</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">실적 금액 <span class="text-red-500">*</span></label>
|
|
<input type="number" name="amount" value="{{ old('amount', $record->amount) }}" required min="0"
|
|
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 @error('amount') border-red-500 @enderror">
|
|
@error('amount')
|
|
<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="number" name="commission" value="{{ old('commission', $record->commission) }}" min="0"
|
|
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">상태 <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="pending" {{ old('status', $record->status) === 'pending' ? 'selected' : '' }}>대기</option>
|
|
<option value="approved" {{ old('status', $record->status) === 'approved' ? 'selected' : '' }}>승인</option>
|
|
<option value="rejected" {{ old('status', $record->status) === 'rejected' ? 'selected' : '' }}>반려</option>
|
|
<option value="paid" {{ old('status', $record->status) === 'paid' ? 'selected' : '' }}>지급완료</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">설명</label>
|
|
<textarea name="description" 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('description', $record->description) }}</textarea>
|
|
</div>
|
|
|
|
<div class="flex justify-end gap-3 pt-4 border-t">
|
|
<a href="{{ route('sales.records.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
|