Merge commit '055091d64db22ad32f84c4f6f43cd6c9a123e006' into iipbs/wr/hasuReg
This commit is contained in:
@@ -1,28 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { SelectBox } from "@common/business_components";
|
||||
import {
|
||||
FormUi,
|
||||
UiModal,
|
||||
type SelectDataType,
|
||||
} from "@common/business_components/ui";
|
||||
import { Form, FormField } from "@common/business_components/ui/form";
|
||||
import { Button, Input, Label, TableHead, TableRow } from "@common/components";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { set, useFieldArray, useForm } from "react-hook-form";
|
||||
import { use, useEffect, useRef, useState } from "react";
|
||||
import { z } from "zod";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import {
|
||||
selectClass,
|
||||
type TableUpperProps,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import {
|
||||
commonButonSize,
|
||||
formH1Class,
|
||||
formTableName,
|
||||
} from "@/components/lib/class/comClass";
|
||||
import MngRegFormDetail from "../mngReg/mngRegFormDetail/mngRegFormDetail";
|
||||
import {
|
||||
businessMoneyInfo,
|
||||
businessSttnInfo,
|
||||
@@ -33,13 +11,31 @@ import {
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/headList";
|
||||
import {
|
||||
fcBizSchema,
|
||||
pbnstRegZod,
|
||||
type fcBizType,
|
||||
type fcOrgwtType,
|
||||
type ppInstlType,
|
||||
type ppInstlType
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
import RuseMngTable from "@/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable";
|
||||
import {
|
||||
selectClass
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import {
|
||||
commonButonSize,
|
||||
formH1Class,
|
||||
formTableName,
|
||||
} from "@/components/lib/class/comClass";
|
||||
import FcOrgwtsRegModal from "@/components/ui/modal/fcltReg/fcOrgwtsRegModal/fcOrgwtsRegModal";
|
||||
import RuseMngTable from "@/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable";
|
||||
import { SelectBox } from "@common/business_components";
|
||||
import {
|
||||
UiModal,
|
||||
type SelectDataType
|
||||
} from "@common/business_components/ui";
|
||||
import { Form } from "@common/business_components/ui/form";
|
||||
import { Button, Input, Label } from "@common/components";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useFieldArray, useForm } from "react-hook-form";
|
||||
import MngRegFormDetail from "../mngReg/mngRegFormDetail/mngRegFormDetail";
|
||||
|
||||
export function PbnstBuseForm({ data }: { data: fcBizType[] }) {
|
||||
// const ref = useRef<ppInstlType[] | null>(data[0]?.pplInstls ?? null);
|
||||
@@ -52,7 +48,8 @@ export function PbnstBuseForm({ data }: { data: fcBizType[] }) {
|
||||
const [ppiSelectList, setPpiSelectList] =
|
||||
useState<[{ name: string; val: SelectDataType[] }]>();
|
||||
const [ppiYn, setPpiYn] = useState("Y");
|
||||
const [ isFcOrgwts, setIsFcOrgwts] = useState<boolean>(false);
|
||||
const [isFcOrgwts, setIsFcOrgwts] = useState<boolean>(false);
|
||||
const [modalData, setModalData] = useState<fcOrgwtType | null>(null);
|
||||
|
||||
|
||||
|
||||
@@ -75,6 +72,12 @@ const [ isFcOrgwts, setIsFcOrgwts] = useState<boolean>(false);
|
||||
name: "pplInstls",
|
||||
});
|
||||
|
||||
const buttonClick = () => {
|
||||
console.log("머임?", data[0]?.fcOrgwts)
|
||||
setIsFcOrgwts(true);
|
||||
const moData = data[0]?.fcOrgwts;
|
||||
setModalData(moData);
|
||||
}
|
||||
|
||||
|
||||
const plusHist = () => {
|
||||
@@ -127,6 +130,7 @@ const [ isFcOrgwts, setIsFcOrgwts] = useState<boolean>(false);
|
||||
}, [form.formState.errors]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className=" !mx-[1.6rem] !p-0r">
|
||||
{/* 차수별 등록 현황 폼 */}
|
||||
<div className="justify-between">
|
||||
@@ -193,7 +197,18 @@ const [ isFcOrgwts, setIsFcOrgwts] = useState<boolean>(false);
|
||||
|
||||
<h1 className={formH1Class}>재이용 원수취수 현황</h1>
|
||||
<div>
|
||||
<Button type="button" onClick={() => {setIsFcOrgwts(true)} }size={commonButonSize}>추가등록</Button>
|
||||
<Button
|
||||
type="button"
|
||||
onClick={
|
||||
// () => {
|
||||
// setIsFcOrgwts(true)
|
||||
// setModalData(modalData)
|
||||
// }
|
||||
buttonClick
|
||||
}
|
||||
size={commonButonSize}>
|
||||
추가등록
|
||||
</Button>
|
||||
<RuseMngTable
|
||||
tableData={fcOrgwtFiled}
|
||||
headList={pbnst.pbnstOrgwtHeadList}
|
||||
@@ -267,9 +282,10 @@ const [ isFcOrgwts, setIsFcOrgwts] = useState<boolean>(false);
|
||||
<UiModal
|
||||
open={isFcOrgwts}
|
||||
onOpenChange={(open: boolean) => setIsFcOrgwts(open)}
|
||||
bodyClass={"w-[68vw] max-w-none h-[60vh]"}
|
||||
body={<FcOrgwtsRegModal></FcOrgwtsRegModal>}
|
||||
bodyClass={"w-[60vw] max-w-none h-[60vh]"}
|
||||
body={<FcOrgwtsRegModal data={ modalData || []}></FcOrgwtsRegModal>}
|
||||
></UiModal>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user