Files
sam-manage/resources/views/approvals/partials/_delegation-form.blade.php
김보곤 1ccf97ce6b feat: [approval] 위임장 양식 추가
- 위임장 전용 폼(_delegation-form.blade.php) 생성
- 위임장 읽기전용 뷰(_delegation-show.blade.php) 생성
- create/edit/show 페이지에 위임장 통합
- 미리보기/인쇄 기능 포함
- 인사/근태 카테고리에 배치
2026-03-06 22:25:00 +09:00

172 lines
11 KiB
PHP

{{--
위임장 전용
Props:
$tenantInfo (array) - 테넌트(회사) 정보
--}}
@php
$tenantInfo = $tenantInfo ?? [];
@endphp
<div id="delegation-form-container" style="display: none;" class="mb-4">
<input type="hidden" id="dl-company-name" value="{{ $tenantInfo['company_name'] ?? '' }}">
<input type="hidden" id="dl-business-num" value="{{ $tenantInfo['business_num'] ?? '' }}">
<input type="hidden" id="dl-ceo-name" value="{{ $tenantInfo['ceo_name'] ?? '' }}">
<input type="hidden" id="dl-company-address" value="{{ $tenantInfo['address'] ?? '' }}">
<div class="space-y-4">
{{-- 1. 위임인 (회사 정보 - 읽기전용) --}}
<div class="border border-gray-200 rounded-lg overflow-hidden">
<div class="bg-gray-50 px-4 py-2 border-b border-gray-200">
<h3 class="text-sm font-semibold text-gray-700">1. 위임인</h3>
</div>
<div class="p-4 space-y-3">
<div class="flex gap-4 flex-wrap">
<div style="flex: 1 1 250px;">
<label class="block text-xs font-medium text-gray-500 mb-1">법인명</label>
<input type="text" id="dl-company-display" readonly value="{{ $tenantInfo['company_name'] ?? '' }}"
class="w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-gray-50 text-gray-700">
</div>
<div style="flex: 1 1 200px; max-width: 250px;">
<label class="block text-xs font-medium text-gray-500 mb-1">사업자등록번호</label>
<input type="text" id="dl-business-display" readonly value="{{ $tenantInfo['business_num'] ?? '' }}"
class="w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-gray-50 text-gray-700">
</div>
</div>
<div>
<label class="block text-xs font-medium text-gray-500 mb-1">주소</label>
<input type="text" id="dl-address-display" readonly value="{{ $tenantInfo['address'] ?? '' }}"
class="w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-gray-50 text-gray-700">
</div>
<div style="max-width: 250px;">
<label class="block text-xs font-medium text-gray-500 mb-1">대표자</label>
<input type="text" id="dl-ceo-display" readonly value="{{ $tenantInfo['ceo_name'] ?? '' }}"
class="w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-gray-50 text-gray-700">
</div>
</div>
</div>
{{-- 2. 수임인 (대리인 정보 - 입력) --}}
<div class="border border-gray-200 rounded-lg overflow-hidden">
<div class="bg-gray-50 px-4 py-2 border-b border-gray-200">
<h3 class="text-sm font-semibold text-gray-700">2. 수임인 (대리인)</h3>
</div>
<div class="p-4 space-y-3">
<div class="flex gap-4 flex-wrap">
<div style="flex: 1 1 200px; max-width: 250px;">
<label class="block text-xs font-medium text-gray-500 mb-1">성명 <span class="text-red-500">*</span></label>
<input type="text" id="dl-agent-name" placeholder="대리인 성명"
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div style="flex: 1 1 200px; max-width: 250px;">
<label class="block text-xs font-medium text-gray-500 mb-1">생년월일</label>
<input type="date" id="dl-agent-birth"
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
</div>
<div>
<label class="block text-xs font-medium text-gray-500 mb-1">주소</label>
<input type="text" id="dl-agent-address" placeholder="대리인 주소"
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div class="flex gap-4 flex-wrap">
<div style="flex: 1 1 200px; max-width: 250px;">
<label class="block text-xs font-medium text-gray-500 mb-1">연락처</label>
<input type="text" id="dl-agent-phone" placeholder="010-0000-0000"
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div style="flex: 1 1 200px; max-width: 250px;">
<label class="block text-xs font-medium text-gray-500 mb-1">소속</label>
<input type="text" id="dl-agent-department" placeholder="소속 부서"
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
</div>
</div>
</div>
{{-- 3. 위임사항 --}}
<div class="border border-gray-200 rounded-lg overflow-hidden">
<div class="bg-gray-50 px-4 py-2 border-b border-gray-200">
<h3 class="text-sm font-semibold text-gray-700">3. 위임사항</h3>
</div>
<div class="p-4">
<textarea id="dl-delegation-detail" rows="3" placeholder="예: 법인 휴대폰 개통 및 변경 업무에 대하여 상기 대리인에게 권한을 위임합니다."
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"></textarea>
</div>
</div>
{{-- 4. 위임기간 --}}
<div class="border border-gray-200 rounded-lg overflow-hidden">
<div class="bg-gray-50 px-4 py-2 border-b border-gray-200">
<h3 class="text-sm font-semibold text-gray-700">4. 위임기간</h3>
</div>
<div class="p-4">
<div class="flex gap-3 items-center flex-wrap">
<div style="flex: 1 1 180px; max-width: 200px;">
<input type="date" id="dl-period-start" value="{{ now()->format('Y-m-d') }}"
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<span class="text-gray-400 text-sm">~</span>
<div style="flex: 1 1 180px; max-width: 200px;">
<input type="date" id="dl-period-end" value="{{ now()->format('Y-m-d') }}"
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
</div>
</div>
</div>
{{-- 5. 첨부서류 --}}
<div class="border border-gray-200 rounded-lg overflow-hidden">
<div class="bg-gray-50 px-4 py-2 border-b border-gray-200">
<h3 class="text-sm font-semibold text-gray-700">5. 첨부서류</h3>
</div>
<div class="p-4">
<textarea id="dl-attachments-desc" rows="3" placeholder="예:&#10;- 인감증명서 1부&#10;- 대리인 신분증 1부&#10;- 재직증명서 1부"
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"></textarea>
</div>
</div>
{{-- 미리보기 버튼 --}}
<div class="flex justify-end">
<button type="button" onclick="openDelegationPreview()"
class="px-3 py-2 bg-indigo-50 text-indigo-600 hover:bg-indigo-100 border border-indigo-200 rounded-lg text-sm font-medium transition inline-flex items-center gap-1">
<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="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>
</div>
{{-- 위임장 미리보기 모달 --}}
<div id="delegation-preview-modal" style="display: none;" class="fixed inset-0 z-50">
<div class="absolute inset-0 bg-black/50" onclick="closeDelegationPreview()"></div>
<div class="relative flex items-center justify-center min-h-full p-4">
<div class="bg-white rounded-xl shadow-2xl w-full overflow-hidden relative" style="max-width: 700px;">
<div class="flex items-center justify-between px-5 py-3 border-b border-gray-200 bg-gray-50">
<h3 class="text-base font-semibold text-gray-800">위임장 미리보기</h3>
<div class="flex items-center gap-2">
<button type="button" onclick="printDelegationPreview()"
class="px-3 py-1.5 bg-white border border-gray-300 hover:bg-gray-50 rounded-lg text-xs font-medium transition inline-flex items-center gap-1">
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"/>
</svg>
인쇄
</button>
<button type="button" onclick="closeDelegationPreview()"
class="p-1 text-gray-400 hover:text-gray-600 transition">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
</div>
<div class="overflow-y-auto" style="max-height: 80vh;">
<div id="delegation-preview-content" style="padding: 48px 56px; font-family: 'Pretendard', 'Malgun Gothic', sans-serif;">
</div>
</div>
</div>
</div>
</div>