fix(860-3): 불러오기 [수정] 창 머리 금액 = 고른 판 이름 · 금액
- 머리 「엑셀 단가 58,889」 가 [우리 단가로] 뒤에도 그대로이던 것 → 셈 답이 올 때마다 고른 판 이름 · 금액 (= 표 합계) · 다른 판 금액은 곁에 작게(우리 판 = 엑셀 금액 · 엑셀 판 = 한 번 셈한 우리 금액) - 일위대가표 덧칸 고리 `LaborView.onCalc`(셈 답 · 문서) · 문서 `본뜬.단가기준` 타입 - 화면 봉화 제1호표 엑셀 58,889 → 우리 59,948 · 엑셀 58,889 → 다시 엑셀 58,889 · 우리 59,948 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
* · 단가산출 줄 누름 = 그 블록 가져온 식 모달(`Hopyo_Imported` · 미리 보기 · 층에 안 씀 · 저장 = 모달 [저장] ·
|
||||
* 835-1 — 옛 「누르면 SK 만듦」 걷음 · [엑셀 단가 그대로 | 우리 단가로])
|
||||
* · 일위대가 줄 누름 = 그 하위 호표 [수정] 모달 · 후보 줄 누름 = 후보 목록(고르기 = [내 일위대가로] 뒤 일위대가 [연결])
|
||||
* · 머리 = 표지 수 · 엑셀 단가 · [내 일위대가로](807-1 `Hopyo_Mine`) · [구조물 조합으로](만든 SC 있을 때 · `Hopyo_ToItem`) · [엑셀 보기]
|
||||
* · 머리 = 표지 수 · 고른 판 단가(860-3 · 셈 답 = 표 합계 · 다른 판 금액 작게) · [내 일위대가로](807-1 `Hopyo_Mine`) · [구조물 조합으로](만든 SC 있을 때 · `Hopyo_ToItem`) · [엑셀 보기]
|
||||
* 기초 판정 · 「우리 기초로 바꾸기」 없음(요구 703).
|
||||
* ========================================================================== */
|
||||
|
||||
@@ -39,6 +39,9 @@ const TEXT = {
|
||||
None: ["못 이음", "Not linked"],
|
||||
Logic: ["로직 {n}", "Logic {n}"],
|
||||
ExcelPrice: ["엑셀 단가", "Excel price"],
|
||||
OurPrice: ["우리 단가", "우리 단가"],
|
||||
ExcelShort: ["엑셀", "엑셀"],
|
||||
OurShort: ["우리", "우리"],
|
||||
Hint: [
|
||||
"경쟁사 로직 그대로 · 요소만 연결 — 단가산출 줄을 누르면 수식 탭 · 금액 = 엑셀",
|
||||
"Competitor logic kept · elements linked — click a build-up line for its formula",
|
||||
@@ -157,11 +160,30 @@ export function openHopyoView(o: ViewOptions): void {
|
||||
];
|
||||
badges.forEach((b, i) => (b.dataset.viewCount = ["로직", "연결됨", "후보", "못 이음"][i]));
|
||||
const sheet = createButton({ label: t("Sheet"), size: 28, variant: "ghost", onClick: () => { close(); o.onSheet?.(); } }); // prettier-ignore
|
||||
// 860-3 머리 금액 = 고른 판 이름 · 금액(표 합계 = 셈 답) · 다른 판 금액은 곁에 작게(우리 = 한 번 셈한 뒤)
|
||||
const excel = r.금액?.계 ?? null;
|
||||
let ours: number | null = null;
|
||||
let main = createText("", "muted", 14);
|
||||
let other = createText("", "muted", 12);
|
||||
const paintPrice = (basis: unknown, total: number | null): void => {
|
||||
if (basis === "우리") ours = total;
|
||||
const won = (v: number | null): string => (v == null ? "—" : formatPrice(v));
|
||||
const head = `${t(basis === "우리" ? "OurPrice" : "ExcelPrice")} ${won(total)}`;
|
||||
const side = basis === "우리" ? `${t("ExcelShort")} ${won(excel)}` : ours == null ? "" : `${t("OurShort")} ${won(ours)}`; // prettier-ignore
|
||||
const [m, s] = [createText(head, "muted", 14), createText(side, "muted", 12)];
|
||||
m.dataset.hopyoPrice = basis === "우리" ? "우리" : "엑셀";
|
||||
s.hidden = !side;
|
||||
main.replaceWith(m);
|
||||
other.replaceWith(s);
|
||||
[main, other] = [m, s];
|
||||
};
|
||||
paintPrice("엑셀", excel);
|
||||
const items: (HTMLElement | "divider")[] = [
|
||||
el("strong", { text: `제${r.번}호표 ${name}` }),
|
||||
...badges,
|
||||
"divider",
|
||||
createText(`${t("ExcelPrice")} ${r.금액?.계 == null ? "—" : formatPrice(r.금액.계)}`, "muted", 14), // prettier-ignore
|
||||
main,
|
||||
other,
|
||||
...(o.brief ? [mineButton(o.file, o.key, o.brief)] : []),
|
||||
...(o.brief?.만든 && o.canWrite
|
||||
? [itemButton(o.target, o.brief.만든, name, r.단위 ?? "")]
|
||||
@@ -188,6 +210,7 @@ export function openHopyoView(o: ViewOptions): void {
|
||||
return key === "x_mark" ? markText(m) : m.엑셀.계;
|
||||
},
|
||||
tone: (n, key) => (key === "x_mark" && r.줄[n] ? markTone(r.줄[n]) : null),
|
||||
onCalc: (got, doc) => paintPrice(doc.본뜬?.단가기준 ?? "엑셀", got.반영합?.계 ?? null),
|
||||
onRow: (n) => {
|
||||
const m = r.줄[n];
|
||||
const line = (r.문서 as { 담은로직?: { 별칭?: string | null }[] }).담은로직?.[n];
|
||||
|
||||
@@ -174,6 +174,8 @@ export interface LaborDoc {
|
||||
키?: string;
|
||||
파일?: string;
|
||||
전국자재?: NationalMat[];
|
||||
/** 불러온 일위대가 판(859-4) — 엑셀 | 우리 */
|
||||
단가기준?: string;
|
||||
} | null;
|
||||
담은로직: LaborRow[];
|
||||
자재: LaborMat[];
|
||||
|
||||
@@ -43,6 +43,8 @@ export interface LaborView {
|
||||
cell: (n: number, key: string) => string | number | null;
|
||||
tone?: (n: number, key: string) => string | null;
|
||||
onRow?: (n: number) => boolean;
|
||||
/** 셈 답이 올 때마다(860-3 [수정] 창 머리 = 고른 판 금액 · `doc.본뜬.단가기준`) */
|
||||
onCalc?: (calc: LaborCalc, doc: LaborDoc) => void;
|
||||
}
|
||||
|
||||
export interface LaborDetailHandle {
|
||||
|
||||
@@ -78,9 +78,7 @@ export function laborBlock(
|
||||
unit: fx.비율 ? "%" : (fx.단위 ?? ""),
|
||||
prices: money(line?.기준, line?.배 || 1),
|
||||
amounts: money(line?.반영),
|
||||
note:
|
||||
line?.까닭 ??
|
||||
fixedNote(fx, line, (doc.본뜬 as { 단가기준?: string } | undefined)?.단가기준),
|
||||
note: line?.까닭 ?? fixedNote(fx, line, doc.본뜬?.단가기준),
|
||||
tag: HOPYO_TAG.fix,
|
||||
};
|
||||
return {
|
||||
|
||||
@@ -257,6 +257,7 @@ export function mountLaborTable(
|
||||
: await calcLabor(opt.layer, opt.column, cur, qty, opt.owner);
|
||||
if (!alive || mine !== seq) return;
|
||||
calc = last = got;
|
||||
opt.view?.onCalc?.(got, cur); // 860-3 [수정] 창 머리 금액
|
||||
const pills = got.알약 as { 키: string; 이름?: string; 단위?: string }[];
|
||||
combo?.setPills(pills.filter((p) => !p.키.startsWith(`참조|${DRAFT}|`))); // 860-2 초안 = 저장 뒤 잇기
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user