-
중수도시설 등록
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ }
+ bodyClass="sm:max-w-7xl"
+ />
+
+
-
-
-
-
-
-
-
-
-
- {nodeList}
-
-
-
-
-
-
-
-
-
+
+
+
+
+ {nodeList}
+
+
+
+
+
+
+
+
+
+
+
+
>
);
}
diff --git a/apps/wr/app/store/common/code/index.ts b/apps/wr/app/store/common/code/index.ts
index 3d1250119..7125f5b71 100644
--- a/apps/wr/app/store/common/code/index.ts
+++ b/apps/wr/app/store/common/code/index.ts
@@ -11,7 +11,7 @@ export const yn :selectArray[]=[
{val:'N', text:'N'},
]
-
+//공통 건축물 용도
export const bdstUsgCd: selectArray[] = [
{ val: 1, text: "운동장" },
{ val: 2, text: "체육관" },
@@ -30,7 +30,7 @@ export const bdstUsgCd: selectArray[] = [
{ val: 15, text: "대규모점포" },
{ val: 16, text: "기타" },
];
-
+//빗물 집수면 종류 용도
export const rainFcltCd = [
{ val: "1", text: "지붕" },
{ val: "2", text: "건물옥상" },
@@ -44,6 +44,48 @@ export const rainFcltCd = [
{ val: "10", text: "확인불가" },
];
+//중수도 필수 원수종류
+export const rswtBdstType :selectArray[]= [
+ { text: "숙박업", val: "17" },
+ { text: "목욕장업", val: "18" },
+ { text: "공장", val: "19" },
+ { text: "발전시설", val: "20" },
+ { text: "관광단지개발사업", val: "21" },
+ { text: "도시개발사업", val: "22" },
+ { text: "산업단지개발사업", val: "23" },
+ { text: "택지개발사업", val: "24" },
+ { text: "대규모점포(대형마트)", val: "25" },
+ { text: "대규모점포(전문점)", val: "26" },
+ { text: "대규모점포(백화점)", val: "27" },
+ { text: "대규모점포(쇼핑센터)", val: "28" },
+ { text: "대규모점포(복합쇼핑몰)", val: "29" },
+ { text: "물류시설", val: "30" },
+ { text: "운수시설(여객자동차터미널)", val: "31" },
+ { text: "운수시설(철도시설)", val: "32" },
+ { text: "운수시설(공항시설)", val: "33" },
+ { text: "운수시설(항만시설)", val: "34" },
+ { text: "업무시설(공공업무시설)", val: "35" },
+ { text: "업무시설(금융업소)", val: "36" },
+ { text: "업무시설(사무소)", val: "37" },
+ { text: "업무시설(결혼상담소 등 소개업소)", val: "38" },
+ { text: "업무시설(출판사)", val: "39" },
+ { text: "업무시설(신문사)", val: "40" },
+ { text: "업무시설(오피스텔)", val: "41" },
+ { text: "교정시설", val: "42" },
+ { text: "방송국", val: "43" },
+ { text: "전신전화국", val: "44" },
+ { text: "기타", val: "45" },
+];
+
+
+const orgwtKndCd = [
+ { text: "오수(변기 오수 제외)", val: "1" },
+ { text: "오수", val: "2" },
+ { text: "폐수", val: "3" },
+ { text: "오수 및 폐수", val: "4" },
+ { text: "기타", val: "5" },
+];
+
export const chBuCd = [
{ val: "1", text: "증축" },
{ val: "2", text: "개축" },
@@ -60,6 +102,7 @@ export type comCodeState = {
bdstUsgCd: selectArray[];
cityCd: selectArray[];
sggCd: selectArray[];
+ orgwtKndCd:selectArray[];
yn:selectArray[];
};
};
@@ -85,6 +128,7 @@ export const getCityCd = async (set: any) => {
val: item.mctpvCd,
text: item.mctpvKornNm,
}));
+ cityCd.unshift({val:0,text:'전체'})
set((state: comCodeState) => ({
code: {
...state.code,
@@ -99,6 +143,7 @@ export const comCodeStateExport: comCodeState = {
rainFcltCd: rainFcltCd,
bdstUsgCd: bdstUsgCd,
chBuCd:chBuCd,
+ orgwtKndCd:orgwtKndCd,
cityCd: [],
sggCd: [],
yn:yn
diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/bdstReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/bdstReg/index.tsx
index ffa920f39..f7b990dba 100644
--- a/apps/wr/app/store/ruseFcltMng/fcltReg/bdstReg/index.tsx
+++ b/apps/wr/app/store/ruseFcltMng/fcltReg/bdstReg/index.tsx
@@ -34,12 +34,12 @@ export type bdstState = {
};
type bdstActions = {
- findBdst: (sggCd:string, searchTxt:string) => void ;
+ findBdst: (sggCd:string, searchTxt:string, flag:string) => void ;
};
- const findBdstInfo = async(sggCd:string, searchTxt:string)=>{
- return await getFectch('wr', `/reuseFc/building/${sggCd}`+(searchTxt?`/${searchTxt}`:''))
+ const findBdstInfo = async(sggCd:string, searchTxt:string ,flg:string)=>{
+ return await getFectch('wr', `/reuseFc/building/${flg}/${sggCd}`+(searchTxt?`/${searchTxt}`:'' ))
}
@@ -55,10 +55,10 @@ export const bdstActionsExport: (set: any) => bdstActions = (
) => {
return {
- findBdst: async(sggCd:string, searchTxt:string) =>{
+ findBdst: async(sggCd:string, searchTxt:string ,flg:string ) =>{
try{
- const bdst = await findBdstInfo(sggCd, searchTxt);
+ const bdst = await findBdstInfo(sggCd, searchTxt, flg);
return set((state:bdstState) =>({
...state,
bdst:{
diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx
index 2e06ebe8a..f15a170df 100644
--- a/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx
+++ b/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx
@@ -25,10 +25,10 @@ export const rainZod =
instlCst: z.number(),
instlCstSprtYn: z.string(),
instlCstSprtAmt: z.number(),
- grntchBdstCertYn: z.string(),
- grntchBdstCertNo: z.string(),
- grntchBdstCertGrd: z.string(),
- grntchBdstCertYr: z.string(),
+ grntchBdstCertYn: z.string().nullish(),
+ grntchBdstCertNo: z.string().nullish(),
+ grntchBdstCertGrd: z.string().nullish(),
+ grntchBdstCertYr: z.string().nullish(),
bdstReuseFcltFk:z.number().nullish(),
pntfColKnd: z.string(),
pntfColArea: z.number(),
@@ -92,6 +92,7 @@ export type chgBuilding={
export type RainyBuilding = {
+ bdstInfoPk: number|null;
ctpvCd: number;
sggCd: number;
bdstNm: string;
@@ -99,7 +100,6 @@ export type RainyBuilding = {
frstArchPrmsnDt: Date;
archArea: string;
archChgArea: number;
- bdstInfoPk: number;
reuseBuilding: reuseBuilding[];
chgBuilding:chgBuilding[]
};
@@ -146,7 +146,8 @@ export const upHeadList: TableUpperProps[] = [
{ id: "sggText", title: "시군구" },
{ id: "bdstNm", title: "시설명" },
{ id: "daddr", title: "위치" },
- { id: "bdstUsgCd", title: "건축물용도" },
+ { id: "bdstUsgText", title: "건축물용도" },
+ // { id: "bdstUsgCd", title: "건축물용도" },
{ id: "frstArchPrmsnDt", title: "최초건축허가일" },
{ id: "archArea", title: "건축면적" },
{ id: "lawTrgtYn", title: "법적의무대상여부" },
@@ -223,8 +224,8 @@ export type rainFacState = {
};
};
type rainFacSActions = {
- init: () => void;
- dataInit: () => void;
+ init: (txt:string|undefined) => void;
+ rainSearTxt: (txt:string) => void;
rainReg: (data: RainyBuilding) => void;
rainUpdate: (data: RainyBuilding) => void;
};
@@ -241,23 +242,20 @@ export const rainFacStateExport: rainFacState = {
},
};
-const findBdstInfo = async(sggCd:string, searchTxt:string)=>{
- return await getFectch('wr', `/reuseFc/building/${sggCd}/${searchTxt}`)
-
-}
-const initFetch = async () => {
- return await getFectch("wr", "/reuseFc/rainyInfoList/1/20/41");
+
+const initFetch = async (txt:string|undefined) => {
+ return await getFectch("wr", `/reuseFc/rainyInfoList/1/20/41` +(txt? `/${txt}`:''));
};
export const rainFacActionsExport: (set: any) => rainFacSActions = (
set: any
) => {
return {
- init: async () => {
+ init: async (txt:string|undefined) => {
try {
// 파라이터 수정 통합관리자 =0, 시관리자=시코드, 시군구 관리자= 시군구 코드 를 세번째 파라미터로 지정 / 건축물 서치가 있을경우 4번째 파라미터로 던지기 즉 1/20/42(서울시)/영현빌딩 이런식으로)
- const rainRes = await initFetch();
+ const rainRes = await initFetch(txt);
// 여기서 상태 업데이트
return set((state: rainFacState) => ({
...state,
@@ -273,20 +271,30 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = (
console.log("finally");
}
},
- dataInit: () =>
- set((state: rainFacState) => {
- console.log(" state ", state.rain);
- return {
- rain: {
- ...state.rain,
- isInit: false,
- },
- };
- }),
+ rainSearTxt: async(txt:string) =>{
+ try{
+
+ const rainRes = await getFectch('wr' , `/reuseFc/rainyInfoList/1/20/41` +(txt? `/${txt}`:''))
+ set((state: rainFacState) => {
+ return {
+ rain: {
+ ...state.rain,
+ rainRes: rainRes,
+ isInit: false,
+ },
+ };
+ })}
+ catch(erTxt){
+ console.log("error", erTxt)
+ }
+ },
rainReg: async (data: RainyBuilding) => {
try {
const res = await postFectch("/reuseFc/rainyInfo", data);
- const rainRes = await initFetch();
+ if(res.ok){
+ alert(" 등록이 완료되었습니다.")
+ }
+ const rainRes = await initFetch(undefined);
set((state: rainFacState) => ({
...state,
rain: {
@@ -299,7 +307,6 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = (
console.log("e", e);
alert("등록 오류입니다.");
} finally {
- alert("등록이 완료되었습니다.");
}
},
rainUpdate: async (data: RainyBuilding) => {
@@ -311,7 +318,7 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = (
alert(" 수정이 완료되었습니다.")
}
- const rainRes = await initFetch();
+ const rainRes = await initFetch(undefined);
set((state: rainFacState) => ({
...state,
rain: {
diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx
index 16cd43b44..000218b96 100644
--- a/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx
+++ b/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx
@@ -1,94 +1,97 @@
-import { upHeadList, type bdstType, type selectArray, type TableUpperProps } from "../rainReg";
+import { getFectch } from "@/components/lib/api";
+import { upHeadList, type chgBuilding, type TableUpperProps } from "../rainReg";
+export type RswtBuilding = {
+ bdstInfoPk: number;
+ ctpvCd: number;
+ sggCd: number;
+ bdstNm: string;
+ daddr: string;
+ frstArchPrmsnDt: Date;
+ archArea: string;
+ archChgArea: number;
+ reuseBuilding: rswtReuseBuilding[];
+ chgBuilding: chgBuilding[];
+};
-const rswtOfObject:bdstType[] = [
- {
- sido: "서울",
- sigungo: "종로구",
- facilityName: "그랑서울",
- location: "종로 33",
- locationgubun: "업무시설",
- firstConstructionPermission : '2024-10-10',
- buildingArea: "50",
- facilityCapacity: "800,000",
- reuse: "Y",
- permissionDay:'2024-10-10',
- register: "Y",
- legalTargetYn:"Y"
- },
- {
- sido: "서울",
- sigungo: "종로구",
- facilityName: "그랑서울",
- location: "종로 33",
- locationgubun: "업무시설",
- firstConstructionPermission : '2024-10-10',
- buildingArea: "50",
- facilityCapacity: "800,000",
- reuse: "Y",
- permissionDay:'2024-10-10',
- register: "Y",
- legalTargetYn:"Y"
- },
- {
- sido: "서울",
- sigungo: "종로구",
- facilityName: "그랑서울",
- location: "종로 33",
- locationgubun: "업무시설",
- firstConstructionPermission : '2024-10-10',
- buildingArea: "50",
- facilityCapacity: "800,000",
- reuse: "Y",
- permissionDay:'2024-10-10',
- register: "Y",
- legalTargetYn:"Y"
- },
-]
+export type rswtReuseBuilding = {
+ bdstRuseFcltPk: number;
+ bdstInfoFk: number;
+ instlCmptnDt: Date | undefined;
+ instlCst: number | undefined;
+ operMngCd: number;
+ lawTrgtYn: string | undefined;
+ anlOperCst: number;
+ instlCstSprtYn: string | undefined;
+ instlCstSprtAmt: number | undefined;
+ bdstUsgCd: number | undefined;
+ grntchBdstCertYn: string | undefined;
+ grntchBdstCertNo: string | undefined;
+ grntchBdstCertGrd: string | undefined;
+ grntchBdstCertYr: string | undefined;
+ rswtrObj: rswtrObj | null;
+};
+export type rswtrObj = {
+ bdstRuseFcltFk: number | undefined;
+ wtrUsqty: number | undefined;
+ oblgTrgtWtrUsqty: number | undefined;
+ orgwtKndCd: string | undefined;
+ filtrTrtmfctProcs: string | undefined;
+ filtrTrtmfctUsgCd: string | undefined;
+ rswtrUsqty: number;
+ altUswtrUtztnYn: string;
+ altUswtrKndCd: string;
+ altUswtrUtztnQnt: number;
+ altUswtrIdntyMthdCd: string;
+};
+const rswtRes: RswtBuilding[] = [];
-const selectHomeWater = [
- { text: '집수면', val: "1" },
- { text: "종류", val: "2" },
- ];
-
- const selectYN= [
- { text: 'Y', val: "1" },
- { text: 'N', val: "2" },
- ];
-
-export type rswtFacState ={ rswt:{
+export type rswtFacState = {
+ rswt: {
isInit: boolean;
upHeadList: TableUpperProps[];
- rswtOfObject: bdstType[];
- selectHomeWater:selectArray[];
- selectYN:selectArray[];
-}}
+ rswtRes: RswtBuilding[];
+ };
+};
type rswtFacSActions = {
- decrementList: () => void
-}
+ initRswt: (txt: string | undefined) => void;
+};
export type rswtFacType = rswtFacState & rswtFacSActions;
-export const rswtFacStateExport:rswtFacState= {rswt:{
- isInit:false,
+export const rswtFacStateExport: rswtFacState = {
+ rswt: {
+ isInit: false,
upHeadList: upHeadList,
- rswtOfObject: rswtOfObject,
- selectHomeWater:selectHomeWater,
- selectYN:selectYN
-
-
-}}
-export const rswtFacActionsExport:(set:any)=>rswtFacSActions=(set: any) => {
- return {
- decrementList:()=>set(
- (state:rswtFacState) => {
- return (
- {rain:{
- upHeadList: state.rswt.upHeadList,
- rainOfObject:
- state.rswt.rswtOfObject.slice(0, state.rswt.rswtOfObject.length - 1)
- }})}
- )
- }
-}
+ rswtRes: rswtRes,
+ },
+};
+
+const initFetch = async (txt: string | undefined) => {
+ return await getFectch(
+ "wr",
+ `/reuseFc/waterreuseFc/1/20/01` + (txt ? `/${txt}` : "")
+ );
+};
+export const rswtFacActionsExport: (set: any) => rswtFacSActions = (
+ set: any
+) => {
+ return {
+ initRswt: async (txt: string | undefined) => {
+ try {
+ const rswtRes = await initFetch(txt);
+ return set((state: rswtFacState) => ({
+ ...state,
+ rswt: {
+ ...state.rswt,
+ rswtRes: rswtRes,
+ isInit: false,
+ },
+ }));
+ } catch (error) {
+ console.log(error);
+ }
+ },
+ };
+};
diff --git a/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx b/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx
index bf57cc97e..659297d4e 100644
--- a/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx
+++ b/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx
@@ -70,12 +70,14 @@ export function RainRegForm({
...rb?.rainyObj,
...data.reuseBuilding?.at(0),
pntfColKnd: selectedOption ? String(selectedOption.val) : undefined,
- frstArchPrmsnDt: new Date(data.frstArchPrmsnDt)
+ frstArchPrmsnDt: new Date(data.frstArchPrmsnDt ||null),
+ instlCmptnDt: new Date(data?.instlCmptnDt ||null)
};
form.reset(formData);
} else {
formData = {
- ...data
+ ...data,
+ frstArchPrmsnDt: new Date(data.frstArchPrmsnDt||null)
};
form.reset(formData);
@@ -142,15 +144,14 @@ export function RainRegForm({
};
if (isModal) {
+ // regRainForm.bdstInfoPk = null;
rainReg(regRainForm);
} else {
- console.log(" regRainForm ", regRainForm)
rainUpdate(regRainForm);
}
};
function onSubmit(values: z.infer
) {
- console.log(values);
objToForm(values);
}
diff --git a/apps/wr/components/ui/form/fcltReg/rswtrReg/component.tsx b/apps/wr/components/ui/form/fcltReg/rswtrReg/component.tsx
index cd8c4a02b..f563b3c53 100644
--- a/apps/wr/components/ui/form/fcltReg/rswtrReg/component.tsx
+++ b/apps/wr/components/ui/form/fcltReg/rswtrReg/component.tsx
@@ -33,7 +33,7 @@ const formSchema = z.object({
});
export function RswtrRegForm() {
- const { rswt } = useWrStore((state) => state);
+ const { rswt,code } = useWrStore((state) => state);
const form = useForm>({
resolver: zodResolver(formSchema),
@@ -165,7 +165,7 @@ export function RswtrRegForm() {
@@ -189,23 +189,7 @@ export function RswtrRegForm() {
)}
/>