feat:인계 완료 항목 영업/매니저 기록 조회 기능 추가
- 인계 완료 섹션에 영업/매니저 기록 조회 버튼 추가 - readonly 모드로 열어 수정 불가, 조회만 가능 - prospectManagerScenario에 readonly 파라미터 지원 추가 - 단계 이동 시 readonly 파라미터 유지 - 마지막 단계 버튼 텍스트 조건부 표시 (완료/닫기) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -228,6 +228,7 @@ public function prospectManagerScenario(int $prospectId, Request $request): View
|
||||
$steps = config('sales_scenario.manager_steps');
|
||||
$currentStep = (int) $request->input('step', 1);
|
||||
$icons = config('sales_scenario.icons');
|
||||
$readonly = $request->boolean('readonly', false);
|
||||
|
||||
// 가망고객 영업 관리 정보 조회 또는 생성
|
||||
$management = SalesTenantManagement::findOrCreateByProspect($prospectId);
|
||||
@@ -250,6 +251,7 @@ public function prospectManagerScenario(int $prospectId, Request $request): View
|
||||
'icons' => $icons,
|
||||
'management' => $management,
|
||||
'isProspect' => true,
|
||||
'readonly' => $readonly,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -262,6 +264,7 @@ public function prospectManagerScenario(int $prospectId, Request $request): View
|
||||
'icons' => $icons,
|
||||
'management' => $management,
|
||||
'isProspect' => true,
|
||||
'readonly' => $readonly,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,10 +9,11 @@
|
||||
swap: 'innerHTML'
|
||||
});
|
||||
},
|
||||
openProspectScenarioModal(prospectId, type) {
|
||||
openProspectScenarioModal(prospectId, type, readonly = false) {
|
||||
const readonlyParam = readonly ? '?readonly=1' : '';
|
||||
const url = type === 'sales'
|
||||
? `/sales/scenarios/prospect/${prospectId}/sales`
|
||||
: `/sales/scenarios/prospect/${prospectId}/manager`;
|
||||
? `/sales/scenarios/prospect/${prospectId}/sales${readonlyParam}`
|
||||
: `/sales/scenarios/prospect/${prospectId}/manager${readonlyParam}`;
|
||||
htmx.ajax('GET', url, {
|
||||
target: '#scenario-modal-container',
|
||||
swap: 'innerHTML'
|
||||
@@ -329,6 +330,29 @@ class="inline-flex items-center gap-1 px-3 py-1.5 rounded text-xs font-medium bg
|
||||
<span>{{ $prospect->business_number ?? '-' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{-- 영업/매니저 기록 조회 버튼 (읽기 전용) --}}
|
||||
<div class="flex-shrink-0 flex items-center gap-1">
|
||||
<button
|
||||
x-on:click="openProspectScenarioModal({{ $prospect->id }}, 'sales', true)"
|
||||
class="inline-flex items-center gap-1 px-2 py-1 rounded text-xs font-medium bg-blue-100 text-blue-700 hover:bg-blue-200 transition-colors"
|
||||
title="영업 기록 조회">
|
||||
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
|
||||
</svg>
|
||||
영업
|
||||
</button>
|
||||
<button
|
||||
x-on:click="openProspectScenarioModal({{ $prospect->id }}, 'manager', true)"
|
||||
class="inline-flex items-center gap-1 px-2 py-1 rounded text-xs font-medium bg-green-100 text-green-700 hover:bg-green-200 transition-colors"
|
||||
title="매니저 기록 조회">
|
||||
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
|
||||
</svg>
|
||||
매니저
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 진행 현황 (완료) -->
|
||||
|
||||
@@ -202,12 +202,15 @@ class="border-t border-gray-100">
|
||||
$routeName = $isProspectMode
|
||||
? 'sales.scenarios.prospect.' . $scenarioType
|
||||
: 'sales.scenarios.' . $scenarioType;
|
||||
|
||||
// readonly 파라미터
|
||||
$readonlyParam = $isReadonly ? '&readonly=1' : '';
|
||||
@endphp
|
||||
<div class="flex items-center justify-between pt-4 border-t border-gray-200">
|
||||
{{-- 이전 단계 버튼 --}}
|
||||
@if($currentStepId > 1)
|
||||
<button type="button"
|
||||
hx-get="{{ route($routeName, $entityId) }}?step={{ $prevStepId }}"
|
||||
hx-get="{{ route($routeName, $entityId) }}?step={{ $prevStepId }}{{ $readonlyParam }}"
|
||||
hx-target="#scenario-step-content"
|
||||
hx-swap="innerHTML"
|
||||
x-on:click="window.dispatchEvent(new CustomEvent('step-changed', { detail: {{ $prevStepId }} }))"
|
||||
@@ -229,11 +232,11 @@ class="inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white b
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
|
||||
</svg>
|
||||
완료
|
||||
{{ $isReadonly ? '닫기' : '완료' }}
|
||||
</button>
|
||||
@else
|
||||
<button type="button"
|
||||
hx-get="{{ route($routeName, $entityId) }}?step={{ $nextStepId }}"
|
||||
hx-get="{{ route($routeName, $entityId) }}?step={{ $nextStepId }}{{ $readonlyParam }}"
|
||||
hx-target="#scenario-step-content"
|
||||
hx-swap="innerHTML"
|
||||
x-on:click="window.dispatchEvent(new CustomEvent('step-changed', { detail: {{ $nextStepId }} }))"
|
||||
|
||||
Reference in New Issue
Block a user