수요매칭 검토 작업중
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,7 @@ import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button, Label, Table, TableBody, TableHeader } from "@common/components/ui";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { headMakeprfmnc } from "../../prfmncReg/chkgdnReg/TableHead";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
|
||||
|
||||
|
||||
@@ -587,10 +588,10 @@ export default function PbnstPrfmncSttn() {
|
||||
const fromNum = Number(fromDate);
|
||||
const toNum = Number(toDate);
|
||||
if (fromNum > toNum) {
|
||||
alert("시작년도가 종료년도 이후로 설정할 수 없습니다.");
|
||||
toast.error("시작년도가 종료년도 이후로 설정할 수 없습니다.");
|
||||
} else {
|
||||
if (toNum - fromNum > 5) {
|
||||
alert("최대 5년까지 선택 가능합니다.");
|
||||
toast.error("최대 5년까지 선택 가능합니다.");
|
||||
} else {
|
||||
tableHeadMaker(fromNum, toNum);
|
||||
|
||||
@@ -679,6 +680,7 @@ export default function PbnstPrfmncSttn() {
|
||||
</div>
|
||||
</div>
|
||||
</ContentsDiv>
|
||||
<Toaster position="top-center"/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -11,27 +11,27 @@ export const sttnHeadListType = z.array(
|
||||
|
||||
export const coRvwHeadListExport: z.infer<typeof sttnHeadListType> = [
|
||||
{
|
||||
id: "ctpv",
|
||||
id: "cityText",
|
||||
title: "시도",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "sgg",
|
||||
id: "sggText",
|
||||
title: "시군구",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "coNm",
|
||||
id: "dmdCoNm",
|
||||
title: "회사명",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "addr",
|
||||
id: "daddr",
|
||||
title: "공장주소",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "telNo",
|
||||
id: "telno",
|
||||
title: "전화번호",
|
||||
visible: true,
|
||||
},
|
||||
|
||||
@@ -2,6 +2,8 @@ import type { z } from "zod";
|
||||
import type { sttnHeadListType } from "../coSttn/headList";
|
||||
import { coRvwHeadListExport, coRvwNodeListExport } from "./headList";
|
||||
import type { CommonTableProps } from "../../common/type/header";
|
||||
import type { DmdCoReqType } from "./type";
|
||||
import { fetchType, getFetch } from "@/components/lib/api";
|
||||
|
||||
const coRvwHeadList = coRvwHeadListExport;
|
||||
const coRvwNodeList = coRvwNodeListExport;
|
||||
@@ -9,26 +11,54 @@ const coRvwNodeList = coRvwNodeListExport;
|
||||
export type coRvwState = {
|
||||
coRvw: {
|
||||
isInit: boolean;
|
||||
coRvwHeadList: z.infer<typeof sttnHeadListType>;
|
||||
coMatRvwRes: DmdCoReqType[];
|
||||
coRvwHeadList: CommonTableProps[];
|
||||
coRvwNodeList: CommonTableProps[];
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
export const coRvwStateExport: coRvwState = {
|
||||
coRvw: {
|
||||
isInit: false,
|
||||
coMatRvwRes: [],
|
||||
coRvwHeadList: coRvwHeadList,
|
||||
coRvwNodeList: coRvwNodeList,
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export type coRvwType = coRvwState & coRvwActions;
|
||||
|
||||
type coRvwActions = {
|
||||
coMatRvwInit: (
|
||||
pageCnt: number,
|
||||
pageNo: number,
|
||||
sggCd: string,
|
||||
startYear: string,
|
||||
endYear: string
|
||||
) => void;
|
||||
};
|
||||
|
||||
export const coRvwActionsExport: (set: any) => coRvwActions = (set: any) => {
|
||||
return {
|
||||
}
|
||||
}
|
||||
coMatRvwInit: async (
|
||||
pageCnt: number,
|
||||
pageNo: number,
|
||||
sggCd: string,
|
||||
startYear: string,
|
||||
endYear: string
|
||||
) => {
|
||||
const tempData = `/reuseFc/request/10000000000000`;
|
||||
const url = `/reuseFc/request/${pageNo}/${pageCnt}/${sggCd}/${startYear}/${endYear}}`;
|
||||
const coMatRvwRes = await getFetch(fetchType.WR, tempData);
|
||||
|
||||
return set((state: coRvwState) => ({
|
||||
...state,
|
||||
coRvw: {
|
||||
...state.coRvw,
|
||||
init: false,
|
||||
coMatRvwRes: [coMatRvwRes],
|
||||
},
|
||||
}));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
import { z } from "zod";
|
||||
const DmdInfoSchema = z.object({
|
||||
dmdInfoSn: z.number(),
|
||||
dmdInfoFk: z.string(),
|
||||
dmndTmng: z.coerce.date(),
|
||||
dmndQty: z.number(),
|
||||
wntUntprc: z.number(),
|
||||
grssClfg: z.number(),
|
||||
combResdch: z.number(),
|
||||
trbt: z.number(),
|
||||
blgcOxygDmndQnt: z.number(),
|
||||
smll: z.number(),
|
||||
crmty: z.number(),
|
||||
tn: z.number(),
|
||||
tph: z.number(),
|
||||
ph: z.number(),
|
||||
clIonQnt: z.number(),
|
||||
cdtnv: z.number(),
|
||||
rmrk: z.string(),
|
||||
useUsgCd: z.string(),
|
||||
});
|
||||
const DmdMatSchema = z.object({
|
||||
dmdInfoFk: z.string(),
|
||||
splyFcltFk: z.string(),
|
||||
splyFcltFlg: z.string(),
|
||||
pbnstRuseFcltBizFk: z.number(),
|
||||
splyBgngDay: z.coerce.date(),
|
||||
splyEndDay: z.coerce.date(),
|
||||
splyCpct: z.number(),
|
||||
splyFmYn: z.string(),
|
||||
useUsgCd: z.string(),
|
||||
});
|
||||
|
||||
export const DmdCoReqSchema =
|
||||
z.object({
|
||||
cityText:z.string().nullish(),
|
||||
sggText:z.string().nullish(),
|
||||
dmdInfoPk: z.string(),
|
||||
dmdCoNm: z.string(),
|
||||
ctpvCd: z.string(),
|
||||
sggCd: z.string(),
|
||||
daddr: z.string(),
|
||||
splyBgngDay: z.coerce.date(),
|
||||
splyEndDay: z.coerce.date(),
|
||||
splyCpct: z.number(),
|
||||
splyFmYn: z.string(),
|
||||
telno: z.string(),
|
||||
useUsgCd: z.string(),
|
||||
regDt: z.coerce.date(),
|
||||
rgtr: z.string(),
|
||||
mdfcnDt: z.coerce.date(),
|
||||
mdfr: z.string(),
|
||||
dmdAplyPswd: z.string(),
|
||||
demandInfo: z.array(DmdInfoSchema),
|
||||
demandMatchings: z.array(DmdMatSchema),
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
export type DmdCoReqType = z.infer<typeof DmdCoReqSchema>;
|
||||
export type DmdMatTableType = {
|
||||
cityText:string,
|
||||
sggText:string,
|
||||
dmdCoNm:string,
|
||||
daddr:string,
|
||||
telno:string,
|
||||
regDt:string,
|
||||
state:string
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
} from "@common/business_components/ui";
|
||||
import { Form, FormField } from "@common/business_components/ui/form";
|
||||
import { Button, Input } from "@common/components";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useFieldArray, useForm, type UseFormReturn } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
@@ -19,12 +18,10 @@ import {
|
||||
formTableName,
|
||||
} from "@/components/lib/class/comClass";
|
||||
import { TusClientUpload } from "@/components/lib/useTus_wr/useTusWr";
|
||||
import RuseMngTable from "@/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable";
|
||||
import {
|
||||
pbnstRegZod,
|
||||
type customPbnst,
|
||||
type fcFileType,
|
||||
type operType,
|
||||
type PbnstRegArrrayType,
|
||||
type selectLabel,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
|
||||
@@ -10,7 +10,6 @@ import { useEffect, useState } from "react";
|
||||
import { getCity, tableData } from "@/components/lib/func/commom";
|
||||
import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
|
||||
import type { customHtdflBdst } from "@/app/store/ruseFcltMng/fcltReg/htdflReg";
|
||||
import { headMakeColSpan } from "@/app/ruseFcltMng/fcltReg/rainReg/TableHead";
|
||||
import RainRegForm from "@/components/ui/form/fcltReg/rainReg/rainRegForm";
|
||||
import RswtrRegForm from "@/components/ui/form/fcltReg/rswtrReg/rswtrRegForm";
|
||||
import HtdflRegForm from "@/components/ui/form/fcltReg/htdflReg/htdflRegForm";
|
||||
|
||||
@@ -10,7 +10,6 @@ import { Button } from "@common/business_components/ui/table/lib/button";
|
||||
import { Input } from "@common/components/ui";
|
||||
import { ArrowLeft, ArrowRight } from "lucide-react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useFieldArray } from "react-hook-form";
|
||||
|
||||
export default function FcOrgwtsRegModal({ onRightSet, closeModal }: { onRightSet?: (rightData:fcOrgwtType[]) => void,closeModal?:(val:boolean) =>void }) {
|
||||
const { code, pbnst, getSwtrmtFcltNm, searchFclts } = useWrStore((state) => state);
|
||||
|
||||
Reference in New Issue
Block a user