{{-- 시나리오 단계별 체크리스트 --}} @php use App\Models\Sales\SalesScenarioChecklist; // $steps가 없거나 비어있으면 config에서 가져오기 (안전장치) if (empty($steps)) { $steps = config($scenarioType === 'sales' ? 'sales_scenario.sales_steps' : 'sales_scenario.manager_steps', []); } $step = $step ?? collect($steps)->firstWhere('id', $currentStep ?? 1); // prospect 모드 확인 $isProspectMode = isset($isProspect) && $isProspect; $entity = $isProspectMode ? $prospect : $tenant; $entityId = $entity->id; // 읽기 전용 모드 확인 $isReadonly = isset($readonly) && $readonly; // DB에서 체크된 항목 조회 $checklist = $isProspectMode ? SalesScenarioChecklist::getChecklistByProspect($entityId, $scenarioType) : SalesScenarioChecklist::getChecklist($entityId, $scenarioType); @endphp
{{-- 단계 헤더 --}}
{!! $icons[$step['icon']] ?? '' !!}
STEP {{ $step['id'] }} {{ $step['subtitle'] }}

{{ $step['title'] }}

{{ $step['description'] }}

{{-- 매니저용 팁 (있는 경우) --}} @if(isset($step['tips']))

매니저 TIP

{{ $step['tips'] }}

@endif {{-- 체크포인트 목록 --}}
@foreach($step['checkpoints'] as $checkpoint) @php $checkKey = "{$step['id']}_{$checkpoint['id']}"; $isChecked = isset($checklist[$checkKey]); @endphp
{{-- 체크포인트 헤더 --}}
{{-- 체크박스 --}} {{-- 제목 및 설명 --}}

{{ $checkpoint['title'] }}

{{ $checkpoint['detail'] }}

{{-- 확장 아이콘 --}}
{{-- 확장 콘텐츠 --}}
{{-- 상세 설명 --}}
상세 설명

{{ $checkpoint['detail'] }}

{{-- PRO TIP --}}

PRO TIP

{{ $checkpoint['pro_tip'] }}

@endforeach
{{-- 계약 체결 단계 (Step 6)에서만 상품 선택 컴포넌트 표시 --}} @if($step['id'] === 6 && $scenarioType === 'sales') @include('sales.modals.partials.product-selection', [ 'entity' => $entity, 'isProspect' => $isProspectMode, ]) @endif {{-- 단계 이동 버튼 --}} @php $currentStepId = (int) $step['id']; $totalSteps = count($steps); $isLastStep = ($currentStepId >= $totalSteps); $nextStepId = $currentStepId + 1; $prevStepId = $currentStepId - 1; $stepColor = $step['color'] ?? 'blue'; // 라우트 결정 $routeName = $isProspectMode ? 'sales.scenarios.prospect.' . $scenarioType : 'sales.scenarios.' . $scenarioType; // readonly 파라미터 $readonlyParam = $isReadonly ? '&readonly=1' : ''; @endphp
{{-- 이전 단계 버튼 --}} @if($currentStepId > 1) @else
@endif {{-- 다음 단계 / 완료 버튼 --}} @if($isLastStep) @else @endif