Files
distribution_erp/src/app/(main)/inventory/history/page.tsx
T
chpark 6af863199f feat: 모모유통 유통관리 ERP (Next.js 16) — MOMO 브랜딩 + distribution DB + momo.junggomoa.com
- fito-nextjs 기반으로 재구성
- 로그인: MOMO 로고 + 모모유통 + 유통관리 ERP, 하단에 본사/지사 주소 표시
- 사이드바 상단: MOMO 아이콘 + 모모유통 + 유통관리 ERP
- 파비콘: /src/app/icon.svg (MOMO 그린 배지)
- layout.tsx title: 모모유통 | 유통관리 ERP
- DB: 183.99.177.40:5432/distribution (fito 스키마 import 완료)
- Traefik: Host(momo.junggomoa.com), 컨테이너 momo-erp
2026-04-25 02:44:40 +09:00

44 lines
1.7 KiB
TypeScript

"use client";
import { useState, useEffect, useCallback } from "react";
import { useSearchParams } from "next/navigation";
import { DataGrid, type GridColumn } from "@/components/grid/data-grid";
import { Button } from "@/components/ui/button";
// 재고 입출고 이력 팝업
export default function InventoryHistoryPage() {
const searchParams = useSearchParams();
const objId = searchParams.get("objId") || "";
const [data, setData] = useState<Record<string, unknown>[]>([]);
const fetchData = useCallback(async () => {
if (!objId) return;
const res = await fetch("/api/inventory/history", {
method: "POST", headers: { "Content-Type": "application/json" },
body: JSON.stringify({ parent_objid: objId }),
});
if (res.ok) { const json = await res.json(); setData(json.RESULTLIST || []); }
}, [objId]);
useEffect(() => { fetchData(); }, [fetchData]);
const columns: GridColumn[] = [
{ title: "유형", field: "TYPE", width: 80, hozAlign: "center" },
{ title: "수량", field: "QTY", width: 100, hozAlign: "right", formatter: "money" },
{ title: "일자", field: "HIST_DATE", width: 110, hozAlign: "center" },
{ title: "위치", field: "LOCATION_NAME", width: 100, hozAlign: "center" },
{ title: "등록자", field: "WRITER_NAME", width: 90, hozAlign: "center" },
{ title: "비고", field: "REMARK", hozAlign: "left" },
];
return (
<div className="p-4">
<h2 className="text-lg font-bold text-gray-800 mb-3"> </h2>
<DataGrid columns={columns} data={data} />
<div className="flex justify-end mt-3">
<Button variant="secondary" onClick={() => window.close()}></Button>
</div>
</div>
);
}