From 6314b8059e720a6253ec3399f283e1b8cfa3d608 Mon Sep 17 00:00:00 2001 From: jyha00 Date: Fri, 30 May 2025 15:29:29 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=ED=8F=BC=20=ED=95=A9=EA=B3=84=20readonly?= =?UTF-8?q?=20/=20=EC=9E=90=EB=8F=99=EA=B3=84=EC=82=B0=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx | 15 ++++++++++++--- .../table/pbnstReg/ruseMngTable/ruseMngTable.tsx | 11 +++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx index 95fdcd8b2..d1bf87adb 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx @@ -43,6 +43,7 @@ export function PbnstBuseForm({ data }: { data: fcBizType[] }) { const [ppiYn, setPpiYn] = useState("Y"); const [isFcOrgwts, setIsFcOrgwts] = useState(false); const [modalData, setModalData] = useState(null); + const [sumCpct, setSumCpct] = useState(0); const form = useForm({ resolver: zodResolver(fcBizSchema), @@ -50,7 +51,7 @@ export function PbnstBuseForm({ data }: { data: fcBizType[] }) { // 2. Define a submit handler. function onSubmit(values: fcBizType) { - console.log(values); + // console.log(values); } const { fields: fcOrgwtFiled } = useFieldArray({ @@ -128,7 +129,7 @@ export function PbnstBuseForm({ data }: { data: fcBizType[] }) { } }, [getBizCycle,pbnst.pbnstResObj]); - + useEffect(() => { const ppl = []; if (code.pplLenght) { @@ -253,7 +254,7 @@ export function PbnstBuseForm({ data }: { data: fcBizType[] }) { @@ -281,6 +282,14 @@ export function PbnstBuseForm({ data }: { data: fcBizType[] }) { code={ppiSelectList ?? []} ref={ref} upHeadList={[]} + onTableSet={(val) => { + if (!ref.current) return; + let sum = 0; + ref.current.forEach(item => { + sum += Number(item.cpct) || 0; + }); + setSumCpct(sum); + }} /> diff --git a/apps/wr/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable.tsx b/apps/wr/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable.tsx index c1a7e95ca..43a08e203 100644 --- a/apps/wr/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable.tsx +++ b/apps/wr/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable.tsx @@ -21,6 +21,7 @@ type RuseMngTableProps = { headList: TableUpperProps[]; upHeadList: chHeadType[]; code?: { name: string, val: SelectDataType[] }[]; + onTableSet?:(item:any)=> void; }; const RuseMngTable = React.forwardRef( @@ -28,14 +29,20 @@ const RuseMngTable = React.forwardRef( tableData, headList, upHeadList, - code + code, + onTableSet }, ref) => { const [tableState, setTableState] = useState([...tableData]); useEffect(() => { if (ref && typeof ref === "object" && "current" in ref) { ref.current = tableState; } - }, [tableState]); + if(onTableSet) + onTableSet (tableState) + }, [tableState,onTableSet]); + + + useEffect(() => { if(tableData) From 43d80be24bbd78164a896511b0f3861eca887b20 Mon Sep 17 00:00:00 2001 From: jyha00 Date: Fri, 30 May 2025 16:19:46 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=EA=B3=B5=EA=B8=89=EA=B4=80=EB=A1=9C=20?= =?UTF-8?q?=EC=9C=A0=EB=AC=B4=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EC=BB=A8?= =?UTF-8?q?=ED=8A=B8=EB=A1=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fcltReg/pbnstReg/buseReg/bugRegForm.tsx | 243 +++++++++--------- 1 file changed, 127 insertions(+), 116 deletions(-) diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx index d1bf87adb..d1cfe8ebf 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx @@ -34,7 +34,7 @@ import MngRegFormDetail from "../mngReg/mngRegFormDetail/mngRegFormDetail"; export function PbnstBuseForm({ data }: { data: fcBizType[] }) { // const ref = useRef(data[0]?.pplInstls ?? null); - const ref = useRef( null); + const ref = useRef(null); const { code, pbnst, pbnstBizData } = useWrStore((state) => state); const { pbnstBizCycle, pbnstRes } = pbnst; const [getBizCycle, setBizCycle] = useState("1"); @@ -72,12 +72,19 @@ export function PbnstBuseForm({ data }: { data: fcBizType[] }) { const formData = form.watch() - formData.pplInstls = ref.current? [...ref.current]:[] // ← form 내부 상태 기준으로 복사 + formData.pplInstls = ref.current ? [...ref.current] : [] // ← form 내부 상태 기준으로 복사 console.log("formData pplReg", formData) pbnstBizData(formData as fcBizType); }, [form.formState]); + useEffect(() => { + + if (ppiYn === "N") { + form.setValue('pplInstls', []) + } + }, [ppiYn, pbnst.pplInstlsHeadLisat]) + useEffect(() => { console.log("pbnst.pbnstMngRegData ", pbnst.pbnstMngRegData); }, [pbnst.pbnstMngRegData]); @@ -89,8 +96,8 @@ export function PbnstBuseForm({ data }: { data: fcBizType[] }) { }; const plusHist = () => { - const regData ={ - ruseFcltBizFk: ref.current?.[0]?.ruseFcltBizFk??"", + const regData = { + ruseFcltBizFk: ref.current?.[0]?.ruseFcltBizFk ?? "", choose: false, ppMqlt: "", pdmt: '', @@ -107,7 +114,7 @@ export function PbnstBuseForm({ data }: { data: fcBizType[] }) { }; const plusArray = () => { - + } const removeSelected = () => { @@ -119,17 +126,17 @@ export function PbnstBuseForm({ data }: { data: fcBizType[] }) { }; useEffect(() => { - - if(getBizCycle){ + + if (getBizCycle) { const index = Number(getBizCycle) - 1; form.reset(pbnst.pbnstResObj?.fcBizs[index]); ref.current = pbnst.pbnstResObj?.fcBizs[index]?.pplInstls ?? []; } - }, [getBizCycle,pbnst.pbnstResObj]); - + }, [getBizCycle, pbnst.pbnstResObj]); + useEffect(() => { const ppl = []; if (code.pplLenght) { @@ -218,116 +225,120 @@ export function PbnstBuseForm({ data }: { data: fcBizType[] }) { sonClass="col-span-4" /> -

재이용 원수취수 현황

-
-
- -
- 재이용 원수취수 현황 +
+
+ +
+ -
-

재이용 공급관로 설치 현황

-
- - setPpiYn(String(val))} - /> - - - - -
-
- { - if (!ref.current) return; - let sum = 0; - ref.current.forEach(item => { - sum += Number(item.cpct) || 0; - }); - setSumCpct(sum); - }} - /> -
- - - -

하수처리수 재이용수 수요처

-
-
- - + headList={pbnst.pbnstOrgwtHeadList} + upHeadList={[]} /> +
+

재이용 공급관로 설치 현황

+
+ + setPpiYn(String(val))} + /> + + + {ppiYn === 'Y' ? <> + + + : <> + + } +
+
+ { + if (!ref.current) return; + let sum = 0; + ref.current.forEach(item => { + sum += Number(item.cpct) || 0; + }); + setSumCpct(sum); + }} + />
- -
- - -
- setIsFcOrgwts(open)} - bodyClass={"w-[50vw] max-w-none h-[60vh]"} - body={ { console.log("val", val); return {}; }} >} - > - + + +

하수처리수 재이용수 수요처

+
+
+ + +
+ +
+ + + + + setIsFcOrgwts(open)} + bodyClass={"w-[50vw] max-w-none h-[60vh]"} + body={ { console.log("val", val); return {}; }} >} + > + ); } From 858486c36a2e09c12118f6e6c86e107eb0e77853 Mon Sep 17 00:00:00 2001 From: jyha00 Date: Fri, 30 May 2025 17:00:31 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=EC=88=98=EC=9A=94=EC=B2=98=20=ED=8F=BC?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruseFcltMng/fcltReg/pbnstReg/headList.tsx | 10 +++++++ .../fcltReg/pbnstReg/buseReg/bugRegForm.tsx | 30 ++++++++++++------- .../mngRegFormDetail/mngRegFormDetail.tsx | 4 +-- 3 files changed, 31 insertions(+), 13 deletions(-) diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/headList.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/headList.tsx index c3c2af5e4..07cbe401f 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/headList.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/headList.tsx @@ -64,6 +64,16 @@ export const fcOrgwtsHeadListExport: TableUpperProps[] = [ { id: "addr", title: "위치" }, ]; +export const dmdCoList: formDetailType[] = [ + { id: "dmdCoNm", lable: "수요처명" }, + { id: "daddr", lable: "위치(주소)" }, + { id: "useUsgCd", lable: "사용용도" }, + { id: "splyBgngDay", lable: "공급시작일", type: "date" }, + { id: "splyEndDay", lable: "공급종료일", type: "date" }, + { id: "splyCpct", lable: "(계약)공급량(m3/일)" }, + { id: "splyFmYn", lable: "공급 유량계 유무", type: "selectYn" }, +]; + export const pbnstMngNmExport: chHeadType[] = [ { headNm: "upChangeRe", text: "운영대행기간", length: 2 }, ]; diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx index d1cfe8ebf..4e704c21c 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx @@ -5,6 +5,7 @@ import { businessMoneyInfo, businessSttnInfo, concentratedWaterInfo, + dmdCoList, ruseFcltinfo, ruseWaterQulityList, wasteWaterFcltINfo, @@ -312,22 +313,29 @@ export function PbnstBuseForm({ data }: { data: fcBizType[] }) { sonClass="col-span-4" /> -

하수처리수 재이용수 수요처

+ {/*

하수처리수 재이용수 수요처

*/}
- - +
- + {/* -
+ /> */} + diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegFormDetail/mngRegFormDetail.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegFormDetail/mngRegFormDetail.tsx index 5d9d1fee5..85dde2e3c 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegFormDetail/mngRegFormDetail.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegFormDetail/mngRegFormDetail.tsx @@ -14,7 +14,7 @@ export default function MngRegFormDetail({ cycle, }: { formList: formDetailType[]; - h1Title: string; + h1Title?: string; form: any; moClass?: string; cycle?:string @@ -23,7 +23,7 @@ export default function MngRegFormDetail({ const { code, } = useWrStore((state) => state); return ( <> -

{h1Title}

+ { h1Title ?

{h1Title}

: <>}
{formList?.map((item, index) => {