feat(project): 연간 목표 엑셀식 칸 병합(끌어 고르기·우클릭 병합/해제) + 월별 주간 회의록
엑셀식 칸 병합 (예전 Shift+클릭·병합 버튼·오른쪽/왼쪽 칸 병합 메뉴 대체)
- 글 칸을 마우스로 끌어(또는 Shift+클릭) 사각형 선택 → 우클릭 "셀 병합 (N줄 × M칸)" / "병합 해제"
- 같은 업무 영역 안 세로(row_span) + 같은 반기 월 칸 가로, 연간·상·하반기 칸은 세로로만
- 걸친 병합은 엑셀처럼 범위를 넓혀 흡수, 글은 왼쪽 위부터 이어 왼쪽 위 칸에, 해제하면 왼쪽 위 칸에 남음
- POST /api/goals/areas/{id}/merge {row_from,row_to,col_from,col_to} (db.merge_goal_rect), router._goal_area_layout(colspan·rowspan)
- 가려진 칸 저장 거절(세로 포함), 병합 안쪽 줄 끼우기 +1 / 가려진 줄 지우기 -1, 세로 병합에 걸린 줄 이동 거절
주간 회의록 (/project/goals/{연도}/meetings/{월}, 목표 표 월 머리 클릭)
- 주(월~일) 탭, 주마다 회의록: 이번주 할 일·목표 금액 | 지난주 할 일·목표·결과·달성률·평가
- 앞선 회의록 줄 이어받기(carry_from), 처음이면 목표 표 업무 영역 + 기본 양식 줄(유통 줄 쇼핑몰 연결 추측)
- 머리: 월 목표·지난주까지 누적·주당 필요 매출(페이싱)·전주 목표/결과/달성률·금주 목표/현재 실적
- 쇼핑몰 연결 줄의 결과·누적·주간 매출은 실적 모듈 performance_store 읽기 전용(없으면 직접 입력)
- 금액 입력 120만·1.5억·3천만·1억2천만, 참석자·결정 사항 메모, 줄 메뉴(추가·순서·쇼핑몰 연결·삭제), 인쇄
마이그레이션 015(project_db): goal_cell_merges.row_span + CHECK 교체, goal_meetings, goal_meeting_items
캐시 버전 20261001c, 테스트(DB 회귀 test_goal_rect_merges·test_goal_meetings)·문서 갱신
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+453
-49
@@ -13,6 +13,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import re
|
||||
import time
|
||||
from datetime import date, datetime
|
||||
from datetime import time as dtime
|
||||
@@ -1919,8 +1920,9 @@ class ProjectStore:
|
||||
|
||||
metrics = {"sales": {"target": {1: 12.0, ...}, "actual": {...}}, "roas": {...}}
|
||||
areas = [{id, name, color, rows: [{id, label, cells: {0: "연간 글", 1: "1월 글", 13: "상반기 글", ...},
|
||||
merges: {시작월: 칸 수}}]}]
|
||||
merges: {시작 칸: (가로 칸 수, 세로 줄 수)}}]}]
|
||||
halves = 마이그레이션 014 적용 여부(상·하반기 글 칸·병합)
|
||||
rect = 마이그레이션 015 적용 여부(세로 병합·연간/반기 칸 병합·주간 회의록)
|
||||
"""
|
||||
with self._pool.connection() as conn:
|
||||
head = conn.execute(
|
||||
@@ -1948,8 +1950,9 @@ class ProjectStore:
|
||||
(year,),
|
||||
).fetchall()
|
||||
halves = self._table_exists(conn, "goal_cell_merges")
|
||||
rect = halves and self._column_exists(conn, "goal_cell_merges", "row_span")
|
||||
merge_rows = conn.execute(
|
||||
"SELECT m.row_id, m.start_month, m.span FROM goal_cell_merges m "
|
||||
"SELECT m.row_id, m.start_month, m.span" + (", m.row_span" if rect else "") + " FROM goal_cell_merges m "
|
||||
"JOIN goal_rows r ON r.id = m.row_id JOIN goal_areas a ON a.id = r.area_id "
|
||||
"WHERE a.year = %s",
|
||||
(year,),
|
||||
@@ -1962,9 +1965,10 @@ class ProjectStore:
|
||||
cells: dict[int, dict[int, str]] = {}
|
||||
for c in cell_rows:
|
||||
cells.setdefault(int(c["row_id"]), {})[int(c["month"])] = c["body"]
|
||||
merges: dict[int, dict[int, int]] = {}
|
||||
merges: dict[int, dict[int, tuple[int, int]]] = {}
|
||||
for g in merge_rows:
|
||||
merges.setdefault(int(g["row_id"]), {})[int(g["start_month"])] = int(g["span"])
|
||||
merges.setdefault(int(g["row_id"]), {})[int(g["start_month"])] = (
|
||||
int(g["span"]), int(g.get("row_span") or 1))
|
||||
rows_by_area: dict[int, list[dict[str, Any]]] = {}
|
||||
for r in row_rows:
|
||||
rid = int(r["id"])
|
||||
@@ -1978,7 +1982,7 @@ class ProjectStore:
|
||||
for a in area_rows
|
||||
]
|
||||
return {"year": int(head["year"]), "sales_unit": head["sales_unit"],
|
||||
"metrics": metrics, "areas": areas, "halves": halves}
|
||||
"metrics": metrics, "areas": areas, "halves": halves, "rect": rect}
|
||||
|
||||
def set_goal_metric(
|
||||
self, *, year: int, metric: str, kind: str, month: int, value: float | None, updated_by: str = ""
|
||||
@@ -2069,6 +2073,17 @@ class ProjectStore:
|
||||
self._move_goal_item("goal_areas", "year", area_id, direction)
|
||||
|
||||
def move_goal_row(self, *, row_id: int, direction: int) -> None:
|
||||
"""줄 순서 바꾸기 — 세로로 병합된 칸에 걸린 줄(자신 또는 바꿀 이웃)은 옮기지 않는다(엑셀처럼 병합을 먼저 해제)."""
|
||||
with self._pool.connection() as conn:
|
||||
me = conn.execute("SELECT area_id FROM goal_rows WHERE id = %s", (row_id,)).fetchone()
|
||||
if me is None:
|
||||
raise KeyError(row_id)
|
||||
ids, merges, _ = self._area_geometry(conn, int(me["area_id"]))
|
||||
i = ids.index(row_id)
|
||||
j = i + (1 if direction > 0 else -1)
|
||||
if 0 <= j < len(ids) and any(g["r1"] > g["r0"] and (g["r0"] <= i <= g["r1"] or g["r0"] <= j <= g["r1"])
|
||||
for g in merges):
|
||||
raise ValueError("세로로 병합된 칸에 걸린 줄은 옮길 수 없습니다. 병합을 해제한 뒤 옮기세요.")
|
||||
self._move_goal_item("goal_rows", "area_id", row_id, direction)
|
||||
|
||||
def add_goal_row(
|
||||
@@ -2102,6 +2117,17 @@ class ProjectStore:
|
||||
(area_id, lb),
|
||||
).fetchone()["id"])
|
||||
i = ids.index(ref_row_id) + (1 if place == "below" else 0)
|
||||
# 세로 병합 안쪽(시작 줄 아래 ~ 마지막 줄)에 끼우면 엑셀처럼 그 병합이 한 줄 늘어난다
|
||||
if self._table_exists(conn, "goal_cell_merges") and self._column_exists(
|
||||
conn, "goal_cell_merges", "row_span"):
|
||||
_, merges, _ = self._area_geometry(conn, area_id)
|
||||
for g in merges:
|
||||
if g["r0"] < i <= g["r1"]:
|
||||
conn.execute(
|
||||
"UPDATE goal_cell_merges SET row_span = row_span + 1 "
|
||||
"WHERE row_id = %s AND start_month = %s",
|
||||
(g["row_id"], g["start"]),
|
||||
)
|
||||
ids.insert(i, rid)
|
||||
for n, x in enumerate(ids):
|
||||
conn.execute("UPDATE goal_rows SET sort_order = %s WHERE id = %s", (n, x))
|
||||
@@ -2128,6 +2154,24 @@ class ProjectStore:
|
||||
).fetchone()["n"]
|
||||
if n <= 1:
|
||||
raise ValueError("업무 영역의 마지막 줄은 지울 수 없습니다. 영역을 삭제하세요.")
|
||||
# 세로 병합에 가려진 줄이면 그 병합이 한 줄 준다(시작 줄을 지우면 병합도 같이 지워진다 — CASCADE)
|
||||
if self._table_exists(conn, "goal_cell_merges") and self._column_exists(
|
||||
conn, "goal_cell_merges", "row_span"):
|
||||
ids, merges, _ = self._area_geometry(conn, int(me["area_id"]))
|
||||
i = ids.index(row_id)
|
||||
for g in merges:
|
||||
if g["r0"] < i <= g["r1"]:
|
||||
if g["span"] * (g["row_span"] - 1) >= 2:
|
||||
conn.execute(
|
||||
"UPDATE goal_cell_merges SET row_span = row_span - 1 "
|
||||
"WHERE row_id = %s AND start_month = %s",
|
||||
(g["row_id"], g["start"]),
|
||||
)
|
||||
else:
|
||||
conn.execute(
|
||||
"DELETE FROM goal_cell_merges WHERE row_id = %s AND start_month = %s",
|
||||
(g["row_id"], g["start"]),
|
||||
)
|
||||
conn.execute("DELETE FROM goal_rows WHERE id = %s", (row_id,))
|
||||
|
||||
def set_goal_cell(self, *, row_id: int, month: int, body: str, updated_by: str = "") -> None:
|
||||
@@ -2136,16 +2180,14 @@ class ProjectStore:
|
||||
with self._pool.connection() as conn:
|
||||
if not conn.execute("SELECT 1 FROM goal_rows WHERE id = %s", (row_id,)).fetchone():
|
||||
raise KeyError(row_id)
|
||||
if m != store.GOAL_YEAR:
|
||||
halves = self._table_exists(conn, "goal_cell_merges")
|
||||
if m > 12 and not halves:
|
||||
raise store.GoalMigration014Needed()
|
||||
# 병합된 칸의 가운데·끝 월(글은 병합 시작 월에만 둔다) — 다른 창에서 병합된 뒤의 늦은 저장
|
||||
if m <= 12 and halves and conn.execute(
|
||||
"SELECT 1 FROM goal_cell_merges WHERE row_id = %s "
|
||||
"AND start_month < %s AND start_month + span - 1 >= %s",
|
||||
(row_id, m, m),
|
||||
).fetchone():
|
||||
halves = self._table_exists(conn, "goal_cell_merges")
|
||||
if m > 12 and not halves:
|
||||
raise store.GoalMigration014Needed()
|
||||
if halves:
|
||||
# 병합에 가려진 칸(글은 왼쪽 위 칸에만 둔다) — 다른 창에서 병합된 뒤의 늦은 저장
|
||||
area_id = conn.execute("SELECT area_id FROM goal_rows WHERE id = %s", (row_id,)).fetchone()["area_id"]
|
||||
ids, merges, _ = self._area_geometry(conn, int(area_id))
|
||||
if self._covered_by(merges, ids.index(row_id), store.GOAL_COL_ORDER.index(m)):
|
||||
raise ValueError("병합된 칸입니다. 새로고침해 주세요.")
|
||||
if not text:
|
||||
conn.execute("DELETE FROM goal_cells WHERE row_id = %s AND month = %s", (row_id, m))
|
||||
@@ -2157,54 +2199,125 @@ class ProjectStore:
|
||||
(row_id, m, text, store.norm_str(updated_by, lower=True)),
|
||||
)
|
||||
|
||||
def merge_goal_cells(self, *, row_id: int, start: Any, end: Any, updated_by: str = "") -> tuple[int, int]:
|
||||
"""업무 영역 줄의 start~end 월 칸을 가로로 합친다 → (시작 월, 칸 수).
|
||||
# ── 엑셀식 사각형 병합 ─────────────────────────────────────────
|
||||
@staticmethod
|
||||
def _column_exists(conn: Any, table: str, column: str) -> bool:
|
||||
row = conn.execute(
|
||||
"SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' "
|
||||
"AND table_name = %s AND column_name = %s",
|
||||
(table, column),
|
||||
).fetchone()
|
||||
return row is not None
|
||||
|
||||
걸쳐 있는 기존 병합은 통째로 흡수한다(병합은 서로 겹치지 않고 반기 안이라 범위도 반기 안).
|
||||
글은 범위 안 칸들의 글을 월 순서대로 줄바꿈으로 이어 시작 월 칸에 두고, 나머지 칸 글은 지운다."""
|
||||
s, e = store.validate_goal_merge(start, end)
|
||||
def _area_geometry(self, conn: Any, area_id: int) -> tuple[list[int], list[dict[str, Any]], bool]:
|
||||
"""업무 영역 하나의 병합 배치 — (줄 id 순서, 병합 목록, 세로 병합(015) 가능 여부).
|
||||
병합 = {row_id, start, span, row_span, r0, r1(줄 순번), c0, c1(화면 칸 순번)}. 줄 범위는 영역 끝에서 자른다."""
|
||||
ids = [int(r["id"]) for r in conn.execute(
|
||||
"SELECT id FROM goal_rows WHERE area_id = %s ORDER BY sort_order, id", (area_id,)
|
||||
).fetchall()]
|
||||
if not self._table_exists(conn, "goal_cell_merges"):
|
||||
return ids, [], False
|
||||
rect = self._column_exists(conn, "goal_cell_merges", "row_span")
|
||||
rows = conn.execute(
|
||||
"SELECT m.row_id, m.start_month, m.span" + (", m.row_span" if rect else "")
|
||||
+ " FROM goal_cell_merges m JOIN goal_rows r ON r.id = m.row_id WHERE r.area_id = %s",
|
||||
(area_id,),
|
||||
).fetchall()
|
||||
merges = []
|
||||
for g in rows:
|
||||
rid, start = int(g["row_id"]), int(g["start_month"])
|
||||
if rid not in ids or start not in store.GOAL_COL_ORDER:
|
||||
continue
|
||||
r0 = ids.index(rid)
|
||||
span, rs = int(g["span"]), int(g.get("row_span") or 1) if rect else 1
|
||||
c0 = store.GOAL_COL_ORDER.index(start)
|
||||
merges.append({"row_id": rid, "start": start, "span": span, "row_span": rs, "r0": r0,
|
||||
"r1": min(len(ids) - 1, r0 + rs - 1), "c0": c0,
|
||||
"c1": min(len(store.GOAL_COL_ORDER) - 1, c0 + span - 1)})
|
||||
return ids, merges, rect
|
||||
|
||||
@staticmethod
|
||||
def _covered_by(merges: list[dict[str, Any]], ri: int, ci: int) -> dict[str, Any] | None:
|
||||
"""(줄 순번, 칸 순번)을 가리는 병합(시작 칸 자신은 빼고)."""
|
||||
for g in merges:
|
||||
if g["r0"] <= ri <= g["r1"] and g["c0"] <= ci <= g["c1"] and (ri, ci) != (g["r0"], g["c0"]):
|
||||
return g
|
||||
return None
|
||||
|
||||
def merge_goal_rect(
|
||||
self, *, area_id: int, row_from: Any, row_to: Any, col_from: Any, col_to: Any, updated_by: str = ""
|
||||
) -> dict[str, int]:
|
||||
"""업무 영역 칸을 엑셀처럼 사각형으로 합친다 → {row_id(왼쪽 위 줄), start, span, row_span}.
|
||||
|
||||
줄은 같은 영역 안 연속된 줄, 칸은 화면 순서(연간·1~6월·상반기·7~12월·하반기) — 가로는 같은 반기 월 칸끼리만.
|
||||
걸친 기존 병합은 통째로 흡수(엑셀이 선택을 넓히듯). 글은 범위 안 칸들의 글을 왼쪽 위부터 줄·칸 순서대로
|
||||
줄바꿈으로 이어 왼쪽 위 칸에 두고, 나머지 칸 글은 지운다(글을 잃지 않게)."""
|
||||
who = store.norm_str(updated_by, lower=True)
|
||||
try:
|
||||
rf, rt = int(row_from), int(row_to)
|
||||
except (TypeError, ValueError):
|
||||
raise ValueError("병합할 줄이 올바르지 않습니다.")
|
||||
store.validate_goal_rect_cols(col_from, col_to) # 칸 번호 검사(묶음 검사는 넓힌 뒤 다시)
|
||||
with self._pool.connection() as conn:
|
||||
with conn.transaction():
|
||||
if not self._table_exists(conn, "goal_cell_merges"):
|
||||
raise store.GoalMigration014Needed()
|
||||
if not conn.execute(
|
||||
"SELECT 1 FROM goal_rows WHERE id = %s FOR UPDATE", (row_id,)
|
||||
).fetchone():
|
||||
raise KeyError(row_id)
|
||||
for g in conn.execute(
|
||||
"SELECT start_month, span FROM goal_cell_merges WHERE row_id = %s", (row_id,)
|
||||
).fetchall():
|
||||
gs, ge = int(g["start_month"]), int(g["start_month"]) + int(g["span"]) - 1
|
||||
if gs <= e and ge >= s:
|
||||
s, e = min(s, gs), max(e, ge)
|
||||
bodies = [
|
||||
str(c["body"]).strip() for c in conn.execute(
|
||||
"SELECT body FROM goal_cells WHERE row_id = %s AND month BETWEEN %s AND %s "
|
||||
"ORDER BY month",
|
||||
(row_id, s, e),
|
||||
).fetchall()
|
||||
]
|
||||
text = store.validate_goal_text("\n".join(b for b in bodies if b))
|
||||
if not conn.execute("SELECT 1 FROM goal_areas WHERE id = %s FOR UPDATE", (area_id,)).fetchone():
|
||||
raise KeyError(area_id)
|
||||
ids, merges, rect = self._area_geometry(conn, area_id)
|
||||
if rf not in ids or rt not in ids:
|
||||
raise KeyError(rf if rf not in ids else rt)
|
||||
r0, r1 = sorted((ids.index(rf), ids.index(rt)))
|
||||
c0, c1 = sorted((store.GOAL_COL_ORDER.index(int(col_from)), store.GOAL_COL_ORDER.index(int(col_to))))
|
||||
grown = True
|
||||
while grown: # 걸친 병합을 통째로 품을 때까지 넓힌다
|
||||
grown = False
|
||||
for g in merges:
|
||||
if g["r0"] <= r1 and g["r1"] >= r0 and g["c0"] <= c1 and g["c1"] >= c0:
|
||||
n = (min(r0, g["r0"]), max(r1, g["r1"]), min(c0, g["c0"]), max(c1, g["c1"]))
|
||||
if n != (r0, r1, c0, c1):
|
||||
r0, r1, c0, c1 = n
|
||||
grown = True
|
||||
start, span = store.validate_goal_rect_cols(store.GOAL_COL_ORDER[c0], store.GOAL_COL_ORDER[c1])
|
||||
row_span = r1 - r0 + 1
|
||||
if span * row_span < 2:
|
||||
raise ValueError("두 칸 이상 골라야 병합할 수 있습니다.")
|
||||
if (row_span > 1 or start in (store.GOAL_YEAR, store.GOAL_H1, store.GOAL_H2)) and not rect:
|
||||
raise store.GoalMigration015Needed()
|
||||
rows_in = ids[r0:r1 + 1]
|
||||
cols_in = list(store.GOAL_COL_ORDER[c0:c1 + 1])
|
||||
bodies = {(int(c["row_id"]), int(c["month"])): str(c["body"]).strip() for c in conn.execute(
|
||||
"SELECT row_id, month, body FROM goal_cells WHERE row_id = ANY(%s) AND month = ANY(%s)",
|
||||
(rows_in, cols_in),
|
||||
).fetchall()}
|
||||
text = store.validate_goal_text("\n".join(
|
||||
bodies[(r, m)] for r in rows_in for m in cols_in if bodies.get((r, m))
|
||||
))
|
||||
conn.execute(
|
||||
"DELETE FROM goal_cell_merges WHERE row_id = %s AND start_month BETWEEN %s AND %s",
|
||||
(row_id, s, e),
|
||||
"DELETE FROM goal_cell_merges WHERE row_id = ANY(%s) AND start_month = ANY(%s)",
|
||||
(rows_in, cols_in),
|
||||
)
|
||||
conn.execute(
|
||||
"DELETE FROM goal_cells WHERE row_id = %s AND month BETWEEN %s AND %s",
|
||||
(row_id, s, e),
|
||||
"DELETE FROM goal_cells WHERE row_id = ANY(%s) AND month = ANY(%s)", (rows_in, cols_in),
|
||||
)
|
||||
anchor = rows_in[0]
|
||||
if text:
|
||||
conn.execute(
|
||||
"INSERT INTO goal_cells (row_id, month, body, updated_by) VALUES (%s,%s,%s,%s)",
|
||||
(row_id, s, text, who),
|
||||
(anchor, start, text, who),
|
||||
)
|
||||
conn.execute(
|
||||
"INSERT INTO goal_cell_merges (row_id, start_month, span, updated_by) "
|
||||
"VALUES (%s, %s, %s, %s)",
|
||||
(row_id, s, e - s + 1, who),
|
||||
)
|
||||
return s, e - s + 1
|
||||
if rect:
|
||||
conn.execute(
|
||||
"INSERT INTO goal_cell_merges (row_id, start_month, span, row_span, updated_by) "
|
||||
"VALUES (%s, %s, %s, %s, %s)",
|
||||
(anchor, start, span, row_span, who),
|
||||
)
|
||||
else:
|
||||
conn.execute(
|
||||
"INSERT INTO goal_cell_merges (row_id, start_month, span, updated_by) VALUES (%s, %s, %s, %s)",
|
||||
(anchor, start, span, who),
|
||||
)
|
||||
return {"row_id": anchor, "start": start, "span": span, "row_span": row_span}
|
||||
|
||||
def unmerge_goal_cells(self, *, row_id: int, start: int) -> None:
|
||||
"""병합 해제 — 글은 시작 월 칸에 그대로 남는다."""
|
||||
@@ -2218,6 +2331,297 @@ class ProjectStore:
|
||||
if row is None:
|
||||
raise KeyError(row_id)
|
||||
|
||||
# ════════════════════════════════════════════════════════════
|
||||
# 주간 회의록 (마이그레이션 015) — 목표 표 월 머리 → 그 달 주차별 회의록
|
||||
# ════════════════════════════════════════════════════════════
|
||||
_MEETING_ITEM_COLS = ("id, week_start, section, section_color, label, content, target_amount, result_amount, "
|
||||
"status, marketplace_code, carry_from, sort_order")
|
||||
|
||||
def meetings_enabled(self) -> bool:
|
||||
with self._pool.connection() as conn:
|
||||
return self._table_exists(conn, "goal_meetings")
|
||||
|
||||
def _require_meetings(self, conn: Any) -> None:
|
||||
if not self._table_exists(conn, "goal_meetings"):
|
||||
raise store.GoalMigration015Needed()
|
||||
|
||||
@staticmethod
|
||||
def _meeting_item(r: dict[str, Any]) -> dict[str, Any]:
|
||||
out = dict(r)
|
||||
out["id"] = int(out["id"])
|
||||
out["week_start"] = out["week_start"].isoformat()
|
||||
for k in ("target_amount", "result_amount", "carry_from"):
|
||||
out[k] = int(out[k]) if out.get(k) is not None else None
|
||||
return out
|
||||
|
||||
def meeting_weeks(self, *, start: date, end: date) -> list[str]:
|
||||
"""기간 안에 회의록이 있는 주(월요일) 목록."""
|
||||
with self._pool.connection() as conn:
|
||||
if not self._table_exists(conn, "goal_meetings"):
|
||||
return []
|
||||
rows = conn.execute(
|
||||
"SELECT week_start FROM goal_meetings WHERE week_start BETWEEN %s AND %s ORDER BY week_start",
|
||||
(start, end),
|
||||
).fetchall()
|
||||
return [r["week_start"].isoformat() for r in rows]
|
||||
|
||||
def get_meeting(self, *, week_start: date) -> dict[str, Any] | None:
|
||||
"""한 주 회의록 — 머리(금주 목표·참석자·메모) + 줄(전주 줄 prev 포함). 없으면 None.
|
||||
prev_meeting = 이 회의록보다 앞선 가장 가까운 회의록의 머리(전주 목표)."""
|
||||
with self._pool.connection() as conn:
|
||||
self._require_meetings(conn)
|
||||
head = conn.execute(
|
||||
"SELECT week_start, week_target, attendees, notes, updated_by, updated_at "
|
||||
"FROM goal_meetings WHERE week_start = %s", (week_start,),
|
||||
).fetchone()
|
||||
if head is None:
|
||||
return None
|
||||
items = conn.execute(
|
||||
f"SELECT {self._MEETING_ITEM_COLS} FROM goal_meeting_items WHERE week_start = %s "
|
||||
"ORDER BY sort_order, id", (week_start,),
|
||||
).fetchall()
|
||||
prev_ids = [int(r["carry_from"]) for r in items if r["carry_from"] is not None]
|
||||
prevs = {int(r["id"]): self._meeting_item(r) for r in conn.execute(
|
||||
f"SELECT {self._MEETING_ITEM_COLS} FROM goal_meeting_items WHERE id = ANY(%s)", (prev_ids,),
|
||||
).fetchall()} if prev_ids else {}
|
||||
prev_head = conn.execute(
|
||||
"SELECT week_start, week_target FROM goal_meetings WHERE week_start < %s "
|
||||
"ORDER BY week_start DESC LIMIT 1", (week_start,),
|
||||
).fetchone()
|
||||
out_items = []
|
||||
for r in items:
|
||||
it = self._meeting_item(r)
|
||||
it["prev"] = prevs.get(it["carry_from"]) if it["carry_from"] is not None else None
|
||||
out_items.append(it)
|
||||
return {
|
||||
"week_start": head["week_start"].isoformat(),
|
||||
"week_target": int(head["week_target"]) if head["week_target"] is not None else None,
|
||||
"attendees": head["attendees"], "notes": head["notes"], "updated_by": head["updated_by"],
|
||||
"updated_at": head["updated_at"].astimezone(KST).isoformat(timespec="minutes") if head["updated_at"] else "",
|
||||
"items": out_items,
|
||||
"prev_meeting": {"week_start": prev_head["week_start"].isoformat(),
|
||||
"week_target": int(prev_head["week_target"]) if prev_head["week_target"] is not None
|
||||
else None} if prev_head else None,
|
||||
}
|
||||
|
||||
def create_meeting(self, *, week_start: date, sections: list[tuple[str, str]], created_by: str = "") -> bool:
|
||||
"""회의록 만들기 — 이미 있으면 False. 앞선 가장 가까운 회의록이 있으면 그 줄(구역·이름·쇼핑몰 연결·순서)을
|
||||
글 없이 이어받고(carry_from = 그 줄 → 이번 회의에서 지난주 할 일·목표·결과를 나란히 리뷰), 없으면 sections
|
||||
(목표 표 업무 영역 이름·색)마다 기본 양식 줄(store.MEETING_TEMPLATE)로 시작한다."""
|
||||
ws = store.validate_week_start(week_start)
|
||||
who = store.norm_str(created_by, lower=True)
|
||||
with self._pool.connection() as conn:
|
||||
with conn.transaction():
|
||||
self._require_meetings(conn)
|
||||
ins = conn.execute(
|
||||
"INSERT INTO goal_meetings (week_start, created_by, updated_by) VALUES (%s, %s, %s) "
|
||||
"ON CONFLICT (week_start) DO NOTHING RETURNING week_start",
|
||||
(ws, who, who),
|
||||
).fetchone()
|
||||
if ins is None:
|
||||
return False
|
||||
prev = conn.execute(
|
||||
"SELECT week_start FROM goal_meetings WHERE week_start < %s ORDER BY week_start DESC LIMIT 1",
|
||||
(ws,),
|
||||
).fetchone()
|
||||
prev_items = conn.execute(
|
||||
"SELECT id, section, section_color, label, marketplace_code, sort_order FROM goal_meeting_items "
|
||||
"WHERE week_start = %s ORDER BY sort_order, id", (prev["week_start"],),
|
||||
).fetchall() if prev else []
|
||||
if prev_items:
|
||||
for n, r in enumerate(prev_items):
|
||||
conn.execute(
|
||||
"INSERT INTO goal_meeting_items (week_start, section, section_color, label, "
|
||||
"marketplace_code, carry_from, sort_order, updated_by) VALUES (%s,%s,%s,%s,%s,%s,%s,%s)",
|
||||
(ws, r["section"], r["section_color"], r["label"], r["marketplace_code"], r["id"], n, who),
|
||||
)
|
||||
else:
|
||||
n = 0
|
||||
for name, color in sections or [(k, "") for k in store.MEETING_TEMPLATE]:
|
||||
for label in store.MEETING_TEMPLATE.get(name, ("",)):
|
||||
conn.execute(
|
||||
"INSERT INTO goal_meeting_items (week_start, section, section_color, label, "
|
||||
"marketplace_code, sort_order, updated_by) VALUES (%s,%s,%s,%s,%s,%s,%s)",
|
||||
(ws, name, color, label, store.guess_meeting_market(name, label), n, who),
|
||||
)
|
||||
n += 1
|
||||
return True
|
||||
|
||||
def delete_meeting(self, *, week_start: date) -> None:
|
||||
with self._pool.connection() as conn:
|
||||
self._require_meetings(conn)
|
||||
row = conn.execute(
|
||||
"DELETE FROM goal_meetings WHERE week_start = %s RETURNING week_start", (week_start,)
|
||||
).fetchone()
|
||||
if row is None:
|
||||
raise KeyError(str(week_start))
|
||||
|
||||
def update_meeting(self, *, week_start: date, fields: dict[str, Any], updated_by: str = "") -> None:
|
||||
"""머리 칸 — week_target(금주 목표 매출, 원) · attendees(참석자) · notes(결정 사항·메모)."""
|
||||
sets: list[str] = []
|
||||
params: list[Any] = []
|
||||
if "week_target" in fields:
|
||||
v = store.validate_meeting_amount(fields["week_target"])
|
||||
if v is not None and v < 0:
|
||||
raise ValueError("금주 목표는 0 이상이어야 합니다.")
|
||||
sets.append("week_target = %s")
|
||||
params.append(v)
|
||||
if "attendees" in fields:
|
||||
sets.append("attendees = %s")
|
||||
params.append(store.validate_meeting_text(fields["attendees"], limit=500, what="참석자"))
|
||||
if "notes" in fields:
|
||||
sets.append("notes = %s")
|
||||
params.append(store.validate_meeting_text(fields["notes"], what="메모"))
|
||||
if not sets:
|
||||
return
|
||||
with self._pool.connection() as conn:
|
||||
self._require_meetings(conn)
|
||||
row = conn.execute(
|
||||
f"UPDATE goal_meetings SET {', '.join(sets)}, updated_by = %s, updated_at = now() "
|
||||
"WHERE week_start = %s RETURNING week_start",
|
||||
(*params, store.norm_str(updated_by, lower=True), week_start),
|
||||
).fetchone()
|
||||
if row is None:
|
||||
raise KeyError(str(week_start))
|
||||
|
||||
def add_meeting_item(
|
||||
self, *, week_start: date, section: str, section_color: str = "", label: str = "",
|
||||
ref_item_id: int | None = None, place: str = "below", updated_by: str = "",
|
||||
) -> int:
|
||||
"""줄 추가 — 기준 줄 위/아래(같은 구역), 없으면 그 구역 끝(구역이 없으면 맨 끝 = 새 구역)."""
|
||||
sec = store.norm_str(section)
|
||||
if not sec or len(sec) > store.MEETING_LABEL_MAX:
|
||||
raise ValueError("구역 이름을 입력하세요(50자 이하).")
|
||||
lb = store.validate_meeting_text(label, limit=store.MEETING_LABEL_MAX, what="줄 이름")
|
||||
if place not in ("above", "below"):
|
||||
raise ValueError("place 는 above 또는 below 입니다.")
|
||||
with self._pool.connection() as conn:
|
||||
with conn.transaction():
|
||||
self._require_meetings(conn)
|
||||
if not conn.execute(
|
||||
"SELECT 1 FROM goal_meetings WHERE week_start = %s FOR UPDATE", (week_start,)
|
||||
).fetchone():
|
||||
raise KeyError(str(week_start))
|
||||
rows = conn.execute(
|
||||
"SELECT id, section, section_color FROM goal_meeting_items WHERE week_start = %s "
|
||||
"ORDER BY sort_order, id", (week_start,),
|
||||
).fetchall()
|
||||
ids = [int(r["id"]) for r in rows]
|
||||
color = store.norm_str(section_color) or next(
|
||||
(r["section_color"] for r in rows if r["section"] == sec), "")
|
||||
if ref_item_id is not None:
|
||||
if ref_item_id not in ids:
|
||||
raise KeyError(ref_item_id)
|
||||
i = ids.index(ref_item_id) + (1 if place == "below" else 0)
|
||||
else:
|
||||
same = [n for n, r in enumerate(rows) if r["section"] == sec]
|
||||
i = same[-1] + 1 if same else len(ids)
|
||||
new_id = int(conn.execute(
|
||||
"INSERT INTO goal_meeting_items (week_start, section, section_color, label, marketplace_code, "
|
||||
"sort_order, updated_by) VALUES (%s,%s,%s,%s,%s,0,%s) RETURNING id",
|
||||
(week_start, sec, color, lb, store.guess_meeting_market(sec, lb),
|
||||
store.norm_str(updated_by, lower=True)),
|
||||
).fetchone()["id"])
|
||||
ids.insert(i, new_id)
|
||||
for n, x in enumerate(ids):
|
||||
conn.execute("UPDATE goal_meeting_items SET sort_order = %s WHERE id = %s", (n, x))
|
||||
return new_id
|
||||
|
||||
def update_meeting_item(self, *, item_id: int, fields: dict[str, Any], updated_by: str = "") -> dict[str, Any]:
|
||||
"""줄 칸 — label · content(이번주 할 일) · target_amount · result_amount(그 주 결과, 원) · status(평가) ·
|
||||
marketplace_code(실적 쇼핑몰 연결 — 결과 자동). 저장된 줄을 돌려준다."""
|
||||
sets: list[str] = []
|
||||
params: list[Any] = []
|
||||
if "label" in fields:
|
||||
sets.append("label = %s")
|
||||
params.append(store.validate_meeting_text(fields["label"], limit=store.MEETING_LABEL_MAX, what="줄 이름"))
|
||||
if "content" in fields:
|
||||
sets.append("content = %s")
|
||||
params.append(store.validate_meeting_text(fields["content"]))
|
||||
for k in ("target_amount", "result_amount"):
|
||||
if k in fields:
|
||||
v = store.validate_meeting_amount(fields[k])
|
||||
if k == "target_amount" and v is not None and v < 0:
|
||||
raise ValueError("목표 금액은 0 이상이어야 합니다.")
|
||||
sets.append(f"{k} = %s")
|
||||
params.append(v)
|
||||
if "status" in fields:
|
||||
sets.append("status = %s")
|
||||
params.append(store.validate_meeting_status(fields["status"]))
|
||||
if "marketplace_code" in fields:
|
||||
code = store.norm_str(fields["marketplace_code"], lower=True)
|
||||
if len(code) > 30 or not re.fullmatch(r"[a-z0-9_]*", code):
|
||||
raise ValueError("쇼핑몰 코드가 올바르지 않습니다.")
|
||||
sets.append("marketplace_code = %s")
|
||||
params.append(code)
|
||||
with self._pool.connection() as conn:
|
||||
self._require_meetings(conn)
|
||||
if sets:
|
||||
row = conn.execute(
|
||||
f"UPDATE goal_meeting_items SET {', '.join(sets)}, updated_by = %s, updated_at = now() "
|
||||
f"WHERE id = %s RETURNING {self._MEETING_ITEM_COLS}",
|
||||
(*params, store.norm_str(updated_by, lower=True), item_id),
|
||||
).fetchone()
|
||||
else:
|
||||
row = conn.execute(
|
||||
f"SELECT {self._MEETING_ITEM_COLS} FROM goal_meeting_items WHERE id = %s", (item_id,),
|
||||
).fetchone()
|
||||
if row is None:
|
||||
raise KeyError(item_id)
|
||||
return self._meeting_item(row)
|
||||
|
||||
def delete_meeting_item(self, *, item_id: int) -> None:
|
||||
with self._pool.connection() as conn:
|
||||
self._require_meetings(conn)
|
||||
row = conn.execute("DELETE FROM goal_meeting_items WHERE id = %s RETURNING id", (item_id,)).fetchone()
|
||||
if row is None:
|
||||
raise KeyError(item_id)
|
||||
|
||||
def move_meeting_item(self, *, item_id: int, direction: int) -> None:
|
||||
"""같은 구역 안에서 한 칸 위/아래."""
|
||||
with self._pool.connection() as conn:
|
||||
with conn.transaction():
|
||||
self._require_meetings(conn)
|
||||
me = conn.execute(
|
||||
"SELECT week_start, section FROM goal_meeting_items WHERE id = %s", (item_id,)
|
||||
).fetchone()
|
||||
if me is None:
|
||||
raise KeyError(item_id)
|
||||
rows = conn.execute(
|
||||
"SELECT id, section FROM goal_meeting_items WHERE week_start = %s ORDER BY sort_order, id "
|
||||
"FOR UPDATE", (me["week_start"],),
|
||||
).fetchall()
|
||||
ids = [int(r["id"]) for r in rows]
|
||||
i = ids.index(item_id)
|
||||
j = i + (1 if direction > 0 else -1)
|
||||
if not 0 <= j < len(ids) or rows[j]["section"] != me["section"]:
|
||||
return
|
||||
ids[i], ids[j] = ids[j], ids[i]
|
||||
for n, x in enumerate(ids):
|
||||
conn.execute("UPDATE goal_meeting_items SET sort_order = %s WHERE id = %s", (n, x))
|
||||
|
||||
def goal_month_targets(self, *, year: int, month: int) -> dict[str, Any]:
|
||||
"""회의록 머리 — 그 달 매출 목표·실적, 로아스 목표(목표 표 숫자), 매출 단위. 목표 표가 없으면 빈 값."""
|
||||
with self._pool.connection() as conn:
|
||||
if not self._table_exists(conn, "goal_years"):
|
||||
return {"sales_unit": "", "sales_target": None, "sales_actual": None, "roas_target": None}
|
||||
head = conn.execute("SELECT sales_unit FROM goal_years WHERE year = %s", (year,)).fetchone()
|
||||
vals = {(r["metric"], r["kind"]): float(r["value"]) for r in conn.execute(
|
||||
"SELECT metric, kind, value FROM goal_metrics WHERE year = %s AND month = %s", (year, month),
|
||||
).fetchall()}
|
||||
return {"sales_unit": head["sales_unit"] if head else "", "sales_target": vals.get(("sales", "target")),
|
||||
"sales_actual": vals.get(("sales", "actual")), "roas_target": vals.get(("roas", "target"))}
|
||||
|
||||
def goal_area_sections(self, *, year: int) -> list[tuple[str, str]]:
|
||||
"""그 해 목표 표의 업무 영역(이름, 색) — 첫 회의록 구역. 없으면 빈 목록(기본 양식 구역)."""
|
||||
with self._pool.connection() as conn:
|
||||
if not self._table_exists(conn, "goal_areas"):
|
||||
return []
|
||||
rows = conn.execute(
|
||||
"SELECT name, color FROM goal_areas WHERE year = %s ORDER BY sort_order, id", (year,)
|
||||
).fetchall()
|
||||
return [(r["name"], r["color"]) for r in rows]
|
||||
|
||||
# ════════════════════════════════════════════════════════════
|
||||
# 직렬화
|
||||
# ════════════════════════════════════════════════════════════
|
||||
|
||||
+302
-27
@@ -24,7 +24,7 @@ import logging
|
||||
import threading
|
||||
import time
|
||||
import uuid
|
||||
from datetime import date
|
||||
from datetime import date, timedelta
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
@@ -2515,6 +2515,7 @@ def inbox_page(request: Request) -> HTMLResponse:
|
||||
# ────────────────────────────────────────────────────────────
|
||||
_GOALS_MIGRATION_MSG = "연간 목표 기능이 아직 준비되지 않았습니다(DB 마이그레이션 013 필요)."
|
||||
_GOALS_014_MSG = "상·하반기 칸과 칸 병합은 DB 마이그레이션 014 가 필요합니다."
|
||||
_GOALS_015_MSG = "세로 병합·연간/반기 칸 병합과 주간 회의록은 DB 마이그레이션 015 가 필요합니다."
|
||||
|
||||
|
||||
def _fmt_goal_num(v: float | None) -> str:
|
||||
@@ -2532,23 +2533,39 @@ def _goal_label(metric: str, v: float | None) -> str:
|
||||
return f"{s}%" if s and metric == "roas" else s
|
||||
|
||||
|
||||
def _goal_row_layout(merges: dict[int, int], this_month: int) -> list[dict[str, Any]]:
|
||||
"""업무 영역 한 줄의 칸 배치 — 연간 · 1~6월 · 상반기 · 7~12월 · 하반기 순서.
|
||||
def _goal_area_layout(rows: list[dict[str, Any]], this_month: int) -> None:
|
||||
"""업무 영역 줄마다 칸 배치(row["layout"]) — 연간 · 1~6월 · 상반기 · 7~12월 · 하반기 순서, 엑셀식 사각형 병합.
|
||||
|
||||
월 칸은 병합(시작 월 → 칸 수)을 반영해 {"m", "span", "h"(1|2), "now"}, 연간·반기 칸은 {"m": 0|13|14}.
|
||||
병합 정보가 반기를 넘거나 겹치면(있을 수 없지만) 그 병합은 무시한다."""
|
||||
out: list[dict[str, Any]] = [{"m": store.GOAL_YEAR, "kind": "year"}]
|
||||
for h, (lo, hi, half_m) in enumerate(((1, 6, store.GOAL_H1), (7, 12, store.GOAL_H2)), start=1):
|
||||
mo = lo
|
||||
while mo <= hi:
|
||||
span = int(merges.get(mo, 1) or 1)
|
||||
if span < 1 or mo + span - 1 > hi:
|
||||
span = 1
|
||||
out.append({"m": mo, "span": span, "h": h, "kind": "month",
|
||||
"now": mo <= this_month <= mo + span - 1})
|
||||
mo += span
|
||||
out.append({"m": half_m, "kind": "half", "h": h})
|
||||
return out
|
||||
병합(row["merges"] = {시작 칸: (가로 칸 수, 세로 줄 수)})의 시작 칸은 {"span", "rspan"}(colspan/rowspan),
|
||||
병합에 가려진 칸은 빼고 그린다. 칸 = {"m", "kind": year|month|half, "h", "span", "rspan", "now"}.
|
||||
가로는 같은 반기 월 칸 안, 세로는 영역 끝까지로 자른다. 겹치는 병합(있을 수 없지만)은 나중 것을 무시."""
|
||||
order = store.GOAL_COL_ORDER
|
||||
covered: set[tuple[int, int]] = set()
|
||||
anchors: dict[tuple[int, int], tuple[int, int]] = {}
|
||||
for ri, row in enumerate(rows):
|
||||
for start, (span, rspan) in sorted((row.get("merges") or {}).items()):
|
||||
if start not in order:
|
||||
continue
|
||||
ci = order.index(start)
|
||||
cols = [c for c in range(ci, min(len(order), ci + span))
|
||||
if store.goal_col_group(order[c]) == store.goal_col_group(start)]
|
||||
rr = list(range(ri, min(len(rows), ri + max(1, rspan))))
|
||||
cells = {(r, c) for r in rr for c in cols}
|
||||
if (ri, ci) in covered or cells & set(anchors) - {(ri, ci)} or cells & covered:
|
||||
continue
|
||||
anchors[(ri, ci)] = (len(cols), len(rr))
|
||||
covered |= cells - {(ri, ci)}
|
||||
for ri, row in enumerate(rows):
|
||||
out: list[dict[str, Any]] = []
|
||||
for ci, m in enumerate(order):
|
||||
if (ri, ci) in covered:
|
||||
continue
|
||||
span, rspan = anchors.get((ri, ci), (1, 1))
|
||||
kind = "year" if m == store.GOAL_YEAR else "half" if m in (store.GOAL_H1, store.GOAL_H2) else "month"
|
||||
h = 0 if kind == "year" else (1 if m == store.GOAL_H1 else 2) if kind == "half" else store.goal_half_of(m)
|
||||
out.append({"m": m, "kind": kind, "h": h, "span": span, "rspan": rspan,
|
||||
"now": kind == "month" and m <= this_month <= m + span - 1})
|
||||
row["layout"] = out
|
||||
|
||||
|
||||
def _goal_call(fn: Any, *args: Any, **kwargs: Any) -> Any:
|
||||
@@ -2557,6 +2574,8 @@ def _goal_call(fn: Any, *args: Any, **kwargs: Any) -> Any:
|
||||
return fn(*args, **kwargs)
|
||||
except store.GoalMigration014Needed:
|
||||
raise HTTPException(status_code=503, detail=_GOALS_014_MSG)
|
||||
except store.GoalMigration015Needed:
|
||||
raise HTTPException(status_code=503, detail=_GOALS_015_MSG)
|
||||
except UndefinedTable:
|
||||
raise HTTPException(status_code=503, detail=_GOALS_MIGRATION_MSG)
|
||||
except KeyError:
|
||||
@@ -2597,8 +2616,7 @@ def goals_page(request: Request, year: int) -> HTMLResponse:
|
||||
for kind in list(m):
|
||||
m[kind + "_label"] = {mo: _goal_label(metric, v) for mo, v in m[kind].items()}
|
||||
for area in board["areas"]:
|
||||
for row in area["rows"]:
|
||||
row["layout"] = _goal_row_layout(row.get("merges") or {}, this_month)
|
||||
_goal_area_layout(area["rows"], this_month)
|
||||
return render_template(
|
||||
request,
|
||||
"project/goals.html",
|
||||
@@ -2754,22 +2772,279 @@ def api_set_goal_cell(
|
||||
return JSONResponse({"ok": True})
|
||||
|
||||
|
||||
@router.post("/api/goals/rows/{row_id}/merge")
|
||||
def api_merge_goal_cells(request: Request, row_id: int, payload: dict[str, Any] = Body(...)) -> JSONResponse:
|
||||
"""월 칸 가로 병합 {start, end}(반기 안, 2칸 이상) — 걸친 병합은 흡수, 글은 이어서 시작 월 칸에."""
|
||||
@router.post("/api/goals/areas/{area_id}/merge")
|
||||
def api_merge_goal_rect(request: Request, area_id: int, payload: dict[str, Any] = Body(...)) -> JSONResponse:
|
||||
"""엑셀식 병합 {row_from, row_to(줄 id), col_from, col_to(칸 번호 0·1~12·13·14)} — 같은 영역 안 사각형,
|
||||
가로는 같은 반기 월 칸끼리. 걸친 병합은 흡수, 글은 왼쪽 위부터 이어서 왼쪽 위 칸에."""
|
||||
user = _require_admin(request)
|
||||
st = _db_or_503(request)
|
||||
start, span = _goal_call(
|
||||
st.merge_goal_cells, row_id=row_id, start=payload.get("start"), end=payload.get("end"),
|
||||
updated_by=user["email"],
|
||||
res = _goal_call(
|
||||
st.merge_goal_rect, area_id=area_id, row_from=payload.get("row_from"), row_to=payload.get("row_to"),
|
||||
col_from=payload.get("col_from"), col_to=payload.get("col_to"), updated_by=user["email"],
|
||||
)
|
||||
return JSONResponse({"ok": True, "start": start, "span": span})
|
||||
return JSONResponse({"ok": True, **res})
|
||||
|
||||
|
||||
@router.delete("/api/goals/rows/{row_id}/merge/{start}")
|
||||
def api_unmerge_goal_cells(request: Request, row_id: int, start: int) -> JSONResponse:
|
||||
"""병합 해제 — 글은 시작 월 칸에 남는다."""
|
||||
"""병합 해제 — 글은 왼쪽 위(시작) 칸에 남는다(엑셀과 같음)."""
|
||||
_require_admin(request)
|
||||
st = _db_or_503(request)
|
||||
_goal_call(st.unmerge_goal_cells, row_id=row_id, start=start)
|
||||
return JSONResponse({"ok": True})
|
||||
|
||||
|
||||
# ════════════════════════════════════════════════════════════
|
||||
# 주간 회의록 (마이그레이션 015) — 목표 표 월 머리 → /project/goals/{연도}/meetings/{월}?week=월요일
|
||||
# 주 = 월요일~일요일. 지난주 목표·결과 리뷰 → 월 목표 달성을 위한 이번주 목표·할 일.
|
||||
# 쇼핑몰 연결(유통 줄) 결과·전주/금주 매출·월 누적은 실적 모듈(performance_db)에서 읽기만 한다.
|
||||
# ════════════════════════════════════════════════════════════
|
||||
def _perf_sales(request: Request) -> Any:
|
||||
"""실적 모듈 저장소(읽기 전용). 없거나 오류면 None — 회의록은 직접 입력만으로도 동작한다."""
|
||||
return getattr(request.app.state, "performance_store", None)
|
||||
|
||||
|
||||
def _perf_markets(perf: Any) -> list[dict[str, Any]]:
|
||||
if perf is None:
|
||||
return []
|
||||
try:
|
||||
return [m for m in perf.list_marketplaces() if m.get("enabled")]
|
||||
except Exception: # noqa: BLE001 — 실적 DB 장애가 회의록을 막지 않게
|
||||
logger.warning("performance marketplaces unavailable for meeting", exc_info=True)
|
||||
return []
|
||||
|
||||
|
||||
def _perf_sum(perf: Any, start: date, end: date, codes: list[str]) -> dict[str, int] | None:
|
||||
"""기간 쇼핑몰별 매출 합(원, 취소·반품 차감 = 대시보드 총매출과 같은 값). 실적 모듈이 없으면 None."""
|
||||
if perf is None or not codes or end < start:
|
||||
return {} if perf is not None else None
|
||||
try:
|
||||
out: dict[str, int] = {}
|
||||
for (_, code), amount in perf.daily_amounts(start, end, codes).items():
|
||||
out[code] = out.get(code, 0) + int(amount)
|
||||
return out
|
||||
except Exception: # noqa: BLE001
|
||||
logger.warning("performance sales unavailable for meeting", exc_info=True)
|
||||
return None
|
||||
|
||||
|
||||
def _meeting_view(request: Request, st: Any, *, year: int, month: int, week: date) -> dict[str, Any]:
|
||||
"""회의록 화면 데이터 — 머리(월 목표·누적·남은 주 필요 매출·전주/금주 목표·결과) + 줄(전주 리뷰 포함)."""
|
||||
today = today_kst()
|
||||
meeting = st.get_meeting(week_start=week)
|
||||
targets = st.goal_month_targets(year=year, month=month)
|
||||
mult = store.sales_unit_multiplier(targets["sales_unit"])
|
||||
perf = _perf_sales(request)
|
||||
markets = _perf_markets(perf)
|
||||
names = {m["code"]: m["name"] for m in markets}
|
||||
sales_codes = [m["code"] for m in markets if m.get("include_in_sales")]
|
||||
week_end = week + timedelta(days=6)
|
||||
prev_start, prev_end = week - timedelta(days=7), week - timedelta(days=1)
|
||||
first = date(year, month, 1)
|
||||
last = date(year + (month == 12), month % 12 + 1, 1) - timedelta(days=1)
|
||||
|
||||
def total(a: date, b: date) -> int | None:
|
||||
r = _perf_sum(perf, a, min(b, today), sales_codes)
|
||||
return None if r is None else sum(r.values())
|
||||
|
||||
# 월 누적 = 이 주 앞까지(지난주 일요일까지) — 남은 목표를 이번 주 포함 남은 주로 나눠 "주당 필요 매출"
|
||||
mtd_end = min(last, today, prev_end)
|
||||
month_target_won = int(round(targets["sales_target"] * mult)) if targets["sales_target"] is not None and mult else None
|
||||
mtd = total(first, mtd_end) if mtd_end >= first else 0
|
||||
weeks_left = sum(1 for mon, _ in store.month_weeks(year, month) if mon >= week)
|
||||
pm = meeting.get("prev_meeting") if meeting else None # 바로 앞 주 회의록이어야 "전주 목표"
|
||||
need = None
|
||||
if month_target_won is not None and mtd is not None and weeks_left:
|
||||
need = max(0, month_target_won - mtd) // weeks_left
|
||||
head = {
|
||||
"sales_unit": targets["sales_unit"], "sales_target": targets["sales_target"],
|
||||
"roas_target": targets["roas_target"], "month_target_won": month_target_won,
|
||||
"mtd": mtd, "mtd_end": mtd_end.isoformat() if mtd_end >= first else "", "weeks_left": weeks_left,
|
||||
"need_per_week": need,
|
||||
"prev_target": pm["week_target"] if pm and pm["week_start"] == prev_start.isoformat() else None,
|
||||
"prev_result": total(prev_start, prev_end) if prev_start <= today else None,
|
||||
"week_result": total(week, week_end) if week <= today else None,
|
||||
"perf": perf is not None,
|
||||
}
|
||||
if meeting:
|
||||
# 줄마다 전주 결과 — 쇼핑몰 연결이면 그 주 실적(자동), 아니면 직접 입력한 결과
|
||||
by_week: dict[str, dict[str, int] | None] = {}
|
||||
for it in meeting["items"]:
|
||||
prev = it.get("prev")
|
||||
if not prev:
|
||||
continue
|
||||
auto = None
|
||||
code = prev.get("marketplace_code") or ""
|
||||
if code:
|
||||
ws = prev["week_start"]
|
||||
if ws not in by_week:
|
||||
a = date.fromisoformat(ws)
|
||||
by_week[ws] = _perf_sum(perf, a, min(a + timedelta(days=6), today),
|
||||
[m["code"] for m in markets]) if a <= today else {}
|
||||
got = by_week[ws]
|
||||
auto = None if got is None else got.get(code, 0)
|
||||
prev["auto_result"] = auto
|
||||
prev["result"] = auto if auto is not None else prev.get("result_amount")
|
||||
prev["market_name"] = names.get(code, code)
|
||||
for it in meeting["items"]:
|
||||
it["market_name"] = names.get(it["marketplace_code"], it["marketplace_code"]) if it["marketplace_code"] else ""
|
||||
p = it.get("prev")
|
||||
it["rate"] = (round(p["result"] / p["target_amount"] * 100, 1)
|
||||
if p and p.get("result") is not None and p.get("target_amount") else None)
|
||||
# 구역 묶음 — 이어진 같은 구역 줄을 한 덩어리로(표의 구역 칸 rowspan)
|
||||
sections: list[dict[str, Any]] = []
|
||||
for it in meeting["items"]:
|
||||
if not sections or sections[-1]["name"] != it["section"]:
|
||||
sections.append({"name": it["section"], "color": it["section_color"], "rows": []})
|
||||
sections[-1]["rows"].append(it) # 키 이름 rows — 템플릿의 sec.items 는 dict.items 메서드가 된다
|
||||
meeting["sections"] = sections
|
||||
prev_items = [it["prev"] for it in meeting["items"] if it.get("prev")]
|
||||
head["prev_items_target"] = sum(p["target_amount"] or 0 for p in prev_items) if prev_items else None
|
||||
return {"meeting": meeting, "head": head, "markets": [{"code": m["code"], "name": m["name"]} for m in markets]}
|
||||
|
||||
|
||||
@router.get("/goals/{year}/meetings/{month}", response_class=HTMLResponse)
|
||||
def goal_meeting_page(request: Request, year: int, month: int, week: str | None = None) -> HTMLResponse:
|
||||
"""주간 회의록 — 그 달과 겹치는 주(월~일) 탭, 주마다 회의록 하나. 입력은 관리자만(목표 표와 같음)."""
|
||||
from app.main import build_erp_nav, render_template # noqa: WPS433
|
||||
from app.store import is_admin # noqa: WPS433
|
||||
|
||||
user = _require_user(request)
|
||||
st = _store(request)
|
||||
if st is None:
|
||||
return _render_config_needed(request, user)
|
||||
if not 2000 <= year <= 2100 or not 1 <= month <= 12:
|
||||
raise HTTPException(status_code=404, detail="연도·월이 올바르지 않습니다.")
|
||||
weeks = store.month_weeks(year, month)
|
||||
today = today_kst()
|
||||
sel = None
|
||||
if week:
|
||||
try:
|
||||
sel = store.validate_week_start(week)
|
||||
except ValueError:
|
||||
sel = None
|
||||
if sel is None or sel not in [w for w, _ in weeks]:
|
||||
sel = next((w for w, e in weeks if w <= today <= e), weeks[0][0])
|
||||
enabled = st.meetings_enabled()
|
||||
existing = set(st.meeting_weeks(start=weeks[0][0], end=weeks[-1][0])) if enabled else set()
|
||||
view = _meeting_view(request, st, year=year, month=month, week=sel) if enabled else {}
|
||||
admin = is_admin(user)
|
||||
return render_template(
|
||||
request,
|
||||
"project/goal_meeting.html",
|
||||
{
|
||||
"user": user,
|
||||
"is_admin": admin,
|
||||
"nav_items": build_erp_nav(user, active="project"),
|
||||
"nav_projects": _nav_projects(st, user, admin),
|
||||
"goal_years": _goal_years_nav(st),
|
||||
"goal_year_active": year,
|
||||
"my_open_total": _my_open_count(st, user),
|
||||
"mention_unread": _safe_mention_unread(st, user),
|
||||
"page_title": f"{year}년 {month}월 주간 회의록",
|
||||
"page_subtitle": "지난주 리뷰와 이번주 목표",
|
||||
"force_sidebar_collapsed": True,
|
||||
"color_palette": list(store.COLOR_PALETTE),
|
||||
"project_icons": list(store.PROJECT_ICONS),
|
||||
"goal_year": year,
|
||||
"goal_month": month,
|
||||
"meetings_enabled": enabled,
|
||||
"weeks": [{"start": w.isoformat(), "end": e.isoformat(), "n": i + 1, "label": f"{w.month}/{w.day}~{e.month}/{e.day}",
|
||||
"has": w.isoformat() in existing, "now": w <= today <= e} for i, (w, e) in enumerate(weeks)],
|
||||
"week": sel.isoformat(),
|
||||
"week_n": next(i + 1 for i, (w, _) in enumerate(weeks) if w == sel),
|
||||
"week_end": (sel + timedelta(days=6)).isoformat(),
|
||||
"prev_week": (sel - timedelta(days=7)).isoformat(),
|
||||
"meeting_status": store.MEETING_STATUS,
|
||||
**view,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@router.get("/api/goals/meetings/{week_start}")
|
||||
def api_get_meeting(request: Request, week_start: str, year: int, month: int) -> JSONResponse:
|
||||
"""회의록 다시 읽기(저장 뒤 머리 숫자·달성률 갱신용) — 화면과 같은 계산."""
|
||||
_require_user(request)
|
||||
st = _db_or_503(request)
|
||||
ws = _goal_call(store.validate_week_start, week_start)
|
||||
if not 1 <= month <= 12:
|
||||
raise HTTPException(status_code=400, detail="월이 올바르지 않습니다.")
|
||||
view = _goal_call(_meeting_view, request, st, year=year, month=month, week=ws)
|
||||
return JSONResponse(view)
|
||||
|
||||
|
||||
@router.post("/api/goals/meetings/{week_start}")
|
||||
def api_create_meeting(request: Request, week_start: str, payload: dict[str, Any] = Body(default={})) -> JSONResponse:
|
||||
"""회의록 만들기(관리자) — 앞선 회의록 줄을 이어받거나, 처음이면 그 해 목표 표 업무 영역 + 기본 양식 줄."""
|
||||
user = _require_admin(request)
|
||||
st = _db_or_503(request)
|
||||
ws = _goal_call(store.validate_week_start, week_start)
|
||||
year = _goal_call(store.validate_goal_year, payload.get("year") or ws.year)
|
||||
created = _goal_call(st.create_meeting, week_start=ws, sections=st.goal_area_sections(year=year),
|
||||
created_by=user["email"])
|
||||
return JSONResponse({"ok": True, "created": created}, status_code=201 if created else 200)
|
||||
|
||||
|
||||
@router.put("/api/goals/meetings/{week_start}")
|
||||
def api_update_meeting(request: Request, week_start: str, payload: dict[str, Any] = Body(...)) -> JSONResponse:
|
||||
user = _require_admin(request)
|
||||
st = _db_or_503(request)
|
||||
ws = _goal_call(store.validate_week_start, week_start)
|
||||
fields = {k: payload[k] for k in ("week_target", "attendees", "notes") if k in payload}
|
||||
_goal_call(st.update_meeting, week_start=ws, fields=fields, updated_by=user["email"])
|
||||
return JSONResponse({"ok": True})
|
||||
|
||||
|
||||
@router.delete("/api/goals/meetings/{week_start}")
|
||||
def api_delete_meeting(request: Request, week_start: str) -> JSONResponse:
|
||||
_require_admin(request)
|
||||
st = _db_or_503(request)
|
||||
ws = _goal_call(store.validate_week_start, week_start)
|
||||
_goal_call(st.delete_meeting, week_start=ws)
|
||||
return JSONResponse({"ok": True})
|
||||
|
||||
|
||||
@router.post("/api/goals/meetings/{week_start}/items")
|
||||
def api_add_meeting_item(request: Request, week_start: str, payload: dict[str, Any] = Body(...)) -> JSONResponse:
|
||||
"""줄 추가 {section, label?, ref_item_id?, place?: above|below} — 기준 줄 위/아래, 없으면 구역 끝(새 구역이면 맨 끝)."""
|
||||
user = _require_admin(request)
|
||||
st = _db_or_503(request)
|
||||
ws = _goal_call(store.validate_week_start, week_start)
|
||||
ref = payload.get("ref_item_id")
|
||||
try:
|
||||
ref_id = int(ref) if ref not in (None, "") else None
|
||||
except (TypeError, ValueError):
|
||||
raise HTTPException(status_code=400, detail="ref_item_id 가 올바르지 않습니다.")
|
||||
item_id = _goal_call(
|
||||
st.add_meeting_item, week_start=ws, section=payload.get("section", ""), label=payload.get("label", ""),
|
||||
ref_item_id=ref_id, place=payload.get("place") or "below", updated_by=user["email"],
|
||||
)
|
||||
return JSONResponse({"ok": True, "id": item_id}, status_code=201)
|
||||
|
||||
|
||||
@router.put("/api/goals/meeting-items/{item_id}")
|
||||
def api_update_meeting_item(request: Request, item_id: int, payload: dict[str, Any] = Body(...)) -> JSONResponse:
|
||||
"""줄 칸 하나 — label·content·target_amount·result_amount·status·marketplace_code. 전주 결과·평가는
|
||||
이번 회의 화면에서 지난주 줄(prev)의 result_amount·status 로 저장한다."""
|
||||
user = _require_admin(request)
|
||||
st = _db_or_503(request)
|
||||
keys = ("label", "content", "target_amount", "result_amount", "status", "marketplace_code")
|
||||
item = _goal_call(st.update_meeting_item, item_id=item_id,
|
||||
fields={k: payload[k] for k in keys if k in payload}, updated_by=user["email"])
|
||||
return JSONResponse({"ok": True, "item": item})
|
||||
|
||||
|
||||
@router.delete("/api/goals/meeting-items/{item_id}")
|
||||
def api_delete_meeting_item(request: Request, item_id: int) -> JSONResponse:
|
||||
_require_admin(request)
|
||||
st = _db_or_503(request)
|
||||
_goal_call(st.delete_meeting_item, item_id=item_id)
|
||||
return JSONResponse({"ok": True})
|
||||
|
||||
|
||||
@router.post("/api/goals/meeting-items/{item_id}/move")
|
||||
def api_move_meeting_item(request: Request, item_id: int, payload: dict[str, Any] = Body(...)) -> JSONResponse:
|
||||
_require_admin(request)
|
||||
st = _db_or_503(request)
|
||||
_goal_call(st.move_meeting_item, item_id=item_id, direction=int(payload.get("direction") or 0))
|
||||
return JSONResponse({"ok": True})
|
||||
|
||||
@@ -7,6 +7,7 @@ DB 없이 단위 테스트 가능한 순수 함수만 둔다(malaysia.store 패
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
from datetime import date, timedelta
|
||||
from html.parser import HTMLParser
|
||||
from typing import Any
|
||||
|
||||
@@ -471,6 +472,151 @@ def validate_goal_text(body: Any) -> str:
|
||||
return v
|
||||
|
||||
|
||||
# ── 엑셀식 사각형 병합(마이그레이션 015) ──────────────────────────────
|
||||
class GoalMigration015Needed(RuntimeError):
|
||||
"""세로 병합·주간 회의록은 마이그레이션 015 뒤에만 된다."""
|
||||
|
||||
|
||||
# 업무 영역 글 칸의 화면 순서 — 연간 · 1~6월 · 상반기 · 7~12월 · 하반기
|
||||
GOAL_COL_ORDER: tuple[int, ...] = (0, 1, 2, 3, 4, 5, 6, GOAL_H1, 7, 8, 9, 10, 11, 12, GOAL_H2)
|
||||
|
||||
|
||||
def goal_col_group(m: int) -> str:
|
||||
"""병합 가능 묶음 — 가로 병합은 같은 묶음 안에서만(연간·반기 칸은 혼자, 월은 같은 반기끼리)."""
|
||||
if m == GOAL_YEAR:
|
||||
return "year"
|
||||
if m in (GOAL_H1, GOAL_H2):
|
||||
return f"half{1 if m == GOAL_H1 else 2}"
|
||||
return f"months{goal_half_of(m)}"
|
||||
|
||||
|
||||
def validate_goal_rect_cols(col_from: Any, col_to: Any) -> tuple[int, int]:
|
||||
"""병합할 칸 범위(화면 순서의 양 끝 칸 번호) → (시작 칸 번호, 가로 칸 수).
|
||||
가로로 여러 칸이면 같은 반기의 월 칸끼리만 — 연간·상반기·하반기 칸은 세로로만 합칠 수 있다."""
|
||||
try:
|
||||
a, b = int(col_from), int(col_to)
|
||||
except (TypeError, ValueError):
|
||||
raise ValueError("병합할 칸이 올바르지 않습니다.")
|
||||
if a not in GOAL_COL_ORDER or b not in GOAL_COL_ORDER:
|
||||
raise ValueError("병합할 칸이 올바르지 않습니다.")
|
||||
ia, ib = sorted((GOAL_COL_ORDER.index(a), GOAL_COL_ORDER.index(b)))
|
||||
cols = GOAL_COL_ORDER[ia:ib + 1]
|
||||
if len({goal_col_group(m) for m in cols}) > 1:
|
||||
raise ValueError("연간·상반기·하반기 칸은 세로로만, 월 칸은 같은 반기 안에서만 합칠 수 있습니다.")
|
||||
return cols[0], len(cols)
|
||||
|
||||
|
||||
# ── 주간 회의록(마이그레이션 015) — 월 머리를 누르면 그 달 주차별 회의록 ──────────
|
||||
MEETING_STATUS: dict[str, str] = {"": "", "done": "완료", "partial": "일부", "miss": "미달"}
|
||||
MEETING_TEXT_MAX = 4000
|
||||
MEETING_LABEL_MAX = 50
|
||||
# 첫 회의록(이전 주 회의록이 없을 때)의 구역별 줄 — 사용자 회의록 양식(2026-10). 목표 표의 업무 영역 이름과 같으면
|
||||
# 그 줄들로, 없는 구역은 빈 줄 하나. 다음 주부터는 지난주 회의록 줄을 그대로 이어받는다.
|
||||
MEETING_TEMPLATE: dict[str, tuple[str, ...]] = {
|
||||
"상품": ("상품1", "상품2", "상품3", "상품4", "상품5"),
|
||||
"마케팅": ("메타(숫자)", "구글", "네이버", "기타.신규"),
|
||||
"컨텐츠": ("내용1", "내용2", "내용3", "내용4", "내용5"),
|
||||
"유통": ("신규 인플루언서", "콜라보", "쿠팡", "네이버", "gs", "토스", "애터미", "해외", "오프라인", "기타"),
|
||||
}
|
||||
# 유통 줄 이름 → 실적 모듈 쇼핑몰 코드(그 주 결과를 실적에서 자동으로). 첫 단어 기준, 소문자 비교.
|
||||
MEETING_MARKET_GUESS: tuple[tuple[str, str], ...] = (
|
||||
("쿠팡", "coupang"), ("네이버", "naver"), ("스마트스토어", "naver"), ("gs", "gsshop"), ("토스", "toss"),
|
||||
("11번가", "elevenst"), ("카페24", "cafe24"), ("자사몰", "cafe24"), ("롯데", "lotteon"), ("지마켓", "gmarket"),
|
||||
("g마켓", "gmarket"), ("카카오", "kakao"), ("오늘의집", "ohouse"),
|
||||
)
|
||||
|
||||
|
||||
def guess_meeting_market(section: str, label: str) -> str:
|
||||
"""유통 구역 줄 이름으로 실적 쇼핑몰 코드 추측(없으면 ""). 마케팅의 "네이버"(광고)는 연결하지 않는다."""
|
||||
if norm_str(section) != "유통":
|
||||
return ""
|
||||
lb = norm_str(label).lower()
|
||||
for word, code in MEETING_MARKET_GUESS:
|
||||
if lb.startswith(word):
|
||||
return code
|
||||
return ""
|
||||
|
||||
|
||||
def week_monday(d: date) -> date:
|
||||
return d - timedelta(days=d.weekday())
|
||||
|
||||
|
||||
def month_weeks(year: int, month: int) -> list[tuple[date, date]]:
|
||||
"""그 달과 겹치는 주(월요일~일요일) 목록 — 1주차 = 1일이 들어 있는 주."""
|
||||
first = date(year, month, 1)
|
||||
last = (date(year + (month == 12), month % 12 + 1, 1) - timedelta(days=1))
|
||||
out, mon = [], week_monday(first)
|
||||
while mon <= last:
|
||||
out.append((mon, mon + timedelta(days=6)))
|
||||
mon += timedelta(days=7)
|
||||
return out
|
||||
|
||||
|
||||
def validate_week_start(v: Any) -> date:
|
||||
try:
|
||||
d = date.fromisoformat(str(v).strip()[:10])
|
||||
except ValueError:
|
||||
raise ValueError("주 시작일이 올바르지 않습니다.")
|
||||
if d.weekday() != 0:
|
||||
raise ValueError("주 시작일은 월요일이어야 합니다.")
|
||||
if not 2000 <= d.year <= 2100:
|
||||
raise ValueError("주 시작일이 올바르지 않습니다.")
|
||||
return d
|
||||
|
||||
|
||||
def _korean_amount(s: str) -> float:
|
||||
""""1억2천만"·"3천만"·"1.5억"·"120만"·"3천5백" → 숫자. 단위 없는 숫자는 그대로. 틀리면 ValueError."""
|
||||
def small(t: str) -> float: # 만 아래 자리 — 천·백·십
|
||||
val = 0.0
|
||||
for unit, mul in (("천", 1_000), ("백", 100), ("십", 10)):
|
||||
if unit in t:
|
||||
a, t = t.split(unit, 1)
|
||||
val += (float(a) if a else 1.0) * mul
|
||||
return val + (float(t) if t else 0.0)
|
||||
|
||||
total, rest = 0.0, s
|
||||
for unit, mul in (("억", 100_000_000), ("만", 10_000)):
|
||||
if unit in rest:
|
||||
a, rest = rest.split(unit, 1)
|
||||
total += (small(a) if a else 1.0) * mul
|
||||
return total + small(rest)
|
||||
|
||||
|
||||
def validate_meeting_amount(v: Any) -> int | None:
|
||||
"""금액(원) — 쉼표·공백·"원" 은 떼고, "120만"·"1.5억"·"3천만"·"1억2천만" 도 읽는다. 빈값은 None(=지움)."""
|
||||
s = norm_str(v).replace(",", "").replace(" ", "").rstrip("원")
|
||||
if not s:
|
||||
return None
|
||||
try:
|
||||
f = _korean_amount(s)
|
||||
except ValueError:
|
||||
raise ValueError(f"금액은 숫자로 입력하세요(예: 1,200,000 · 120만 · 1.5억 · 3천만): {v}")
|
||||
if f != f or abs(f) >= 1e15:
|
||||
raise ValueError(f"금액 범위를 벗어났습니다: {v}")
|
||||
return int(round(f))
|
||||
|
||||
|
||||
def validate_meeting_text(v: Any, *, limit: int = MEETING_TEXT_MAX, what: str = "내용") -> str:
|
||||
s = str(v or "").replace("\r\n", "\n").strip()
|
||||
if len(s) > limit:
|
||||
raise ValueError(f"{what}은(는) {limit}자까지 쓸 수 있습니다.")
|
||||
return s
|
||||
|
||||
|
||||
def validate_meeting_status(v: Any) -> str:
|
||||
s = norm_str(v)
|
||||
if s not in MEETING_STATUS:
|
||||
raise ValueError("평가 값이 올바르지 않습니다.")
|
||||
return s
|
||||
|
||||
|
||||
def sales_unit_multiplier(unit: str) -> int | None:
|
||||
"""목표 표의 매출 단위 글자 → 원 배수("백만원" → 1,000,000). 모르는 단위면 None(원 환산 안 함)."""
|
||||
u = norm_str(unit).replace(" ", "").rstrip("원") or ""
|
||||
table = {"": 1, "천": 1_000, "만": 10_000, "십만": 100_000, "백만": 1_000_000, "천만": 10_000_000, "억": 100_000_000}
|
||||
return table.get(u)
|
||||
|
||||
|
||||
def build_subject_assigned(*, project_name: str, task_title: str, assignee: str) -> str:
|
||||
return f"[DBX 프로젝트] 작업 배정: {project_name} · {task_title} → {assignee}"
|
||||
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261001c" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
{% block topbar_after_logout %}{% include "project/_help_btn.html" %}{% endblock %}
|
||||
|
||||
{%- macro won(v) -%}{% if v is not none %}{{ "{:,}".format(v) }}{% endif %}{%- endmacro -%}
|
||||
{%- macro num(v) -%}{% if v is not none %}{% if v == v | int %}{{ "{:,}".format(v | int) }}{% else %}{{ "{:,.2f}".format(v) }}{% endif %}{% endif %}{%- endmacro -%}
|
||||
|
||||
{% block content %}
|
||||
{# 주간 회의록 — 목표 표 월 머리를 누르면 열린다(/project/goals/{연도}/meetings/{월}?week=월요일).
|
||||
주(월~일)마다 회의록 하나: 머리(월 목표·지난주까지 누적·주당 필요 매출, 전주 목표·결과, 금주 목표·현재)
|
||||
+ 구역(목표 표 업무 영역)별 줄 — 이번주 할 일·목표 금액 | 전주 할 일·목표·결과·달성률·평가.
|
||||
전주 칸은 지난 회의록의 같은 줄(carry_from). 쇼핑몰 연결 줄의 결과·전주/금주 매출·누적은 실적 모듈에서 자동.
|
||||
입력은 관리자만(칸별 즉시 저장, project.js initGoalMeeting). DB: project_db 015 (goal_meetings·goal_meeting_items). #}
|
||||
<div class="pj-wrap pj-inbox-view pj-goal-view pj-meet-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 pj-meet-head">
|
||||
<div class="pj-meet-title">
|
||||
<a class="pj-meet-back" href="/project/goals/{{ goal_year }}" title="{{ goal_year }}년 목표로"><span class="material-symbols-outlined">arrow_back</span></a>
|
||||
<h2>{{ goal_year }}년 {{ goal_month }}월 주간 회의록</h2>
|
||||
{% set pm = goal_month - 1 if goal_month > 1 else 12 %}{% set py = goal_year if goal_month > 1 else goal_year - 1 %}
|
||||
{% set nm = goal_month + 1 if goal_month < 12 else 1 %}{% set ny = goal_year if goal_month < 12 else goal_year + 1 %}
|
||||
<a class="pj-btn pj-btn-sm" href="/project/goals/{{ py }}/meetings/{{ pm }}">‹ {{ pm }}월</a>
|
||||
<a class="pj-btn pj-btn-sm" href="/project/goals/{{ ny }}/meetings/{{ nm }}">{{ nm }}월 ›</a>
|
||||
</div>
|
||||
{% if meeting and is_admin %}
|
||||
<div class="pj-goal-head-acts">
|
||||
<button type="button" class="pj-btn" id="pj-meet-print"><span class="material-symbols-outlined">print</span> 인쇄</button>
|
||||
<button type="button" class="pj-btn pj-btn-danger" id="pj-meet-del">회의록 삭제</button>
|
||||
</div>
|
||||
{% elif meeting %}
|
||||
<div class="pj-goal-head-acts">
|
||||
<button type="button" class="pj-btn" id="pj-meet-print"><span class="material-symbols-outlined">print</span> 인쇄</button>
|
||||
<span class="pj-goal-note">회의록은 관리자만 입력할 수 있습니다.</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="pj-view pj-meet-pane" id="pj-meet-pane" data-week="{{ week }}" data-year="{{ goal_year }}"
|
||||
data-month="{{ goal_month }}" data-admin="{{ 'true' if is_admin else 'false' }}">
|
||||
{# 주차 탭 — 주 = 월요일~일요일, 1주차 = 1일이 들어 있는 주. 점 = 회의록 있음 #}
|
||||
<nav class="pj-meet-weeks" aria-label="주차">
|
||||
{% for w in weeks %}
|
||||
<a class="pj-meet-week{% if w.start == week %} is-on{% endif %}{% if w.now %} is-now{% endif %}"
|
||||
href="?week={{ w.start }}">
|
||||
<b>{{ w.n }}주차</b><span>{{ w.label }}</span>
|
||||
{% if w.has %}<i class="pj-meet-dot" title="회의록 있음"></i>{% endif %}
|
||||
{% if w.now %}<em>이번 주</em>{% endif %}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
|
||||
{% if not meetings_enabled %}
|
||||
<div class="pj-empty">주간 회의록이 아직 준비되지 않았습니다(DB 마이그레이션 015 필요).</div>
|
||||
{% elif not meeting %}
|
||||
<div class="pj-empty pj-goal-empty">
|
||||
<p>{{ week_n }}주차({{ week }} ~ {{ week_end }}) 회의록이 아직 없습니다.</p>
|
||||
{% if is_admin %}
|
||||
<p class="pj-goal-empty-sub">만들면 앞선 회의록의 줄(구역·항목·쇼핑몰 연결)을 이어받아, 지난주 할 일·목표·결과를 나란히 리뷰할 수 있습니다.
|
||||
처음이면 {{ goal_year }}년 목표 표의 업무 영역과 기본 양식 줄로 시작합니다.</p>
|
||||
<button type="button" class="pj-btn pj-btn-primary" id="pj-meet-create">{{ week_n }}주차 회의록 만들기</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
{% set h = head %}
|
||||
{% set edit = is_admin %}
|
||||
{# ── 머리 — 월 목표 대비 누적·남은 주 필요 매출 / 전주 리뷰 / 금주 목표 ── #}
|
||||
<div class="pj-meet-kpis">
|
||||
<div class="pj-meet-kpi">
|
||||
<span class="pj-meet-kpi-label">월 목표 매출</span>
|
||||
<span class="pj-meet-kpi-val">{% if h.sales_target is not none %}{{ num(h.sales_target) }}<small>{{ h.sales_unit }}</small>{% else %}<span class="pj-muted">목표 표에 없음</span>{% endif %}</span>
|
||||
{% if h.month_target_won is not none and h.sales_unit and h.sales_unit != '원' %}<span class="pj-meet-kpi-sub">= {{ won(h.month_target_won) }}원</span>{% endif %}
|
||||
</div>
|
||||
<div class="pj-meet-kpi">
|
||||
<span class="pj-meet-kpi-label">월 누적 실적 <small>(지난주까지)</small></span>
|
||||
<span class="pj-meet-kpi-val">{% if h.mtd is not none %}{{ won(h.mtd) }}<small>원</small>{% else %}<span class="pj-muted">—</span>{% endif %}</span>
|
||||
{% if h.month_target_won and h.mtd is not none %}<span class="pj-meet-kpi-sub">달성 {{ "%.1f" | format(h.mtd / h.month_target_won * 100) }}%</span>{% endif %}
|
||||
</div>
|
||||
<div class="pj-meet-kpi is-accent">
|
||||
<span class="pj-meet-kpi-label">주당 필요 매출 <small>(남은 {{ h.weeks_left }}주)</small></span>
|
||||
<span class="pj-meet-kpi-val">{% if h.need_per_week is not none %}{{ won(h.need_per_week) }}<small>원</small>{% else %}<span class="pj-muted">—</span>{% endif %}</span>
|
||||
<span class="pj-meet-kpi-sub">월 목표 − 누적을 이번 주 포함 남은 주로 나눈 값</span>
|
||||
</div>
|
||||
<div class="pj-meet-kpi">
|
||||
<span class="pj-meet-kpi-label">목표 ROAS</span>
|
||||
<span class="pj-meet-kpi-val">{% if h.roas_target is not none %}{{ num(h.roas_target) }}<small>%</small>{% else %}<span class="pj-muted">—</span>{% endif %}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pj-meet-kpis is-week">
|
||||
<div class="pj-meet-kpi">
|
||||
<span class="pj-meet-kpi-label">전주 목표</span>
|
||||
<span class="pj-meet-kpi-val">{% if h.prev_target is not none %}{{ won(h.prev_target) }}<small>원</small>{% else %}<span class="pj-muted">—</span>{% endif %}</span>
|
||||
</div>
|
||||
<div class="pj-meet-kpi">
|
||||
<span class="pj-meet-kpi-label">전주 결과 <small>({{ prev_week[5:] | replace('-', '/') }}~ 실적)</small></span>
|
||||
<span class="pj-meet-kpi-val">{% if h.prev_result is not none %}{{ won(h.prev_result) }}<small>원</small>{% else %}<span class="pj-muted">—</span>{% endif %}</span>
|
||||
</div>
|
||||
<div class="pj-meet-kpi">
|
||||
<span class="pj-meet-kpi-label">전주 달성률</span>
|
||||
{% if h.prev_target and h.prev_result is not none %}{% set r = h.prev_result / h.prev_target * 100 %}
|
||||
<span class="pj-meet-kpi-val {{ 'is-good' if r >= 100 else 'is-low' }}">{{ "%.1f" | format(r) }}<small>%</small></span>
|
||||
{% else %}<span class="pj-meet-kpi-val"><span class="pj-muted">—</span></span>{% endif %}
|
||||
</div>
|
||||
<div class="pj-meet-kpi is-input">
|
||||
<span class="pj-meet-kpi-label">금주 목표</span>
|
||||
{% if edit %}
|
||||
<span class="pj-meet-kpi-val"><input type="text" class="pj-meet-amount" id="pj-meet-target" inputmode="decimal"
|
||||
autocomplete="off" placeholder="{{ won(h.need_per_week) if h.need_per_week is not none else '예: 30,000,000' }}"
|
||||
value="{{ won(meeting.week_target) }}" /><small>원</small></span>
|
||||
{% else %}
|
||||
<span class="pj-meet-kpi-val">{% if meeting.week_target is not none %}{{ won(meeting.week_target) }}<small>원</small>{% else %}<span class="pj-muted">—</span>{% endif %}</span>
|
||||
{% endif %}
|
||||
{% if h.need_per_week is not none %}<span class="pj-meet-kpi-sub">필요 {{ won(h.need_per_week) }}원</span>{% endif %}
|
||||
</div>
|
||||
<div class="pj-meet-kpi">
|
||||
<span class="pj-meet-kpi-label">금주 현재 실적</span>
|
||||
<span class="pj-meet-kpi-val">{% if h.week_result is not none %}{{ won(h.week_result) }}<small>원</small>{% else %}<span class="pj-muted">—</span>{% endif %}</span>
|
||||
{% if meeting.week_target and h.week_result is not none %}<span class="pj-meet-kpi-sub">목표의 {{ "%.1f" | format(h.week_result / meeting.week_target * 100) }}%</span>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if not h.perf %}<p class="pj-goal-note">실적 모듈이 연결되지 않아 실적·누적·쇼핑몰 자동 결과는 비어 있습니다(결과는 직접 입력).</p>{% endif %}
|
||||
|
||||
<label class="pj-meet-attend">참석자
|
||||
{% if edit %}<input type="text" id="pj-meet-attendees" maxlength="500" placeholder="예: 대표, 마케팅팀, 유통팀" value="{{ meeting.attendees }}" />
|
||||
{% else %}<span>{{ meeting.attendees or '—' }}</span>{% endif %}
|
||||
</label>
|
||||
|
||||
{# ── 구역별 줄 — 왼쪽: 이번주 / 오른쪽: 전주 리뷰(지난 회의록 같은 줄) ── #}
|
||||
<table class="pj-meet-table" id="pj-meet-table">
|
||||
{# table-layout: fixed 는 첫 줄(묶음 머리, colspan)로 너비를 정하므로 열 너비는 colgroup 으로 #}
|
||||
<colgroup>
|
||||
<col class="pj-meet-w-sec" /><col class="pj-meet-w-label" /><col /><col class="pj-meet-w-amt" />
|
||||
<col /><col class="pj-meet-w-amt" /><col class="pj-meet-w-amt" /><col class="pj-meet-w-rate" /><col class="pj-meet-w-eval" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="pj-meet-group">
|
||||
<th colspan="2"></th>
|
||||
<th colspan="2" class="is-this">이번주 ({{ week[5:] | replace('-', '/') }} ~ {{ week_end[5:] | replace('-', '/') }})</th>
|
||||
<th colspan="5" class="is-prev">지난주 리뷰</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="pj-meet-c-sec">구역</th>
|
||||
<th class="pj-meet-c-label">항목</th>
|
||||
<th class="pj-meet-c-text">이번주 할 일 · 행사</th>
|
||||
<th class="pj-meet-c-amt">목표 금액</th>
|
||||
<th class="pj-meet-c-text is-prev">지난주 할 일</th>
|
||||
<th class="pj-meet-c-amt is-prev">지난주 목표</th>
|
||||
<th class="pj-meet-c-amt is-prev">결과</th>
|
||||
<th class="pj-meet-c-rate is-prev">달성률</th>
|
||||
<th class="pj-meet-c-eval is-prev">평가</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{% for sec in meeting.sections %}
|
||||
<tbody class="pj-meet-sec" data-section="{{ sec.name }}" style="--goal-bg: {{ sec.color or '#fff' }}">
|
||||
{% for it in sec.rows %}
|
||||
{% set p = it.prev %}
|
||||
<tr data-item="{{ it.id }}" data-section="{{ sec.name }}" data-market="{{ it.marketplace_code }}"{% if p %} data-prev="{{ p.id }}" data-prev-target="{{ p.target_amount if p.target_amount is not none else '' }}"{% endif %}>
|
||||
{% if loop.first %}
|
||||
<th class="pj-meet-c-sec" rowspan="{{ sec.rows | length }}">{{ sec.name }}
|
||||
{% if edit %}<button type="button" class="pj-meet-sec-add" data-meet-act="sec-add" title="{{ sec.name }} 구역 끝에 줄 추가">+</button>{% endif %}
|
||||
</th>
|
||||
{% endif %}
|
||||
<th class="pj-meet-c-label">
|
||||
<span class="pj-meet-label"{% if edit %} data-meet-edit="label" title="눌러서 이름 수정 · 우클릭 = 줄 메뉴"{% endif %}>{{ it.label }}</span>
|
||||
{% if it.market_name %}<span class="pj-meet-market" title="결과를 실적 모듈 {{ it.market_name }} 매출에서 자동으로">{{ it.market_name }}</span>{% endif %}
|
||||
{% if edit %}<button type="button" class="pj-icon-btn pj-meet-more" data-meet-act="menu" title="줄 메뉴"><span class="material-symbols-outlined">more_horiz</span></button>{% endif %}
|
||||
</th>
|
||||
<td class="pj-meet-c-text">
|
||||
{% if edit %}<textarea class="pj-meet-text" rows="1" data-field="content" placeholder="이번주 할 일·행사">{{ it.content }}</textarea>
|
||||
{% else %}<div class="pj-meet-ro">{{ it.content }}</div>{% endif %}
|
||||
</td>
|
||||
<td class="pj-meet-c-amt">
|
||||
{% if edit %}<input type="text" class="pj-meet-amount" data-field="target_amount" inputmode="decimal" autocomplete="off" value="{{ won(it.target_amount) }}" />
|
||||
{% else %}{{ won(it.target_amount) }}{% endif %}
|
||||
</td>
|
||||
{% if p %}
|
||||
<td class="pj-meet-c-text is-prev"><div class="pj-meet-ro">{{ p.content }}</div></td>
|
||||
<td class="pj-meet-c-amt is-prev">{{ won(p.target_amount) }}</td>
|
||||
<td class="pj-meet-c-amt is-prev">
|
||||
{% if p.auto_result is not none %}
|
||||
<span class="pj-meet-auto" title="실적 모듈 {{ p.market_name }} {{ p.week_start }} 주 매출(자동)">{{ won(p.auto_result) }}</span>
|
||||
{% elif edit %}<input type="text" class="pj-meet-amount" data-field="result_amount" data-target="prev" inputmode="decimal" autocomplete="off" value="{{ won(p.result_amount) }}" placeholder="결과" />
|
||||
{% else %}{{ won(p.result_amount) }}{% endif %}
|
||||
</td>
|
||||
<td class="pj-meet-c-rate is-prev" data-rate>{% if it.rate is not none %}<span class="{{ 'is-good' if it.rate >= 100 else 'is-low' }}">{{ it.rate }}%</span>{% endif %}</td>
|
||||
<td class="pj-meet-c-eval is-prev">
|
||||
{% if edit %}
|
||||
<select class="pj-meet-eval" data-field="status" data-target="prev" data-v="{{ p.status }}">
|
||||
{% for k, v in meeting_status.items() %}<option value="{{ k }}"{% if k == p.status %} selected{% endif %}>{{ v or '—' }}</option>{% endfor %}
|
||||
</select>
|
||||
{% else %}<span class="pj-meet-eval-ro" data-v="{{ p.status }}">{{ meeting_status[p.status] or '—' }}</span>{% endif %}
|
||||
</td>
|
||||
{% else %}
|
||||
<td class="pj-meet-c-text is-prev is-none" colspan="5"><span class="pj-muted">지난 회의록에 없는 줄</span></td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% if edit %}
|
||||
<div class="pj-goal-foot">
|
||||
<button type="button" class="pj-btn" id="pj-meet-sec-new">+ 구역 추가</button>
|
||||
<span class="pj-goal-note">칸을 고치면 바로 저장됩니다. 금액은 원 단위(120만·1.5억도 됨). 항목을 우클릭하거나 ⋯ 를 누르면
|
||||
줄 추가·순서·삭제·쇼핑몰 연결(결과를 실적에서 자동). 지난주 결과·평가는 지난 회의록 줄에 저장됩니다.</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="pj-meet-notes">
|
||||
<h3>결정 사항 · 메모</h3>
|
||||
{% if edit %}<textarea id="pj-meet-notes" rows="4" placeholder="이번 회의에서 정한 것, 다음 주까지 확인할 것">{{ meeting.notes }}</textarea>
|
||||
{% else %}<div class="pj-meet-ro">{{ meeting.notes or '—' }}</div>{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if markets %}<script>window.PJ_MEET_MARKETS = {{ markets | tojson }};</script>{% endif %}
|
||||
{% include "project/_side_modals.html" %}
|
||||
{% include "project/_member_tasks_modal.html" %}
|
||||
|
||||
<script src="/static/project.js?v=20261001c" defer></script>
|
||||
{% endblock %}
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261001b" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261001c" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -74,7 +74,8 @@
|
||||
{# 연간·월·반기 칸도 머리 칸 오른쪽 끝을 끌어 너비 조절(data-col: y · m1~m12 · h1 · h2) #}
|
||||
<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 halves %}
|
||||
{% for mo in hmonths %}<th class="pj-goal-m{% if mo == this_month %} is-now{% endif %}" data-h="{{ h }}" data-col="m{{ mo }}"><span class="pj-goal-mlabel">{{ mo }}월</span><span class="pj-goal-colresize" data-col="m{{ mo }}" title="끌어서 너비 조절"></span></th>{% endfor %}
|
||||
{# 월 이름을 누르면 그 달 주간 회의록(/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) #}
|
||||
<th class="pj-goal-half-col" data-h="{{ h }}" data-col="h{{ h }}">
|
||||
<button type="button" class="pj-goal-fold" data-h="{{ h }}" aria-expanded="true"
|
||||
@@ -167,14 +168,13 @@
|
||||
</span>
|
||||
{% endif %}
|
||||
</th>
|
||||
{# 칸 배치는 router._goal_area_layout — 엑셀식 사각형 병합(colspan·rowspan), 가려진 칸은 없다 #}
|
||||
{% 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 %}
|
||||
{% 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 == 'month' %}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 -%}
|
||||
<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>
|
||||
@@ -192,7 +192,8 @@
|
||||
<div class="pj-goal-foot">
|
||||
<button type="button" class="pj-btn" id="pj-goal-area-add">+ 업무 영역 추가</button>
|
||||
<span class="pj-goal-note">칸을 고치면 바로 저장됩니다. 숫자 칸을 비우면 지워집니다. 항목 칸을 우클릭하면 줄을 추가·삭제합니다.
|
||||
{%- if board.halves %} 월 칸은 Shift+클릭으로 여러 칸을 고른 뒤 병합하거나, 우클릭 메뉴로 병합·해제합니다.{% endif %}</span>
|
||||
{%- if board.halves %} 칸을 마우스로 끌어 여러 칸을 고른 뒤 우클릭 → 셀 병합, 병합된 칸은 우클릭 → 병합 해제(글은 왼쪽 위 칸에 남음).{% endif %}
|
||||
월 이름을 누르면 그 달 주간 회의록이 열립니다.</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@@ -205,5 +206,5 @@
|
||||
{% include "project/_side_modals.html" %}
|
||||
{% include "project/_member_tasks_modal.html" %}
|
||||
|
||||
<script src="/static/project.js?v=20261001b" defer></script>
|
||||
<script src="/static/project.js?v=20261001c" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261001b" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261001c" />
|
||||
<link rel="stylesheet" href="/static/project-help.css?v=20260926v" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261001b" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261001c" />
|
||||
<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=20261001b" defer></script>
|
||||
<script src="/static/project.js?v=20261001c" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261001b" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261001c" />
|
||||
<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=20261001b" defer></script>
|
||||
<script src="/static/project.js?v=20261001c" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261001b" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261001c" />
|
||||
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — 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=20261001b" defer></script>
|
||||
<script src="/static/project.js?v=20261001c" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261001b" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261001c" />
|
||||
<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=20261001b" defer></script>
|
||||
<script src="/static/project.js?v=20261001c" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user