feat: tkpurchase 시스템 Phase 1 - 협력업체 마스터 + 당일 방문 관리

신규 독립 시스템 tkpurchase (구매/방문 관리) 구축:
- 협력업체 CRUD + 소속 작업자 관리 (마스터 데이터 소유)
- 당일 방문 등록/체크인/체크아웃 + 일괄 마감
- 업체 자동완성, CSV 내보내기, 집계 통계
- 자정 자동 체크아웃 (node-cron)
- tkuser 협력업체 읽기 전용 탭 + 권한 그리드(tkpurchase-perms) 추가
- docker-compose에 tkpurchase-api/web 서비스 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-12 15:45:37 +09:00
parent 5b1b89254c
commit 281f5d35d1
29 changed files with 2641 additions and 7 deletions

View File

@@ -61,6 +61,9 @@
<button class="tab-btn px-4 py-2 rounded-lg text-sm font-medium whitespace-nowrap" onclick="switchTab('vacations')">
<i class="fas fa-umbrella-beach mr-2"></i>휴가
</button>
<button class="tab-btn px-4 py-2 rounded-lg text-sm font-medium whitespace-nowrap" onclick="switchTab('partners')">
<i class="fas fa-truck mr-2"></i>협력업체
</button>
</div>
</div>
</nav>
@@ -191,6 +194,22 @@
</div>
<div id="dept-s3-perms" class="p-4 border border-t-0 border-purple-100 rounded-b-lg space-y-4"></div>
</div>
<!-- tkpurchase - 구매 관리 -->
<div class="system-section tkpurchase rounded-lg mb-5 bg-white">
<div class="flex items-center justify-between px-4 py-3 bg-green-50 rounded-t-lg border border-green-100">
<div class="flex items-center gap-2">
<i class="fas fa-truck text-green-500"></i>
<span class="font-semibold text-sm text-green-900">구매 관리</span>
<span class="text-xs text-green-500 bg-green-100 px-2 py-0.5 rounded-full">tkpurchase</span>
</div>
<div class="flex gap-2">
<button onclick="toggleDeptSystemAll('tkpurchase', true)" class="text-xs text-green-600 hover:underline">전체 허용</button>
<span class="text-gray-300">|</span>
<button onclick="toggleDeptSystemAll('tkpurchase', false)" class="text-xs text-green-600 hover:underline">전체 해제</button>
</div>
</div>
<div id="dept-tkpurchase-perms" class="p-4 border border-t-0 border-green-100 rounded-b-lg space-y-4"></div>
</div>
<!-- 저장 -->
<div class="flex items-center gap-3 pt-2">
<button id="saveDeptPermBtn" class="px-6 py-2.5 bg-slate-700 text-white rounded-lg hover:bg-slate-800 text-sm font-medium">
@@ -250,6 +269,23 @@
<div id="s3-perms" class="p-4 border border-t-0 border-purple-100 rounded-b-lg space-y-4"></div>
</div>
<!-- tkpurchase - 구매 관리 -->
<div class="system-section tkpurchase rounded-lg mb-5 bg-white">
<div class="flex items-center justify-between px-4 py-3 bg-green-50 rounded-t-lg border border-green-100">
<div class="flex items-center gap-2">
<i class="fas fa-truck text-green-500"></i>
<span class="font-semibold text-sm text-green-900">구매 관리</span>
<span class="text-xs text-green-500 bg-green-100 px-2 py-0.5 rounded-full">tkpurchase</span>
</div>
<div class="flex gap-2">
<button onclick="toggleSystemAll('tkpurchase', true)" class="text-xs text-green-600 hover:underline">전체 허용</button>
<span class="text-gray-300">|</span>
<button onclick="toggleSystemAll('tkpurchase', false)" class="text-xs text-green-600 hover:underline">전체 해제</button>
</div>
</div>
<div id="tkpurchase-perms" class="p-4 border border-t-0 border-green-100 rounded-b-lg space-y-4"></div>
</div>
<!-- 저장 버튼 -->
<div class="flex items-center gap-3 pt-2">
<button id="savePermissionsBtn" class="px-6 py-2.5 bg-slate-700 text-white rounded-lg hover:bg-slate-800 text-sm font-medium">
@@ -1382,6 +1418,36 @@
</div>
</div>
<!-- ============ 협력업체 탭 ============ -->
<div id="tab-partners" class="hidden">
<div class="grid lg:grid-cols-5 gap-6">
<!-- 업체 목록 -->
<div class="lg:col-span-2 bg-white rounded-xl shadow-sm p-5">
<h2 class="text-base font-semibold text-gray-800 mb-4"><i class="fas fa-building text-emerald-500 mr-2"></i>협력업체</h2>
<div class="flex gap-2 mb-3">
<input type="text" id="partnerSearchTkuser" class="input-field flex-1 px-3 py-1.5 rounded-lg text-sm" placeholder="업체명/사업자번호 검색">
<select id="partnerFilterActiveTkuser" class="input-field px-2 py-1.5 rounded-lg text-sm">
<option value="true">활성</option>
<option value="">전체</option>
<option value="false">비활성</option>
</select>
</div>
<div id="partnersListTkuser" class="space-y-2 max-h-[65vh] overflow-y-auto">
<p class="text-gray-400 text-center py-4 text-sm">탭을 선택하면 데이터를 불러옵니다.</p>
</div>
</div>
<!-- 업체 상세 -->
<div class="lg:col-span-3">
<div id="partnerDetailTkuser" class="hidden"></div>
<div id="partnerEmptyTkuser" class="text-center text-gray-400 py-16">
<i class="fas fa-building text-4xl mb-3"></i>
<p>업체를 선택하면 상세 정보를 볼 수 있습니다</p>
<p class="text-xs mt-2">협력업체 등록/수정은 <a href="https://tkpurchase.technicalkorea.net/partner.html" target="_blank" class="text-emerald-600 underline">tkpurchase</a>에서 관리합니다.</p>
</div>
</div>
</div>
</div>
<!-- 사진 확대 모달 -->
<div id="photoViewModal" class="fixed inset-0 bg-black bg-opacity-80 hidden z-[60] flex items-center justify-center p-4 cursor-pointer" onclick="this.classList.add('hidden')">
<img id="photoViewImage" class="max-w-full max-h-[90vh] rounded-lg shadow-2xl">
@@ -1400,6 +1466,7 @@
<script src="/static/js/tkuser-tasks.js?v=20260224"></script>
<script src="/static/js/tkuser-vacations.js?v=20260224"></script>
<script src="/static/js/tkuser-layout-map.js?v=20260305"></script>
<script src="/static/js/tkuser-partners.js?v=20260312"></script>
<!-- Boot -->
<script>init();</script>
</body>