하수재이용시설 등록 하수처리량 api 적용

This commit is contained in:
leedj312
2025-06-05 13:10:42 +09:00
parent a38a1315f2
commit 0ad3d9a477
3 changed files with 26 additions and 4 deletions
@@ -41,6 +41,7 @@ export default function PublicReuseFaciltyInsert() {
pbnstMngData,
pbnstRuseFcltUpdate,
pbnstRuseBizUpdate,
getHasuFlow
} = useWrStore((state) => state);
const { pubFacHeadList, pbnstHasuRes, pbnstRes } = pbnst;
const [currentTab, setCurrentTab] = useState<string>("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)
}
};
@@ -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)
}
}
};
};
@@ -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
/>
</FormUi>
)}