diff --git a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx index 86dce20d6..cefc971a4 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx @@ -41,6 +41,7 @@ export default function PublicReuseFaciltyInsert() { pbnstMngData, pbnstRuseFcltUpdate, pbnstRuseBizUpdate, + getHasuFlow } = useWrStore((state) => state); const { pubFacHeadList, pbnstHasuRes, pbnstRes } = pbnst; const [currentTab, setCurrentTab] = useState("mng"); @@ -75,11 +76,9 @@ export default function PublicReuseFaciltyInsert() { await pbnstRuseFcltUpdate(data) - console.log('bizs ', bizs) await pbnstRuseBizUpdate(bizs) - console.log(' data ', data) } @@ -99,6 +98,8 @@ export default function PublicReuseFaciltyInsert() { if (selectRow) { setIsRuseReg({ ...isRuseReg, data: selectRow }); pbnstRegClick(selectRow); + + getHasuFlow(selectRow.gugun, selectRow.bscFctNm) } }; diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx index 22980aa16..27a45057d 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx @@ -53,6 +53,7 @@ export type pubFacState = { fcOrgwtsHeadList: TableUpperProps[]; pbnstMngRegData: customPbnst[]; pbnsUpdateIndex: pbnstInsertIndex; + efflAmnt:string dmdComList: any[]; }; }; @@ -70,8 +71,8 @@ type pubFacActions = { getpbnstInsertIndex: (data: pbnstInsertIndex) => void; pbnstRuseFcltUpdate: (ruseRes: customPbnst[]) => void; pbnstRuseBizUpdate: (ruseRes: fcBizType[]) => void; + getHasuFlow: (sggCd:string, swtrmtFcltNm:string) => void }; - export type pubFacType = pubFacState & pubFacActions; export const pubFacStateExport: pubFacState = { @@ -82,6 +83,7 @@ export const pubFacStateExport: pubFacState = { pbnstMngNm: pbnstMngNm, pbnstOrgwtHeadList: pbnstOrgwtHeadList, pbnstHasuRes: [], + efflAmnt:'', pbnstResObj: null, // 초기값을 null로 변경 pbnstRes: [], // 초기값을 null로 변경 pbnstBizCycle: [{ text: "없음", val: "1" }], @@ -374,6 +376,21 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { } catch (e) { console.log(e); } - }, + },getHasuFlow: async(sggCd:string, swtrmtFcltNm:string) =>{ + try{ + const year = new Date().getFullYear()-1 + const flow = await getFetch( fetchType.COMMON, `/fclt/flow/1/1/${year}/A/${sggCd}/0/1/${swtrmtFcltNm}`) + + return set((state: pubFacState) => ({ + ...state, + pbnst: { + ...state.pbnst, + efflAmnt: flow[0].efflAmnt, + }, + })); + }catch(e){ + console.log(e) + } + } }; }; diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx index 3f0776a4e..3333f3dca 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx @@ -88,6 +88,9 @@ export function PbnstMngForm({ if (pbnst.pbnstRes && pbnst.pbnstRes[val]) { getBizCycle(pbnst.pbnstRes[val]); form.reset(pbnst.pbnstRes[val]); + + console.log('pbnst.efflAmnt ', pbnst.efflAmnt) + form.setValue('hasuhasu' , Number(pbnst.efflAmnt)??0) getpbnstInsertIndex({ ...pbnst.pbnsUpdateIndex, mng: val }); } }; @@ -426,6 +429,7 @@ export function PbnstMngForm({ field.onChange(Number(e.target.value)); }} value={field.value ?? 0} + readOnly /> )}