feat(cupang): 출고리스트 작성 팝업 — 입고센터별 카드 배경색

센터를 고르면 카드 배경·왼쪽 띠·제목 색이 센터마다 달라진다(팝업에 나온 순서대로 8색, 같은 센터는 같은 색, 미선택은 회색).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-23 16:31:10 +09:00
parent c590e0fabe
commit 248782fffb
5 changed files with 54 additions and 6 deletions
+22 -1
View File
@@ -2,6 +2,7 @@
- 날짜 칸: 프로젝트 화면의 날짜 팝업(window.PJLib.enhanceDateInput)을 그대로 쓴다.
- 입고센터 카드: 하루에 센터가 여럿일 수 있어 센터마다 출고방식(기본 택배)·제품·출고를 따로 입력한다
(#cpg-ol-center-tpl 템플릿, [+ 입고센터 추가]). 작성일·출고일·센터입고일·작업자는 공통.
카드 배경색은 센터마다 다르다(recolor — 같은 센터는 같은 색, 미선택은 회색).
- 입고센터 후보: 출고리스트 엑셀(구글 드라이브 .xlsx)에 적힌 센터 + 설정에 등록된 센터(GET /cupang/api/outbound-sheet/centers).
- 제품: 코드표(itemcode_db) 전체 목록(GET /cupang/api/products/all)에서 코드·이름으로 찾아 추가.
- [완료] → POST /cupang/api/outbound-sheet?stream=1 → 서버가 단계별 진행률을 한 줄씩(NDJSON) 보내면 막대·%로 표시,
@@ -108,6 +109,23 @@
c.no.textContent = "입고센터 " + (i + 1);
c.del.hidden = cardList.length < 2;
});
recolor();
}
// 센터마다 카드 배경색(data-tone 0~7, cupang.css) — 팝업에 나온 순서대로 배정해 다른 센터끼리 겹치지 않게,
// 같은 센터를 두 카드에서 고르면 같은 색, 아직 안 고른 카드는 회색(data-tone 없음).
var TONES = 8;
function centerOf(c) {
return c.centerSel.value === NEW_CENTER ? c.centerNew.value.trim() : c.centerSel.value;
}
function recolor() {
var order = [];
cardList.forEach(function (c) {
var name = centerOf(c);
if (!name) { delete c.el.dataset.tone; return; }
if (order.indexOf(name) < 0) order.push(name);
c.el.dataset.tone = String(order.indexOf(name) % TONES);
});
}
function createCard() {
@@ -145,11 +163,14 @@
add(NEW_CENTER, "+ 직접 입력");
if (keep && (keep === NEW_CENTER || centerNames.indexOf(keep) >= 0)) sel.value = keep;
card.centerCustom.hidden = sel.value !== NEW_CENTER;
recolor();
};
card.centerSel.addEventListener("change", function () {
card.centerCustom.hidden = card.centerSel.value !== NEW_CENTER;
if (!card.centerCustom.hidden) card.centerNew.focus();
recolor();
});
card.centerNew.addEventListener("input", recolor);
// 제품 검색(코드표)
var hits = [], activeHit = -1;
@@ -261,7 +282,7 @@
card.collect = function (no) {
var label = cardList.length > 1 ? "입고센터 " + no + ": " : "";
var center = card.centerSel.value === NEW_CENTER ? card.centerNew.value.trim() : card.centerSel.value;
var center = centerOf(card);
var lines = Array.prototype.map.call(card.linesBody.children, function (tr) {
return { code: tr.dataset.code, name: tr.dataset.name, quantity: tr.querySelector(".cpg-ol-qty").value };
});
+13 -2
View File
@@ -1651,11 +1651,22 @@ a.cpg-boxno-dl:hover { background: #1a5c38; border-color: #1a5c38; font-weight:
/* 입고센터 카드 — 센터마다 출고방식·제품·출고 */
.cpg-ol-centers { display: flex; flex-direction: column; gap: 10px; }
.cpg-ol-center {
--ol-bg: #f6f7f8; --ol-line: var(--color-subtle-ash); --ol-ink: var(--color-midtone-gray);
display: flex; flex-direction: column; gap: 10px; padding: 12px;
border: 1px solid var(--color-subtle-ash); border-radius: 10px; background: #f7faf8;
border: 1px solid var(--ol-line); border-left: 4px solid var(--ol-line); border-radius: 10px; background: var(--ol-bg);
transition: background-color .15s, border-color .15s;
}
/* 입고센터마다 다른 색(cupang-outbound.js 가 팝업에 나온 순서대로 data-tone 0~7, 같은 센터는 같은 색, 미선택은 회색) */
.cpg-ol-center[data-tone="0"] { --ol-bg: #eef7f1; --ol-line: #9fd0b1; --ol-ink: #217346; }
.cpg-ol-center[data-tone="1"] { --ol-bg: #eef4fc; --ol-line: #a8c4ec; --ol-ink: #1f5fae; }
.cpg-ol-center[data-tone="2"] { --ol-bg: #fdf3e8; --ol-line: #efc595; --ol-ink: #a8590f; }
.cpg-ol-center[data-tone="3"] { --ol-bg: #f4effb; --ol-line: #cbb6ec; --ol-ink: #6b3fb0; }
.cpg-ol-center[data-tone="4"] { --ol-bg: #eaf7f7; --ol-line: #99d3d3; --ol-ink: #137a7a; }
.cpg-ol-center[data-tone="5"] { --ol-bg: #fceef3; --ol-line: #ecb2c8; --ol-ink: #b0306a; }
.cpg-ol-center[data-tone="6"] { --ol-bg: #fbf7e3; --ol-line: #e0cf7c; --ol-ink: #806a00; }
.cpg-ol-center[data-tone="7"] { --ol-bg: #eff1f4; --ol-line: #b9c1cc; --ol-ink: #3f4a5a; }
.cpg-ol-center-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cpg-ol-center-no { font-size: 14px; color: #217346; }
.cpg-ol-center-no { font-size: 14px; color: var(--ol-ink); }
.cpg-ol-center-del[hidden] { display: none; }
.cpg-ol-add-center { align-self: flex-start; }
/* 완료 진행 막대 */