Files
tk-factory-services/tkpurchase/web/schedule.html
Hyungi Ahn 46a1f8310d fix(cache): tkds→tkfb 변경 후 전 서비스 캐시 버스팅 갱신
tkfb-core.js v=2026040104, tksupport/tksafety/tkpurchase/tkuser-core.js,
system2 api-base.js, system3 app.js 캐시 버스팅 일괄 갱신.
브라우저 캐시에 남은 구버전(tkds 리다이렉트) 강제 갱신.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 15:31:14 +09:00

283 lines
17 KiB
HTML

<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>작업일정 - TK 구매관리</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="stylesheet" href="/static/css/tkpurchase.css?v=2026031602">
</head>
<body>
<!-- Header -->
<header class="bg-emerald-700 text-white sticky top-0 z-50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between items-center h-14">
<div class="flex items-center gap-3">
<button id="mobileMenuBtn" onclick="toggleMobileMenu()" class="lg:hidden text-emerald-200 hover:text-white">
<i class="fas fa-bars text-xl"></i>
</button>
<i class="fas fa-truck text-xl text-emerald-200"></i>
<h1 class="text-lg font-semibold">TK 구매관리</h1>
</div>
<div class="flex items-center gap-4">
<div id="headerUserName" class="text-sm font-medium hidden sm:block">-</div>
<div id="headerUserAvatar" class="w-8 h-8 bg-emerald-600 rounded-full flex items-center justify-center text-sm font-semibold">-</div>
<button onclick="doLogout()" class="text-emerald-200 hover:text-white" title="로그아웃"><i class="fas fa-sign-out-alt"></i></button>
</div>
</div>
</div>
</header>
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4 fade-in">
<div class="flex gap-6">
<!-- Sidebar Nav -->
<nav id="sideNav" class="hidden lg:flex flex-col gap-1 w-48 flex-shrink-0 pt-2"></nav>
<!-- Main -->
<div class="flex-1 min-w-0">
<!-- 필터 및 추가 버튼 -->
<div class="bg-white rounded-xl shadow-sm p-4 mb-5">
<div class="flex flex-wrap items-end gap-3 filter-bar">
<div>
<label class="block text-xs font-medium text-gray-600 mb-1">업체 검색</label>
<input type="text" id="filterCompany" class="input-field 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="filterDateFrom" class="input-field 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="filterDateTo" class="input-field px-3 py-2 rounded-lg text-sm">
</div>
<div>
<label class="block text-xs font-medium text-gray-600 mb-1">상태</label>
<select id="filterStatus" class="input-field px-3 py-2 rounded-lg text-sm">
<option value="">전체</option>
<option value="requested">신청</option>
<option value="scheduled">예정</option>
<option value="in_progress">진행중</option>
<option value="completed">완료</option>
<option value="cancelled">취소</option>
<option value="rejected">반려</option>
</select>
</div>
<div class="filter-actions">
<button onclick="loadSchedules()" class="px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm hover:bg-gray-200">
<i class="fas fa-search mr-1"></i>조회
</button>
<button onclick="openAddSchedule()" class="px-4 py-2 bg-emerald-600 text-white rounded-lg text-sm hover:bg-emerald-700 font-medium">
<i class="fas fa-plus mr-1"></i>일정 등록
</button>
</div>
</div>
</div>
<!-- 테이블 -->
<div class="bg-white rounded-xl shadow-sm p-5">
<h2 class="text-base font-semibold text-gray-800 mb-4">
<i class="fas fa-calendar-alt text-blue-500 mr-2"></i>작업일정 목록
</h2>
<div class="overflow-x-auto">
<table class="visit-table">
<thead>
<tr>
<th>업체</th>
<th>기간</th>
<th>프로젝트</th>
<th>작업내용</th>
<th class="hide-mobile">작업장</th>
<th class="text-center">예상인원</th>
<th>상태</th>
<th class="text-right">관리</th>
</tr>
</thead>
<tbody id="scheduleTableBody">
<tr><td colspan="8" class="text-center text-gray-400 py-8">로딩 중...</td></tr>
</tbody>
</table>
</div>
<div id="schedulePagination" class="flex justify-center items-center gap-2 mt-4"></div>
</div>
</div>
</div>
</div>
<!-- 등록 모달 -->
<div id="addScheduleModal" class="hidden modal-overlay" onclick="if(event.target===this)closeAddSchedule()">
<div class="modal-content p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-semibold">일정 등록</h3>
<button onclick="closeAddSchedule()" class="text-gray-400 hover:text-gray-600"><i class="fas fa-times"></i></button>
</div>
<form id="addScheduleForm" onsubmit="submitAddSchedule(event)">
<div class="space-y-3">
<div class="relative">
<label class="block text-xs font-medium text-gray-600 mb-1">업체 <span class="text-red-400">*</span></label>
<input type="text" id="addCompanySearch" class="input-field w-full px-3 py-2 rounded-lg text-sm" placeholder="업체명 검색..." autocomplete="off">
<input type="hidden" id="addCompanyId">
<div id="addCompanyDropdown" class="hidden absolute z-10 w-full mt-1 bg-white border rounded-lg shadow-lg max-h-48 overflow-y-auto"></div>
</div>
<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="date" id="addStartDate" 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">종료일 <span class="text-red-400">*</span></label>
<input type="date" id="addEndDate" class="input-field w-full px-3 py-2 rounded-lg text-sm" required>
</div>
</div>
<div>
<label class="block text-xs font-medium text-gray-600 mb-1">프로젝트</label>
<select id="addProject" class="input-field w-full px-3 py-2 rounded-lg text-sm">
<option value="">선택 안함</option>
</select>
</div>
<div>
<label class="block text-xs font-medium text-gray-600 mb-1">작업내용</label>
<textarea id="addWorkDescription" rows="3" class="input-field w-full px-3 py-2 rounded-lg text-sm" placeholder="작업 내용"></textarea>
</div>
<div>
<label class="block text-xs font-medium text-gray-600 mb-1">작업장</label>
<input type="text" id="addWorkplaceName" 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="number" id="addExpectedWorkers" min="0" value="0" 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>
<textarea id="addNotes" rows="2" class="input-field w-full px-3 py-2 rounded-lg text-sm" placeholder="추가 사항"></textarea>
</div>
</div>
<div class="flex justify-end mt-4 gap-2">
<button type="button" onclick="closeAddSchedule()" class="px-4 py-2 border rounded-lg text-sm hover:bg-gray-50">취소</button>
<button type="submit" class="px-4 py-2 bg-emerald-600 text-white rounded-lg text-sm hover:bg-emerald-700">등록</button>
</div>
</form>
</div>
</div>
<!-- 수정 모달 -->
<div id="editScheduleModal" class="hidden modal-overlay" onclick="if(event.target===this)closeEditSchedule()">
<div class="modal-content p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-semibold">일정 수정</h3>
<button onclick="closeEditSchedule()" class="text-gray-400 hover:text-gray-600"><i class="fas fa-times"></i></button>
</div>
<form id="editScheduleForm" onsubmit="submitEditSchedule(event)">
<input type="hidden" id="editScheduleId">
<div class="space-y-3">
<div class="relative">
<label class="block text-xs font-medium text-gray-600 mb-1">업체 <span class="text-red-400">*</span></label>
<input type="text" id="editCompanySearch" class="input-field w-full px-3 py-2 rounded-lg text-sm" placeholder="업체명 검색..." autocomplete="off">
<input type="hidden" id="editCompanyId">
<div id="editCompanyDropdown" class="hidden absolute z-10 w-full mt-1 bg-white border rounded-lg shadow-lg max-h-48 overflow-y-auto"></div>
</div>
<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="date" id="editStartDate" 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">종료일 <span class="text-red-400">*</span></label>
<input type="date" id="editEndDate" class="input-field w-full px-3 py-2 rounded-lg text-sm" required>
</div>
</div>
<div>
<label class="block text-xs font-medium text-gray-600 mb-1">프로젝트</label>
<select id="editProject" class="input-field w-full px-3 py-2 rounded-lg text-sm">
<option value="">선택 안함</option>
</select>
</div>
<div>
<label class="block text-xs font-medium text-gray-600 mb-1">작업내용</label>
<textarea id="editWorkDescription" rows="3" class="input-field w-full px-3 py-2 rounded-lg text-sm"></textarea>
</div>
<div>
<label class="block text-xs font-medium text-gray-600 mb-1">작업장</label>
<input type="text" id="editWorkplaceName" 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="number" id="editExpectedWorkers" min="0" 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>
<textarea id="editNotes" rows="2" class="input-field w-full px-3 py-2 rounded-lg text-sm"></textarea>
</div>
</div>
<div class="flex justify-end mt-4 gap-2">
<button type="button" onclick="closeEditSchedule()" class="px-4 py-2 border rounded-lg text-sm hover:bg-gray-50">취소</button>
<button type="submit" class="px-4 py-2 bg-emerald-600 text-white rounded-lg text-sm hover:bg-emerald-700">저장</button>
</div>
</form>
</div>
</div>
<!-- 체크인 상세 모달 -->
<div id="checkinModal" class="hidden modal-overlay" onclick="if(event.target===this)closeCheckinModal()">
<div class="modal-content p-6" style="max-width:600px">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-semibold">체크인 현황</h3>
<button onclick="closeCheckinModal()" class="text-gray-400 hover:text-gray-600"><i class="fas fa-times"></i></button>
</div>
<div id="checkinModalBody" class="space-y-3">
<p class="text-gray-400 text-center py-4">로딩 중...</p>
</div>
</div>
</div>
<!-- 승인 모달 -->
<div id="approveModal" class="hidden modal-overlay" onclick="if(event.target===this)closeApproveModal()">
<div class="modal-content p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-semibold">작업 신청 승인</h3>
<button onclick="closeApproveModal()" class="text-gray-400 hover:text-gray-600"><i class="fas fa-times"></i></button>
</div>
<input type="hidden" id="approveScheduleId">
<div class="space-y-3">
<div class="bg-amber-50 rounded-lg p-4 text-sm">
<div class="font-medium text-amber-800 mb-2"><i class="fas fa-info-circle mr-1"></i>신청 정보</div>
<div id="approveInfo" class="space-y-1 text-gray-700"></div>
</div>
<div>
<label class="block text-xs font-medium text-gray-600 mb-1">프로젝트 배정</label>
<select id="approveProject" class="input-field w-full px-3 py-2 rounded-lg text-sm">
<option value="">선택 안함</option>
</select>
</div>
<div>
<label class="block text-xs font-medium text-gray-600 mb-1">작업장 보정</label>
<input type="text" id="approveWorkplace" class="input-field w-full px-3 py-2 rounded-lg text-sm">
</div>
<div class="grid grid-cols-2 gap-3">
<div>
<label class="block text-xs font-medium text-gray-600 mb-1">작업일</label>
<input type="date" id="approveStartDate" 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="approveEndDate" class="input-field w-full px-3 py-2 rounded-lg text-sm">
</div>
</div>
</div>
<div class="flex justify-end mt-4 gap-2">
<button onclick="doReject()" class="px-4 py-2 bg-red-500 text-white rounded-lg text-sm hover:bg-red-600">
<i class="fas fa-times mr-1"></i>반려
</button>
<button onclick="doApprove()" class="px-4 py-2 bg-emerald-600 text-white rounded-lg text-sm hover:bg-emerald-700">
<i class="fas fa-check mr-1"></i>승인
</button>
</div>
</div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026040101"></script>
<script src="/static/js/tkpurchase-schedule.js?v=2026031602"></script>
<script>initSchedulePage();</script>
</body>
</html>