diff --git a/resources/views/approvals/create.blade.php b/resources/views/approvals/create.blade.php index 0581292e..9c125668 100644 --- a/resources/views/approvals/create.blade.php +++ b/resources/views/approvals/create.blade.php @@ -660,33 +660,36 @@ function updateApprovalLineSummary() { const editorEl = document.getElementById('approval-line-editor'); if (!editorEl || !editorEl._x_dataStack) return; - const steps = editorEl._x_dataStack[0].steps; + const alpineData = editorEl._x_dataStack[0]; + const steps = alpineData.steps; + const references = alpineData.references || []; const summaryEl = document.getElementById('approval-line-summary'); if (summarySortableInstance) { summarySortableInstance.destroy(); summarySortableInstance = null; } - if (!steps || steps.length === 0) { + if ((!steps || steps.length === 0) && references.length === 0) { summaryEl.className = 'p-3 bg-gray-50 rounded-lg border border-gray-200 flex items-center'; summaryEl.innerHTML = '결재선이 설정되지 않았습니다.'; return; } - const typeCounters = { approval: 0, agreement: 0, reference: 0 }; - const typeLabels = { approval: '결재', agreement: '합의', reference: '참조' }; - const typeBg = { approval: 'bg-blue-50 border-blue-100', agreement: 'bg-green-50 border-green-100', reference: 'bg-gray-100 border-gray-200' }; - const typeLabelColor = { approval: 'text-blue-600', agreement: 'text-green-600', reference: 'text-gray-500' }; + const typeCounters = { approval: 0, agreement: 0 }; + const typeLabels = { approval: '결재', agreement: '합의' }; + const typeBg = { approval: 'bg-blue-50 border-blue-100', agreement: 'bg-green-50 border-green-100' }; + const typeLabelColor = { approval: 'text-blue-600', agreement: 'text-green-600' }; - const cards = []; + // 결재선 카드 + const approvalCards = []; steps.forEach(function(s, i) { typeCounters[s.step_type] = (typeCounters[s.step_type] || 0) + 1; var count = typeCounters[s.step_type]; var label = typeLabels[s.step_type] || s.step_type; - var bg = typeBg[s.step_type] || typeBg.reference; - var labelColor = typeLabelColor[s.step_type] || typeLabelColor.reference; - var stepLabel = s.step_type === 'reference' ? label : count + '차 ' + label; + var bg = typeBg[s.step_type] || 'bg-blue-50 border-blue-100'; + var labelColor = typeLabelColor[s.step_type] || 'text-blue-600'; + var stepLabel = count + '차 ' + label; var position = s.position || ''; - cards.push( + approvalCards.push( '