feat: 구매/안전 시스템 전면 개편 — tkpurchase 개편 + tksafety 신규 + 권한 보강
Phase 1: tkuser 협력업체 CRUD 이관 (읽기전용 → 전체 CRUD) Phase 2: tkpurchase 개편 — 일용공 신청/확정, 작업일정, 업무현황, 계정관리, 협력업체 포털 Phase 3: tksafety 신규 시스템 — 방문관리 + 안전교육 신고 Phase 4: SSO 인증 보강 (partner_company_id JWT, 만료일 체크), 권한 테이블 기반 접근 제어 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -210,6 +210,18 @@
|
||||
</div>
|
||||
<div id="dept-tkpurchase-perms" class="p-4 border border-t-0 border-green-100 rounded-b-lg space-y-4"></div>
|
||||
</div>
|
||||
<!-- tksafety -->
|
||||
<div>
|
||||
<div class="flex items-center justify-between bg-orange-50 px-4 py-2 rounded-t-lg border border-orange-100">
|
||||
<h4 class="font-semibold text-orange-800"><i class="fas fa-hard-hat mr-2"></i>안전 관리 (tksafety)</h4>
|
||||
<div class="flex gap-2">
|
||||
<button onclick="toggleDeptSystemAll('tksafety', true)" class="text-xs text-orange-600 hover:underline">전체 허용</button>
|
||||
<span class="text-gray-300">|</span>
|
||||
<button onclick="toggleDeptSystemAll('tksafety', false)" class="text-xs text-orange-600 hover:underline">전체 해제</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dept-tksafety-perms" class="p-4 border border-t-0 border-orange-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">
|
||||
@@ -285,6 +297,18 @@
|
||||
</div>
|
||||
<div id="tkpurchase-perms" class="p-4 border border-t-0 border-green-100 rounded-b-lg space-y-4"></div>
|
||||
</div>
|
||||
<!-- tksafety -->
|
||||
<div>
|
||||
<div class="flex items-center justify-between bg-orange-50 px-4 py-2 rounded-t-lg border border-orange-100">
|
||||
<h4 class="font-semibold text-orange-800"><i class="fas fa-hard-hat mr-2"></i>안전 관리 (tksafety)</h4>
|
||||
<div class="flex gap-2">
|
||||
<button onclick="toggleSystemAll('tksafety', true)" class="text-xs text-orange-600 hover:underline">전체 허용</button>
|
||||
<span class="text-gray-300">|</span>
|
||||
<button onclick="toggleSystemAll('tksafety', false)" class="text-xs text-orange-600 hover:underline">전체 해제</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tksafety-perms" class="p-4 border border-t-0 border-orange-100 rounded-b-lg space-y-4"></div>
|
||||
</div>
|
||||
|
||||
<!-- 저장 버튼 -->
|
||||
<div class="flex items-center gap-3 pt-2">
|
||||
@@ -1423,7 +1447,12 @@
|
||||
<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 items-center justify-between mb-4">
|
||||
<h2 class="text-base font-semibold text-gray-800"><i class="fas fa-building text-emerald-500 mr-2"></i>협력업체</h2>
|
||||
<button id="btnAddPartnerTkuser" onclick="openAddPartnerTkuser()" class="hidden px-3 py-1.5 bg-slate-700 text-white rounded-lg text-xs hover:bg-slate-800">
|
||||
<i class="fas fa-plus mr-1"></i>업체 등록
|
||||
</button>
|
||||
</div>
|
||||
<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">
|
||||
@@ -1442,12 +1471,216 @@
|
||||
<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="addPartnerModalTkuser" class="hidden fixed inset-0 bg-black bg-opacity-40 z-50 flex items-center justify-center p-4" onclick="if(event.target===this)closeAddPartnerTkuser()">
|
||||
<div class="bg-white rounded-xl shadow-xl max-w-lg w-full p-6">
|
||||
<div class="flex justify-between items-center mb-4">
|
||||
<h3 class="text-lg font-semibold">협력업체 등록</h3>
|
||||
<button onclick="closeAddPartnerTkuser()" class="text-gray-400 hover:text-gray-600"><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
<form id="addPartnerFormTkuser">
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<div class="col-span-2">
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">업체명 <span class="text-red-400">*</span></label>
|
||||
<input type="text" id="newPartnerCompanyNameTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm" required>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">사업자번호</label>
|
||||
<input type="text" id="newPartnerBusinessNumberTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm" placeholder="000-00-00000">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">대표자</label>
|
||||
<input type="text" id="newPartnerRepresentativeTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">담당자명</label>
|
||||
<input type="text" id="newPartnerContactNameTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">담당자 연락처</label>
|
||||
<input type="text" id="newPartnerContactPhoneTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div class="col-span-2">
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">주소</label>
|
||||
<input type="text" id="newPartnerAddressTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">업종 (콤마 구분)</label>
|
||||
<input type="text" id="newPartnerBusinessTypeTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm" placeholder="배관, 용접">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">산재보험 관리번호</label>
|
||||
<input type="text" id="newPartnerInsuranceNumberTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">산재보험 만료일</label>
|
||||
<input type="date" id="newPartnerInsuranceExpiryTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">비고</label>
|
||||
<input type="text" id="newPartnerNotesTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end mt-4 gap-2">
|
||||
<button type="button" onclick="closeAddPartnerTkuser()" class="px-4 py-2 border rounded-lg text-sm hover:bg-gray-50">취소</button>
|
||||
<button type="submit" class="px-4 py-2 bg-slate-700 text-white rounded-lg text-sm hover:bg-slate-800">등록</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 협력업체 수정 모달 -->
|
||||
<div id="editPartnerModalTkuser" class="hidden fixed inset-0 bg-black bg-opacity-40 z-50 flex items-center justify-center p-4" onclick="if(event.target===this)closeEditPartnerTkuser()">
|
||||
<div class="bg-white rounded-xl shadow-xl max-w-lg w-full p-6">
|
||||
<div class="flex justify-between items-center mb-4">
|
||||
<h3 class="text-lg font-semibold">협력업체 수정</h3>
|
||||
<button onclick="closeEditPartnerTkuser()" class="text-gray-400 hover:text-gray-600"><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
<form id="editPartnerFormTkuser">
|
||||
<input type="hidden" id="editPartnerIdTkuser">
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<div class="col-span-2">
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">업체명 <span class="text-red-400">*</span></label>
|
||||
<input type="text" id="editPartnerCompanyNameTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm" required>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">사업자번호</label>
|
||||
<input type="text" id="editPartnerBusinessNumberTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">대표자</label>
|
||||
<input type="text" id="editPartnerRepresentativeTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">담당자명</label>
|
||||
<input type="text" id="editPartnerContactNameTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">담당자 연락처</label>
|
||||
<input type="text" id="editPartnerContactPhoneTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div class="col-span-2">
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">주소</label>
|
||||
<input type="text" id="editPartnerAddressTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">업종 (콤마 구분)</label>
|
||||
<input type="text" id="editPartnerBusinessTypeTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">산재보험 관리번호</label>
|
||||
<input type="text" id="editPartnerInsuranceNumberTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">산재보험 만료일</label>
|
||||
<input type="date" id="editPartnerInsuranceExpiryTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">비고</label>
|
||||
<input type="text" id="editPartnerNotesTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end mt-4 gap-2">
|
||||
<button type="button" onclick="closeEditPartnerTkuser()" class="px-4 py-2 border rounded-lg text-sm hover:bg-gray-50">취소</button>
|
||||
<button type="submit" class="px-4 py-2 bg-slate-700 text-white rounded-lg text-sm hover:bg-slate-800">저장</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 작업자 등록 모달 -->
|
||||
<div id="addWorkerModalTkuser" class="hidden fixed inset-0 bg-black bg-opacity-40 z-50 flex items-center justify-center p-4" onclick="if(event.target===this)closeAddWorkerTkuser()">
|
||||
<div class="bg-white rounded-xl shadow-xl max-w-md w-full p-6">
|
||||
<div class="flex justify-between items-center mb-4">
|
||||
<h3 class="text-lg font-semibold">작업자 등록</h3>
|
||||
<button onclick="closeAddWorkerTkuser()" class="text-gray-400 hover:text-gray-600"><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
<form id="addWorkerFormTkuser">
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">성명 <span class="text-red-400">*</span></label>
|
||||
<input type="text" id="newWorkerNameTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm" required>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">직위</label>
|
||||
<input type="text" id="newWorkerPositionTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div class="flex items-end pb-1">
|
||||
<label class="flex items-center gap-2 cursor-pointer">
|
||||
<input type="checkbox" id="newWorkerIsLeaderTkuser" class="h-4 w-4 text-slate-600 rounded">
|
||||
<span class="text-sm">팀장급</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">연락처</label>
|
||||
<input type="text" id="newWorkerPhoneTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm" placeholder="팀장급 필수">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">안전교육 이수일</label>
|
||||
<input type="date" id="newWorkerSafetyDateTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">비고</label>
|
||||
<input type="text" id="newWorkerNotesTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end mt-4 gap-2">
|
||||
<button type="button" onclick="closeAddWorkerTkuser()" class="px-4 py-2 border rounded-lg text-sm hover:bg-gray-50">취소</button>
|
||||
<button type="submit" class="px-4 py-2 bg-slate-700 text-white rounded-lg text-sm hover:bg-slate-800">등록</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 작업자 수정 모달 -->
|
||||
<div id="editWorkerModalTkuser" class="hidden fixed inset-0 bg-black bg-opacity-40 z-50 flex items-center justify-center p-4" onclick="if(event.target===this)closeEditWorkerTkuser()">
|
||||
<div class="bg-white rounded-xl shadow-xl max-w-md w-full p-6">
|
||||
<div class="flex justify-between items-center mb-4">
|
||||
<h3 class="text-lg font-semibold">작업자 수정</h3>
|
||||
<button onclick="closeEditWorkerTkuser()" class="text-gray-400 hover:text-gray-600"><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
<form id="editWorkerFormTkuser">
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">성명</label>
|
||||
<input type="text" id="editWorkerNameTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm" required>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">직위</label>
|
||||
<input type="text" id="editWorkerPositionTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div class="flex items-end pb-1">
|
||||
<label class="flex items-center gap-2 cursor-pointer">
|
||||
<input type="checkbox" id="editWorkerIsLeaderTkuser" class="h-4 w-4 text-slate-600 rounded">
|
||||
<span class="text-sm">팀장급</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">연락처</label>
|
||||
<input type="text" id="editWorkerPhoneTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">안전교육 이수일</label>
|
||||
<input type="date" id="editWorkerSafetyDateTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">비고</label>
|
||||
<input type="text" id="editWorkerNotesTkuser" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end mt-4 gap-2">
|
||||
<button type="button" onclick="closeEditWorkerTkuser()" class="px-4 py-2 border rounded-lg text-sm hover:bg-gray-50">취소</button>
|
||||
<button type="submit" class="px-4 py-2 bg-slate-700 text-white rounded-lg text-sm hover:bg-slate-800">저장</button>
|
||||
</div>
|
||||
</form>
|
||||
</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">
|
||||
|
||||
Reference in New Issue
Block a user