feat(est-test): 묶음 인쇄 간지 일괄적용·기본양식 저장·전체선택/해제
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -489,6 +489,8 @@ ative-standard.js에 표준시장단가 원천(SilJukDat)과 내역 행(EstMainD
|
||||
- 남음: 구성비·요율 전환(CalcBase), 약어 표시(SName), 제비율 기준 문서 보기(원본 한글 파일).
|
||||
- [x] 수량산출서 검색·전체보기(원본 TFRMMULLANG btnSerch·btnAllDisplay — 빈칸·|·괄호 무시 포함 검색) — 고르기 줄을 `native-quantity-sheets.js` 로 옮겨 700줄 제한 유지.
|
||||
- 검증완료: `test_est_quantity_sheets.py` 검색 시험 포함 수량 시험 22개 통과. ORCA 브라우저에서 「집수」 검색 → 항목에 집수정이 있는 「배수」만·선택 이동, 전체보기 → 3개 복귀, 샘플 복구.
|
||||
- [x] 묶음 인쇄 간지 설정값 일괄적용·기본양식에저장·전체선택/선택해제(원본 TFRMESTPRINTPRIVATE btnGangiAllSet·btnSaveToMain, TFRMESTPRINT2 btnNoselect) — 간지 인쇄·간지 겹테두리를 모든 서식에 같게, 고른 서식·간지 설정을 「묶음기본양식」(양식 보관함 종류 print)으로 저장해 묶음 설정 없는 공사에서 열 때 씀.
|
||||
- 검증완료: 묶음 인쇄·바인딩 시험 통과. ORCA 브라우저에서 선택해제 0 · 전체선택 40, 겹테두리 끔 → 미리보기 간지 테두리 없음, 기본양식 저장 뒤 설정 지우고 다시 열면 1개·겹테두리 끔 복원, 양식 지우고 샘플 복구.
|
||||
- [x] 갑지 공사금액 자동변경(원본 TFRMGABGI popupCostChange) — 「공사금액 자동변경」 체크 시 고른 원가 비목·방식을 기억해 인쇄 때마다 현재 원가 금액으로 공사금액 글을 다시 만듦(다시 열면 고른 비목·방식 그대로).
|
||||
- 검증완료: 문서 시험 3개 통과. ORCA 브라우저에서 도급액 고정 풀고 자동변경 저장 → 수량 2배 뒤 인쇄 금액 「칠천구백육십만삼천삼백이십사원」→「팔천이백칠만사천팔백구십일원」, 저장 글은 그대로, 샘플 복구.
|
||||
- [x] 선택 행 예정공정표에 표시/해제(원본 mnuShowSchedule · popMainShowChart) — 내역서에서 고른 상세 행만 공정표에 넣음(이미 있는 행은 건너뜀), 고른 행이 모두 있으면 뺌(검증: 2행 넣기 → 다시 눌러 0행).
|
||||
|
||||
@@ -18,7 +18,7 @@ const EstPrintBatch = (() => {
|
||||
Name: row.Name2 || row.Name || String(row.Index),
|
||||
checked: saved ? saved.includes(row.Index) : Number(row.Checked) === 1,
|
||||
gangi: project.printBatch?.gangi ?? Number(row.PrintGangiShow) === 1,
|
||||
outline: Number(row.PrintGangiOutLineShow ?? 1) === 1,
|
||||
outline: project.printBatch?.outline ?? Number(row.PrintGangiOutLineShow ?? 1) === 1,
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -54,7 +54,21 @@ const EstPrintBatch = (() => {
|
||||
}
|
||||
|
||||
let catalog = [];
|
||||
// 간지 설정값 일괄적용(btnGangiAllSet): 간지 인쇄·겹테두리를 모든 서식에 같게. 기본양식에저장(btnSaveToMain):
|
||||
// 고른 서식·간지 설정을 서버 양식 보관함(종류 print, 이름 「묶음기본양식」)에 — 묶음 설정이 없는 공사에서 열 때 씀.
|
||||
const DEFAULT = "묶음기본양식";
|
||||
const post = (body) => ({
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(body),
|
||||
});
|
||||
async function open(state) {
|
||||
if (!state.project.printBatch) {
|
||||
const saved = (await EstApp.api("/api/forms")).find(
|
||||
(f) => f.kind === "print" && f.name === DEFAULT,
|
||||
);
|
||||
if (saved) EstApp.change((project) => (project.printBatch = saved.data), false);
|
||||
}
|
||||
const defaults = await EstApp.api("/api/print-catalog");
|
||||
const original = new Map((state.project.printCatalog || []).map((row) => [row.Index, row]));
|
||||
catalog = defaults.map((row) => ({ ...row, ...original.get(row.Index) }));
|
||||
@@ -64,16 +78,17 @@ const EstPrintBatch = (() => {
|
||||
const list = forms(catalog, state.project);
|
||||
EstApp.showDialog(
|
||||
"묶음 인쇄(설계서 일체)",
|
||||
`<p>인쇄할 서식을 고르세요. 인쇄표 차례대로 이어 인쇄합니다.</p><label><input type="checkbox" name="pb-gangi" ${list[0]?.gangi ? "checked" : ""}>간지 인쇄</label><div style="max-height:260px;overflow:auto;columns:2">${list.map((f) => `<label style="display:block"><input type="checkbox" name="pb-form" value="${esc(f.Index)}" ${f.checked ? "checked" : ""}>${esc(f.Name)}</label>`).join("")}</div><button data-action="print-batch-preview">미리보기</button> <button data-action="print-batch-print">인쇄</button><p id="print-batch-note"></p><iframe id="print-batch-frame" style="width:100%;height:360px;border:1px solid #ccc"></iframe>`,
|
||||
`<p>인쇄할 서식을 고르세요. 인쇄표 차례대로 이어 인쇄합니다.</p><label><input type="checkbox" name="pb-gangi" ${list[0]?.gangi ? "checked" : ""}>간지 인쇄</label> <label><input type="checkbox" name="pb-outline" ${list[0]?.outline !== false ? "checked" : ""}>간지 겹테두리</label> (모든 서식에 일괄적용) <button data-action="print-batch-all">전체선택</button><button data-action="print-batch-none">선택해제</button><button data-action="print-batch-default">기본양식에저장</button><div style="max-height:260px;overflow:auto;columns:2">${list.map((f) => `<label style="display:block"><input type="checkbox" name="pb-form" value="${esc(f.Index)}" ${f.checked ? "checked" : ""}>${esc(f.Name)}</label>`).join("")}</div><button data-action="print-batch-preview">미리보기</button> <button data-action="print-batch-print">인쇄</button><p id="print-batch-note"></p><iframe id="print-batch-frame" style="width:100%;height:360px;border:1px solid #ccc"></iframe>`,
|
||||
);
|
||||
}
|
||||
function read(state) {
|
||||
const checked = [...document.querySelectorAll('#dialog-content [name="pb-form"]:checked')].map(
|
||||
(n) => (/^\d+$/.test(n.value) ? Number(n.value) : n.value),
|
||||
);
|
||||
const gangi = document.querySelector('#dialog-content [name="pb-gangi"]').checked;
|
||||
const gangi = document.querySelector('#dialog-content [name="pb-gangi"]').checked,
|
||||
outline = document.querySelector('#dialog-content [name="pb-outline"]').checked;
|
||||
if (!checked.length) throw Error("인쇄할 서식을 하나 이상 고르세요.");
|
||||
const next = { checked, gangi };
|
||||
const next = { checked, gangi, outline };
|
||||
if (JSON.stringify(next) !== JSON.stringify(state.project.printBatch))
|
||||
EstApp.change((project) => (project.printBatch = next), false);
|
||||
return next;
|
||||
@@ -96,7 +111,18 @@ const EstPrintBatch = (() => {
|
||||
EstApp.render();
|
||||
});
|
||||
else if (name === "print-batch-preview") build(state);
|
||||
else if (name === "print-batch-print") {
|
||||
else if (name === "print-batch-all" || name === "print-batch-none")
|
||||
for (const n of document.querySelectorAll('#dialog-content [name="pb-form"]'))
|
||||
n.checked = name === "print-batch-all";
|
||||
else if (name === "print-batch-default") {
|
||||
const data = read(state);
|
||||
EstApp.api("/api/forms", post({ kind: "print", name: DEFAULT, data }))
|
||||
.then(
|
||||
() =>
|
||||
(EstApp.byId("print-batch-note").textContent = "묶음 인쇄 기본양식을 저장했습니다."),
|
||||
)
|
||||
.catch((error) => (EstApp.byId("print-batch-note").textContent = error.message));
|
||||
} else if (name === "print-batch-print") {
|
||||
const frame = build(state);
|
||||
frame.onload = () => frame.contentWindow.print();
|
||||
} else return false;
|
||||
|
||||
Reference in New Issue
Block a user