Compare commits
2 Commits
fc05650c2a
...
21b4459757
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21b4459757 | ||
|
|
adf1738772 |
@@ -104,6 +104,11 @@ export default function SubcontractorItemPage() {
|
||||
if (res.data?.success) optMap[col] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
}
|
||||
// 외주업체 거래유형 (subcontractor_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/${SUBCONTRACTOR_TABLE}/division/values`);
|
||||
if (res.data?.success) optMap["subcontractor_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
};
|
||||
load();
|
||||
@@ -536,7 +541,7 @@ export default function SubcontractorItemPage() {
|
||||
<TableCell className="text-center"><input type="checkbox" checked={subCheckedIds.has(s.id)} readOnly /></TableCell>
|
||||
<TableCell className="text-[13px]">{s.subcontractor_code}</TableCell>
|
||||
<TableCell className="text-sm">{s.subcontractor_name}</TableCell>
|
||||
<TableCell className="text-[13px]">{s.division}</TableCell>
|
||||
<TableCell className="text-[13px]">{resolve("subcontractor_division", s.division)}</TableCell>
|
||||
<TableCell className="text-[13px]">{s.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -286,6 +286,11 @@ export default function PurchaseItemPage() {
|
||||
} catch { /* skip */ }
|
||||
})
|
||||
);
|
||||
// 공급업체 거래유형 (supplier_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/${SUPPLIER_TABLE}/division/values`);
|
||||
if (res.data?.success) optMap["supplier_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
|
||||
// 단가 카테고리
|
||||
@@ -1700,7 +1705,7 @@ export default function PurchaseItemPage() {
|
||||
</TableCell>
|
||||
<TableCell className="text-[13px] font-mono text-muted-foreground">{c.supplier_code}</TableCell>
|
||||
<TableCell className="text-sm font-medium text-foreground">{c.supplier_name}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.division}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{resolve("supplier_division", c.division)}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -285,6 +285,11 @@ export default function SalesItemPage() {
|
||||
if (res.data?.success) optMap[col] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
}
|
||||
// 거래처 거래유형 (customer_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/customer_mng/division/values`);
|
||||
if (res.data?.success) optMap["customer_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
|
||||
// 단가 카테고리
|
||||
@@ -1702,7 +1707,7 @@ export default function SalesItemPage() {
|
||||
</TableCell>
|
||||
<TableCell className="text-[13px] font-mono text-muted-foreground">{c.customer_code}</TableCell>
|
||||
<TableCell className="text-sm font-medium text-foreground">{c.customer_name}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.division}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{resolve("customer_division", c.division)}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -104,6 +104,11 @@ export default function SubcontractorItemPage() {
|
||||
if (res.data?.success) optMap[col] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
}
|
||||
// 외주업체 거래유형 (subcontractor_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/${SUBCONTRACTOR_TABLE}/division/values`);
|
||||
if (res.data?.success) optMap["subcontractor_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
};
|
||||
load();
|
||||
@@ -536,7 +541,7 @@ export default function SubcontractorItemPage() {
|
||||
<TableCell className="text-center"><input type="checkbox" checked={subCheckedIds.has(s.id)} readOnly /></TableCell>
|
||||
<TableCell className="text-[13px]">{s.subcontractor_code}</TableCell>
|
||||
<TableCell className="text-sm">{s.subcontractor_name}</TableCell>
|
||||
<TableCell className="text-[13px]">{s.division}</TableCell>
|
||||
<TableCell className="text-[13px]">{resolve("subcontractor_division", s.division)}</TableCell>
|
||||
<TableCell className="text-[13px]">{s.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -286,6 +286,11 @@ export default function PurchaseItemPage() {
|
||||
} catch { /* skip */ }
|
||||
})
|
||||
);
|
||||
// 공급업체 거래유형 (supplier_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/${SUPPLIER_TABLE}/division/values`);
|
||||
if (res.data?.success) optMap["supplier_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
|
||||
// 단가 카테고리
|
||||
@@ -1700,7 +1705,7 @@ export default function PurchaseItemPage() {
|
||||
</TableCell>
|
||||
<TableCell className="text-[13px] font-mono text-muted-foreground">{c.supplier_code}</TableCell>
|
||||
<TableCell className="text-sm font-medium text-foreground">{c.supplier_name}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.division}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{resolve("supplier_division", c.division)}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -285,6 +285,11 @@ export default function SalesItemPage() {
|
||||
if (res.data?.success) optMap[col] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
}
|
||||
// 거래처 거래유형 (customer_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/customer_mng/division/values`);
|
||||
if (res.data?.success) optMap["customer_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
|
||||
// 단가 카테고리
|
||||
@@ -1702,7 +1707,7 @@ export default function SalesItemPage() {
|
||||
</TableCell>
|
||||
<TableCell className="text-[13px] font-mono text-muted-foreground">{c.customer_code}</TableCell>
|
||||
<TableCell className="text-sm font-medium text-foreground">{c.customer_name}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.division}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{resolve("customer_division", c.division)}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -104,6 +104,11 @@ export default function SubcontractorItemPage() {
|
||||
if (res.data?.success) optMap[col] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
}
|
||||
// 외주업체 거래유형 (subcontractor_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/${SUBCONTRACTOR_TABLE}/division/values`);
|
||||
if (res.data?.success) optMap["subcontractor_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
};
|
||||
load();
|
||||
@@ -536,7 +541,7 @@ export default function SubcontractorItemPage() {
|
||||
<TableCell className="text-center"><input type="checkbox" checked={subCheckedIds.has(s.id)} readOnly /></TableCell>
|
||||
<TableCell className="text-[13px]">{s.subcontractor_code}</TableCell>
|
||||
<TableCell className="text-sm">{s.subcontractor_name}</TableCell>
|
||||
<TableCell className="text-[13px]">{s.division}</TableCell>
|
||||
<TableCell className="text-[13px]">{resolve("subcontractor_division", s.division)}</TableCell>
|
||||
<TableCell className="text-[13px]">{s.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -286,6 +286,11 @@ export default function PurchaseItemPage() {
|
||||
} catch { /* skip */ }
|
||||
})
|
||||
);
|
||||
// 공급업체 거래유형 (supplier_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/${SUPPLIER_TABLE}/division/values`);
|
||||
if (res.data?.success) optMap["supplier_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
|
||||
// 단가 카테고리
|
||||
@@ -1700,7 +1705,7 @@ export default function PurchaseItemPage() {
|
||||
</TableCell>
|
||||
<TableCell className="text-[13px] font-mono text-muted-foreground">{c.supplier_code}</TableCell>
|
||||
<TableCell className="text-sm font-medium text-foreground">{c.supplier_name}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.division}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{resolve("supplier_division", c.division)}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -285,6 +285,11 @@ export default function SalesItemPage() {
|
||||
if (res.data?.success) optMap[col] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
}
|
||||
// 거래처 거래유형 (customer_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/customer_mng/division/values`);
|
||||
if (res.data?.success) optMap["customer_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
|
||||
// 단가 카테고리
|
||||
@@ -1702,7 +1707,7 @@ export default function SalesItemPage() {
|
||||
</TableCell>
|
||||
<TableCell className="text-[13px] font-mono text-muted-foreground">{c.customer_code}</TableCell>
|
||||
<TableCell className="text-sm font-medium text-foreground">{c.customer_name}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.division}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{resolve("customer_division", c.division)}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -104,6 +104,11 @@ export default function SubcontractorItemPage() {
|
||||
if (res.data?.success) optMap[col] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
}
|
||||
// 외주업체 거래유형 (subcontractor_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/${SUBCONTRACTOR_TABLE}/division/values`);
|
||||
if (res.data?.success) optMap["subcontractor_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
};
|
||||
load();
|
||||
@@ -536,7 +541,7 @@ export default function SubcontractorItemPage() {
|
||||
<TableCell className="text-center"><input type="checkbox" checked={subCheckedIds.has(s.id)} readOnly /></TableCell>
|
||||
<TableCell className="text-[13px]">{s.subcontractor_code}</TableCell>
|
||||
<TableCell className="text-sm">{s.subcontractor_name}</TableCell>
|
||||
<TableCell className="text-[13px]">{s.division}</TableCell>
|
||||
<TableCell className="text-[13px]">{resolve("subcontractor_division", s.division)}</TableCell>
|
||||
<TableCell className="text-[13px]">{s.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -142,10 +142,6 @@ const FORM_FIELDS = [
|
||||
{ key: "division", label: "관리품목", type: "multi-category" },
|
||||
{ key: "type", label: "품목구분", type: "category" },
|
||||
{ key: "size", label: "규격", type: "text" },
|
||||
{ key: "width", label: "가로", type: "text", placeholder: "숫자 입력 (mm)" },
|
||||
{ key: "height", label: "세로", type: "text", placeholder: "숫자 입력 (mm)" },
|
||||
{ key: "thickness", label: "두께", type: "text", placeholder: "숫자 입력 (mm)" },
|
||||
{ key: "area", label: "면적", type: "text", placeholder: "숫자 입력 (㎡)" },
|
||||
{ key: "unit", label: "단위", type: "category" },
|
||||
{ key: "material", label: "재질", type: "category" },
|
||||
{ key: "status", label: "상태", type: "category" },
|
||||
@@ -179,10 +175,6 @@ const ITEM_GRID_COLUMNS = [
|
||||
{ key: "item_number", label: "품번" },
|
||||
{ key: "item_name", label: "품명" },
|
||||
{ key: "size", label: "규격" },
|
||||
{ key: "width", label: "가로" },
|
||||
{ key: "height", label: "세로" },
|
||||
{ key: "thickness", label: "두께" },
|
||||
{ key: "area", label: "면적" },
|
||||
{ key: "unit", label: "단위" },
|
||||
{ key: "standard_price", label: "기준단가/구매단가" },
|
||||
{ key: "currency_code", label: "통화" },
|
||||
@@ -294,6 +286,11 @@ export default function PurchaseItemPage() {
|
||||
} catch { /* skip */ }
|
||||
})
|
||||
);
|
||||
// 공급업체 거래유형 (supplier_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/${SUPPLIER_TABLE}/division/values`);
|
||||
if (res.data?.success) optMap["supplier_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
|
||||
// 단가 카테고리
|
||||
@@ -1613,25 +1610,9 @@ export default function PurchaseItemPage() {
|
||||
) : (
|
||||
<Input
|
||||
value={formData[field.key] || ""}
|
||||
readOnly={field.key === "area"}
|
||||
onChange={(e) => {
|
||||
if (field.key === "area") return;
|
||||
const v = e.target.value;
|
||||
setFormData((prev) => {
|
||||
const next = { ...prev, [field.key]: v };
|
||||
// 가로/세로 변경 시 면적(㎡) 자동 계산: (가로mm × 세로mm) / 1,000,000
|
||||
if (field.key === "width" || field.key === "height") {
|
||||
const w = Number(field.key === "width" ? v : prev.width);
|
||||
const h = Number(field.key === "height" ? v : prev.height);
|
||||
if (!isNaN(w) && !isNaN(h) && w > 0 && h > 0) {
|
||||
next.area = ((w * h) / 1_000_000).toFixed(4);
|
||||
}
|
||||
}
|
||||
return next;
|
||||
});
|
||||
}}
|
||||
placeholder={field.key === "area" ? "자동 계산" : ("placeholder" in field ? field.placeholder : field.label)}
|
||||
className={cn("h-9", field.key === "area" && "bg-muted cursor-not-allowed")}
|
||||
onChange={(e) => setFormData((prev) => ({ ...prev, [field.key]: e.target.value }))}
|
||||
placeholder={"placeholder" in field ? field.placeholder : field.label}
|
||||
className="h-9"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
@@ -1724,7 +1705,7 @@ export default function PurchaseItemPage() {
|
||||
</TableCell>
|
||||
<TableCell className="text-[13px] font-mono text-muted-foreground">{c.supplier_code}</TableCell>
|
||||
<TableCell className="text-sm font-medium text-foreground">{c.supplier_name}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.division}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{resolve("supplier_division", c.division)}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -285,6 +285,11 @@ export default function SalesItemPage() {
|
||||
if (res.data?.success) optMap[col] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
}
|
||||
// 거래처 거래유형 (customer_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/customer_mng/division/values`);
|
||||
if (res.data?.success) optMap["customer_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
|
||||
// 단가 카테고리
|
||||
@@ -1702,7 +1707,7 @@ export default function SalesItemPage() {
|
||||
</TableCell>
|
||||
<TableCell className="text-[13px] font-mono text-muted-foreground">{c.customer_code}</TableCell>
|
||||
<TableCell className="text-sm font-medium text-foreground">{c.customer_name}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.division}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{resolve("customer_division", c.division)}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -104,6 +104,11 @@ export default function SubcontractorItemPage() {
|
||||
if (res.data?.success) optMap[col] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
}
|
||||
// 외주업체 거래유형 (subcontractor_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/${SUBCONTRACTOR_TABLE}/division/values`);
|
||||
if (res.data?.success) optMap["subcontractor_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
};
|
||||
load();
|
||||
@@ -536,7 +541,7 @@ export default function SubcontractorItemPage() {
|
||||
<TableCell className="text-center"><input type="checkbox" checked={subCheckedIds.has(s.id)} readOnly /></TableCell>
|
||||
<TableCell className="text-[13px]">{s.subcontractor_code}</TableCell>
|
||||
<TableCell className="text-sm">{s.subcontractor_name}</TableCell>
|
||||
<TableCell className="text-[13px]">{s.division}</TableCell>
|
||||
<TableCell className="text-[13px]">{resolve("subcontractor_division", s.division)}</TableCell>
|
||||
<TableCell className="text-[13px]">{s.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -286,6 +286,11 @@ export default function PurchaseItemPage() {
|
||||
} catch { /* skip */ }
|
||||
})
|
||||
);
|
||||
// 공급업체 거래유형 (supplier_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/${SUPPLIER_TABLE}/division/values`);
|
||||
if (res.data?.success) optMap["supplier_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
|
||||
// 단가 카테고리
|
||||
@@ -1700,7 +1705,7 @@ export default function PurchaseItemPage() {
|
||||
</TableCell>
|
||||
<TableCell className="text-[13px] font-mono text-muted-foreground">{c.supplier_code}</TableCell>
|
||||
<TableCell className="text-sm font-medium text-foreground">{c.supplier_name}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.division}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{resolve("supplier_division", c.division)}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -285,6 +285,11 @@ export default function SalesItemPage() {
|
||||
if (res.data?.success) optMap[col] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
}
|
||||
// 거래처 거래유형 (customer_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/customer_mng/division/values`);
|
||||
if (res.data?.success) optMap["customer_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
|
||||
// 단가 카테고리
|
||||
@@ -1702,7 +1707,7 @@ export default function SalesItemPage() {
|
||||
</TableCell>
|
||||
<TableCell className="text-[13px] font-mono text-muted-foreground">{c.customer_code}</TableCell>
|
||||
<TableCell className="text-sm font-medium text-foreground">{c.customer_name}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.division}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{resolve("customer_division", c.division)}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -104,6 +104,11 @@ export default function SubcontractorItemPage() {
|
||||
if (res.data?.success) optMap[col] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
}
|
||||
// 외주업체 거래유형 (subcontractor_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/${SUBCONTRACTOR_TABLE}/division/values`);
|
||||
if (res.data?.success) optMap["subcontractor_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
};
|
||||
load();
|
||||
@@ -536,7 +541,7 @@ export default function SubcontractorItemPage() {
|
||||
<TableCell className="text-center"><input type="checkbox" checked={subCheckedIds.has(s.id)} readOnly /></TableCell>
|
||||
<TableCell className="text-[13px]">{s.subcontractor_code}</TableCell>
|
||||
<TableCell className="text-sm">{s.subcontractor_name}</TableCell>
|
||||
<TableCell className="text-[13px]">{s.division}</TableCell>
|
||||
<TableCell className="text-[13px]">{resolve("subcontractor_division", s.division)}</TableCell>
|
||||
<TableCell className="text-[13px]">{s.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -286,6 +286,11 @@ export default function PurchaseItemPage() {
|
||||
} catch { /* skip */ }
|
||||
})
|
||||
);
|
||||
// 공급업체 거래유형 (supplier_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/${SUPPLIER_TABLE}/division/values`);
|
||||
if (res.data?.success) optMap["supplier_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
|
||||
// 단가 카테고리
|
||||
@@ -1700,7 +1705,7 @@ export default function PurchaseItemPage() {
|
||||
</TableCell>
|
||||
<TableCell className="text-[13px] font-mono text-muted-foreground">{c.supplier_code}</TableCell>
|
||||
<TableCell className="text-sm font-medium text-foreground">{c.supplier_name}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.division}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{resolve("supplier_division", c.division)}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -285,6 +285,11 @@ export default function SalesItemPage() {
|
||||
if (res.data?.success) optMap[col] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
}
|
||||
// 거래처 거래유형 (customer_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/customer_mng/division/values`);
|
||||
if (res.data?.success) optMap["customer_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
|
||||
// 단가 카테고리
|
||||
@@ -1702,7 +1707,7 @@ export default function SalesItemPage() {
|
||||
</TableCell>
|
||||
<TableCell className="text-[13px] font-mono text-muted-foreground">{c.customer_code}</TableCell>
|
||||
<TableCell className="text-sm font-medium text-foreground">{c.customer_name}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.division}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{resolve("customer_division", c.division)}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -104,6 +104,11 @@ export default function SubcontractorItemPage() {
|
||||
if (res.data?.success) optMap[col] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
}
|
||||
// 외주업체 거래유형 (subcontractor_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/${SUBCONTRACTOR_TABLE}/division/values`);
|
||||
if (res.data?.success) optMap["subcontractor_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
};
|
||||
load();
|
||||
@@ -536,7 +541,7 @@ export default function SubcontractorItemPage() {
|
||||
<TableCell className="text-center"><input type="checkbox" checked={subCheckedIds.has(s.id)} readOnly /></TableCell>
|
||||
<TableCell className="text-[13px]">{s.subcontractor_code}</TableCell>
|
||||
<TableCell className="text-sm">{s.subcontractor_name}</TableCell>
|
||||
<TableCell className="text-[13px]">{s.division}</TableCell>
|
||||
<TableCell className="text-[13px]">{resolve("subcontractor_division", s.division)}</TableCell>
|
||||
<TableCell className="text-[13px]">{s.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -142,10 +142,6 @@ const FORM_FIELDS = [
|
||||
{ key: "division", label: "관리품목", type: "multi-category" },
|
||||
{ key: "type", label: "품목구분", type: "category" },
|
||||
{ key: "size", label: "규격", type: "text" },
|
||||
{ key: "width", label: "가로", type: "text", placeholder: "숫자 입력 (mm)" },
|
||||
{ key: "height", label: "세로", type: "text", placeholder: "숫자 입력 (mm)" },
|
||||
{ key: "thickness", label: "두께", type: "text", placeholder: "숫자 입력 (mm)" },
|
||||
{ key: "area", label: "면적", type: "text", placeholder: "숫자 입력 (㎡)" },
|
||||
{ key: "unit", label: "단위", type: "category" },
|
||||
{ key: "material", label: "재질", type: "category" },
|
||||
{ key: "status", label: "상태", type: "category" },
|
||||
@@ -179,10 +175,6 @@ const ITEM_GRID_COLUMNS = [
|
||||
{ key: "item_number", label: "품번" },
|
||||
{ key: "item_name", label: "품명" },
|
||||
{ key: "size", label: "규격" },
|
||||
{ key: "width", label: "가로" },
|
||||
{ key: "height", label: "세로" },
|
||||
{ key: "thickness", label: "두께" },
|
||||
{ key: "area", label: "면적" },
|
||||
{ key: "unit", label: "단위" },
|
||||
{ key: "standard_price", label: "기준단가/구매단가" },
|
||||
{ key: "currency_code", label: "통화" },
|
||||
@@ -294,6 +286,11 @@ export default function PurchaseItemPage() {
|
||||
} catch { /* skip */ }
|
||||
})
|
||||
);
|
||||
// 공급업체 거래유형 (supplier_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/${SUPPLIER_TABLE}/division/values`);
|
||||
if (res.data?.success) optMap["supplier_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
|
||||
// 단가 카테고리
|
||||
@@ -1613,25 +1610,9 @@ export default function PurchaseItemPage() {
|
||||
) : (
|
||||
<Input
|
||||
value={formData[field.key] || ""}
|
||||
readOnly={field.key === "area"}
|
||||
onChange={(e) => {
|
||||
if (field.key === "area") return;
|
||||
const v = e.target.value;
|
||||
setFormData((prev) => {
|
||||
const next = { ...prev, [field.key]: v };
|
||||
// 가로/세로 변경 시 면적(㎡) 자동 계산: (가로mm × 세로mm) / 1,000,000
|
||||
if (field.key === "width" || field.key === "height") {
|
||||
const w = Number(field.key === "width" ? v : prev.width);
|
||||
const h = Number(field.key === "height" ? v : prev.height);
|
||||
if (!isNaN(w) && !isNaN(h) && w > 0 && h > 0) {
|
||||
next.area = ((w * h) / 1_000_000).toFixed(4);
|
||||
}
|
||||
}
|
||||
return next;
|
||||
});
|
||||
}}
|
||||
placeholder={field.key === "area" ? "자동 계산" : ("placeholder" in field ? field.placeholder : field.label)}
|
||||
className={cn("h-9", field.key === "area" && "bg-muted cursor-not-allowed")}
|
||||
onChange={(e) => setFormData((prev) => ({ ...prev, [field.key]: e.target.value }))}
|
||||
placeholder={"placeholder" in field ? field.placeholder : field.label}
|
||||
className="h-9"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
@@ -1724,7 +1705,7 @@ export default function PurchaseItemPage() {
|
||||
</TableCell>
|
||||
<TableCell className="text-[13px] font-mono text-muted-foreground">{c.supplier_code}</TableCell>
|
||||
<TableCell className="text-sm font-medium text-foreground">{c.supplier_name}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.division}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{resolve("supplier_division", c.division)}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
@@ -285,6 +285,11 @@ export default function SalesItemPage() {
|
||||
if (res.data?.success) optMap[col] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
}
|
||||
// 거래처 거래유형 (customer_mng.division)
|
||||
try {
|
||||
const res = await apiClient.get(`/table-categories/customer_mng/division/values`);
|
||||
if (res.data?.success) optMap["customer_division"] = flatten(res.data.data || []);
|
||||
} catch { /* skip */ }
|
||||
setCategoryOptions(optMap);
|
||||
|
||||
// 단가 카테고리
|
||||
@@ -1702,7 +1707,7 @@ export default function SalesItemPage() {
|
||||
</TableCell>
|
||||
<TableCell className="text-[13px] font-mono text-muted-foreground">{c.customer_code}</TableCell>
|
||||
<TableCell className="text-sm font-medium text-foreground">{c.customer_name}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.division}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{resolve("customer_division", c.division)}</TableCell>
|
||||
<TableCell className="text-[13px] text-muted-foreground">{c.contact_person}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user