feat(project): allow text in meeting target/result cells; fix result note save
- Target and result cells accept text such as "20개". Values that parse
as amounts still go to the integer columns; anything else goes to the
new target_text/result_text columns (migration 021).
- Fix: PUT /api/goals/meeting-items/{id} dropped result_note, so the
last-week result text was never saved.
- Update meeting nav test to the month-bounded week numbering.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+10
-8
@@ -10195,17 +10195,19 @@
|
||||
const cell = inp.closest("td") || inp.closest(".pj-meet-kpi");
|
||||
clearSaveFailed(cell);
|
||||
flashSaved(cell);
|
||||
let confirmed;
|
||||
let shown;
|
||||
if (inp === tgt) {
|
||||
confirmed = res && Object.prototype.hasOwnProperty.call(res, "week_target") ? res.week_target : undefined;
|
||||
meetRepaint().catch(function () {}); // 금주 현재 실적의 "목표의 %"·필요 매출 — 서버 계산으로
|
||||
if (res && Object.prototype.hasOwnProperty.call(res, "week_target")) shown = won(res.week_target);
|
||||
meetRepaint().catch(function () {}); // 머리 숫자 — 서버 계산으로
|
||||
} else {
|
||||
const tr = inp.closest("tr");
|
||||
confirmed = res.item[inp.dataset.field];
|
||||
if (inp.dataset.field === "target_amount") tr.dataset.targetAmount = confirmed == null ? "" : String(confirmed);
|
||||
// 숫자면 원 정수(쉼표 표기), 숫자가 아니면(예: "20개") 서버가 글 칸(target_text·result_text, 021)에 둔 글 그대로
|
||||
const tr = inp.closest("tr"), f = inp.dataset.field, item = res.item;
|
||||
const text = item[f.replace("_amount", "_text")];
|
||||
shown = text ? text : won(item[f]);
|
||||
if (f === "target_amount") tr.dataset.targetAmount = item[f] == null ? "" : String(item[f]);
|
||||
}
|
||||
if (!same || confirmed === undefined) return undefined; // 요청 뒤 새로 입력 중 — 그 초안을 그대로
|
||||
inp.value = won(confirmed);
|
||||
if (!same || shown === undefined) return undefined; // 요청 뒤 새로 입력 중 — 그 초안을 그대로
|
||||
inp.value = shown;
|
||||
return inp.value;
|
||||
},
|
||||
onFail: function (inp, err) { markSaveFailed(inp.closest("td") || inp.closest(".pj-meet-kpi"), err); },
|
||||
|
||||
Reference in New Issue
Block a user