수요매칭검토, 재이용검토이력 화면 퍼블리싱

This commit is contained in:
jyha00
2025-06-04 16:17:40 +09:00
parent 0952750773
commit 103defd700
7 changed files with 918 additions and 17 deletions
+330 -11
View File
@@ -1,14 +1,42 @@
"use client";
import { useWrStore } from "@/app/store";
import { ContentsDiv, ScrollArea, SearchDiv, SearchFormLeft, SearchFormRight, SearchInput, Title, UiTable } from "@common/business_components/ui";
import { formTableName } from "@/components/lib/class/comClass";
import { ContentsDiv, Form, FormField, FormUi, ScrollArea, SearchDiv, SearchFormLeft, SearchFormRight, SearchInput, SelectBox, Title, UiTable } from "@common/business_components/ui";
import ListDiv from "@common/business_components/ui/list_div";
import { Button, Label } from "@common/components/ui";
import { Button, DatePicker, Input, Label } from "@common/components/ui";
import { zodResolver } from "@hookform/resolvers/zod";
import { useState } from "react";
import { useFieldArray, useForm } from "react-hook-form";
import { z } from "zod";
export default function coMatRvw() {
const { code, coRvw, } = useWrStore((state) => state);
const { coRvwHeadList, } = coRvw;
const { coRvw, } = useWrStore((state) => state);
const { coRvwHeadList, } = coRvw;
const [fromDate, setFromDate] = useState<Date>(new Date());
const [toDate, setToDate] = useState<Date>(new Date());
const schema = z.object({
fcltCpct: z.number().optional(),
});
const form = useForm<z.infer<typeof schema>>({
resolver: zodResolver(schema),
defaultValues: {
fcltCpct: 0,
}
});
const {
fields: [],
append,
remove,
} = useFieldArray({
control: form.control,
name: "",
});
return (
<>
<ContentsDiv>
@@ -17,12 +45,42 @@ export default function coMatRvw() {
<Title title={"수요매칭검토"} />
<SearchDiv>
<SearchFormLeft>
<div className="col-span-2 flex flex-row space-x-2">
<Label className="w-28 mt-2 text-xl text-gray-600">{'시설명'}</Label>
<div className="col-span-8 flex flex-row">
<SelectBox
className="col-span-2 w-1/3 h-full text-2xl"
label="시도"
selectClass={""}
selectArray={[]}
value={""}
onSelectValue={(val: string | number) => { }
}
/>
<SelectBox
className="col-span-2 w-1/3 h-full text-2xl"
label="시군구"
selectClass={""}
selectArray={[]}
value={""}
onSelectValue={(val: string | number) => { }
}
/>
<div className="col-span-5 w-full">
<div className="flex flex-row items-center">
<Label className="text-xl text-gray-600">수요신청년도</Label>
<div className="flex flex-row">
<DatePicker mode={'single'}
selected={fromDate}
onSelect={(date: Date | undefined) => { if (date) setFromDate(date) }} />
<span>~</span>
<DatePicker mode={'single'}
selected={toDate}
onSelect={(date: Date | undefined) => { if (date) setToDate(date) }} />
</div>
</div>
</div>
<SearchInput
className={"w-full text-2xl"}
label=""
className={"text-2xl"}
label="회사명"
textValue={""}
setText={(e) => {
}}
@@ -50,7 +108,7 @@ export default function coMatRvw() {
<div className="col-span-6">
<ListDiv>
<UiTable
headName={[]}
headName={"수요매칭검토현황"}
tableData={[]}
children={undefined}
headlist={coRvwHeadList}
@@ -60,10 +118,271 @@ export default function coMatRvw() {
}}
onPageChange={() => { }}
></UiTable>
<hr />
<Form {...form}>
<h3 className="mt-4 ml-2 text-2xl font-medium text-label">표준공사비 산정</h3>
<div className="flex items-center mx-3 mb-3">
<h1 className="">처리시설 표준공사비 산정</h1>
<Button
size={"sm"}
onClick={(e) => { }}
>
계산
</Button>
<Button
size={"sm"}
onClick={(e) => { }}
>
저장
</Button>
</div>
<div className="grid grid-cols-12 gap-4 ml-4 mr-4">
<div className="col-span-3 mt-4">
<FormField
control={form.control}
name=""
render={({ field }) => (
<FormUi label="용도">
<Input
placeholder=""
type="text"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
value={field.value ?? ""}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3 mt-4">
<FormField
control={form.control}
name=""
render={({ field }) => (
<FormUi label="요구수량(M3/d)">
<Input
placeholder=""
type="number"
step="0.1"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
value={field.value ?? 0}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3 mt-4">
<Label className="">용도에 따른 처리공정<i className="diveicon di-search" /></Label>
<FormField
control={form.control}
name=""
render={({ field }) => (
<FormUi label="">
<Input
placeholder=""
type="text"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
value={field.value || ""}
className="mt-2"
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3 mt-4">
<FormField
control={form.control}
name=""
render={({ field }) => (
<FormUi label="처리시설 용량(요구수량 * 365일)">
<Input
placeholder=""
type="number"
step="0.001"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
value={field.value ?? 0}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3 mt-4">
<div className="flex items-center justify-between">
<Label>처리시설용량에 따른 공사비(백만원)</Label>
<Button
size={"sm"}
onClick={(e) => { }}
className="bg-none"
>
공사비 산정표 보기
</Button>
</div>
<FormField
control={form.control}
name=""
render={({ field }) => (
<FormUi label="">
<Input
placeholder=""
type="number"
step="0.001"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
value={field.value ?? 0}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3 mt-4">
<div className="flex items-center justify-between">
<Label>시설부대경비 요율(%)</Label>
<Button
size={"sm"}
onClick={(e) => { }}
>
요율표 보기
</Button>
</div>
<FormField
control={form.control}
name=""
render={({ field }) => (
<FormUi label="">
<Input
placeholder=""
type="number"
step="0.01"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
value={field.value ?? 0}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3 mt-4">
<Label>총사업비 (백만원)<i className="diveicon di-search" /></Label>
<FormField
control={form.control}
name=""
render={({ field }) => (
<FormUi label="">
<Input
placeholder=""
className="mt-2"
type="number"
step="0.01"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
value={field.value ?? 0}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3 mt-4">
<div className="flex items-center justify-between">
<Label>공급처 선정</Label>
<Button
size={"sm"}
onClick={(e) => { }}
className="bg-none"
>
후보지 선택
</Button>
</div>
<FormField
control={form.control}
name=""
render={({ field }) => (
<FormUi label="">
<Input
placeholder=""
type="text"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
value={field.value ?? ""}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-4 mt-4">
<div>
<FormField
control={form.control}
name=""
render={({ field }) => (
<FormUi label="공급관로 표준공사비(백만원)">
<Input
placeholder=""
type="text"
step="0.001"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
value={field.value ?? 0}
/>
</FormUi>
)}
/>
</div>
<div className="mt-4">
<Label>관로 표준공사비 산정 프로그램</Label>
<Button
size={"sm"}
onClick={(e) => { }}
className="bg-none"
>
다운로드
</Button>
</div>
<div className="col-span-4 mt-4">
<FormField
control={form.control}
name=""
render={({ field }) => (
<Label className="text-xl">처리시설 + 공급관로 총사업비(백만원)
<FormUi label="">
<Input
placeholder=""
type="text"
step="0.001"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
readOnly={true}
value={field.value ?? 0}
/>
</FormUi>
</Label>
)}
/>
</div>
</div>
</div>
</Form>
</ListDiv>
</div>
</div>
</ContentsDiv>
</ContentsDiv >
</>
)
}
@@ -0,0 +1,353 @@
"use client";
import { useWrStore } from "@/app/store";
import { formTableName } from "@/components/lib/class/comClass";
import { ContentsDiv, Form, FormField, FormUi, ScrollArea, SearchDiv, SearchFormLeft, SearchFormRight, SearchInput, SelectBox, Title, UiTable } from "@common/business_components/ui";
import ListDiv from "@common/business_components/ui/list_div";
import { Button, DatePicker, Input, Label } from "@common/components/ui";
import { zodResolver } from "@hookform/resolvers/zod";
import { useState } from "react";
import { useFieldArray, useForm } from "react-hook-form";
import { z } from "zod";
export default function ruseRvwHstry() {
const { ruseHstry, } = useWrStore((state) => state);
const { ruseHstryHeadList, } = ruseHstry;
const [fromDate, setFromDate] = useState<Date>(new Date());
const [toDate, setToDate] = useState<Date>(new Date());
const schema = z.object({
fcltCpct: z.number().optional(),
});
const form = useForm<z.infer<typeof schema>>({
resolver: zodResolver(schema),
defaultValues: {
fcltCpct: 0,
}
});
const {
fields: [],
append,
remove,
} = useFieldArray({
control: form.control,
name: "",
});
return (
<>
<ContentsDiv>
<div className="grid grid-cols-4 gap-4">
<div className="col-span-4">
<Title title={"재이용검토이력"} />
<SearchDiv>
<SearchFormLeft>
<div className="col-span-8 flex flex-row">
<SelectBox
className="col-span-2 w-1/3 h-full text-2xl"
label="시도"
selectClass={""}
selectArray={[]}
value={""}
onSelectValue={(val: string | number) => { }
}
/>
<SelectBox
className="col-span-2 w-1/3 h-full text-2xl"
label="시군구"
selectClass={""}
selectArray={[]}
value={""}
onSelectValue={(val: string | number) => { }
}
/>
<div className="col-span-5 w-full">
<div className="flex flex-row items-center">
<Label className="text-xl text-gray-600">수요신청년도</Label>
<div className="flex flex-row">
<DatePicker mode={'single'}
className="w-full"
selected={fromDate}
onSelect={(date: Date | undefined) => { if (date) setFromDate(date) }} />
<span>~</span>
<DatePicker mode={'single'}
selected={toDate}
onSelect={(date: Date | undefined) => { if (date) setToDate(date) }} />
</div>
</div>
</div>
<SearchInput
className={"text-2xl"}
label="시설명"
textValue={""}
setText={(e) => {
}}
/>
<SearchInput
className={"text-2xl"}
label="회사명"
textValue={""}
setText={(e) => {
}}
/>
</div>
</SearchFormLeft>
<SearchFormRight
className="w-2/12 mx-5 flex flex-col items-center justify-center space-x-2 ">
<div className="space-y">
<div className="flex flex-row space-x-2">
<Button
size={"sm"}
onClick={(e) => { }}
>
조회
</Button>
<Button
size={"sm"}
onClick={(e) => { }}
>
검토완료
</Button>
</div>
</div>
</SearchFormRight>
</SearchDiv>
</div>
</div>
<div className="grid grid-cols-6 gap-4 ">
<div className="col-span-6">
<ListDiv>
<UiTable
headName={"재이용검토현황"}
tableData={[]}
children={undefined}
headlist={ruseHstryHeadList}
pageSize={20}
total={100000}
cellClick={(index: number | undefined, headId: string) => {
}}
onPageChange={() => { }}
></UiTable>
<hr />
<Form {...form}>
<h3 className="mt-4 ml-2 text-2xl font-medium text-label">수요신청 상세현황</h3>
<h1 className="mt-1 ml-3">표준공사비 산정</h1>
<div className="flex items-center mx-3 mb-3">
<h1 className="">처리시설 표준공사비 산정</h1>
<Button
size={"sm"}
onClick={(e) => { }}
>
재계산
</Button>
<Button
size={"sm"}
onClick={(e) => { }}
>
저장
</Button>
</div>
<div className="grid grid-cols-12 gap-4 ml-4 mr-4">
<div className="col-span-3 mt-4">
<FormField
control={form.control}
name=""
render={({ field }) => (
<FormUi label="용도">
<Input
placeholder=""
type="text"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
value={field.value ?? ""}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3 mt-4">
<FormField
control={form.control}
name=""
render={({ field }) => (
<FormUi label="요구수량(M3/d)">
<Input
placeholder=""
type="number"
step="0.1"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
value={field.value ?? 0}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3 mt-4">
<Label className="">용도에 따른 처리공정<i className="diveicon di-search" /></Label>
<FormField
control={form.control}
name=""
render={({ field }) => (
<FormUi label="">
<Input
placeholder=""
type="text"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
value={field.value || ""}
className="mt-2"
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3 mt-4">
<FormField
control={form.control}
name=""
render={({ field }) => (
<FormUi label="처리시설 용량(요구수량 * 365일)">
<Input
placeholder=""
type="number"
step="0.001"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
value={field.value ?? 0}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3 mt-4">
<div className="flex items-center justify-between">
<Label>처리시설용량에 따른 공사비(백만원)</Label>
<Button
size={"sm"}
onClick={(e) => { }}
className="bg-none"
>
공사비 산정표 보기
</Button>
</div>
<FormField
control={form.control}
name=""
render={({ field }) => (
<FormUi label="">
<Input
placeholder=""
type="number"
step="0.001"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
value={field.value ?? 0}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3 mt-4">
<div className="flex items-center justify-between">
<Label>시설부대경비 요율(%)</Label>
<Button
size={"sm"}
onClick={(e) => { }}
>
요율표 보기
</Button>
</div>
<FormField
control={form.control}
name=""
render={({ field }) => (
<FormUi label="">
<Input
placeholder=""
type="number"
step="0.01"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
value={field.value ?? 0}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3 mt-4">
<Label>총사업비 (백만원)<i className="diveicon di-search" /></Label>
<FormField
control={form.control}
name=""
render={({ field }) => (
<FormUi label="">
<Input
placeholder=""
className="mt-2"
type="number"
step="0.01"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
value={field.value ?? 0}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-3 mt-4">
<div className="flex items-center justify-between">
<Label>공급처 선정</Label>
<Button
size={"sm"}
onClick={(e) => { }}
className="bg-none"
>
후보지 선택
</Button>
</div>
<FormField
control={form.control}
name=""
render={({ field }) => (
<FormUi label="">
<Input
placeholder=""
type="text"
onChange={(e) => {
field.onChange(Number(e.target.value));
}}
value={field.value ?? ""}
/>
</FormUi>
)}
/>
</div>
<div className="col-span-4 mt-4">
<div className="mt-4">
<Label>관로 표준공사비 산정</Label>
</div>
</div>
</div>
</Form>
</ListDiv>
</div>
</div>
</ContentsDiv >
</>
)
}
+5
View File
@@ -129,6 +129,11 @@ export default function Home() {
<Link href="matMng/matDmd/coMatRvw">수요처 매칭 검토</Link>
</Button>
</div>
<div className="col-span-2">
<Button className="w-full">
<Link href="matMng/matDmd/ruseRvwHstry">재이용검토이력</Link>
</Button>
</div>
</div>
</div>
</div>
@@ -22,7 +22,7 @@ import { set } from "react-hook-form";
import { Toaster } from "react-hot-toast";
export default function prfmncPrfmncReg() {
const { code, prfmnc, prfmncHasuInit, searchFclts } = useWrStore(
const { code, prfmnc, prfmncHasuInit, } = useWrStore(
(state) => state
);
const { pbnstPrfmncHeadList, monthHeadList, prfmncRes } = prfmnc;
@@ -38,7 +38,7 @@ export default function prfmncPrfmncReg() {
const excelClick = useCallback(() => {
console.log("dd")
excelDownload(
prfmnc.excelList,
[[]],
"하수재이용실적",
"sample_pbnstPrfmncReg.xlsx",
"A1:O1"
@@ -104,7 +104,7 @@ export default function prfmncPrfmncReg() {
<Button size={"sm"} onClick={() => {setIsExcelOPen(true)}}>
파일등록
</Button>
<Button color="green" size={"sm"} onClick={() => {}}>
<Button color="green" size={"sm"} onClick={excelClick}>
양식받기
</Button>
</div>
@@ -0,0 +1,185 @@
import { z } from "zod";
import type { CommonTableProps } from "../../common/type/headder";
export const sttnHeadListType = z.array(
z.object({
id: z.string(),
title: z.string(),
visible: z.boolean(),
})
);
export const ruseHstryHeadListExport: z.infer<typeof sttnHeadListType> = [
{
id: "ctpv",
title: "시도",
visible: true,
},
{
id: "sgg",
title: "시군구",
visible: true,
},
{
id: "coNm",
title: "회사명",
visible: true,
},
{
id: "addr",
title: "공장주소",
visible: true,
},
{
id: "telNo",
title: "전화번호",
visible: true,
},
{
id: "regDt", //바꾸기
title: "신청일자",
visible: true,
},
{
id: "rvwDt", //바꾸기
title: "검토일자",
visible: true,
},
{
id: "matDt", //바꾸기
title: "매칭 완료일자",
visible: true,
},
{
id: "gong", //바꾸기
title: "공급처",
visible: true,
},
{
id: "dmndQty", //바꾸기
title: "요구수량(M3/d)",
visible: true,
},
{
id: "useUsgCd", //바꾸기
title: "사용용도",
visible: true,
},
{
id: "state", //바꾸기
title: "진행상태",
visible: true,
},
{
id: "matYn", //바꾸기
title: "매칭완료 여부",
visible: true,
},
];
// id는 다확인해야함
export const ruseHstryNodeListExport: CommonTableProps[] = [
{
id: "ctpv",
title: "시도",
visible: true,
row: 1,
rowSpan: 1,
colSpan: 1,
},
{
id: "sgg",
title: "시군구",
visible: true,
row: 1,
rowSpan: 1,
colSpan: 1,
},
{
id: "coNm",
title: "회사명",
visible: true,
row: 1,
rowSpan: 1,
colSpan: 1,
},
{
id: "addr",
title: "공장주소",
visible: true,
row: 1,
rowSpan: 1,
colSpan: 1,
},{
id: "telNo",
title: "전화번호",
visible: true,
row: 1,
rowSpan: 1,
colSpan: 1,
},
{
id: "regDt", //바꾸기
title: "신청일자",
visible: true,
row: 1,
rowSpan: 1,
colSpan: 1,
},
{
id: "rvwDt", //바꾸기
title: "검토일자",
visible: true,
row: 1,
rowSpan: 1,
colSpan: 1,
},{
id: "matDt", //바꾸기
title: "매칭 완료일자",
visible: true,
row: 1,
rowSpan: 1,
colSpan: 1,
},{
id: "gong", //바꾸기
title: "공급처",
visible: true,
row: 1,
rowSpan: 1,
colSpan: 1,
},
{
id: "dmndQty", //바꾸기
title: "요구수량(M3/d)",
visible: true,
row: 1,
rowSpan: 1,
colSpan: 1,
},
{
id: "useUsgCd", //바꾸기
title: "사용용도",
visible: true,
row: 1,
rowSpan: 1,
colSpan: 1,
},
{
id: "state", //바꾸기
title: "진행상태",
visible: true,
row: 1,
rowSpan: 1,
colSpan: 1,
},
{
id: "matYn", //바꾸기
title: "매칭완료 여부",
visible: true,
row: 1,
rowSpan: 1,
colSpan: 1,
},
];
@@ -0,0 +1,34 @@
import type { z } from "zod";
import type { sttnHeadListType } from "../coSttn/headList";
import type { CommonTableProps } from "../../common/type/headder";
import { ruseHstryHeadListExport, ruseHstryNodeListExport } from "./headList";
const ruseHstryHeadList = ruseHstryHeadListExport;
const ruseHstryNodeList = ruseHstryNodeListExport;
export type ruseHstryState = {
ruseHstry: {
isInit: boolean;
ruseHstryHeadList: z.infer<typeof sttnHeadListType>;
ruseHstryNodeList: CommonTableProps[];
};
};
export const ruseHstryStateExport: ruseHstryState = {
ruseHstry: {
isInit: false,
ruseHstryHeadList: ruseHstryHeadList,
ruseHstryNodeList: ruseHstryNodeList,
}
}
export type ruseHstryType = ruseHstryState & ruseHstryActions;
type ruseHstryActions = {
};
export const ruseHstryActionsExport: (set: any) => ruseHstryActions = (set: any) => {
return {
}
}
+8 -3
View File
@@ -90,6 +90,7 @@ import { ldrmntCoSttnActionsExport, ldrmntCoSttnStateExport, type ldrmntCoSttnSt
import { searchActions, type comFcltActions, type comFcltState } from "./common/searchCode";
import { pbnstPrfmncActionsExport, pbnstPrfmncStateExport, type pbnstPrfmncState, type pbnstPrfmncType } from "./prfmncReg/pbnstPrfmncReg";
import { coRvwActionsExport, coRvwStateExport, type coRvwState, type coRvwType } from "./matDmd/coMatRvw";
import { ruseHstryActionsExport, ruseHstryStateExport, type ruseHstryState, type ruseHstryType } from "./matDmd/ruseRvwHstry";
export type WrStore = comCodeType &
pubFacType &
@@ -110,7 +111,8 @@ export type WrStore = comCodeType &
coSttnType& // 옮겨야함
ldrmntCoSttnType& // 옮겨야함
pbnstPrfmncType&
coRvwType
coRvwType&
ruseHstryType
;
export const StoreZus = (
@@ -132,7 +134,8 @@ export const StoreZus = (
coSttnState& // 옮겨야함
ldrmntCoSttnState& // 옮겨야함
pbnstPrfmncState&
coRvwState
coRvwState&
ruseHstryState
= {
...comCodeStateExport,
...pubFacStateExport,
@@ -153,6 +156,7 @@ export const StoreZus = (
...ldrmntCoSttnStateExport, // 옮겨야함
...pbnstPrfmncStateExport,
...coRvwStateExport,
...ruseHstryStateExport,
}
) => {
return createStore<WrStore>()((set) => {
@@ -183,7 +187,8 @@ export const StoreZus = (
...coSttnActionsExport(set), // 옮겨야함
...ldrmntCoSttnActionsExport(set), // 옮겨야함
...pbnstPrfmncActionsExport(set),
...coRvwActionsExport(set)
...coRvwActionsExport(set),
...ruseHstryActionsExport(set),
};
});
};