dd648d4752
- POST tasks 의 repeat_daily: true = 만든 뒤 켬(033 미적용 503), 화면은 data-daily-ready(db.daily_ready)일 때만 버튼 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
212 lines
16 KiB
HTML
212 lines
16 KiB
HTML
{% extends "erp_base.html" %}
|
|
|
|
{% block head_extra %}
|
|
<link rel="stylesheet" href="/static/project.css?v=20261111e" />
|
|
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
|
{% endblock %}
|
|
|
|
{% block topbar_after_logout %}{% include "project/_help_btn.html" %}{% endblock %}
|
|
|
|
{% block content %}
|
|
{# 연간 목표 — 좌측 사이드바 "목표" → 연도. 스프레드시트처럼 한 표에
|
|
① 매출(목표·실적·달성)·로아스(목표·실적) 월별 숫자
|
|
② 업무 영역(상품·마케팅·컨텐츠·유통 …)별 연간·월별 글.
|
|
입력·구조 변경은 Pro user 이상(칸별 즉시 저장, project.js initGoals), 나머지는 보기만.
|
|
DB: project_db 013 (goal_years·goal_metrics·goal_areas·goal_rows·goal_cells). #}
|
|
<div class="pj-wrap pj-inbox-view pj-goal-view">
|
|
<div class="pj-layout">
|
|
{% with current_pid = 0, side_active = "goals" %}{% include "project/_side.html" %}{% endwith %}
|
|
|
|
<section class="pj-main">
|
|
<div class="pj-section-head">
|
|
<h2 class="pj-goal-title">{{ goal_year }}년 목표</h2>
|
|
{% if board %}
|
|
<div class="pj-goal-head-acts">
|
|
{% if pj_pro %}
|
|
<label class="pj-goal-unit">매출 단위
|
|
<input type="text" id="pj-goal-unit" maxlength="20" placeholder="예: 백만원"
|
|
value="{{ board.sales_unit }}" data-year="{{ goal_year }}" />
|
|
</label>
|
|
<button type="button" class="pj-btn pj-btn-danger" id="pj-goal-year-del"
|
|
data-year="{{ goal_year }}">연도 삭제</button>
|
|
{% else %}
|
|
{% if board.sales_unit %}<span class="pj-goal-unit-ro">매출 단위: {{ board.sales_unit }}</span>{% endif %}
|
|
<span class="pj-goal-note">목표는 Pro user 이상만 입력할 수 있습니다.</span>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{% if pj_pro and goals_enabled and board %}
|
|
{% include "project/_cell_format.html" %}
|
|
{% endif %}
|
|
<div class="pj-view pj-goal-pane" id="pj-goal-pane">
|
|
{% if not goals_enabled %}
|
|
<div class="pj-empty">연간 목표가 아직 준비되지 않았습니다(DB 마이그레이션 013 필요).</div>
|
|
{% elif not board %}
|
|
<div class="pj-empty pj-goal-empty">
|
|
<p>{{ goal_year }}년 목표가 아직 없습니다.</p>
|
|
{% if pj_pro %}
|
|
<p class="pj-goal-empty-sub">만들면 가장 가까운 이전 연도의 업무 영역 구성을 그대로 가져옵니다(처음이면 상품·마케팅·컨텐츠·유통).</p>
|
|
<button type="button" class="pj-btn pj-btn-primary" id="pj-goal-create" data-year="{{ goal_year }}">{{ goal_year }}년 목표 만들기</button>
|
|
{% endif %}
|
|
</div>
|
|
{% else %}
|
|
{% set sm = board.metrics.sales %}
|
|
{% set rm = board.metrics.roas %}
|
|
{# 월 칸은 pj-goal-m + data-h(분기 1~4) — 분기 접기(initGoals)가 이걸로 숨긴다.
|
|
분기 칸 클래스는 예전 이름 pj-goal-half-col 그대로(연간 칸처럼 굵게·회색 합계) #}
|
|
{# 매출 목표 칸(020) — 누르면 그 달 월 목표(직접 입력)·주차별 목표 입력 창, 맨 아래 차이(월 목표 − 주차 합계) #}
|
|
{% macro num_cell(metric, kind, labels, mo) -%}
|
|
{%- set weekly = week_targets and metric == 'sales' and kind == 'target' -%}
|
|
<td class="pj-goal-numtd pj-goal-m{% if mo == this_month %} is-now{% endif %}{% if weekly %} is-weekly{% endif %}" data-h="{{ (mo - 1) // 3 + 1 }}">
|
|
{%- if pj_pro -%}
|
|
<input type="text" class="pj-goal-num" inputmode="decimal" autocomplete="off"
|
|
data-metric="{{ metric }}" data-kind="{{ kind }}" data-month="{{ mo }}"
|
|
{%- if weekly %} readonly data-weekly="1" title="{{ mo }}월 목표·주차별 목표 입력"{% endif %}
|
|
value="{{ labels.get(mo, '') }}" />
|
|
{%- else -%}
|
|
<span class="pj-goal-num" data-metric="{{ metric }}" data-kind="{{ kind }}" data-month="{{ mo }}"
|
|
{%- if weekly %} data-weekly="1" tabindex="0" title="{{ mo }}월 주차별 목표 보기"{% endif %}>{{ labels.get(mo, '') }}</span>
|
|
{%- endif -%}
|
|
</td>
|
|
{%- endmacro %}
|
|
<table class="pj-goal-table" id="pj-goal-table" data-year="{{ goal_year }}"
|
|
data-pro="{{ 'true' if pj_pro 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>
|
|
{# 연간·월·분기 칸도 머리 칸 오른쪽 끝을 끌어 너비 조절(data-col: y · m1~m12 · q1~q4) #}
|
|
<th class="pj-goal-year-col" data-col="y">연간<span class="pj-goal-colresize" data-col="y" title="끌어서 너비 조절"></span></th>
|
|
{% for h, hmonths, hm, hname in quarters %}
|
|
{# 월 이름을 누르면 그 달 주간 회의록(/goals/{연도}/meetings/{월}) #}
|
|
{% for mo in hmonths %}<th class="pj-goal-m{% if mo == this_month %} is-now{% endif %}" data-h="{{ h }}" data-col="m{{ mo }}"><a class="pj-goal-mlabel pj-goal-mlink" href="/project/goals/{{ goal_year }}/meetings/{{ mo }}" title="{{ mo }}월 주간 회의록">{{ mo }}월</a><span class="pj-goal-colresize" data-col="m{{ mo }}" title="끌어서 너비 조절"></span></th>{% endfor %}
|
|
{# 분기 칸 — 머리 칸 아무 곳이나 누르면 그 분기의 월 칸을 접었다 편다(localStorage pj_goal_fold_q).
|
|
아이콘은 엑셀 열 그룹처럼 네모 안 − (펼침, 누르면 접힘) / + (접힘, 누르면 펼침).
|
|
분기 색(data-h → --qc)은 머리 위 색 띠(월 가늘게·분기 두껍게)와 분기 열 옅은 음영 #}
|
|
<th class="pj-goal-half-col pj-goal-fold-th" data-h="{{ h }}" data-col="q{{ 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] }}월 접기"><svg class="pj-goal-fold-ic" viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><rect x="1.75" y="1.75" width="12.5" height="12.5" rx="3"/><path d="M5 8h6"/><path class="pj-goal-fold-v" d="M8 5v6"/></svg></button>{{ hname }}
|
|
<span class="pj-goal-colresize" data-col="q{{ h }}" title="끌어서 너비 조절"></span>
|
|
</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 pj-goal-year-col" data-metric="sales" data-kind="target" data-scope="0"></td>
|
|
{% for h, hmonths, hm, hname in quarters %}
|
|
{% 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 }}" data-h="{{ h }}"></td>
|
|
{% endfor %}
|
|
</tr>
|
|
<tr>
|
|
<th class="pj-goal-c2">실적</th>
|
|
<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 quarters %}
|
|
{% 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 }}" data-h="{{ h }}"></td>
|
|
{% endfor %}
|
|
</tr>
|
|
<tr class="pj-goal-rate-row">
|
|
<th class="pj-goal-c2">달성</th>
|
|
<td class="pj-goal-rate pj-goal-year-col" data-month="0"></td>
|
|
{% for h, hmonths, hm, hname in quarters %}
|
|
{% 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 }}" data-h="{{ h }}"></td>
|
|
{% endfor %}
|
|
</tr>
|
|
<tr>
|
|
<th class="pj-goal-c1" rowspan="2">로아스</th>
|
|
<th class="pj-goal-c2">목표</th>
|
|
{# 로아스 연간·분기 = 월 매출로 가중한 평균(광고비 = 매출 ÷ 로아스로 환산) — project.js recompute #}
|
|
<td class="pj-goal-sum pj-goal-year-col" data-metric="roas" data-kind="target" data-scope="0"></td>
|
|
{% for h, hmonths, hm, hname in quarters %}
|
|
{% for mo in hmonths %}{{ num_cell("roas", "target", rm.target_label, mo) }}{% endfor %}
|
|
<td class="pj-goal-sum pj-goal-half-col" data-metric="roas" data-kind="target" data-scope="{{ hm }}" data-h="{{ h }}"></td>
|
|
{% endfor %}
|
|
</tr>
|
|
<tr>
|
|
<th class="pj-goal-c2">실적</th>
|
|
<td class="pj-goal-sum pj-goal-year-col" data-metric="roas" data-kind="actual" data-scope="0"></td>
|
|
{% for h, hmonths, hm, hname in quarters %}
|
|
{% for mo in hmonths %}{{ num_cell("roas", "actual", rm.actual_label, mo) }}{% endfor %}
|
|
<td class="pj-goal-sum pj-goal-half-col" data-metric="roas" data-kind="actual" data-scope="{{ hm }}" data-h="{{ h }}"></td>
|
|
{% endfor %}
|
|
</tr>
|
|
</tbody>
|
|
|
|
{# ── 업무 영역 — 영역마다 tbody 하나, 배경은 영역 색. 이름은 눌러서 그 자리에서 수정(Pro user 이상) ── #}
|
|
{% for area in board.areas %}
|
|
<tbody class="pj-goal-area" data-area-id="{{ area.id }}" data-color="{{ area.color }}" 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 }}">
|
|
{# 구역 메뉴(색·위로·아래로·줄 추가·영역 삭제) — 우클릭 또는 ⋮ 버튼(키보드 Tab → Enter/Space, 터치 탭). project.js areaMenuItems #}
|
|
<span class="pj-goal-area-text"{% if pj_pro %} data-goal-edit="area" tabindex="0" role="button" title="눌러서 이름 수정(Enter) · 우클릭·⋮ = 메뉴"{% endif %}>{{ area.name }}</span>
|
|
{% if pj_pro %}<button type="button" class="pj-goal-menu-btn" data-goal-menu="area" aria-haspopup="menu" aria-expanded="false"
|
|
aria-label="{{ area.name }} 구역 메뉴" title="구역 메뉴"><span class="material-symbols-outlined" aria-hidden="true">more_vert</span></button>{% endif %}
|
|
</th>
|
|
{% endif %}
|
|
{# 항목 칸(2열) — 같은 항목 칸으로 묶인 줄(016 label_cont)은 묶음 첫 줄이 rowspan 으로 덮는다 #}
|
|
{% if not row.label_cont %}
|
|
<th class="pj-goal-c2 pj-goal-row-label"{% if (row.label_span or 1) > 1 %} rowspan="{{ row.label_span }}"{% endif %} data-label-span="{{ row.label_span or 1 }}">
|
|
<span class="pj-goal-row-text"{% if pj_pro %} data-goal-edit="row" tabindex="0" role="button" title="눌러서 줄 이름 수정(Enter) · 우클릭·⋮ = 메뉴"{% endif %}>{{ row.label }}</span>
|
|
{% if pj_pro %}<button type="button" class="pj-goal-menu-btn" data-goal-menu="row" aria-haspopup="menu" aria-expanded="false"
|
|
aria-label="{{ (row.label or '이름 없는') }} 줄 메뉴" title="줄 메뉴"><span class="material-symbols-outlined" aria-hidden="true">more_vert</span></button>{% endif %}
|
|
</th>
|
|
{% endif %}
|
|
{# 칸 배치는 router._goal_area_layout — 엑셀식 사각형 병합(colspan·rowspan), 가려진 칸은 없다 #}
|
|
{% for c in row.layout %}
|
|
{% set editable = pj_pro and (c.kind != 'quarter' or (board.halves and (c.m not in (15, 16) or board.quarters))) %}
|
|
{% set merged = c.span > 1 or c.rspan > 1 %}
|
|
<td class="pj-goal-texttd {{ 'pj-goal-m' if c.kind == 'month' else ('pj-goal-year-col' if c.kind == 'year' else 'pj-goal-half-col') }}{% if merged %} is-merged{% endif %}{% if c.now %} is-now{% endif %}"
|
|
{% if c.kind in ('month', 'quarter') %}data-h="{{ c.h }}" {% endif %}data-month="{{ c.m }}" data-span="{{ c.span }}" data-rspan="{{ c.rspan }}"
|
|
{%- if c.span > 1 %} colspan="{{ c.span }}" style="--span: {{ c.span }}"{% endif %}{% if c.rspan > 1 %} rowspan="{{ c.rspan }}"{% endif %}>
|
|
{%- if editable -%}
|
|
<div class="pj-goal-text" contenteditable="true" role="textbox" aria-multiline="true" aria-label="목표 내용"
|
|
data-row="{{ row.id }}" data-month="{{ c.m }}"
|
|
data-placeholder="{{ '연간 목표' if c.m == 0 else ((c.h ~ '분기 목표') if c.kind == 'quarter' else '') }}">{{ c.html|safe }}</div>
|
|
{%- else -%}
|
|
<div class="pj-goal-text-ro">{{ c.html|safe }}</div>
|
|
{%- endif -%}
|
|
</td>
|
|
{% endfor %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
{% endfor %}
|
|
</table>
|
|
{% if pj_pro %}
|
|
<div class="pj-goal-foot">
|
|
<button type="button" class="pj-btn" id="pj-goal-area-add">+ 업무 영역 추가</button>
|
|
<span class="pj-goal-note">칸을 고치면 바로 저장됩니다. 글자를 드래그해 선택하면 선택한 셀 상단에서 12색 견본·크기 2px 증감·굵게·기울임·밑줄·서식 초기화를 사용할 수 있습니다. 모든 행의 셀 오른쪽 경계를 끌어 열 너비를 조절하고, 더블클릭하면 그 열의 가장 긴 문단에 맞춥니다. 숫자 칸을 비우면 지워집니다. 구역·항목 칸을 우클릭하거나 칸의 ⋮ 버튼(키보드 Tab·Enter, 터치)을 누르면 색·순서·줄 추가·삭제 메뉴가 나옵니다.
|
|
셀 우클릭 → 현재 열·전체 열 너비 자동 맞춤(접힌 열 포함).
|
|
{%- if board.halves %} 칸을 마우스로 끌어 여러 칸을 고른 뒤 우클릭 → 셀 병합, 병합된 칸은 우클릭 → 병합 해제(글은 왼쪽 위 칸에 남음).{% endif %}
|
|
월 이름을 누르면 그 달 주간 회의록이 열립니다.</span>
|
|
</div>
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
|
|
{% if goal_area_colors %}<script>window.PJ_GOAL_COLORS = {{ goal_area_colors | tojson }};</script>{% endif %}
|
|
{% if week_targets %}<script>window.PJ_GOAL_WEEKS = {{ week_targets | tojson }}; window.PJ_GOAL_WEEK_SPLIT = {{ (week_split or false) | tojson }}; window.PJ_GOAL_UNIT = {{ (board.sales_unit if board else '') | tojson }};</script>{% endif %}
|
|
{% include "project/_side_modals.html" %}
|
|
{% include "project/_member_tasks_modal.html" %}
|
|
|
|
<script src="/static/project-goal-text.js?v=20261026a" defer></script>
|
|
<script src="/static/project.js?v=20261111c" defer></script>
|
|
{% endblock %}
|