feat(inout): 옵션을 톱니 팝업으로, 겹치던 옵션 화면 정리, 공장 담당자·연락처 분리
- 옵션 탭 → 상단 오른쪽 톱니(관리자) → 팝업(탭: 담당자·공장). 내용은 /inout/settings?panel=1, 저장은 팝업 안에서(X-Inout-Options: 1 → JSON, 같은 탭 그대로 다시 그림), 바뀌면 닫을 때 새로고침. 예전 /inout/settings 주소는 목록으로 가서 팝업 열기(?options=1). - 겹침 원인: 공용 .erp-input(min-width 240px + content-box)이 좁은 칸에서 옆 칸을 덮고, .erp-table-wrap(카드 그림자·둥근 모서리)이 카드 안에서 상자를 겹쳐 보이게 함 → .io/.io-dlg 안에서만 바로잡음. 공장 표는 진짜 <table> + 입력칸 form 속성으로 열 맞춤(줄 선·배경 어긋남 없음). - 공장 담당자·연락처 분리: inout_db 002(manager 열, 이름만 있던 연락처는 담당자로). 발주서 화면에 공장 담당자·연락처. 002 미적용이어도 발주서 화면은 열리고 공장 저장만 안내. - 테스트: 팝업·JSON 저장·예전 주소·권한, 담당자/연락처, 002 전후. 실제 브라우저로 겹침 0·줄 맞춤 확인. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+70
-17
@@ -14,8 +14,8 @@
|
||||
|
||||
/* 거르기 줄 */
|
||||
.io-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
||||
.io-filter .erp-input, .io-filter .erp-select { width: auto; }
|
||||
.io-search { min-width: 220px; }
|
||||
.io-filter .erp-select { width: auto; }
|
||||
.io-search { width: 260px; }
|
||||
.io-filter input[type="date"] { width: 150px; }
|
||||
.io-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-midtone-gray); }
|
||||
.io-seg { display: inline-flex; padding: 2px; border: 1px solid var(--color-subtle-ash); border-radius: 10px; background: #fff; }
|
||||
@@ -69,7 +69,7 @@
|
||||
.io-kpis-head { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); align-self: start; min-width: 320px; }
|
||||
.io-head-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 12px; border-top: 1px solid var(--color-subtle-ash); }
|
||||
.io-head-actions form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
|
||||
.io-close-reason { width: 200px; }
|
||||
.io-close-reason { width: 220px; }
|
||||
|
||||
/* 입고 입력 */
|
||||
.io-col-no { width: 36px; color: var(--color-midtone-gray); }
|
||||
@@ -87,6 +87,7 @@
|
||||
/* 발주서 폼 */
|
||||
.io-order-form { overflow: visible; }
|
||||
.io-lines .io-col-qty { width: 130px; }
|
||||
.io-lines .erp-input { width: 100%; }
|
||||
.io-lines .io-col-del { width: 48px; text-align: center; }
|
||||
.io-lines tfoot td { padding: 10px 16px; border-top: 1px solid var(--color-subtle-ash); }
|
||||
.io-item-cell { position: relative; min-width: 320px; }
|
||||
@@ -102,23 +103,75 @@
|
||||
.io-suggest-item:hover, .io-suggest-item.is-active { background: #eef6ff; }
|
||||
.io-suggest-empty { padding: 10px 12px; font-size: 12.5px; color: var(--color-midtone-gray); white-space: normal; }
|
||||
|
||||
/* 옵션 */
|
||||
.io-settings { display: flex; flex-direction: column; gap: 14px; }
|
||||
.io-col-check { width: 90px; text-align: center !important; }
|
||||
.io-factories { padding: 6px 12px 12px; }
|
||||
.io-factory-row { display: grid; grid-template-columns: minmax(140px, 1.2fr) minmax(140px, 1.2fr) minmax(120px, 1.5fr) 70px 50px 60px auto;
|
||||
gap: 8px; align-items: center; padding: 6px 8px; margin: 0; border-bottom: 1px solid var(--color-subtle-ash); }
|
||||
.io-factory-head { font-size: 12px; color: var(--color-midtone-gray); font-weight: 500; }
|
||||
.io-factory-row .erp-input { width: 100%; min-width: 0; }
|
||||
.io-factory-row.io-inactive .erp-input { color: var(--color-midtone-gray); background: var(--color-ghost-gray); }
|
||||
.io-new-factory { border-bottom: 0; background: #fafbfc; border-radius: 8px; }
|
||||
.io-factory-btns { display: inline-flex; gap: 6px; justify-content: flex-end; }
|
||||
.io-check { display: inline-flex; justify-content: center; }
|
||||
/* ── 공용 ERP 스타일과 겹치는 부분(2026-10-16 옵션 화면 겹침) ──
|
||||
· .erp-input 은 min-width 240px + content-box 라 좁은 칸에서 옆 칸을 덮는다 → 이 모듈 안에서는 테두리 기준·최소폭 없음
|
||||
· .erp-table-wrap 은 카드 모양(그림자·둥근 모서리)이라 카드 안에 넣으면 상자가 겹쳐 보인다 → 카드 안에서는 평평하게 */
|
||||
.io *, .io *::before, .io *::after, .io-dlg *, .io-dlg *::before, .io-dlg *::after { box-sizing: border-box; }
|
||||
.io .erp-input { min-width: 0; }
|
||||
.io .erp-card-block .erp-table-wrap { border-radius: 0; box-shadow: none; background: transparent; }
|
||||
|
||||
/* 옵션 톱니(관리자) — 실적 설정 톱니처럼 둥근 아이콘 단추 */
|
||||
.io-gear { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
|
||||
border: 1px solid var(--color-subtle-ash); border-radius: 50%; background: #fff; color: #525860; cursor: pointer;
|
||||
transition: background .12s, color .12s, border-color .12s; }
|
||||
.io-gear:hover { background: var(--color-ghost-gray); color: var(--color-rich-black); border-color: #c9ccd1; }
|
||||
.io-gear:focus-visible { outline: 2px solid var(--color-rich-black); outline-offset: 2px; }
|
||||
.io-factory-who { display: block; font-size: 12px; color: var(--color-midtone-gray); margin-top: 2px; }
|
||||
|
||||
/* 옵션 팝업 */
|
||||
.io-dlg { width: min(1040px, calc(100vw - 40px)); max-height: min(760px, calc(100vh - 40px)); padding: 0; border: 1px solid var(--color-subtle-ash);
|
||||
border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .2); color: var(--color-rich-black); overflow: hidden; }
|
||||
.io-dlg[open] { display: flex; flex-direction: column; }
|
||||
.io-dlg:focus { outline: none; }
|
||||
.io-dlg-tabs button:focus-visible { outline: 2px solid var(--color-rich-black); outline-offset: -4px; border-radius: 6px; }
|
||||
.io-dlg::backdrop { background: rgba(0, 0, 0, .35); }
|
||||
.io-dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--color-subtle-ash); }
|
||||
.io-dlg-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
|
||||
.io-dlg-x { display: inline-flex; padding: 6px; border: 0; border-radius: 6px; background: none; color: #6d6e6f; cursor: pointer; }
|
||||
.io-dlg-x:hover { background: var(--color-ghost-gray); color: var(--color-rich-black); }
|
||||
.io-dlg-msg { margin: 12px 22px 0; padding: 9px 12px; border-radius: 8px; background: #e6f8e9; color: #1e7a34; border: 1px solid #c2efc8; font-size: 13px; }
|
||||
.io-dlg-msg.is-bad { background: #fbe9e6; color: #a1261b; border-color: #efc6bf; }
|
||||
.io-dlg-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 22px 18px; }
|
||||
.io-dlg-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--color-subtle-ash); margin-bottom: 14px; }
|
||||
.io-dlg-tabs button { padding: 8px 14px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none;
|
||||
font: inherit; font-size: 14px; color: var(--color-midtone-gray); cursor: pointer; }
|
||||
.io-dlg-tabs button:hover { color: var(--color-rich-black); }
|
||||
.io-dlg-tabs button.is-active { color: var(--color-rich-black); font-weight: 600; border-bottom-color: var(--color-rich-black); }
|
||||
.io-dlg-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--color-ghost-gray); font-size: 11px; text-align: center; }
|
||||
.io-dlg-body .io-help { padding: 0 0 12px; }
|
||||
.io-dlg-form { margin: 0; }
|
||||
.io-dlg-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
|
||||
.io-dlg-table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--color-midtone-gray); padding: 8px 6px; border-bottom: 1px solid var(--color-subtle-ash); white-space: nowrap; }
|
||||
.io-dlg-table td { padding: 7px 6px; border-bottom: 1px solid var(--color-subtle-ash); vertical-align: middle; }
|
||||
.io-dlg-table tbody tr:last-child td { border-bottom: 0; }
|
||||
.io-dlg-table .io-c { text-align: center; }
|
||||
.io-dlg-table td.io-c input[type="checkbox"] { width: 16px; height: 16px; }
|
||||
.io-user { display: block; font-weight: 500; }
|
||||
.io-sub { font-size: 12px; color: var(--color-midtone-gray); }
|
||||
.io-empty { text-align: center; padding: 18px; color: var(--color-midtone-gray); }
|
||||
.io-in { width: 100%; min-width: 0; padding: 6px 9px; border: 1px solid var(--color-subtle-ash); border-radius: 6px; font: inherit; font-size: 13px;
|
||||
color: var(--color-rich-black); background: #fff; }
|
||||
.io-in:focus { outline: none; border-color: var(--color-rich-black); box-shadow: 0 0 0 3px rgba(0, 0, 0, .06); }
|
||||
.io-in-num { text-align: right; }
|
||||
.io-factory-table col.w-name { width: 18%; }
|
||||
.io-factory-table col.w-man { width: 12%; }
|
||||
.io-factory-table col.w-tel { width: 18%; }
|
||||
.io-factory-table col.w-memo { width: auto; }
|
||||
.io-factory-table col.w-sort { width: 64px; }
|
||||
.io-factory-table col.w-use { width: 48px; }
|
||||
.io-factory-table col.w-cnt { width: 52px; }
|
||||
.io-factory-table col.w-btn { width: 128px; }
|
||||
.io-factory-table tr.is-inactive .io-in { background: var(--color-ghost-gray); color: var(--color-midtone-gray); }
|
||||
.io-factory-table .io-new-row td { background: #fafbfc; border-top: 1px solid var(--color-subtle-ash); }
|
||||
.io-btns { text-align: right; white-space: nowrap; } /* td 에 flex 를 주면 표 칸이 깨진다(줄 선·배경 어긋남) */
|
||||
.io-btns .erp-btn + .erp-btn { margin-left: 4px; }
|
||||
.io-dlg-actions { display: flex; justify-content: flex-end; padding-top: 12px; }
|
||||
.io-dlg-foot { margin: 14px 0 0; font-size: 12px; color: var(--color-midtone-gray); }
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.io-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
.io-head { grid-template-columns: 1fr; }
|
||||
.io-kpis-head { min-width: 0; }
|
||||
.io-factory-row { grid-template-columns: 1fr 1fr; }
|
||||
.io-factory-head { display: none; }
|
||||
.io-dlg-body { overflow-x: auto; }
|
||||
.io-factory-table { min-width: 860px; }
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
· 목록 줄 누르기 = 발주서로
|
||||
· 발주서 폼: 제품 줄 추가·지우기·번호·합계, 코드표 단품 검색(GET /inout/api/items?q=) 드롭다운
|
||||
· 발주서 화면: [남은 수량 모두 채우기], 이번 입고 합계
|
||||
· 옵션 팝업(톱니): 담당자·공장 — 열 때 내용을 받고, 저장은 제자리
|
||||
· data-erp-confirm-btn: 버튼별 확인(formaction 이 있는 버튼 — 공용 data-erp-confirm 은 form.submit() 이라 누른 버튼이 사라짐) */
|
||||
(function () {
|
||||
"use strict";
|
||||
@@ -224,4 +225,86 @@
|
||||
});
|
||||
paintTotal();
|
||||
}
|
||||
|
||||
// ── 옵션 팝업(톱니, 관리자) — 내용은 GET /inout/settings?panel=1, 저장은 제자리(X-Inout-Options: 1 → JSON) ──
|
||||
const optBtn = document.getElementById("io-options-btn");
|
||||
const optDlg = document.getElementById("io-options");
|
||||
if (optBtn && optDlg) initOptions(optBtn, optDlg);
|
||||
|
||||
function initOptions(btn, dlg) {
|
||||
const body = dlg.querySelector("#io-options-body");
|
||||
const msgEl = dlg.querySelector(".io-dlg-msg");
|
||||
let changed = false, pane = "roles";
|
||||
|
||||
function say(text, bad) {
|
||||
msgEl.textContent = text || "";
|
||||
msgEl.hidden = !text;
|
||||
msgEl.classList.toggle("is-bad", !!bad);
|
||||
}
|
||||
function showPane(name) {
|
||||
pane = name;
|
||||
body.querySelectorAll(".io-dlg-tabs [data-pane]").forEach(function (t) {
|
||||
const on = t.dataset.pane === name;
|
||||
t.classList.toggle("is-active", on);
|
||||
t.setAttribute("aria-selected", on ? "true" : "false");
|
||||
t.tabIndex = on ? 0 : -1;
|
||||
});
|
||||
body.querySelectorAll(".io-dlg-pane").forEach(function (p) { p.hidden = p.dataset.pane !== name; });
|
||||
}
|
||||
async function load() {
|
||||
const res = await fetch("/inout/settings?panel=1", { headers: { "X-Inout-Options": "1" } });
|
||||
if (!res.ok) throw new Error("HTTP " + res.status);
|
||||
body.innerHTML = await res.text();
|
||||
showPane(pane);
|
||||
}
|
||||
async function open() {
|
||||
say("");
|
||||
if (!dlg.open) dlg.showModal();
|
||||
try {
|
||||
await load();
|
||||
dlg.focus({ preventScroll: true }); // 닫기(✕)에 초점 테두리가 생기지 않게 창 자체에(Tab 으로 안으로 이동)
|
||||
} catch (_) {
|
||||
body.innerHTML = '<p class="io-error">옵션을 불러오지 못했습니다. 잠시 뒤 다시 여세요.</p>';
|
||||
}
|
||||
}
|
||||
btn.addEventListener("click", open);
|
||||
dlg.addEventListener("click", function (e) {
|
||||
if (e.target.closest("[data-close]")) { dlg.close(); return; }
|
||||
const tab = e.target.closest(".io-dlg-tabs [data-pane]");
|
||||
if (tab) showPane(tab.dataset.pane);
|
||||
});
|
||||
dlg.addEventListener("close", function () {
|
||||
const url = new URL(location.href);
|
||||
const hadParam = url.searchParams.has("options");
|
||||
url.searchParams.delete("options");
|
||||
url.searchParams.delete("msg");
|
||||
if (changed) location.href = url.toString(); // 담당 표시·공장 목록이 바뀌었을 수 있다
|
||||
else if (hadParam) history.replaceState(null, "", url.toString());
|
||||
});
|
||||
dlg.addEventListener("submit", async function (e) {
|
||||
const form = e.target;
|
||||
if (!form.classList || !form.classList.contains("io-dlg-form")) return;
|
||||
e.preventDefault();
|
||||
const sub = e.submitter;
|
||||
if (sub && sub.dataset.confirm && !(await confirmMsg(sub.dataset.confirm))) return;
|
||||
const action = sub && sub.getAttribute("formaction") ? sub.getAttribute("formaction") : form.getAttribute("action");
|
||||
const buttons = Array.from(dlg.querySelectorAll("button[type=submit]"));
|
||||
buttons.forEach(function (b) { b.disabled = true; });
|
||||
try {
|
||||
const res = await fetch(action, { method: "POST", headers: { "X-Inout-Options": "1" },
|
||||
body: new URLSearchParams(new FormData(form)) });
|
||||
let data = {};
|
||||
try { data = await res.json(); } catch (_) {}
|
||||
if (!res.ok || data.ok === false) { say(data.message || data.detail || "저장하지 못했습니다.", true); return; }
|
||||
changed = true;
|
||||
await load();
|
||||
say(data.message || "저장했습니다.");
|
||||
} catch (_) {
|
||||
say("저장하지 못했습니다(연결 오류). 다시 눌러 주세요.", true);
|
||||
} finally {
|
||||
buttons.forEach(function (b) { if (b.isConnected) b.disabled = false; });
|
||||
}
|
||||
});
|
||||
if (btn.dataset.open === "1") open();
|
||||
}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user