feat(tkpurchase): 협력업체 작업 신청 기능 추가
협력업체 포탈에서 오늘 일정이 없을 때 직접 작업을 신청할 수 있는 기능. 구매팀이 승인하면 일정이 생성되고, 반려 시 재신청 가능. - DB: status ENUM에 requested/rejected 추가, requested_by 컬럼 추가 - API: POST /schedules/request, PUT /:id/approve, PUT /:id/reject - 포탈: 신청 폼 + 승인 대기/반려 상태 카드 - 관리자: 신청 배지 + 승인 모달 (프로젝트 배정, 작업장 보정) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -52,10 +52,12 @@
|
||||
<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>
|
||||
<button onclick="loadSchedules()" class="px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm hover:bg-gray-200">
|
||||
@@ -224,6 +226,51 @@
|
||||
</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=20260313"></script>
|
||||
<script src="/static/js/tkpurchase-schedule.js?v=20260313"></script>
|
||||
<script>initSchedulePage();</script>
|
||||
|
||||
Reference in New Issue
Block a user