@extends('layouts.app') @section('title', 'AI 견적 상세') @section('content')

{{ $quotation->title }}

{{ $quotation->status_label }} @if($quotation->isManufacture()) 제조 견적 @endif
목록 @if($quotation->isCompleted()) @if($quotation->isManufacture()) 견적서 편집 @endif 견적서 보기 @endif @if($quotation->isCompleted() || $quotation->status === 'failed') @endif

AI Provider

{{ strtoupper($quotation->ai_provider) }}{{ $quotation->ai_model ? ' ('.$quotation->ai_model.')' : '' }}

@if($quotation->isManufacture())

견적번호

{{ $quotation->quote_number ?? '-' }}

제품 카테고리

{{ $quotation->product_category === 'STEEL' ? '철재' : '방화스크린' }}

@else

입력 유형

{{ ['text' => '텍스트', 'voice' => '음성', 'document' => '문서'][$quotation->input_type] ?? $quotation->input_type }}

@endif

요청자

{{ $quotation->creator?->name ?? '-' }}

생성일

{{ $quotation->created_at->format('Y-m-d H:i') }}

@if($quotation->isCompleted()) @if($quotation->isManufacture()) {{-- ============================================ --}} {{-- 제조 견적 모드 --}} {{-- ============================================ --}} @php $options = $quotation->options ?? []; $client = $options['client'] ?? []; $project = $options['project'] ?? []; $pricing = $options['pricing'] ?? []; $terms = $options['terms'] ?? []; $analysis = $quotation->analysis_result ?? []; $productSpecs = $analysis['product_specs'] ?? []; @endphp @if(!empty($client))

고객 정보

회사명

{{ $client['company'] ?? '-' }}

담당자

{{ $client['contact'] ?? '-' }}

연락처

{{ $client['phone'] ?? '-' }}

이메일

{{ $client['email'] ?? '-' }}

@endif @if(!empty($project))

프로젝트 분석

현장명 {{ $project['name'] ?? '-' }}
건물유형 {{ $project['building_type'] ?? '-' }}
@if(!empty($project['location']))
위치 {{ $project['location'] }}
@endif
@endif @if(!empty($productSpecs))

위치별 제품 사양 (AI 추출)

@foreach($productSpecs as $spec) @endforeach
위치 유형 규격 (W×H) 수량 가이드레일 모터 비고
{{ $spec['floor_name'] ?? '-' }}
{{ $spec['floor_code'] ?? '' }}
{{ $spec['product_type'] ?? '-' }} {{ ($spec['width_mm'] ?? 0) }}×{{ ($spec['height_mm'] ?? 0) }} {{ $spec['quantity'] ?? 1 }} {{ $spec['guide_rail'] ?? '-' }} {{ $spec['motor'] ?? '-' }} {{ $spec['note'] ?? '' }}
@endif

견적 품목

@php $materialItems = $quotation->items->where('item_category', 'material'); $laborItems = $quotation->items->where('item_category', 'labor'); $installItems = $quotation->items->where('item_category', 'install'); $otherItems = $quotation->items->whereNotIn('item_category', ['material', 'labor', 'install']); @endphp @php $no = 1; @endphp {{-- 재료비 --}} @if($materialItems->isNotEmpty()) @foreach($materialItems as $item) @endforeach @endif {{-- 노무비 --}} @if($laborItems->isNotEmpty()) @foreach($laborItems as $item) @endforeach @endif {{-- 설치비 --}} @if($installItems->isNotEmpty()) @foreach($installItems as $item) @endforeach @endif {{-- 기타 --}} @foreach($otherItems as $item) @endforeach
No 위치 품목 규격 수량 단가 금액
재료비
{{ $no++ }} {{ $item->floor_code }} {{ $item->module_name }} {{ $item->specification }} {{ number_format((float)$item->quantity, 0) }} {{ $item->unit }} {{ number_format((float)$item->unit_price) }} {{ number_format((float)$item->total_price) }}
노무비
{{ $no++ }} {{ $item->floor_code }} {{ $item->module_name }} {{ $item->specification }} {{ number_format((float)$item->quantity, 0) }} {{ $item->unit }} {{ number_format((float)$item->unit_price) }} {{ number_format((float)$item->total_price) }}
설치비
{{ $no++ }} {{ $item->floor_code }} {{ $item->module_name }} {{ $item->specification }} {{ number_format((float)$item->quantity, 0) }} {{ $item->unit }} {{ number_format((float)$item->unit_price) }} {{ number_format((float)$item->total_price) }}
{{ $no++ }} {{ $item->floor_code }} {{ $item->module_name }} {{ $item->specification }} {{ number_format((float)$item->quantity, 0) }} {{ $item->unit }} {{ number_format((float)$item->unit_price) }} {{ number_format((float)$item->total_price) }}

금액 요약

재료비{{ number_format((int)($pricing['material_cost'] ?? 0)) }}원
노무비{{ number_format((int)($pricing['labor_cost'] ?? 0)) }}원
설치비{{ number_format((int)($pricing['install_cost'] ?? 0)) }}원
소계{{ number_format((int)($pricing['subtotal'] ?? 0)) }}원
@if(($pricing['discount_rate'] ?? 0) > 0)
할인 ({{ $pricing['discount_rate'] }}%)-{{ number_format((int)($pricing['discount_amount'] ?? 0)) }}원
@endif
부가세 (10%){{ number_format((int)($pricing['vat_amount'] ?? 0)) }}원
최종 금액 {{ number_format((int)($pricing['final_amount'] ?? 0)) }}원
@php $koreanAmount = \App\Services\Rd\AiQuotationService::numberToKorean((int)($pricing['subtotal'] ?? 0)); @endphp
금 {{ $koreanAmount }}원정 (VAT 별도)
@else {{-- ============================================ --}} {{-- 모듈 추천 모드 (기존) --}} {{-- ============================================ --}} @if($quotation->analysis_result) @php $analysis = $quotation->analysis_result; @endphp

AI 업무 분석 결과

@if(isset($analysis['company_analysis'])) @php $company = $analysis['company_analysis']; @endphp
업종 {{ $company['industry'] ?? '-' }}
규모 {{ $company['scale'] ?? '-' }}
디지털화 수준 {{ $company['digitalization_level'] ?? '-' }}
@if(!empty($company['current_systems']))
현재 시스템 {{ implode(', ', $company['current_systems']) }}
@endif
@endif @if(!empty($analysis['business_domains']))

업무 영역 분석

@foreach($analysis['business_domains'] as $domain)

{{ $domain['domain'] ?? '' }}

@php $priorityColor = match($domain['priority'] ?? '') { '필수' => 'bg-red-100 text-red-700', '높음' => 'bg-orange-100 text-orange-700', '보통' => 'bg-yellow-100 text-yellow-700', default => 'bg-gray-100 text-gray-700', }; @endphp {{ $domain['priority'] ?? '' }}

{{ $domain['current_process'] ?? '' }}

@if(!empty($domain['pain_points']))
@foreach($domain['pain_points'] as $point) {{ $point }} @endforeach
@endif @if(!empty($domain['matched_modules']))
@foreach($domain['matched_modules'] as $mod) {{ $mod }} @endforeach
@endif
@endforeach
@endif
@endif

추천 모듈 및 견적

@foreach($quotation->items as $item) @endforeach
구분 모듈 추천 근거 개발비 월 구독료
@if($item->is_required) 필수 @else 선택 @endif
{{ $item->module_name }}
{{ $item->module_code }}
{{ Str::limit($item->reason, 100) }} {{ number_format((int)$item->dev_cost) }}원 {{ number_format((int)$item->monthly_fee) }}원
합계 {{ number_format((int)$quotation->total_dev_cost) }}원 {{ number_format((int)$quotation->total_monthly_fee) }}원/월
@if(!empty($quotation->quotation_result['implementation_plan'])) @php $plan = $quotation->quotation_result['implementation_plan']; @endphp

구현 계획 (AI 추천)

예상 기간: {{ $plan['estimated_months'] ?? '?' }}개월

@if(!empty($plan['phases']))
@foreach($plan['phases'] as $phase)
{{ $phase['phase'] ?? '' }}

{{ $phase['name'] ?? '' }}

{{ $phase['duration_weeks'] ?? '?' }}주 @if(!empty($phase['modules'])) | @foreach($phase['modules'] as $mod) {{ $mod }} @endforeach @endif
@endforeach
@endif
@endif @if(!empty($quotation->quotation_result['analysis_summary']))

AI 분석 요약

{{ $quotation->quotation_result['analysis_summary'] }}

@endif @endif @elseif($quotation->status === 'failed')

AI 분석 실패

AI 분석 중 오류가 발생했습니다. 다시 시도하거나 입력 내용을 수정해 주세요.

@elseif($quotation->isProcessing())

AI 분석 진행중...

분석이 완료되면 자동으로 결과가 표시됩니다.

@endif
인터뷰 원문 보기
{{ $quotation->input_text }}
@endsection @push('scripts') @endpush