feat(project): 연간 목표 상·하반기 칸·반기 접기·이름 바로 수정·월 칸 병합·로아스 %

- 6월·12월 오른쪽에 상반기·하반기 칸 추가. 매출 목표·실적은 반기 합계,
  달성률은 연간과 같은 규칙, 업무 영역 글 칸은 month 13·14 로 저장
- 반기 칸 머리 버튼으로 1~6월 / 7~12월 칸을 접었다 펴기(너비 애니메이션,
  localStorage pj_goal_fold). 표를 width:1px + table-layout:fixed 로 바꿔
  펼칠 때도 애니메이션이 적용되게 함
- 업무 영역·줄 이름을 눌러 그 자리에서 수정(✎ 버튼 제거)
- 월 칸 가로 병합(goal_cell_merges, 반기 안에서만): Shift+클릭 선택 후
  병합 버튼, 우클릭 메뉴로 좌/우 병합·해제. 병합 시 글은 월 순서대로 첫 칸에 모음
- 로아스 목표·실적 칸 % 표기
- 마이그레이션 014 (goal_cells month CHECK 0~14, goal_cell_merges)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 08:24:13 +09:00
parent 91bdc12e78
commit 5d07770ce2
15 changed files with 750 additions and 88 deletions
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260930g" />
<link rel="stylesheet" href="/static/project.css?v=20261001a" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -51,8 +51,9 @@
{% else %}
{% set sm = board.metrics.sales %}
{% set rm = board.metrics.roas %}
{# 월 칸은 pj-goal-m + data-h(1 = 상반기 1~6월, 2 = 하반기 7~12월) — 반기 접기(initGoals)가 이걸로 숨긴다 #}
{% macro num_cell(metric, kind, labels, mo) -%}
<td class="pj-goal-numtd{% if mo == this_month %} is-now{% endif %}">
<td class="pj-goal-numtd pj-goal-m{% if mo == this_month %} is-now{% endif %}" data-h="{{ 1 if mo <= 6 else 2 }}">
{%- if is_admin -%}
<input type="text" class="pj-goal-num" inputmode="decimal" autocomplete="off"
data-metric="{{ metric }}" data-kind="{{ kind }}" data-month="{{ mo }}"
@@ -63,88 +64,114 @@
</td>
{%- endmacro %}
<table class="pj-goal-table" id="pj-goal-table" data-year="{{ goal_year }}"
data-admin="{{ 'true' if is_admin else 'false' }}">
data-admin="{{ 'true' if is_admin else 'false' }}"
data-halves="{{ 'true' if board.halves else 'false' }}">
<thead>
<tr>
{# 오른쪽 끝을 끌어 이름 칸 너비 조절 — 브라우저에 기억(localStorage pj_goal_col_w) #}
<th class="pj-goal-c1"><span class="pj-goal-colresize" data-col="c1" title="끌어서 너비 조절"></span></th>
<th class="pj-goal-c2"><span class="pj-goal-colresize" data-col="c2" title="끌어서 너비 조절"></span></th>
<th class="pj-goal-year-col">연간</th>
{% for mo in months %}<th class="{% if mo == this_month %}is-now{% endif %}">{{ mo }}월</th>{% endfor %}
{% for h, hmonths, hm, hname in halves %}
{% for mo in hmonths %}<th class="pj-goal-m{% if mo == this_month %} is-now{% endif %}" data-h="{{ h }}"><span class="pj-goal-mlabel">{{ mo }}월</span></th>{% endfor %}
{# 반기 칸 — 버튼으로 그 반기의 월 칸을 접었다 편다(localStorage pj_goal_fold) #}
<th class="pj-goal-half-col" data-h="{{ h }}">
<button type="button" class="pj-goal-fold" data-h="{{ h }}" aria-expanded="true"
data-label="{{ hmonths[0] }}~{{ hmonths[-1] }}월"
title="{{ hmonths[0] }}~{{ hmonths[-1] }}월 접기"><span class="material-symbols-outlined">chevron_left</span></button>{{ hname }}
</th>
{% endfor %}
</tr>
</thead>
{# ── 숫자 지표 ── #}
{# ── 숫자 지표 — 연간·반기 칸은 화면에서 계산(매출 합계·달성률), 로아스는 % 단위 ── #}
<tbody class="pj-goal-kpi">
<tr>
<th class="pj-goal-c1" rowspan="3">매출</th>
<th class="pj-goal-c2">목표</th>
<td class="pj-goal-sum" data-metric="sales" data-kind="target"></td>
{% for mo in months %}{{ num_cell("sales", "target", sm.target_label, mo) }}{% endfor %}
<td class="pj-goal-sum pj-goal-year-col" data-metric="sales" data-kind="target" data-scope="0"></td>
{% for h, hmonths, hm, hname in halves %}
{% for mo in hmonths %}{{ num_cell("sales", "target", sm.target_label, mo) }}{% endfor %}
<td class="pj-goal-sum pj-goal-half-col" data-metric="sales" data-kind="target" data-scope="{{ hm }}"></td>
{% endfor %}
</tr>
<tr>
<th class="pj-goal-c2">실적</th>
<td class="pj-goal-sum" data-metric="sales" data-kind="actual"></td>
{% for mo in months %}{{ num_cell("sales", "actual", sm.actual_label, mo) }}{% endfor %}
<td class="pj-goal-sum pj-goal-year-col" data-metric="sales" data-kind="actual" data-scope="0"></td>
{% for h, hmonths, hm, hname in halves %}
{% for mo in hmonths %}{{ num_cell("sales", "actual", sm.actual_label, mo) }}{% endfor %}
<td class="pj-goal-sum pj-goal-half-col" data-metric="sales" data-kind="actual" data-scope="{{ hm }}"></td>
{% endfor %}
</tr>
<tr class="pj-goal-rate-row">
<th class="pj-goal-c2">달성</th>
<td class="pj-goal-rate" data-month="0"></td>
{% for mo in months %}<td class="pj-goal-rate{% if mo == this_month %} is-now{% endif %}" data-month="{{ mo }}"></td>{% endfor %}
<td class="pj-goal-rate pj-goal-year-col" data-month="0"></td>
{% for h, hmonths, hm, hname in halves %}
{% for mo in hmonths %}<td class="pj-goal-rate pj-goal-m{% if mo == this_month %} is-now{% endif %}" data-h="{{ h }}" data-month="{{ mo }}"></td>{% endfor %}
<td class="pj-goal-rate pj-goal-half-col" data-month="{{ hm }}"></td>
{% endfor %}
</tr>
<tr>
<th class="pj-goal-c1" rowspan="2">로아스</th>
<th class="pj-goal-c2">목표</th>
<td class="pj-goal-sum pj-goal-sum-na"></td>
{% for mo in months %}{{ num_cell("roas", "target", rm.target_label, mo) }}{% endfor %}
<td class="pj-goal-sum pj-goal-sum-na pj-goal-year-col"></td>
{% for h, hmonths, hm, hname in halves %}
{% for mo in hmonths %}{{ num_cell("roas", "target", rm.target_label, mo) }}{% endfor %}
<td class="pj-goal-sum pj-goal-sum-na pj-goal-half-col"></td>
{% endfor %}
</tr>
<tr>
<th class="pj-goal-c2">실적</th>
<td class="pj-goal-sum pj-goal-sum-na"></td>
{% for mo in months %}{{ num_cell("roas", "actual", rm.actual_label, mo) }}{% endfor %}
<td class="pj-goal-sum pj-goal-sum-na pj-goal-year-col"></td>
{% for h, hmonths, hm, hname in halves %}
{% for mo in hmonths %}{{ num_cell("roas", "actual", rm.actual_label, mo) }}{% endfor %}
<td class="pj-goal-sum pj-goal-sum-na pj-goal-half-col"></td>
{% endfor %}
</tr>
</tbody>
{# ── 업무 영역 — 영역마다 tbody 하나, 배경은 영역 색 ── #}
{# ── 업무 영역 — 영역마다 tbody 하나, 배경은 영역 색. 이름은 눌러서 그 자리에서 수정(관리자) ── #}
{% for area in board.areas %}
<tbody class="pj-goal-area" data-area-id="{{ area.id }}" style="--goal-bg: {{ area.color or '#fff' }}">
{% for row in area.rows %}
<tr data-row-id="{{ row.id }}">
{% if loop.first %}
<th class="pj-goal-c1 pj-goal-area-name" rowspan="{{ area.rows | length }}">
<span class="pj-goal-area-text">{{ area.name }}</span>
<span class="pj-goal-area-text"{% if is_admin %} data-goal-edit="area" title="눌러서 이름 수정"{% endif %}>{{ area.name }}</span>
{% if is_admin %}
<span class="pj-goal-tools">
<button type="button" class="pj-icon-btn" data-goal-act="area-rename" data-name="{{ area.name }}" title="이름 바꾸기">✎</button>
<button type="button" class="pj-icon-btn" data-goal-act="area-color" data-color="{{ area.color }}" title="색 바꾸기"><span class="material-symbols-outlined">palette</span></button>
<button type="button" class="pj-icon-btn" data-goal-act="area-up" title="위로">↑</button>
<button type="button" class="pj-icon-btn" data-goal-act="area-down" title="아래로">↓</button>
<button type="button" class="pj-icon-btn" data-goal-act="row-add" title="줄 추가">+</button>
<button type="button" class="pj-icon-btn" data-goal-act="area-del" data-name="{{ area.name }}" title="영역 삭제">×</button>
<button type="button" class="pj-icon-btn" data-goal-act="area-del" title="영역 삭제">×</button>
</span>
{% endif %}
</th>
{% endif %}
<th class="pj-goal-c2 pj-goal-row-label">
<span class="pj-goal-row-text">{{ row.label }}</span>
{% if is_admin %}
<span class="pj-goal-row-text"{% if is_admin %} data-goal-edit="row" title="눌러서 줄 이름 수정"{% endif %}>{{ row.label }}</span>
{% if is_admin and area.rows | length > 1 %}
<span class="pj-goal-tools">
<button type="button" class="pj-icon-btn" data-goal-act="row-rename" data-label="{{ row.label }}" title="줄 이름 바꾸기">✎</button>
{% if area.rows | length > 1 %}
<button type="button" class="pj-icon-btn" data-goal-act="row-up" title="위로">↑</button>
<button type="button" class="pj-icon-btn" data-goal-act="row-down" title="아래로">↓</button>
<button type="button" class="pj-icon-btn" data-goal-act="row-del" data-label="{{ row.label }}" title="줄 삭제">×</button>
{% endif %}
<button type="button" class="pj-icon-btn" data-goal-act="row-del" title="줄 삭제">×</button>
</span>
{% endif %}
</th>
{% for mo in [0] + months %}
<td class="pj-goal-texttd{% if mo == 0 %} pj-goal-year-col{% endif %}{% if mo == this_month %} is-now{% endif %}">
{%- if is_admin -%}
<textarea class="pj-goal-text" rows="1" data-row="{{ row.id }}" data-month="{{ mo }}"
placeholder="{{ '연간 목표' if mo == 0 else '' }}">{{ row.cells.get(mo, '') }}</textarea>
{% for c in row.layout %}
{% set editable = is_admin and (c.kind != 'half' or board.halves) %}
{% if c.kind == 'month' %}
<td class="pj-goal-texttd pj-goal-m{% if c.span > 1 %} is-merged{% endif %}{% if c.now %} is-now{% endif %}"
data-h="{{ c.h }}" data-month="{{ c.m }}" data-span="{{ c.span }}"{% if c.span > 1 %} colspan="{{ c.span }}" style="--span: {{ c.span }}"{% endif %}>
{% else %}
<td class="pj-goal-texttd {{ 'pj-goal-year-col' if c.kind == 'year' else 'pj-goal-half-col' }}" data-month="{{ c.m }}">
{% endif %}
{%- if editable -%}
<textarea class="pj-goal-text" rows="1" data-row="{{ row.id }}" data-month="{{ c.m }}"
placeholder="{{ '연간 목표' if c.m == 0 else ('상반기 목표' if c.m == 13 else ('하반기 목표' if c.m == 14 else '')) }}">{{ row.cells.get(c.m, '') }}</textarea>
{%- else -%}
<div class="pj-goal-text-ro">{{ row.cells.get(mo, '') }}</div>
<div class="pj-goal-text-ro">{{ row.cells.get(c.m, '') }}</div>
{%- endif -%}
</td>
{% endfor %}
@@ -156,7 +183,8 @@
{% if is_admin %}
<div class="pj-goal-foot">
<button type="button" class="pj-btn" id="pj-goal-area-add">+ 업무 영역 추가</button>
<span class="pj-goal-note">칸을 고치면 바로 저장됩니다. 숫자 칸을 비우면 지워집니다.</span>
<span class="pj-goal-note">칸을 고치면 바로 저장됩니다. 숫자 칸을 비우면 지워집니다.
{%- if board.halves %} 월 칸은 Shift+클릭으로 여러 칸을 고른 뒤 병합하거나, 우클릭 메뉴로 병합·해제합니다.{% endif %}</span>
</div>
{% endif %}
{% endif %}
@@ -169,5 +197,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260930g" defer></script>
<script src="/static/project.js?v=20261001a" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260930g" />
<link rel="stylesheet" href="/static/project.css?v=20261001a" />
<link rel="stylesheet" href="/static/project-help.css?v=20260926v" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -89,10 +89,15 @@
<li><b>내 작업</b> — 내가 담당자인 작업 모음. 숫자 배지는 아직 끝나지 않은 작업 수입니다. (<a href="#mytasks">15장</a>)</li>
<li><b>휴지통</b> — 지운 작업을 3개월 보관합니다. 관리자에게만 보입니다. (<a href="#trash">19장</a>)</li>
<li><b>목표</b> — 누르면 바로 아래에 연도가 펼쳐집니다. 연도를 누르면 오른쪽에 그해 전체 목표가 한 표로 나옵니다 —
맨 위에 <b>매출</b>(목표·실적·달성률)과 <b>로아스</b>(목표·실적)를 달마다, 그 아래에 <b>업무 영역</b>(상품·마케팅·컨텐츠·유통 등)별로
연간·월별 계획을 적습니다. 매출의 <b>연간</b> 칸은 월 합계, <b>달성</b>은 실적÷목표(100% 이상 초록)로 저절로 계산됩니다.
맨 위에 <b>매출</b>(목표·실적·달성률)과 <b>로아스</b>(목표·실적, 단위 %)를 달마다, 그 아래에 <b>업무 영역</b>(상품·마케팅·컨텐츠·유통 등)별로
연간·반기·월별 계획을 적습니다. 6월 오른쪽에 <b>상반기</b>, 12월 오른쪽에 <b>하반기</b> 칸이 있고, 매출의 <b>연간·반기</b> 칸은 월 합계,
<b>달성</b>은 실적÷목표(100% 이상 초록)로 저절로 계산됩니다. 반기 칸 머리의 <b>‹</b> 버튼을 누르면 그 반기의 월 칸(1~6월 또는 7~12월)이
접히고, 다시 누르면 펼쳐집니다(접힌 상태는 내 브라우저에 기억).
<b>입력은 관리자만</b> 할 수 있고(칸을 고치면 바로 저장), 다른 직원은 보기만 합니다. 관리자는 <b>+ 연도 추가</b>로 새해 목표를
만들고(이전 연도의 업무 영역 구성을 그대로 가져옴), 영역 이름 칸에 마우스를 올려 이름·색·순서·줄 추가·삭제를 합니다.</li>
만들고(이전 연도의 업무 영역 구성을 그대로 가져옴), 영역·줄 이름은 <b>눌러서 그 자리에서 고치고</b>(Enter 저장, Esc 취소),
이름 칸에 마우스를 올려 색·순서·줄 추가·삭제를 합니다. 업무 영역의 월 칸은 <b>병합</b>할 수 있습니다 — 한 칸을 누르고
<b>Shift+클릭</b>으로 같은 줄의 다른 칸까지 고른 뒤 떠 있는 "병합" 버튼을 누르거나, 칸을 <b>우클릭</b>해 "오른쪽/왼쪽 칸과 병합"·"병합 해제".
병합은 상반기·하반기 안에서만 되고, 칸들의 글은 월 순서대로 첫 칸에 모입니다.</li>
<li><b>프로젝트</b> — 내가 멤버인 프로젝트 목록입니다. 누르면 그 프로젝트 화면으로 갑니다. 완료한 프로젝트는 아래 <b>완료 프로젝트</b>에 흐리게 모입니다.</li>
<li><b>전체 멤버</b> — 관리자에게만 보입니다. 사람 아이콘을 누르면 그 사람이 맡은 모든 작업을 한눈에 봅니다.</li>
</ul>
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260930g" />
<link rel="stylesheet" href="/static/project.css?v=20261001a" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -104,5 +104,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260930g" defer></script>
<script src="/static/project.js?v=20261001a" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260930g" />
<link rel="stylesheet" href="/static/project.css?v=20261001a" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -100,5 +100,5 @@
"today": {{ today | tojson }}
}
</script>
<script src="/static/project.js?v=20260930g" defer></script>
<script src="/static/project.js?v=20261001a" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260930g" />
<link rel="stylesheet" href="/static/project.css?v=20261001a" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
@@ -496,5 +496,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20260930g" defer></script>
<script src="/static/project.js?v=20261001a" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260930g" />
<link rel="stylesheet" href="/static/project.css?v=20261001a" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -70,5 +70,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260930g" defer></script>
<script src="/static/project.js?v=20261001a" defer></script>
{% endblock %}