f4b80e8abc
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
139 lines
6.7 KiB
HTML
139 lines
6.7 KiB
HTML
{% extends "erp_base.html" %}
|
|
{% import "vacation/_macros.html" as vm %}
|
|
|
|
{% block head_extra %}<link rel="stylesheet" href="/static/vacation.css?v=20261102c" />
|
|
{#- 달력 = ERP 공용 달력 서식(2026-11-02, erp-datepop mountRange) -#}
|
|
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
|
<link rel="stylesheet" href="/static/erp-datepop.css?v=20261102a" />{% endblock %}
|
|
|
|
{% block content %}
|
|
<section class="vac">
|
|
|
|
{% set action = '/vacation/new' if mode == 'new' else '/vacation/' ~ req.id ~ '/edit' %}
|
|
<form id="vac-form" method="post" action="{{ action }}" class="erp-card vac-form-card">
|
|
|
|
<fieldset class="vac-types">
|
|
<legend>휴가 종류</legend>
|
|
{% for t in vacation_types %}
|
|
<label class="vac-type"><input type="radio" name="vacation_type" value="{{ t }}"
|
|
{% if (req and req.vacation_type == t) or (not req and loop.first) %}checked{% endif %} /><span>{{ t }}</span></label>
|
|
{% endfor %}
|
|
</fieldset>
|
|
|
|
<div class="vac-form-main">
|
|
<div class="vac-range-cal" id="vac-cal"></div>
|
|
|
|
<div class="vac-form-side">
|
|
<input type="hidden" name="start_date" id="vac-start" value="{{ req.start_date if req else '' }}" />
|
|
<input type="hidden" name="end_date" id="vac-end" value="{{ req.end_date if req else '' }}" />
|
|
<div class="vac-form-grid">
|
|
<label class="erp-field"><span>시작일</span>
|
|
<input class="erp-input" type="text" id="vac-start-show" readonly placeholder="달력에서 선택" />
|
|
</label>
|
|
<label class="erp-field" id="vac-end-field"><span>종료일</span>
|
|
<input class="erp-input" type="text" id="vac-end-show" readonly placeholder="달력에서 선택" />
|
|
</label>
|
|
<label class="erp-field" id="vac-start-half-field"><span>시작 구분</span>
|
|
<select class="erp-select" name="start_half" id="vac-start-half">
|
|
{% for h in halves %}
|
|
<option value="{{ h }}" {% if req and req.start_half == h %}selected{% endif %}>{{ half_labels[h] }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</label>
|
|
<label class="erp-field" id="vac-end-half-field"><span>종료 구분</span>
|
|
<select class="erp-select" name="end_half" id="vac-end-half">
|
|
{% for h in halves %}
|
|
<option value="{{ h }}" {% if req and req.end_half == h %}selected{% endif %}>{{ half_labels[h] }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</label>
|
|
</div>
|
|
|
|
<div class="vac-days-preview">
|
|
예상 사용 일수: <strong id="vac-days-out">—</strong>
|
|
<span class="erp-muted">(주말 · 공휴일 제외)</span>
|
|
</div>
|
|
|
|
<label class="erp-field vac-reason"><span>휴가 사유</span>
|
|
<textarea class="erp-input" name="reason" rows="5"
|
|
placeholder="휴가 사유를 입력하세요.">{{ req.reason if req else '' }}</textarea>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
{#- 결재 라인 — 협의자(구성원 전체에서 복수, 사람마다 협의 내용) · 통보자·결재자(옵션 값, 고칠 수 없음) -#}
|
|
<section class="vac-line" aria-label="결재 라인">
|
|
<h3>결재 라인</h3>
|
|
|
|
<div class="vac-line-row">
|
|
<span class="vac-line-label">협의자</span>
|
|
<div class="vac-line-body">
|
|
<button type="button" class="erp-btn erp-btn-outline" id="vac-pick-btn" aria-expanded="false"
|
|
{% if not consult_ready %}disabled{% endif %}>구성원 선택</button>
|
|
<label class="vac-check"><input type="checkbox" name="no_consult" id="vac-no-consult" value="1"
|
|
{% if not consult_ready %}checked disabled{% endif %} /> 협의자 없음</label>
|
|
{% if not consult_ready %}<span class="erp-muted">협의자 기능은 DB 마이그레이션 003 적용 뒤에 쓸 수 있습니다.</span>{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<ul class="vac-pick" id="vac-pick" hidden>
|
|
{% for m in members %}
|
|
<li>
|
|
<label class="vac-opt-person">
|
|
<input type="checkbox" data-email="{{ m.email }}" {% if m.email in consult_chosen %}checked{% endif %} />
|
|
{{ vm.person(m) }}
|
|
</label>
|
|
</li>
|
|
{% else %}
|
|
<li class="erp-muted">고를 수 있는 구성원이 없습니다.</li>
|
|
{% endfor %}
|
|
</ul>
|
|
|
|
<div class="vac-consult-box" id="vac-consult-box" hidden>
|
|
<p class="vac-line-sub">협의자 전달 사항 <span class="erp-muted">— 협의자마다 자기 내용만 메일로 받습니다.</span></p>
|
|
{% for m in members %}
|
|
{% set on = m.email in consult_chosen %}
|
|
<div class="vac-consult-row" data-email="{{ m.email }}" {% if not on %}hidden{% endif %}>
|
|
<input type="hidden" name="consult_email" value="{{ m.email }}" {% if not on %}disabled{% endif %} />
|
|
{{ vm.person(m) }}
|
|
<textarea class="erp-input" name="consult_message" rows="2" placeholder="{{ m.name }}님에게 전달할 내용"
|
|
aria-label="{{ m.name }} 협의 내용" {% if not on %}disabled{% endif %}>{{ consult_chosen.get(m.email, '') }}</textarea>
|
|
<button type="button" class="vac-consult-x" aria-label="{{ m.name }} 빼기">✕</button>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<div class="vac-line-row">
|
|
<span class="vac-line-label">통보자</span>
|
|
<div class="vac-line-body">
|
|
{% for p in line.notifiers %}{{ vm.person(p) }}{% else %}<span class="erp-muted">없음(옵션에서 지정)</span>{% endfor %}
|
|
</div>
|
|
</div>
|
|
<div class="vac-line-row">
|
|
<span class="vac-line-label">결재자</span>
|
|
<div class="vac-line-body">
|
|
{% for p in line.approvers %}{{ vm.person(p) }}{% else %}<span class="erp-muted">ERP 관리자(옵션에서 지정)</span>{% endfor %}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<p class="vac-form-err" id="vac-form-err" role="alert" hidden></p>
|
|
|
|
<div class="erp-page-actions vac-form-actions">
|
|
<button type="submit" class="erp-btn erp-btn-primary" name="action" value="submit">제출</button>
|
|
<button type="submit" class="erp-btn erp-btn-outline" name="action"
|
|
value="{{ 'save' if mode == 'edit' else 'draft' }}">작성중 저장</button>
|
|
{% if mode == 'edit' %}
|
|
<a class="erp-btn erp-btn-outline" href="/vacation/{{ req.id }}">취소</a>
|
|
{% else %}
|
|
<a class="erp-btn erp-btn-outline" href="/vacation/">취소</a>
|
|
{% endif %}
|
|
</div>
|
|
</form>
|
|
</section>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}<script type="application/json" id="vac-holidays">{{ holidays | tojson }}</script>
|
|
<script src="/static/erp-datepop.js?v=20261102a" defer></script>
|
|
<script src="/static/vacation.js?v=20261102a" defer></script>{% endblock %}
|