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:
Hyungi Ahn
2026-03-13 14:40:20 +09:00
parent 03119a0849
commit 0211889636
9 changed files with 352 additions and 17 deletions

View File

@@ -48,10 +48,36 @@
<p class="text-gray-400 text-center py-8 text-sm">로딩 중...</p>
</div>
<!-- 일정 없을 때 -->
<div id="noScheduleMessage" class="hidden bg-white rounded-xl shadow-sm p-8 text-center">
<i class="fas fa-calendar-times text-gray-300 text-4xl mb-3"></i>
<p class="text-gray-500">오늘 예정된 작업 일정이 없습니다.</p>
<!-- 신청 대기 / 반려 카드 영역 -->
<div id="requestCards" class="hidden space-y-4"></div>
<!-- 작업 신청 폼 -->
<div id="workRequestForm" class="hidden bg-white rounded-xl shadow-sm p-6">
<h3 class="text-base font-semibold text-gray-800 mb-4">
<i class="fas fa-paper-plane text-emerald-500 mr-2"></i>작업 신청
</h3>
<p class="text-sm text-gray-500 mb-4">오늘 예정된 작업 일정이 없습니다. 작업이 필요하시면 아래에서 신청해주세요.</p>
<div class="space-y-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="reqStartDate" 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="reqExpectedWorkers" min="1" value="1" 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">작업 내용 <span class="text-red-400">*</span></label>
<textarea id="reqWorkDescription" 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="reqWorkplaceName" class="input-field w-full px-3 py-2 rounded-lg text-sm" placeholder="작업 장소">
</div>
<button onclick="doWorkRequest()" class="w-full px-4 py-3 bg-emerald-600 text-white rounded-lg text-sm hover:bg-emerald-700 font-medium">
<i class="fas fa-paper-plane mr-1"></i>작업 신청
</button>
</div>
</div>
</div>