Merge branch 'iipbs/sn/dev' of https://www.onasys.co.kr:3000/ONAANDALL/frontend into iipbs/sn/dev
This commit is contained in:
@@ -388,6 +388,7 @@ const Map = () => {
|
||||
return (
|
||||
<div className="bg-container">
|
||||
<Gis
|
||||
showZoomLevel={true}
|
||||
treeData={treeData}
|
||||
isSearch={false}
|
||||
gisMaps={gisMaps}
|
||||
|
||||
@@ -58,6 +58,7 @@ export default function MapDrgtPopUp() {
|
||||
return (
|
||||
<div className="bg-container">
|
||||
<Gis
|
||||
showZoomLevel={true}
|
||||
treeData={treeData}
|
||||
isSearch={false}
|
||||
gisMaps={gisMaps}
|
||||
|
||||
@@ -277,6 +277,7 @@ const Map = () => {
|
||||
<>
|
||||
<div className="bg-container">
|
||||
<Gis
|
||||
showZoomLevel={true}
|
||||
height='h-screen'
|
||||
treeData={treeData}
|
||||
isSearch={false}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
"use client";
|
||||
|
||||
/**
|
||||
* 📄 CoMatRvw 수요매칭 검토
|
||||
* Next.js App Router (app/) 기반 페이지 컴포넌트 예시
|
||||
*
|
||||
* - 대민에서 신청하는 수요처의 수요등록 정보를 운영담당자가 수요 매칭 검토를 진행한다.
|
||||
* - 전체적으로 form을 만들어서 form안에 데이터를 넣고 api를 호출하여 저장한다.
|
||||
*/
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { btnClass } from "@/app/store/common/code";
|
||||
import { usageProcData } from "@/app/store/matDmd/coMatRvw/headList";
|
||||
@@ -33,26 +39,21 @@ import {
|
||||
} from "@common/business_components/ui";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button, Input, Label } from "@common/components/ui";
|
||||
import { useAlertStore } from "@/src/shared/lib";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import moment from "moment";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useForm, useWatch } from "react-hook-form";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { z } from "zod";
|
||||
|
||||
|
||||
/**
|
||||
* 📄 CoMatRvw 수요매칭 검토
|
||||
* Next.js App Router (app/) 기반 페이지 컴포넌트 예시
|
||||
*
|
||||
* - 대민에서 신청하는 수요처의 수요등록 정보를 운영담당자가 수요 매칭 검토를 진행한다.
|
||||
* - 전체적으로 form을 만들어서 form안에 데이터를 넣고 api를 호출하여 저장한다.
|
||||
*/
|
||||
export default function CoMatRvw() {
|
||||
const { auth, code, coRvw, coMatRvwInit, coMatRvwSearch, coMatRvwInqua } =
|
||||
useWrStore((state) => state);
|
||||
const { coMatRvwRes, coMatRvwCount } = coRvw;
|
||||
const { regAuthrtYn } = auth;
|
||||
const alert = useAlertStore((state) => state.setMessage);
|
||||
|
||||
//init, sub, match
|
||||
const initRef = useRef<boolean>(false);
|
||||
@@ -253,7 +254,7 @@ export default function CoMatRvw() {
|
||||
const fromNum = Number(fromDate);
|
||||
const toNum = Number(toDate);
|
||||
if (fromNum > toNum) {
|
||||
toast.error(
|
||||
alert(
|
||||
"시작년도가 종료년도 이후로 설정할 수 없습니다."
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -21,8 +21,9 @@ import {
|
||||
} from "@common/business_components/ui";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button, Label } from "@common/components/ui";
|
||||
import { useAlertStore } from "@/src/shared/lib";
|
||||
import { useEffect, useState } from "react";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import * as XLSX from "xlsx";
|
||||
|
||||
@@ -44,6 +45,7 @@ export default function RuseCaseMng() {
|
||||
const [name, setName] = useState<string>("");
|
||||
const [resetPage, isResetPage] = useState(false);
|
||||
const { t } = useTranslation("base");
|
||||
const alert = useAlertStore((state) => state.setMessage);
|
||||
|
||||
// 엑셀 등록 모달
|
||||
const [isExcelOpen, setIsExcelOpen] = useState<boolean>(false);
|
||||
@@ -84,7 +86,7 @@ export default function RuseCaseMng() {
|
||||
if (!excelList) return;
|
||||
|
||||
if (excelList.length === 0) {
|
||||
toast.error(t("excelDownErrMsg"));
|
||||
alert(t("excelDownErrMsg"));
|
||||
return;
|
||||
}
|
||||
fetch(`/sample_ruseCaseMng.xlsx`, {}).then(async (response) => {
|
||||
|
||||
@@ -24,9 +24,10 @@ import {
|
||||
} from "@common/business_components/ui";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button, Label } from "@common/components/ui";
|
||||
import { useAlertStore } from "@/src/shared/lib";
|
||||
import moment from "moment";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
export default function RuseRvwHstry() {
|
||||
const {
|
||||
@@ -40,6 +41,7 @@ export default function RuseRvwHstry() {
|
||||
} = useWrStore((state) => state);
|
||||
const { rvwHistRes, ruseHistHeadList, rvwHistCount } = ruseHist;
|
||||
const { regAuthrtYn } = auth;
|
||||
const alert = useAlertStore((state) => state.setMessage);
|
||||
|
||||
const [pageNation, setPageNatiion] = useState<number>(1);
|
||||
|
||||
@@ -79,7 +81,7 @@ export default function RuseRvwHstry() {
|
||||
const fromNum = Number(fromDate);
|
||||
const toNum = Number(toDate);
|
||||
if (fromNum > toNum) {
|
||||
toast.error("시작년도가 종료년도 이후로 설정할 수 없습니다.");
|
||||
alert("시작년도가 종료년도 이후로 설정할 수 없습니다.");
|
||||
} else {
|
||||
let con: string | number = "";
|
||||
if (String(objSearch.city).length > 0) {
|
||||
@@ -133,7 +135,7 @@ export default function RuseRvwHstry() {
|
||||
selectedData[index]?.splyFcltFlg === "매칭완료" &&
|
||||
headId === "completeYn"
|
||||
) {
|
||||
toast.error(t("canNotChangeMatStateMsg"));
|
||||
alert(t("canNotChangeMatStateMsg"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -177,7 +179,7 @@ export default function RuseRvwHstry() {
|
||||
// </span>
|
||||
// ));
|
||||
} else {
|
||||
toast.error( t('isNotMatchFinishMsg'));
|
||||
alert(t('isNotMatchFinishMsg'));
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
|
||||
@@ -327,7 +327,8 @@ export default function CoSttn() {
|
||||
? objSearch.sgg
|
||||
: objSearch.city;
|
||||
if (updateData?.dmdInfoId) {
|
||||
await updateDemandCompany(data as DemandCompType);
|
||||
const message = await updateDemandCompany(data as DemandCompType);
|
||||
alert(message);
|
||||
coSttnInit("1", "13", String(con));
|
||||
setIsDmdModal({
|
||||
isMoal: false,
|
||||
@@ -343,7 +344,8 @@ export default function CoSttn() {
|
||||
alert(`사업자번호 ${dmd.dmdInfoId}는 이미 등록되었습니다. 다시등록해주세요`);
|
||||
return;
|
||||
}
|
||||
await regDemandCompany(data as DemandCompType);
|
||||
const message = await regDemandCompany(data as DemandCompType);
|
||||
alert(message);
|
||||
coSttnInit("1", "13", String(con));
|
||||
setIsDmdModal({
|
||||
isMoal: false,
|
||||
|
||||
@@ -9,12 +9,14 @@ import type { objSearchType } from "@/components/ui/modal/fcltReg/bdstRegModal/b
|
||||
import { ContentsDiv, DateMonthPicker, downloadExcel, SearchDiv, SearchFormLeft, SearchFormRight, SelectBox, UiModal, UiTable, type SelectDataType } from "@common/business_components/ui";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button, Label, ScrollArea } from "@common/components/ui";
|
||||
import { useAlertStore } from "@/src/shared/lib";
|
||||
import { useEffect, useState, useRef } from "react";
|
||||
import { toast, Toaster } from "react-hot-toast";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
|
||||
export default function DrgtSttn() {
|
||||
const { code, drgt, drgtSearch, drgtModalSearch, drgtInit } = useWrStore((state) => state);
|
||||
const { drgtRes, drgtMoRes } = drgt;
|
||||
const alert = useAlertStore((state) => state.setMessage);
|
||||
const [fromDate, setFromDate] = useState<string>('202506');
|
||||
const [toDate, setToDate] = useState<string>('202506');
|
||||
const [selectSgg, setSelectSgg] = useState<SelectDataType[]>([{ val: '0', text: '전체' }]);
|
||||
@@ -32,7 +34,7 @@ export default function DrgtSttn() {
|
||||
if (fromDate && toDate && drgtRes[index]) {
|
||||
drgtModalSearch(fromDate, toDate, drgtRes[index].sggNm ?? '');
|
||||
} else {
|
||||
toast.error("조회기간을 선택해주세요.");
|
||||
alert("조회기간을 선택해주세요.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,8 +27,9 @@ import {
|
||||
} from "@common/business_components/ui";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button } from "@common/components/ui";
|
||||
import { useAlertStore } from "@/src/shared/lib";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function LdrmntCoSttn() {
|
||||
@@ -46,6 +47,7 @@ export default function LdrmntCoSttn() {
|
||||
const [resetPage, isResetPage] = useState(false);
|
||||
const [isDownloadClicked, setIsDownloadClicked] = useState(false);
|
||||
const { t } = useTranslation('base');
|
||||
const alert = useAlertStore((state) => state.setMessage);
|
||||
const { regAuthrtYn, mdfcnAuthrtYn } = auth;
|
||||
|
||||
const excelClick = useCallback(() => {
|
||||
@@ -113,7 +115,7 @@ export default function LdrmntCoSttn() {
|
||||
headerRange: "A1:F1"
|
||||
});
|
||||
} else {
|
||||
toast.error(t('excelDownErrMsg'));
|
||||
alert(t('excelDownErrMsg'));
|
||||
}
|
||||
setIsDownloadClicked(false);
|
||||
}, [excelData, isDownloadClicked]);
|
||||
@@ -270,7 +272,8 @@ export default function LdrmntCoSttn() {
|
||||
readonly={mdfcnAuthrtYn === 'N'}
|
||||
onFormSubmit={async (value) => {
|
||||
const handleConfirm = async () => {
|
||||
await ldrmntUpdate(value);
|
||||
const message = await ldrmntUpdate(value);
|
||||
alert(message);
|
||||
setDetailModal({ ...detailModal, isOpen: false });
|
||||
ldrmntSearch(false, pageNation, '20', computeCityNm(), searchTxt || "");
|
||||
};
|
||||
|
||||
@@ -44,13 +44,14 @@ import {
|
||||
import { PbnstMngForm } from "@/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm";
|
||||
import { PbnstBuseForm } from "@/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm";
|
||||
import { PbnstRegModal } from "@/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal";
|
||||
import toast, { Toaster } from "react-hot-toast"; // toast 이미 import 되어 있음
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { writeRgtrAndMdfr } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg";
|
||||
import { useFieldArray, useForm, type FieldErrors } from "react-hook-form"; // FieldErrors 타입 추가
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { z } from "zod";
|
||||
import { createDefaultPbnstItem } from "./utilsZod";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useAlertStore } from "@/src/shared/lib";
|
||||
export default function PublicReuseFaciltyInsert() {
|
||||
const {
|
||||
auth,
|
||||
@@ -66,6 +67,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
} = useWrStore((state) => state);
|
||||
|
||||
const { t } = useTranslation("base");
|
||||
const alert = useAlertStore((state) => state.setMessage);
|
||||
const { pubFacHeadList, pbnstHasuResCount, pbnstHasuRes, pbnstRes } = pbnst;
|
||||
const { regAuthrtYn, mdfcnAuthrtYn, laeSeCd } = auth;
|
||||
const [, setCurrentTab] = useState<string>("mng");
|
||||
@@ -140,7 +142,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
const isFcltSuccess = resFclt.status === "fulfilled";
|
||||
const isBizSuccess = resBiz.status === "fulfilled";
|
||||
if (isFcltSuccess && isBizSuccess) {
|
||||
toast.success("하수 재이용 시설 및 사업이 수정되었습니다. ");
|
||||
alert("하수 재이용 시설 및 사업이 수정되었습니다.");
|
||||
// 메시지 표시, 페이지 이동 등
|
||||
} else {
|
||||
let message = "";
|
||||
@@ -151,7 +153,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
if (!isBizSuccess) {
|
||||
message += "하수재이용 시설 사업 ";
|
||||
}
|
||||
toast.error(message + "오류 입니다 ");
|
||||
alert(message + "오류 입니다 ");
|
||||
pubHasuInit("1", laeSeCd);
|
||||
}
|
||||
});
|
||||
@@ -215,7 +217,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
}
|
||||
}
|
||||
// 최종 오류 메시지 출력
|
||||
toast.error(`${prefix}${message}`);
|
||||
alert(`${prefix}${message}`);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -321,8 +323,8 @@ export default function PublicReuseFaciltyInsert() {
|
||||
onClick={() => {
|
||||
// pbnstMngData([] as customPbnst[]);
|
||||
if (!selectRow) {
|
||||
toast.error(
|
||||
"하수리시시설을 테이블을 선택하고 등록버튼을 눌러주세요"
|
||||
alert(
|
||||
"재시용시설을 등록할 하수리시시설을 테이블에서 선택하고 등록버튼을 눌러주세요"
|
||||
);
|
||||
return;
|
||||
} else {
|
||||
@@ -416,7 +418,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
onClick={() => {
|
||||
// pbnstMngData([] as customPbnst[]);
|
||||
if (!selectRow) {
|
||||
toast.error(
|
||||
alert(
|
||||
"하수리시시설을 테이블을 선택하고 등록버튼을 눌러주세요"
|
||||
);
|
||||
return;
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
import type { pubHasuType } from "../../ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
import type { DemandCompType } from "@common/business_components/ui/sdmInsertForm/form";
|
||||
import type { conCostFeeType, rateFeeType } from "./type";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
|
||||
export const comFcltStateExport: comFcltState = {
|
||||
@@ -59,8 +58,8 @@ export type comFcltState = {
|
||||
type comFcltActions = {
|
||||
getSwtrmtFcltNm: (searchNm: string) => void;
|
||||
getDemandCompList: (searchNm: string, cnt: number) => void;
|
||||
regDemandCompany: (data: DemandCompType) => void;
|
||||
updateDemandCompany: (data: DemandCompType) => void;
|
||||
regDemandCompany: (data: DemandCompType) => Promise<string>;
|
||||
updateDemandCompany: (data: DemandCompType) => Promise<string>;
|
||||
getConstCostFee: (year: string) => void;
|
||||
getRateFee: (year: string) => void;
|
||||
};
|
||||
@@ -109,7 +108,6 @@ export const comFcltSearchAction: (set: any) => comFcltActions = (set: any) => {
|
||||
fetchType.WR
|
||||
);
|
||||
if (response.status === 200) {
|
||||
toast.success('수요처가 등록되었습니다. ')
|
||||
set((state: comFcltState) => {
|
||||
|
||||
return {
|
||||
@@ -117,11 +115,12 @@ export const comFcltSearchAction: (set: any) => comFcltActions = (set: any) => {
|
||||
dmdIsSucees: "success"
|
||||
}
|
||||
});
|
||||
return "수요처가 등록되었습니다.";
|
||||
}
|
||||
return "수요처 등록에 실패하였습니다.";
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
toast.error('수요처가 등록 오류입니다.. ')
|
||||
|
||||
return "수요처 등록 중 오류가 발생했습니다.";
|
||||
}
|
||||
},
|
||||
updateDemandCompany: async (data: DemandCompType) => {
|
||||
@@ -131,7 +130,6 @@ export const comFcltSearchAction: (set: any) => comFcltActions = (set: any) => {
|
||||
let message = "";
|
||||
if (response.status === 200) {
|
||||
message = "success";
|
||||
toast.success('수요처 정보가 변경되었습니다. ' )
|
||||
} else {
|
||||
message = "fail";
|
||||
}
|
||||
@@ -142,10 +140,13 @@ export const comFcltSearchAction: (set: any) => comFcltActions = (set: any) => {
|
||||
dmdIsSucees: message
|
||||
}
|
||||
});
|
||||
if (response.status === 200) {
|
||||
return "수요처 정보가 변경되었습니다.";
|
||||
}
|
||||
return "수요처 정보 변경에 실패하였습니다.";
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
toast.success('수요처 정보가 오류입니다. ' )
|
||||
|
||||
return "수요처 정보 변경 중 오류가 발생했습니다.";
|
||||
}
|
||||
},
|
||||
getRateFee: async (year: string) => {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { fetchType, getFetchWithCount, putFectch } from "@/components/lib/api";
|
||||
import toast from "react-hot-toast";
|
||||
import type { CommonTableProps } from "../../common/type/header";
|
||||
import {
|
||||
constCostHeadListExport,
|
||||
@@ -50,7 +49,7 @@ type coRvwActions = {
|
||||
splyCd: string,
|
||||
dmdCd: string,
|
||||
data: DedMatUpdateType
|
||||
) => void;
|
||||
) => Promise<string>;
|
||||
coMatRvwSearch: (
|
||||
pageNo: number,
|
||||
pageCnt: number,
|
||||
@@ -104,20 +103,17 @@ export const coRvwActionsExport: (set: any) => coRvwActions = (set: any) => {
|
||||
splyCd: string,
|
||||
dmdCd: string,
|
||||
data: DedMatUpdateType
|
||||
) => {
|
||||
): Promise<string> => {
|
||||
try {
|
||||
const response = await putFectch(
|
||||
`/reuseFc/request/cst/${splyCd}/${dmdCd}`,
|
||||
data
|
||||
);
|
||||
if (response.status === 200) {
|
||||
|
||||
if(data.flg ==='Sub'){
|
||||
|
||||
toast.success("매칭 검토로 저장되었습니다.");
|
||||
}else{
|
||||
toast.success("매칭 검토완료로 저장되었습니다.");
|
||||
}
|
||||
const successMessage =
|
||||
data.flg === "Sub"
|
||||
? "매칭 검토로 저장되었습니다."
|
||||
: "매칭 검토완료로 저장되었습니다.";
|
||||
|
||||
const coMatRvwRes = await coMatInit(
|
||||
1,
|
||||
@@ -125,21 +121,22 @@ export const coRvwActionsExport: (set: any) => coRvwActions = (set: any) => {
|
||||
new Date().getFullYear().toString(),
|
||||
new Date().getFullYear().toString()
|
||||
);
|
||||
return set((state: coRvwState) => ({
|
||||
set((state: coRvwState) => ({
|
||||
...state,
|
||||
coRvw: {
|
||||
...state.coRvw,
|
||||
coMatRvwRes: coMatRvwRes.data,
|
||||
coMatRvwCount:coMatRvwRes.count,
|
||||
coMatRvwCount: coMatRvwRes.count,
|
||||
init: false,
|
||||
},
|
||||
}));
|
||||
return successMessage;
|
||||
} else {
|
||||
toast.error("매칭 검토 저장에 실패했습니다.");
|
||||
return "매칭 검토 저장에 실패했습니다.";
|
||||
}
|
||||
} catch (e) {
|
||||
toast.error("매칭 검토 저장 오류입니다.");
|
||||
console.error("coMatRvwUpdate error", e);
|
||||
return "매칭 검토 저장 오류입니다.";
|
||||
}
|
||||
},
|
||||
coMatRvwSearch: async (
|
||||
|
||||
@@ -72,7 +72,7 @@ export const ldrmntHeadListExport: CommonTableProps[] = [
|
||||
},
|
||||
{
|
||||
id: "fctryAddr",
|
||||
title: "공장주소",
|
||||
title: "회사주소",
|
||||
visible: true,
|
||||
row: 1,
|
||||
rowSpan: 1,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { CommonTableProps } from "@/app/store/common/type/header";
|
||||
import { deleteFectch, fetchType, getFetchWithCount, postFectch, putFectch } from "@/components/lib/api";
|
||||
import toast from "react-hot-toast";
|
||||
import { z } from "zod";
|
||||
import { TEST_UUID } from "../../ruseFcltMng/fcltReg/rainReg";
|
||||
import { ldrmntHeadListExport, ldrmntNodeListExport, ldrmntZod } from "./headList";
|
||||
@@ -35,7 +34,7 @@ type ldrmntActions = {
|
||||
ldrmntRegData: (data: any[]) => void,
|
||||
ldrmntInit: (isExcel: boolean, con: string) => void
|
||||
ldrmntSearch: (isExcel: boolean, page: number, sggCd: string, total: string, coNm: string) => void;
|
||||
ldrmntUpdate: (ldrmntRes: customLdrmnt) => void;
|
||||
ldrmntUpdate: (ldrmntRes: customLdrmnt) => Promise<string>;
|
||||
ldrmntDelete: () => void;
|
||||
loadingOpen: (isOpen: boolean) => void
|
||||
};
|
||||
@@ -192,12 +191,14 @@ export const ldrmntActionsExport: (set: any) => ldrmntActions = (
|
||||
);
|
||||
|
||||
if (res.ok) {
|
||||
toast.success("잠재수요처 상세정보가 수정되었습니다.",)
|
||||
return "잠재수요처 상세정보가 수정되었습니다.";
|
||||
}
|
||||
return "잠재수요처 상세정보 수정에 실패하였습니다.";
|
||||
} catch (error) {
|
||||
console.error("Error ldrmntUpdate:", error);
|
||||
toast.error("잠재수요처 상세정보 수정에 실패하였습니다.")
|
||||
return "잠재수요처 상세정보 수정에 실패하였습니다.";
|
||||
}
|
||||
return "잠재수요처 상세정보가 없습니다.";
|
||||
},
|
||||
ldrmntDelete: async () => {
|
||||
try {
|
||||
@@ -228,4 +229,4 @@ export const ldrmntActionsExport: (set: any) => ldrmntActions = (
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { fetchType, getFetchWithCount, postFectch } from "@/components/lib/api";
|
||||
import { toast } from "react-hot-toast";
|
||||
import type { TableUpperProps } from "../../common/type/header";
|
||||
import { ruseCaseHeadListExport } from "./headList";
|
||||
import type { ruseCaseMngExcelProps } from "./excel";
|
||||
@@ -24,7 +23,7 @@ type ruseCaseActions = {
|
||||
usageCd: string,
|
||||
name: string
|
||||
) => Promise<void>;
|
||||
insertRuseCaseMng: (data: any) => Promise<void>;
|
||||
insertRuseCaseMng: (data: any) => Promise<string>;
|
||||
};
|
||||
|
||||
const fetchSearchRuseCaseMng = async (
|
||||
@@ -131,11 +130,10 @@ export const ruseCaseActionsExport: (set: any) => ruseCaseActions = (
|
||||
}
|
||||
},
|
||||
|
||||
insertRuseCaseMng: async (data: any) => {
|
||||
insertRuseCaseMng: async (data: any): Promise<string> => {
|
||||
try {
|
||||
const response = await fetchInsertRuseCaseMng(data);
|
||||
if (response.status === 200) {
|
||||
toast.success("물재이용사례 등록이 완료되었습니다. ");
|
||||
const res = await getFetchWithCount(
|
||||
fetchType.WR,
|
||||
`/reuseFc/pubFcRuseCase/1/10/0/0`
|
||||
@@ -147,11 +145,13 @@ export const ruseCaseActionsExport: (set: any) => ruseCaseActions = (
|
||||
count: res.count,
|
||||
},
|
||||
}));
|
||||
return "물재이용사례 등록이 완료되었습니다.";
|
||||
} else {
|
||||
return "물재이용사례 등록에 실패했습니다.";
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
toast.error("물재이용사례 등록에 실패하였습니다. ");
|
||||
return "물재이용사례 등록에 실패했습니다.";
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
getInterpolation,
|
||||
transformAndInterpolate,
|
||||
} from "@/components/lib/func/calculateConstCost ";
|
||||
import { useAlertStore } from "@/src/shared/lib";
|
||||
import { ConstCostFeeTable } from "@/components/ui/modal/coMat/constCostFeeTable";
|
||||
import { RateFeeTableModal } from "@/components/ui/modal/coMat/rateFeeModal";
|
||||
import {
|
||||
@@ -53,6 +54,7 @@ export default function ConCostForm({
|
||||
getRateFee,
|
||||
getConstCostFee,
|
||||
} = useWrStore((state) => state);
|
||||
const alert = useAlertStore((state) => state.setMessage);
|
||||
|
||||
const ref = useRef<boolean>(false);
|
||||
|
||||
@@ -108,11 +110,11 @@ export default function ConCostForm({
|
||||
const calculateConstCost = useCallback(() => {
|
||||
const usgPrcsProcs = usgPrcsProcsWatch;
|
||||
if (!dmndQtyWatch) {
|
||||
toast.error("요구수량(m³/일)을 확인해주세요 계산할수 없습니다. ");
|
||||
alert("요구수량(m³/일)을 확인해주세요 계산할수 없습니다. ");
|
||||
return;
|
||||
}
|
||||
if (usgPrcsProcs === null || usgPrcsProcs === undefined) {
|
||||
toast.error(
|
||||
alert(
|
||||
"용도에 따른 처리공정을 확인할수 없습니다. 용도를 확인해주세요. "
|
||||
);
|
||||
return;
|
||||
@@ -175,9 +177,9 @@ export default function ConCostForm({
|
||||
form.setValue("totalConstCost", Math.round(realResult));
|
||||
}
|
||||
}, [constCostRes, rateFeeRes, usgPrcsProcsWatch, dmndQtyWatch]);
|
||||
const onSubmit = (value: DmdCoReqType) => {
|
||||
const onSubmit = async (value: DmdCoReqType) => {
|
||||
if (value.demandCst && !value.demandCst.prcsFcltCpctCstrnCst) {
|
||||
toast.error("공사비 계산 진행 후 저장을 눌러주새요");
|
||||
alert("공사비 계산 진행 후 저장을 눌러주새요");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -211,10 +213,15 @@ export default function ConCostForm({
|
||||
<div className="flex gap-2 mt-2">
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
onClick={async () => {
|
||||
toast.dismiss(t.id);
|
||||
|
||||
coMatRvwUpdate(pk, form.getValues("dmdInfoId"), data);
|
||||
|
||||
const message = await coMatRvwUpdate(
|
||||
pk,
|
||||
form.getValues("dmdInfoId"),
|
||||
data
|
||||
);
|
||||
alert(message);
|
||||
}}
|
||||
>
|
||||
확인
|
||||
@@ -226,10 +233,15 @@ export default function ConCostForm({
|
||||
</span>
|
||||
));
|
||||
} else {
|
||||
coMatRvwUpdate(pk, form.getValues("dmdInfoId"), data);
|
||||
const message = await coMatRvwUpdate(
|
||||
pk,
|
||||
form.getValues("dmdInfoId"),
|
||||
data
|
||||
);
|
||||
alert(message);
|
||||
}
|
||||
}else{
|
||||
toast.error('후보지를 먼저 선택해주세요')
|
||||
alert('후보지를 먼저 선택해주세요')
|
||||
}
|
||||
}
|
||||
} else if (type === "hist") {
|
||||
|
||||
@@ -39,8 +39,9 @@ import type { DemandCompType } from "@common/business_components/ui/sdmInsertFor
|
||||
import RuseMngTableForm from "@/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm";
|
||||
import type { SelectDataType } from "@common/business_components";
|
||||
import { BuseWaterQulity } from "./buseWaterQulity/buseWaterQulity";
|
||||
import toast from "react-hot-toast";
|
||||
// import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useAlertStore } from "@/src/shared/lib";
|
||||
//import { useTranslation } from "react-i18next";
|
||||
|
||||
|
||||
@@ -74,6 +75,7 @@ export function PbnstBuseForm({
|
||||
readonly?: boolean;
|
||||
}) {
|
||||
const { t } = useTranslation("base");
|
||||
const alert = useAlertStore((state) => state.setMessage);
|
||||
|
||||
const {
|
||||
code,
|
||||
@@ -193,7 +195,7 @@ export function PbnstBuseForm({
|
||||
fcDemands: [],
|
||||
});
|
||||
await appendBiz(newItem);
|
||||
toast.success(t('insertRuseBiz',{cycle: pbnstBizCycle + 1}))
|
||||
alert(t('insertRuseBiz',{cycle: pbnstBizCycle + 1}))
|
||||
setIndexBiz(pbnstBizCycle);
|
||||
}, [form, indexMng, indexBiz, appendBiz, setIndexBiz]);
|
||||
|
||||
@@ -779,8 +781,9 @@ export function PbnstBuseForm({
|
||||
rtnValue={(searchText: string, pageCnt: number) => {
|
||||
getDemandCompList(searchText, pageCnt);
|
||||
}}
|
||||
rtnInputData={(data) => {
|
||||
regDemandCompany(data as DemandCompType);
|
||||
rtnInputData={async (data) => {
|
||||
const message = await regDemandCompany(data as DemandCompType);
|
||||
alert(message);
|
||||
setIsDmdModal({
|
||||
isMoal: false,
|
||||
data: data as DemandCompType,
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useWrStore } from "@/app/store";
|
||||
import { coRegExcel } from "@/app/store/matDmd/coSttn/headList";
|
||||
import { mapAndValidateRow, type ruseCaseMngExcelProps } from "@/app/store/matDmd/ruseCaseMng/excel";
|
||||
import { showConfirmToast } from "@/components/lib/func/commom";
|
||||
import { useAlertStore } from "@/src/shared/lib";
|
||||
import { filePicked, Title } from "@common/business_components/ui";
|
||||
import { Form } from "@common/business_components/ui/form";
|
||||
import { Button, Input } from "@common/components/ui";
|
||||
@@ -12,6 +13,7 @@ import type { z } from "zod";
|
||||
|
||||
export default function RuseCaseMngExcel({setIsExcelOpen}:{setIsExcelOpen: (isOpen:boolean)=>void}) {
|
||||
const { insertRuseCaseMng } = useWrStore((state) => state);
|
||||
const alert = useAlertStore((state) => state.setMessage);
|
||||
const form = useForm<z.infer<typeof coRegExcel>>({
|
||||
resolver: zodResolver(coRegExcel),
|
||||
});
|
||||
@@ -20,7 +22,7 @@ export default function RuseCaseMngExcel({setIsExcelOpen}:{setIsExcelOpen: (isOp
|
||||
|
||||
const onSubmit = () => {
|
||||
if (file) {
|
||||
filePicked(file, 0).then((res: unknown) => {
|
||||
filePicked(file, 0).then(async (res: unknown) => {
|
||||
try {
|
||||
const newArray: ruseCaseMngExcelProps[] = []
|
||||
const isError:string[][] = []
|
||||
@@ -144,7 +146,8 @@ export default function RuseCaseMngExcel({setIsExcelOpen}:{setIsExcelOpen: (isOp
|
||||
alert("업로드할 데이터가 없습니다.");
|
||||
return;
|
||||
}else if(newArray.length > 0){
|
||||
insertRuseCaseMng(newArray);
|
||||
const message = await insertRuseCaseMng(newArray);
|
||||
alert(message);
|
||||
setIsExcelOpen(false);
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -188,4 +191,4 @@ export default function RuseCaseMngExcel({setIsExcelOpen}:{setIsExcelOpen: (isOp
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user