수요/재이용 공사비 작업중
This commit is contained in:
@@ -14,8 +14,8 @@ import {
|
||||
tableData,
|
||||
yearOptions,
|
||||
} from "@/components/lib/func/commom";
|
||||
import { CmpttnModal } from "@/components/ui/modal/coMat/cmpttnModal";
|
||||
import { CoMatModal } from "@/components/ui/modal/coMat/coMatModal";
|
||||
import { CmpttnModal } from "@/components/ui/modal/coMat/constCostFeeTable";
|
||||
import { CoMatModal } from "@/components/ui/modal/coMat/rateFeeModal";
|
||||
import type { objSearchType } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal";
|
||||
import {
|
||||
ContentsDiv,
|
||||
@@ -45,9 +45,8 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import ConCostForm from "@/components/ui/form/coMat/conCostForm/conCostForm";
|
||||
|
||||
export default function CoMatRvw() {
|
||||
const { code, coRvw, coMatRvwInit ,coMatRvwSearch ,coMatRvwInqua} = useWrStore(
|
||||
(state) => state
|
||||
);
|
||||
const { code, coRvw, coMatRvwInit, coMatRvwSearch, coMatRvwInqua } =
|
||||
useWrStore((state) => state);
|
||||
const { coMatRvwRes } = coRvw;
|
||||
//init, sub, match
|
||||
const initRef = useRef<boolean>(false);
|
||||
@@ -78,9 +77,7 @@ export default function CoMatRvw() {
|
||||
sggCd: string,
|
||||
dmdCoNm: string
|
||||
) => {
|
||||
|
||||
if (dmdCoNm.length>0 ) {
|
||||
|
||||
if (dmdCoNm.length > 0) {
|
||||
coMatRvwSearch(
|
||||
pageNation,
|
||||
13,
|
||||
@@ -101,7 +98,6 @@ export default function CoMatRvw() {
|
||||
const TableCellClick = (index: number) => {
|
||||
console.log(coMatRvwRes);
|
||||
if (coMatRvwRes && coMatRvwRes[index]) {
|
||||
console.log(dmdMatData[index]);
|
||||
|
||||
setSelectData(coMatRvwRes[index]);
|
||||
}
|
||||
@@ -118,21 +114,19 @@ export default function CoMatRvw() {
|
||||
}, [form.watch("useUsgCd")]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
console.log(' coMatRvwRes ', coMatRvwRes)
|
||||
if (coMatRvwRes) {
|
||||
const data = coMatRvwRes?.map((item, index) => {
|
||||
console.log(" item ", item);
|
||||
let flag = "";
|
||||
flag = getdmdMatFlag(item?.demandMatching?.splyFcltFlg ??"");
|
||||
return {
|
||||
...item,
|
||||
ctpvCd: item.demandCo.ctpvCd,
|
||||
sggCd: item.demandCo.sggCd,
|
||||
dmdCoNm: item.demandCo.dmdCoNm,
|
||||
daddr: item.demandCo.daddr,
|
||||
telno: item.demandCo.telno,
|
||||
splyFcltFlg: getdmdMatFlag(item.demandMatching?.splyFcltFlg),
|
||||
ctpvCd: item.demandCo?.ctpvCd,
|
||||
sggCd: item.demandCo?.sggCd,
|
||||
dmdCoNm: item.demandCo?.dmdCoNm,
|
||||
daddr: item.demandCo?.daddr,
|
||||
telno: item.demandCo?.telno,
|
||||
regDt: moment(item?.demandCo?.regDt).format("YYYY-MM-DD"),
|
||||
state: "",
|
||||
splyFcltFlg: flag,
|
||||
};
|
||||
});
|
||||
setDmdMtaData(tableData(data, { code }));
|
||||
@@ -242,16 +236,10 @@ export default function CoMatRvw() {
|
||||
if (String(objSearch.city).length > 0) {
|
||||
con = String(objSearch.city);
|
||||
}
|
||||
if (String(objSearch.sgg).length > 0) {
|
||||
if (String(objSearch.sgg).length > 0 && String(objSearch.sgg) !== "0") {
|
||||
con = String(objSearch.sgg);
|
||||
}
|
||||
getSearch(
|
||||
fromNum,
|
||||
toNum,
|
||||
con,
|
||||
dmdCoNm
|
||||
);
|
||||
|
||||
getSearch(fromNum, toNum, con, dmdCoNm);
|
||||
}
|
||||
}
|
||||
}}
|
||||
@@ -674,7 +662,7 @@ export default function CoMatRvw() {
|
||||
</div>
|
||||
</div>
|
||||
</Form>
|
||||
<ConCostForm form={form} type={'mat'}/>
|
||||
<ConCostForm form={form} type={"mat"} />
|
||||
</ListDiv>
|
||||
</ScrollArea>
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { useWrStore } from "@/app/store";
|
||||
import {
|
||||
DmdCoReqSchema,
|
||||
type DmdCoReqType,
|
||||
type RvwHistTableType,
|
||||
} from "@/app/store/matDmd/coMatRvw/type";
|
||||
import {
|
||||
getCity,
|
||||
@@ -32,11 +33,17 @@ import { set, useFieldArray, useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
import { tableData } from "@/components/lib/func/commom";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import { ToastFormUi } from "@/components/ui/toast/toastFromUi";
|
||||
export default function RuseRvwHstry() {
|
||||
const { code, ruseHist, ruseRvwHistInit, ruseRvwSearch, ruseRvwInqua } =
|
||||
useWrStore((state) => state);
|
||||
const {
|
||||
code,
|
||||
ruseHist,
|
||||
ruseRvwHistInit,
|
||||
ruseRvwSearch,
|
||||
ruseRvwInqua,
|
||||
ruseRvwComplete,
|
||||
} = useWrStore((state) => state);
|
||||
const { rvwHistRes, ruseHistHeadList } = ruseHist;
|
||||
const schema = z.object({});
|
||||
const [pageNation, setPageNatiion] = useState<number>(1);
|
||||
|
||||
const [dmdCoNm, setDmdCoNm] = useState<string>("");
|
||||
@@ -53,7 +60,7 @@ export default function RuseRvwHstry() {
|
||||
const [toDate, setToDate] = useState<string>(
|
||||
String(new Date().getFullYear())
|
||||
);
|
||||
const [rvwHistData, setRvwHistData] = useState<DmdCoReqType[]>();
|
||||
const [rvwHistData, setRvwHistData] = useState<RvwHistTableType[]>();
|
||||
|
||||
const getSelCity = (val: string | number) => {
|
||||
const cityValue = String(val); // Ensure val is treated as a string
|
||||
@@ -85,12 +92,16 @@ export default function RuseRvwHstry() {
|
||||
ruseUtztnFcltNm
|
||||
);
|
||||
} else {
|
||||
|
||||
|
||||
console.log("시도코드", sggCd);
|
||||
ruseRvwInqua(pageNation, 13, String(startYear), String(endYear), sggCd);
|
||||
}
|
||||
};
|
||||
|
||||
const form = useForm<DmdCoReqType>({
|
||||
resolver: zodResolver(DmdCoReqSchema),
|
||||
mode: "onChange",
|
||||
});
|
||||
|
||||
const TableCellClick = useCallback(
|
||||
@@ -106,7 +117,37 @@ export default function RuseRvwHstry() {
|
||||
},
|
||||
[rvwHistRes, form]
|
||||
);
|
||||
|
||||
const confrirmToast = () => {
|
||||
const completeData = rvwHistData
|
||||
?.map((item) => {
|
||||
form.clearErrors;
|
||||
if (item?.completeYn) {
|
||||
return item.dmdInfoSn;
|
||||
}
|
||||
})
|
||||
.filter((item) => item !== undefined);
|
||||
if (form.formState.isDirty) {
|
||||
toast((t) => (
|
||||
<span className="flex flex-col items-center">
|
||||
표준공사비 정보가 변경되었습니다. 검토 완료 진행시 입력한 정보는
|
||||
초기화 됩니다.
|
||||
<br />
|
||||
진행하시겠습니까?
|
||||
<button
|
||||
onClick={() => {
|
||||
toast.dismiss(t.id);
|
||||
ruseRvwComplete(completeData as string[]);
|
||||
}}
|
||||
>
|
||||
확인
|
||||
</button>
|
||||
<button onClick={() => toast.dismiss(t.id)}>취소</button>
|
||||
</span>
|
||||
));
|
||||
} else {
|
||||
ruseRvwComplete(completeData as string[]);
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
if (!ruseHist.isInit) {
|
||||
ruseRvwHistInit(
|
||||
@@ -121,13 +162,17 @@ export default function RuseRvwHstry() {
|
||||
useEffect(() => {
|
||||
if (rvwHistRes) {
|
||||
const data = rvwHistRes?.map((item, index) => {
|
||||
let flag = "";
|
||||
flag = getdmdMatFlag(item.demandMatching?.splyFcltFlg ?? "");
|
||||
|
||||
console.log("flag", flag);
|
||||
return {
|
||||
...item,
|
||||
ctpvCd: item.demandCo.ctpvCd,
|
||||
sggCd: item.demandCo.sggCd,
|
||||
dmdCoNm: item.demandCo.dmdCoNm,
|
||||
daddr: item.demandCo.daddr,
|
||||
telno: item.demandCo.telno,
|
||||
ctpvCd: item.demandCo?.ctpvCd,
|
||||
sggCd: item.demandCo?.sggCd,
|
||||
dmdCoNm: item.demandCo?.dmdCoNm,
|
||||
daddr: item.demandCo?.daddr,
|
||||
telno: item.demandCo?.telno,
|
||||
regDt: item?.demandCo?.regDt
|
||||
? moment(item?.demandCo?.regDt).format("YYYY-MM-DD")
|
||||
: "없음",
|
||||
@@ -137,17 +182,21 @@ export default function RuseRvwHstry() {
|
||||
mtchnCmptnYmd: item?.mtchnCmptnYmd
|
||||
? moment(item?.mtchnCmptnYmd).format("YYYY-MM-DD")
|
||||
: "없음",
|
||||
splyFcltFk: item.demandMatching?.splyFcltFk,
|
||||
ruseUtztnFcltNm: item.ruseUtztnFcltNm,
|
||||
dmndQty: item.dmndQty,
|
||||
splyFcltFlg: getdmdMatFlag(item.demandMatching?.splyFcltFlg),
|
||||
matYn: false,
|
||||
};
|
||||
splyFcltFlg: flag,
|
||||
completeYn: false,
|
||||
} as unknown as RvwHistTableType;
|
||||
});
|
||||
|
||||
setRvwHistData(tableData(data, { code }));
|
||||
}
|
||||
}, [rvwHistRes]);
|
||||
|
||||
useEffect(() => {}, [form.formState]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("변경여부 ", form.formState.isDirty);
|
||||
}, [form.formState]);
|
||||
|
||||
return (
|
||||
@@ -238,7 +287,7 @@ export default function RuseRvwHstry() {
|
||||
if (String(objSearch.city).length > 0) {
|
||||
con = String(objSearch.city);
|
||||
}
|
||||
if (String(objSearch.sgg).length > 0) {
|
||||
if (String(objSearch.sgg).length > 0 && objSearch.sgg !== "0") {
|
||||
con = String(objSearch.sgg);
|
||||
}
|
||||
getSearch(
|
||||
@@ -254,7 +303,7 @@ export default function RuseRvwHstry() {
|
||||
>
|
||||
조회
|
||||
</Button>
|
||||
<Button size={"sm"} onClick={(e) => {}}>
|
||||
<Button size={"sm"} onClick={confrirmToast}>
|
||||
검토완료
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -40,11 +40,9 @@ export default function PbnstSttn() {
|
||||
} = useWrStore((state) => state);
|
||||
|
||||
const ref = useRef<ReturnType>({} as ReturnType);
|
||||
const codeData = getCityOrSgg(ref);
|
||||
const [searchYear, setSearchYear] = useState<string>(
|
||||
String(new Date().getFullYear())
|
||||
);
|
||||
|
||||
const [pageNation, setPageNation] = useState(1);
|
||||
const [isChHead, setIsChHead] = useState(false);
|
||||
const [bdstTable, setBdstTable] = useState<WaterReuseFacility[]>();
|
||||
@@ -53,10 +51,8 @@ export default function PbnstSttn() {
|
||||
data: customPbnst;
|
||||
}>({ isModal: false, data: {} as customPbnst });
|
||||
|
||||
const [clickPk , setClickPk] = useState<string>("")
|
||||
const [pbnRuseNm, setPbnRuseNm] = useState<string>("");
|
||||
|
||||
|
||||
const excelClick = useCallback(() => {
|
||||
pbnstSttnSearch("1", "10000", ref.current, "", searchYear);
|
||||
}, [pbnstSttnSearch, searchYear, ref.current]);
|
||||
@@ -69,7 +65,6 @@ export default function PbnstSttn() {
|
||||
pbnstSttn.pbnstSttnRes[index]
|
||||
) {
|
||||
const pbnstRuseFcltPk = pbnstSttn.pbnstSttnRes[index].pbnstRuseFcltPk;
|
||||
// setClickPk(pbnstRuseFcltPk)
|
||||
getPbnStnDetail(pbnstRuseFcltPk);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -6,17 +6,23 @@ import {
|
||||
} from "@/components/lib/api";
|
||||
import type { pubHasuType } from "../../ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
import type { DemandCompType } from "@common/business_components/ui/sdmInsertForm/form";
|
||||
import type { conCostFeeType, rateFeeType } from "./type";
|
||||
export type comFcltState = {
|
||||
searchFclts: pubHasuType;
|
||||
demandCompList: DemandCompType[];
|
||||
dmdIsSucees: string;
|
||||
checkDemand: DemandCompType;
|
||||
constCostRes:conCostFeeType[],
|
||||
rateFeeRes:rateFeeType[],
|
||||
|
||||
};
|
||||
export type comFcltActions = {
|
||||
getSwtrmtFcltNm: (searchNm: string) => void;
|
||||
getDemandCompList: (searchNm: string, cnt: number) => void;
|
||||
regDemandCompany: (data: DemandCompType) => void;
|
||||
updateDemandCompany: (data: DemandCompType) => void;
|
||||
getConstCostFee: (year: string) => void;
|
||||
getRateFee: (year: string) => void;
|
||||
};
|
||||
|
||||
export const searchActions: (set: any) => comFcltActions = (set: any) => {
|
||||
@@ -47,7 +53,7 @@ export const searchActions: (set: any) => comFcltActions = (set: any) => {
|
||||
|
||||
console.log(coList);
|
||||
set((state: comFcltState) => {
|
||||
return state.demandCompList = [...coList];
|
||||
return (state.demandCompList = [...coList]);
|
||||
});
|
||||
},
|
||||
regDemandCompany: async (data: DemandCompType) => {
|
||||
@@ -64,9 +70,8 @@ export const searchActions: (set: any) => comFcltActions = (set: any) => {
|
||||
message = "fail";
|
||||
}
|
||||
set((state: comFcltState) => {
|
||||
state.dmdIsSucees = message;
|
||||
state.dmdIsSucees = message;
|
||||
return state;
|
||||
|
||||
});
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
@@ -84,15 +89,35 @@ export const searchActions: (set: any) => comFcltActions = (set: any) => {
|
||||
}
|
||||
|
||||
set((state: comFcltState) => {
|
||||
state.dmdIsSucees = message;
|
||||
state.dmdIsSucees = message;
|
||||
return state;
|
||||
|
||||
});
|
||||
|
||||
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
},
|
||||
getRateFee: async (year: string) => {
|
||||
try {
|
||||
const url = `/prcsFclt/CstRt/${year}`;
|
||||
const rateFeeRes = await getFetch(fetchType.COMMON, url);
|
||||
set((state: comFcltState) => {
|
||||
state.rateFeeRes = rateFeeRes;
|
||||
return state;
|
||||
});
|
||||
} catch (e) {
|
||||
console.log(" error ", e);
|
||||
}
|
||||
},getConstCostFee: async (year: string) => {
|
||||
try {
|
||||
const url = `/prcsFclt/CstRuse/${year}`;
|
||||
const constCost = await getFetch(fetchType.COMMON, url);
|
||||
set((state: comFcltState) => {
|
||||
state.constCostRes = constCost;
|
||||
return state;
|
||||
});
|
||||
}catch (e) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
export type conCostFeeType= {
|
||||
yr: string,
|
||||
fctCpc: string,
|
||||
fctCd: string,
|
||||
stdCost: string
|
||||
}
|
||||
export type rateFeeType = {
|
||||
yr: string,
|
||||
incExpCd: string,
|
||||
stdCost: number,
|
||||
rt: number
|
||||
}
|
||||
@@ -110,15 +110,12 @@ export const coRvwNodeListExport: CommonTableProps[] = [
|
||||
|
||||
export const cmpttnHeadListExport: CommonTableProps[] = [
|
||||
{
|
||||
id: "ctpv",
|
||||
id: "",
|
||||
title: "구분",
|
||||
visible: true,
|
||||
row: 1,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "sgg",
|
||||
id: "BD",
|
||||
title: "처리시설 용량(m³)",
|
||||
visible: true,
|
||||
row: 1,
|
||||
@@ -213,41 +210,26 @@ export const coModalHeadListExport: CommonTableProps[] = [
|
||||
id: "gubun",
|
||||
title: "공사비/구분",
|
||||
visible: true,
|
||||
row: 1,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "a",
|
||||
id: "BD",
|
||||
title: "기본조사설계비",
|
||||
visible: true,
|
||||
row: 1,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "aa",
|
||||
id: "WD",
|
||||
title: "실시설계비",
|
||||
visible: true,
|
||||
row: 1,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "aaa",
|
||||
id: "SE",
|
||||
title: "공사감리비",
|
||||
visible: true,
|
||||
row: 1,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "aaaa",
|
||||
id: "CE",
|
||||
title: "시설부대비",
|
||||
visible: true,
|
||||
row: 1,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ const coMatInit = async (
|
||||
startYear: string,
|
||||
endYear: string,
|
||||
) => {
|
||||
const url = `/reuseFc/request/infoList/${pageNo}/${pageCnt}/${startYear}/${endYear}`;
|
||||
const url = `/reuseFc/request/infoList/sub/${pageNo}/${pageCnt}/${startYear}/${endYear}`;
|
||||
const coMatRvwRes = await getFetch(fetchType.WR, url);
|
||||
|
||||
return coMatRvwRes;
|
||||
@@ -78,8 +78,7 @@ export const coRvwActionsExport: (set: any) => coRvwActions = (set: any) => {
|
||||
startYear: string,
|
||||
endYear: string,
|
||||
) => {
|
||||
const url = `/reuseFc/request/infoList/${pageNo}/${pageCnt}/${startYear}/${endYear}`;
|
||||
const coMatRvwRes = await getFetch(fetchType.WR, url);
|
||||
const coMatRvwRes = await coMatInit(pageNo, pageCnt, startYear, endYear);
|
||||
|
||||
return set((state: coRvwState) => ({
|
||||
...state,
|
||||
@@ -127,7 +126,7 @@ export const coRvwActionsExport: (set: any) => coRvwActions = (set: any) => {
|
||||
sggCd: string,
|
||||
dmdCoNm: string,
|
||||
) => {
|
||||
let url = `/reuseFc/request/infoList/${pageNo}/${pageCnt}/${startYear}/${endYear}`;
|
||||
let url = `/reuseFc/request/infoList/sub/${pageNo}/${pageCnt}/${startYear}/${endYear}`;
|
||||
|
||||
if (sggCd.length > 0) {
|
||||
url += `/${sggCd}`;
|
||||
@@ -159,9 +158,9 @@ export const coRvwActionsExport: (set: any) => coRvwActions = (set: any) => {
|
||||
sggCd: string
|
||||
) => {
|
||||
try {
|
||||
let url = `/reuseFc/request/infoList/${pageNo}/${pageCnt}/${startYear}/${endYear}`;
|
||||
let url = `/reuseFc/request/infoList/sub/${pageNo}/${pageCnt}/${startYear}/${endYear}`;
|
||||
if (sggCd.length > 0) {
|
||||
url += `/${sggCd}`;
|
||||
url += `/${sggCd}/0`;
|
||||
}else if(sggCd ==='0'){
|
||||
url += `/0/0`;
|
||||
}
|
||||
@@ -176,6 +175,6 @@ export const coRvwActionsExport: (set: any) => coRvwActions = (set: any) => {
|
||||
} catch (e) {
|
||||
console.log(" error ", e);
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -91,7 +91,8 @@ import { z } from "zod";
|
||||
rvwCmptnYmd: z.string().nullish(),
|
||||
demandCo: DemandCoSchema.nullish(),
|
||||
demandMatching: DemandMatchingSchema.nullish(),
|
||||
demandCst: DemandCstSchema
|
||||
demandCst: DemandCstSchema,
|
||||
ruseUtztnFcltNm:z.string().nullish(),
|
||||
});
|
||||
|
||||
|
||||
@@ -103,7 +104,7 @@ export type DmdMatTableType = {
|
||||
daddr:string,
|
||||
telno:string,
|
||||
regDt:string,
|
||||
state:string
|
||||
splyFcltFlg:string
|
||||
}
|
||||
|
||||
|
||||
@@ -115,4 +116,56 @@ export type DedMatUpdateType =
|
||||
fcltSbsdEpsTrf: number;
|
||||
prcsFcltCpctCstrnCst: number;
|
||||
rgtr: string;
|
||||
}
|
||||
|
||||
|
||||
export type RvwHistTableType = {
|
||||
cityText:string,
|
||||
sggText:string,
|
||||
dmdCoNm:string,
|
||||
daddr:string,
|
||||
telno:string,
|
||||
regDt:string,
|
||||
rvwCmptnYmd:string,
|
||||
mtchnCmptnYmd:string,
|
||||
ruseUtztnFcltNm:string,
|
||||
dmndQty:string,
|
||||
useUsgCd:string,
|
||||
splyFcltFlg:string
|
||||
completeYn:boolean
|
||||
dmdInfoSn :string
|
||||
|
||||
}
|
||||
|
||||
export type RvwHistTableType = {
|
||||
cityText:string,
|
||||
sggText:string,
|
||||
dmdCoNm:string,
|
||||
daddr:string,
|
||||
telno:string,
|
||||
regDt:string,
|
||||
rvwCmptnYmd:string,
|
||||
mtchnCmptnYmd:string,
|
||||
ruseUtztnFcltNm:string,
|
||||
dmndQty:string,
|
||||
useUsgCd:string,
|
||||
splyFcltFlg:string
|
||||
completeYn:boolean
|
||||
dmdInfoSn :string
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export type conCostFeeType= {
|
||||
yr: string,
|
||||
fctCpc: string,
|
||||
fctCd: string,
|
||||
stdCost: string
|
||||
}
|
||||
export type rateFeeType = {
|
||||
yr: string,
|
||||
incExpCd: string,
|
||||
stdCost: number,
|
||||
rt: number
|
||||
}
|
||||
@@ -43,7 +43,7 @@ export const ruseHstryHeadListExport:TableUpperProps[]= [
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "splyFcltFk", //바꾸기
|
||||
id: "ruseUtztnFcltNm", //바꾸기
|
||||
title: "공급처",
|
||||
visible: true,
|
||||
},
|
||||
@@ -63,10 +63,9 @@ export const ruseHstryHeadListExport:TableUpperProps[]= [
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "matYn", //바꾸기
|
||||
id: "completeYn", //바꾸기
|
||||
title: "매칭완료 여부",
|
||||
visible: true,
|
||||
type:'check'
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import type {
|
||||
TableUpperProps,
|
||||
} from "../../common/type/header";
|
||||
import { ruseHstryHeadListExport } from "./headList";
|
||||
import { fetchType, getFetch, putFectch } from "@/components/lib/api";
|
||||
import { fetchType, getFetch, postFectch, putFectch } from "@/components/lib/api";
|
||||
import type { DmdCoReqType } from "../coMatRvw/type";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
@@ -46,7 +46,6 @@ type ruseHstryActions = {
|
||||
sggCd: string,
|
||||
dmdCoNm: string,
|
||||
ruseUtztnFcltNm: string
|
||||
|
||||
) => void;
|
||||
ruseRvwInqua: (
|
||||
pageNo: number,
|
||||
@@ -55,6 +54,7 @@ type ruseHstryActions = {
|
||||
endYear: string,
|
||||
sggCd: string
|
||||
) => void;
|
||||
ruseRvwComplete:( data: string[]) => void;
|
||||
};
|
||||
|
||||
const irvwHistInit = async (
|
||||
@@ -64,7 +64,7 @@ const irvwHistInit = async (
|
||||
endYear: string,
|
||||
sggCd?: string
|
||||
) => {
|
||||
let url = `/reuseFc/request/infoList/${pageNo}/${pageCnt}/${startYear}/${endYear}`;
|
||||
let url = `/reuseFc/request/infoList/matched/${pageNo}/${pageCnt}/${startYear}/${endYear}`;
|
||||
|
||||
console.log("sggCd ", sggCd);
|
||||
if (sggCd) {
|
||||
@@ -87,11 +87,6 @@ export const ruseHstryActionsExport: (set: any) => ruseHstryActions = (
|
||||
endYear: string,
|
||||
sggCd?: string
|
||||
) => {
|
||||
let url = `/reuseFc/request/infoList/${pageNo}/${pageCnt}/${startYear}/${endYear}`;
|
||||
|
||||
if (sggCd) {
|
||||
url += `/${sggCd}`;
|
||||
}
|
||||
const rvwHistRes = await irvwHistInit(
|
||||
pageNo,
|
||||
pageCnt,
|
||||
@@ -122,7 +117,7 @@ export const ruseHstryActionsExport: (set: any) => ruseHstryActions = (
|
||||
10,
|
||||
new Date().getFullYear().toString(),
|
||||
new Date().getFullYear().toString(),
|
||||
"11"
|
||||
"0"
|
||||
);
|
||||
return set((state: ruseHstryState) => ({
|
||||
...state,
|
||||
@@ -146,9 +141,8 @@ export const ruseHstryActionsExport: (set: any) => ruseHstryActions = (
|
||||
sggCd: string,
|
||||
dmdCoNm: string,
|
||||
ruseUtztnFcltNm: string
|
||||
|
||||
) => {
|
||||
let url = `/reuseFc/request/infoList/${pageNo}/${pageCnt}/${startYear}/${endYear}`;
|
||||
let url = `/reuseFc/request/infoList/matched/${pageNo}/${pageCnt}/${startYear}/${endYear}`;
|
||||
|
||||
if (sggCd.length > 0) {
|
||||
url += `/${sggCd}`;
|
||||
@@ -183,11 +177,10 @@ export const ruseHstryActionsExport: (set: any) => ruseHstryActions = (
|
||||
sggCd: string
|
||||
) => {
|
||||
try {
|
||||
let url = `/reuseFc/request/infoList/${pageNo}/${pageCnt}/${startYear}/${endYear}`;
|
||||
let url = `/reuseFc/request/infoList/matched/${pageNo}/${pageCnt}/${startYear}/${endYear}`;
|
||||
if (sggCd.length > 0) {
|
||||
url += `/${sggCd}`;
|
||||
url += `/${sggCd}/0`;
|
||||
}
|
||||
|
||||
const rvwHistRes = await getFetch(fetchType.WR, url);
|
||||
return set((state: ruseHstryState) => ({
|
||||
...state,
|
||||
@@ -200,5 +193,30 @@ export const ruseHstryActionsExport: (set: any) => ruseHstryActions = (
|
||||
console.log(" error ", e);
|
||||
}
|
||||
},
|
||||
ruseRvwComplete: async (data: string[]) => {
|
||||
try {
|
||||
const complet = await postFectch(
|
||||
`/reuseFc/request/completeCheck`,
|
||||
JSON.stringify(data),
|
||||
fetchType.WR
|
||||
);
|
||||
if (complet.status === 200) {
|
||||
toast.success("완료 처리가 완료되었습니다.");
|
||||
const rvwHistRes = await irvwHistInit(
|
||||
1,
|
||||
10,
|
||||
new Date().getFullYear().toString(),
|
||||
new Date().getFullYear().toString(),
|
||||
"0"
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(" error ", e);
|
||||
toast.error("완료 처리 중 오류가 발생했습니다.");
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -138,21 +138,18 @@ export const yearOptions: { val: string; text: string }[] = Array.from(
|
||||
})
|
||||
);
|
||||
|
||||
export const getdmdMatFlag = (flag: string) => {
|
||||
export const getdmdMatFlag = (flag: string|undefined) => {
|
||||
let flagMat = "";
|
||||
switch (flag) {
|
||||
case "Init":
|
||||
flagMat = "신청";
|
||||
break;
|
||||
case "Sub":
|
||||
flagMat = "검토";
|
||||
break;
|
||||
case "Matched":
|
||||
flagMat = "완료";
|
||||
break;
|
||||
default :
|
||||
flagMat = "";
|
||||
break;
|
||||
|
||||
if(flag === undefined || flag === null) {
|
||||
flagMat = "신청";
|
||||
}else if(flag.trim() === "Sub") {
|
||||
flagMat = "검토";
|
||||
|
||||
}else if(flag.trim() === "matched") {
|
||||
flagMat = "매칭완료";
|
||||
}else {
|
||||
flagMat = "신청";
|
||||
}
|
||||
return flagMat;
|
||||
};
|
||||
|
||||
@@ -6,8 +6,8 @@ import type {
|
||||
} from "@/app/store/matDmd/coMatRvw/type";
|
||||
import { TEST_UUID } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { formH1Class } from "@/components/lib/class/comClass";
|
||||
import { CmpttnModal } from "@/components/ui/modal/coMat/cmpttnModal";
|
||||
import { CoMatModal } from "@/components/ui/modal/coMat/coMatModal";
|
||||
import { ConstCostFeeTable } from "@/components/ui/modal/coMat/constCostFeeTable";
|
||||
import { RateFeeTableModal } from "@/components/ui/modal/coMat/rateFeeModal";
|
||||
import {
|
||||
Form,
|
||||
FormField,
|
||||
@@ -27,7 +27,7 @@ export default function ConCostForm({
|
||||
form: UseFormReturn<DmdCoReqType>;
|
||||
type: string;
|
||||
}) {
|
||||
const { coMatRvwUpdate,ruseRvwCalUpdate } = useWrStore((state) => state);
|
||||
const { coMatRvwUpdate, ruseRvwCalUpdate } = useWrStore((state) => state);
|
||||
|
||||
const [isTrfMo, setIsTrfMo] = useState<{
|
||||
isModal: boolean;
|
||||
@@ -36,10 +36,19 @@ export default function ConCostForm({
|
||||
isModal: boolean;
|
||||
}>({ isModal: false });
|
||||
|
||||
|
||||
const zipDowonLoad = () => {
|
||||
fetch(`/2024_constarctFeeProgram.zip`, {}).then(async (response) => {
|
||||
const blobRet = await response.blob();
|
||||
// const blob = new Blob([blobRet], { type: "application/octet-stream" });
|
||||
const link = document.createElement("a");
|
||||
link.href = URL.createObjectURL(blobRet);
|
||||
link.download =
|
||||
"24년_수도시설 운영비 및 개략공사비 산정프로그램.zip";
|
||||
link.click();
|
||||
});
|
||||
};
|
||||
|
||||
const onSubmit = (value: DmdCoReqType) => {
|
||||
|
||||
if (type === "mat") {
|
||||
const data: DedMatUpdateType = {
|
||||
dmdInfoSn: form.getValues("dmdInfoSn"),
|
||||
@@ -53,7 +62,7 @@ export default function ConCostForm({
|
||||
coMatRvwUpdate("11000SW001R1", form.getValues("dmdInfoFk"), data);
|
||||
} else if (type === "hist") {
|
||||
console.log("hist data ", value);
|
||||
ruseRvwCalUpdate(value)
|
||||
ruseRvwCalUpdate(value);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -177,7 +186,7 @@ export default function ConCostForm({
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
value={(Number(field.value) * 365)|| 0}
|
||||
value={Number(field.value) * 365 || 0}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -295,7 +304,7 @@ export default function ConCostForm({
|
||||
placeholder=""
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
field.onChange(e.target.value);
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
/>
|
||||
@@ -303,9 +312,7 @@ export default function ConCostForm({
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-4 mt-4">
|
||||
<div>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="demandCst.cstrnCst"
|
||||
@@ -324,12 +331,6 @@ export default function ConCostForm({
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-4">
|
||||
<Label>관로 표준공사비 산정 프로그램</Label>
|
||||
<Button size={"sm"} onClick={(e) => {}} className="bg-none">
|
||||
다운로드
|
||||
</Button>
|
||||
</div>
|
||||
<div className="col-span-4 mt-4 mb-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
@@ -353,19 +354,29 @@ export default function ConCostForm({
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className=" col-span-4 mt-4 ">
|
||||
<Label>관로 표준공사비 산정 프로그램</Label>
|
||||
<Button
|
||||
color="green"
|
||||
size={"sm"}
|
||||
onClick={zipDowonLoad}
|
||||
className="bg-none ml-6"
|
||||
>
|
||||
다운로드
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<UiModal
|
||||
body={<CoMatModal data={[]}></CoMatModal>}
|
||||
bodyClass="w-[40vw] max-w-none h-[70vh]"
|
||||
body={<ConstCostFeeTable setReturnData={(e) =>{}}></ConstCostFeeTable>}
|
||||
bodyClass="w-[40vw] max-w-none h-[30vh]"
|
||||
open={isTrfMo.isModal}
|
||||
onOpenChange={(open) => {
|
||||
setIsTrfMo({ isModal: open });
|
||||
}}
|
||||
/>
|
||||
<UiModal
|
||||
body={<CmpttnModal data={[]}></CmpttnModal>}
|
||||
bodyClass="w-[70vw] max-w-none h-[50vh]"
|
||||
body={<RateFeeTableModal setReturnData={(e) =>{}}></RateFeeTableModal>}
|
||||
bodyClass="w-[70vw] max-w-none h-[30vh]"
|
||||
open={isCmpttnMo.isModal}
|
||||
onOpenChange={(open) => {
|
||||
setIsCmpttnMo({ isModal: open });
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
"use client"
|
||||
|
||||
import { cmpttnHeadListExport } from "@/app/store/matDmd/coMatRvw/headList";
|
||||
import { yearOptions } from "@/components/lib/func/commom"
|
||||
import { SelectBox, UiTable } from "@common/business_components/ui"
|
||||
import { Label } from "@common/components/ui"
|
||||
import { useState } from "react";
|
||||
|
||||
export function CmpttnModal({ data }: { data: [] }) {
|
||||
const [year, setYear] = useState<string>(String(new Date().getFullYear()));
|
||||
return (
|
||||
<>
|
||||
<h3 className="mt-4 ml-2 text-2xl font-medium text-label">공사비 산정표 보기</h3>
|
||||
<hr/>
|
||||
<div className="flex items-center">
|
||||
<Label className="text-xl text-gray-600">기준년도</Label>
|
||||
<SelectBox
|
||||
className="h-full text-2xl"
|
||||
label=""
|
||||
selectClass={"ml-4"}
|
||||
selectArray={yearOptions}
|
||||
value={year}
|
||||
onSelectValue={(val: string | number) => setYear(String(val))} />
|
||||
</div>
|
||||
<UiTable
|
||||
headName={""}
|
||||
tableData={[]}
|
||||
headlist={cmpttnHeadListExport}
|
||||
pageSize={0}
|
||||
total={0}
|
||||
cellClick={() => { }}
|
||||
onPageChange={() => { }}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
"use client"
|
||||
|
||||
import { coModalHeadListExport } from "@/app/store/matDmd/coMatRvw/headList";
|
||||
import { yearOptions } from "@/components/lib/func/commom"
|
||||
import { SelectBox, UiTable } from "@common/business_components/ui"
|
||||
import { Label } from "@common/components/ui"
|
||||
import { useState } from "react";
|
||||
|
||||
export function CoMatModal({ data }: { data: [] }) {
|
||||
const [year, setYear] = useState<string>(String(new Date().getFullYear()));
|
||||
return (
|
||||
<>
|
||||
<h3 className="mt-4 ml-2 text-2xl font-medium text-label">요율표 보기</h3>
|
||||
<hr/>
|
||||
<div className="flex items-center">
|
||||
<Label className="text-xl text-gray-600">기준년도</Label>
|
||||
<SelectBox
|
||||
className="h-full text-2xl"
|
||||
label=""
|
||||
selectClass={"ml-4"}
|
||||
selectArray={yearOptions}
|
||||
value={year}
|
||||
onSelectValue={(val: string | number) => setYear(String(val))} />
|
||||
</div>
|
||||
<UiTable
|
||||
headName={""}
|
||||
tableData={[]}
|
||||
headlist={coModalHeadListExport}
|
||||
onPageChange={() => { }} pageSize={0} total={0} cellClick={undefined} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
"use client";
|
||||
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { cmpttnHeadListExport } from "@/app/store/matDmd/coMatRvw/headList";
|
||||
import { yearOptions } from "@/components/lib/func/commom";
|
||||
import { SelectBox, UiTable } from "@common/business_components/ui";
|
||||
import { Label } from "@common/components/ui";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export function ConstCostFeeTable({
|
||||
setReturnData,
|
||||
}: {
|
||||
setReturnData: (data: any) => void;
|
||||
}) {
|
||||
const { constCostRes,getConstCostFee } = useWrStore((state) => state);
|
||||
|
||||
const [year, setYear] = useState<string>(String(new Date().getFullYear()));
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
getConstCostFee(year)
|
||||
|
||||
}, [year,getConstCostFee]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
const tableData = constCostRes.map((item) => {})
|
||||
console.log(' constCostRes : ', constCostRes);
|
||||
},[constCostRes])
|
||||
|
||||
return (
|
||||
<>
|
||||
<h3 className="mt-4 ml-2 text-2xl font-medium text-label">
|
||||
공사비 산정표 보기
|
||||
</h3>
|
||||
<hr />
|
||||
<div className="flex items-center">
|
||||
<Label className="text-xl text-gray-600">기준년도</Label>
|
||||
<SelectBox
|
||||
className="h-full text-2xl"
|
||||
label=""
|
||||
selectClass={"ml-4"}
|
||||
selectArray={yearOptions}
|
||||
value={year}
|
||||
onSelectValue={(val: string | number) => setYear(String(val))}
|
||||
/>
|
||||
</div>
|
||||
<UiTable
|
||||
headName={""}
|
||||
tableData={[]}
|
||||
headlist={cmpttnHeadListExport}
|
||||
pageSize={0}
|
||||
total={0}
|
||||
cellClick={() => {}}
|
||||
onPageChange={() => {}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
"use client";
|
||||
|
||||
import { useWrStore } from "@/app/store";
|
||||
import type { rateFeeType } from "@/app/store/common/searchCode/type";
|
||||
import { coModalHeadListExport } from "@/app/store/matDmd/coMatRvw/headList";
|
||||
import { yearOptions } from "@/components/lib/func/commom";
|
||||
import { SelectBox, UiTable } from "@common/business_components/ui";
|
||||
import { Label } from "@common/components/ui";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export function RateFeeTableModal({ setReturnData}: { setReturnData: (data: any) => void }) {
|
||||
const [year, setYear] = useState<string>(String(new Date().getFullYear()));
|
||||
|
||||
const { rateFeeRes,getRateFee } = useWrStore((state) => state);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
|
||||
getRateFee(year)
|
||||
},[year,getRateFee])
|
||||
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
let tableData = []
|
||||
const data = rateFeeRes.reduce((acc: any,cur:rateFeeType) =>{
|
||||
const key = cur.stdCost;
|
||||
|
||||
|
||||
let target = acc.find((item: any) => item.stdCost === key);
|
||||
|
||||
if(!target){
|
||||
target={
|
||||
gubun: cur.stdCost,
|
||||
BD: 0,
|
||||
WD: 0,
|
||||
SE: 0,
|
||||
CE: 0,
|
||||
}
|
||||
acc.push(target);
|
||||
}
|
||||
|
||||
target[cur.incExpCd] = cur.rt;
|
||||
|
||||
return acc
|
||||
},[])
|
||||
|
||||
console.log('data : ', data);
|
||||
|
||||
},[rateFeeRes])
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="sticky top-0 z-10 bg-white pb-4">
|
||||
<h3 className="text-2xl font-medium text-label">요율표 보기</h3>
|
||||
<hr />
|
||||
<div className="flex items-center">
|
||||
<Label className="text-xl text-gray-600">기준년도</Label>
|
||||
<SelectBox
|
||||
className="h-full text-2xl"
|
||||
label=""
|
||||
selectClass={"ml-4"}
|
||||
selectArray={yearOptions}
|
||||
value={year}
|
||||
onSelectValue={(val: string | number) => setYear(String(val))}
|
||||
/>
|
||||
</div>
|
||||
<UiTable
|
||||
headName={""}
|
||||
tableData={[]}
|
||||
headlist={coModalHeadListExport}
|
||||
onPageChange={() => {}}
|
||||
pageSize={0}
|
||||
total={0}
|
||||
cellClick={undefined}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user