From 234f2bc0a7d9a7e760e48e4e85eacea09bafe89b Mon Sep 17 00:00:00 2001 From: leedj312 Date: Tue, 8 Jul 2025 10:25:54 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=ED=97=A4=EB=8D=94=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?=EC=82=AC=ED=95=AD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruseFcltMng/fcltSttn/htdflSttn/headList.tsx | 4 ++-- .../ruseFcltMng/fcltSttn/rainSttn/headList.tsx | 2 +- .../ui/modal/sttn/headChModal/headChModal.tsx | 13 ------------- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/headList.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/headList.tsx index bb58b6ea5..e1a8daec6 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/headList.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/headList.tsx @@ -125,7 +125,7 @@ export const htdflSttNodeListExport: CommonTableProps[] = [ visible: true, row: 1, rowSpan: 1, - colSpan: 11, + colSpan: 10, }, { @@ -255,7 +255,7 @@ export const htdflSttNodeListExport: CommonTableProps[] = [ { id: "prcsProcsYn", title: "처리공정여부", - upName: "prcsProcs", + upName: "htdflMngInfo", visible: true, row: 2, rowSpan: 2, diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx index ad2223473..fd8c2173e 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx @@ -343,7 +343,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ id: "filtrTrtmfct", title: "여과등 처리시설", visible: true, - upName: "insenInfo", + upName: "rainFcltInfo", row: 2, rowSpan: 1, colSpan: 3, diff --git a/apps/wr/components/ui/modal/sttn/headChModal/headChModal.tsx b/apps/wr/components/ui/modal/sttn/headChModal/headChModal.tsx index 4b3c8aa75..2cf90416c 100644 --- a/apps/wr/components/ui/modal/sttn/headChModal/headChModal.tsx +++ b/apps/wr/components/ui/modal/sttn/headChModal/headChModal.tsx @@ -13,19 +13,6 @@ export default function HeadChModal({ headList, type }: { headList: z.infer ({ id: item.id, title: item.title, val: item.visible })); - - /*const form = useForm>({ - resolver: zodResolver(sttnHeadListType), - defaultValues: [], - }) - - - useEffect(() =>{ - form.reset(headList) - - - },[headList])*/ - const form = useForm>({ resolver: zodResolver(sttnHeadListType), defaultValues: headList, From c1d1c2e27e502cd898d5244b5ebe11a234514800 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Tue, 8 Jul 2025 14:42:39 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EA=B2=B0=ED=95=A8=EB=8C=80=EC=A4=91=20?= =?UTF-8?q?=EC=A4=91=20=EB=93=B1=EB=A1=9D=20=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=EB=84=A4=EC=9D=B4=EC=85=98=20=EB=B0=8F=20=EC=88=98=EC=9A=94?= =?UTF-8?q?=EC=B2=98=EA=B4=80=EB=A6=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/matMng/coMng/coSttn/page.tsx | 49 +++++++------ .../app/ruseFcltMng/fcltReg/htdflReg/page.tsx | 42 ++++------- .../app/ruseFcltMng/fcltReg/pbnstReg/page.tsx | 2 +- .../app/ruseFcltMng/fcltReg/rainReg/page.tsx | 12 ++- .../app/ruseFcltMng/fcltReg/rswtReg/page.tsx | 44 ++++++----- apps/wr/app/store/matDmd/coSttn/excel.tsx | 11 +-- apps/wr/app/store/matDmd/coSttn/index.tsx | 7 +- .../prfmncReg/chkgdnReg/rainChkgdn/excel.tsx | 69 +++++++++++++++++- .../ruseFcltMng/fcltReg/htdflReg/index.tsx | 38 +++++----- .../ruseFcltMng/fcltReg/rainReg/index.tsx | 23 +++--- .../ruseFcltMng/fcltReg/rswtReg/index.tsx | 29 +++++--- apps/wr/components/lib/api/index.ts | 3 + .../ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx | 20 ++++- apps/wr/public/sample_coSttn.xlsx | Bin 8550 -> 8186 bytes 14 files changed, 226 insertions(+), 123 deletions(-) diff --git a/apps/wr/app/matMng/coMng/coSttn/page.tsx b/apps/wr/app/matMng/coMng/coSttn/page.tsx index e828f4226..163ed1b40 100644 --- a/apps/wr/app/matMng/coMng/coSttn/page.tsx +++ b/apps/wr/app/matMng/coMng/coSttn/page.tsx @@ -2,6 +2,7 @@ import { useWrStore } from "@/app/store"; import { btnClass } from "@/app/store/common/code"; +import { excelCoSttnParsing } from "@/app/store/matDmd/coSttn/excel"; import { fetchType, getFetch } from "@/components/lib/api"; import { excelDownload, @@ -42,7 +43,6 @@ export default function CoSttn() { updateDemandCompany, coSttnTxtSearch, demandCompList, - dmdIsSucees } = useWrStore((state) => state); const [bdstTable, setBdstTable] = useState(); @@ -116,31 +116,36 @@ export default function CoSttn() { coSttn.excelList, "수요처 관리", "sample_coSttn.xlsx", - "A1:F1", + "A1:G1", 2 ); } }, [coSttn.excelList]); - useEffect(() => { - const con = (objSearch.sgg && objSearch.sgg !== "0") ? objSearch.sgg : objSearch.city ? objSearch.city : "0"; - if(con){ - coSttnSearch(String(pageNation), "13", String(con)); - } - }, [coSttnSearch, objSearch.city, objSearch.sgg, pageNation]); + const excelClick = useCallback(() => { - const con = objSearch.sgg ? objSearch.sgg : objSearch.city; - if (con) coSttnSearch("1", "10000", String(con)); - }, [coSttnSearch, objSearch.city, objSearch.sgg]); + // const con = objSearch.sgg ? objSearch.sgg : objSearch.city; + // if (con) coSttnSearch("1", "10000", String(con)); + if(bdstTable){ + const excelData = excelCoSttnParsing(bdstTable); + excelDownload( + excelData as [], + "수요처 관리", + "sample_coSttn.xlsx", + "A1:F1", + 2 + ); + } + // }, [coSttnSearch, objSearch.city, objSearch.sgg]); +}, [excelDownload, bdstTable]); const searchClick = () => { const con = (objSearch.sgg && objSearch.sgg !== "0") ? objSearch.sgg : objSearch.city; if (con) { if (seartchTxt && seartchTxt?.length > 0) { - console.log(' seartchTxt ', seartchTxt) coSttnTxtSearch("1", "13", String(con), seartchTxt ?? ""); } else { coSttnSearch("1", "13", String(con)); @@ -233,7 +238,7 @@ export default function CoSttn() { headName={[]} tableData={bdstTable || []} headlist={coSttn.coSttHeadList} - pageSize={bdstTable?.length ? Math.ceil(bdstTable.length / 13) : 0} + pageSize={20} total={ coSttnResCount || 0 } cellClick={(index: number | undefined, headId: string) => { setUpdateData(coSttnRes[index as number]); @@ -258,22 +263,24 @@ export default function CoSttn() { getDemandCompList(searchText, pageCnt); }} rtnInputData={ async(data) => { + const con = (objSearch.sgg && objSearch.sgg !== "0") ? objSearch.sgg : objSearch.city; + if(upadateData?.dmdInfoPk){ - updateDemandCompany(data as DemandCompType) + + await updateDemandCompany(data as DemandCompType) + coSttnInit("1", "13", String(con)); + setIsDmdModal({ isMoal: false, data: data as DemandCompType }); }else{ const dmd= await getFetch(fetchType.WR,`/reuseFc/request/${data.dmdInfoPk}`) if(dmd) { toast.error(`사업자번호 ${dmd.dmdInfoPk}는 이미 등록되었습니다. 다시등록해주세요`) return } - regDemandCompany(data as DemandCompType); - } - if(dmdIsSucees ==='success'){ - toast.success(`수요처 등록 및 수정 완료되었습니다..`) - setIsDmdModal({ isMoal: false, data: data as DemandCompType }); - }else{ - toast.error(`수요처 등록 및 수정 에러입니다.`) + await regDemandCompany(data as DemandCompType); + coSttnInit("1", "13", String(con)); + setIsDmdModal({ isMoal: false, data: data as DemandCompType }); } + }} bodyClassNm={"w-full mx-auto bg-white rounded-lg shadow-md p-6"} diff --git a/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx index d3333f676..873ad85f3 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx @@ -24,9 +24,8 @@ import { BdstReg } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal import { Toaster } from "react-hot-toast"; export default function Home() { - const { code, htdfl, initHtdflReg, getHtdflBdstData ,htdflNmSearch} = useWrStore( - (state) => state - ); + const { code, htdfl, initHtdflReg, getHtdflBdstData, htdflNmSearch } = + useWrStore((state) => state); const [searchTxt, setSearchTxt] = useState(""); const [pageNation, setPageNation] = useState(1); @@ -43,26 +42,26 @@ export default function Home() { useEffect(() => { if (!htdfl.isInit) { - initHtdflReg('0') + initHtdflReg("0"); } }, [htdfl.isInit, initHtdflReg]); useEffect(() => { - if (htdflRes&&htdflRes.length>0) { - - console.log('htdflRes ', htdflRes) + if (htdflRes && htdflRes.length > 0) { const htdflData = tableData(htdflRes, { code }).map( (item: customHtdflBdst) => { - let archArea = item?.archArea.split('.')[0]!=='-1'?item?.archArea.split('.')[0]:'확인불가' + let archArea = + item?.archArea.split(".")[0] !== "-1" + ? item?.archArea.split(".")[0] + : "확인불가"; return { ...item, - archArea:archArea - + archArea: archArea, }; } ); setbdstTable(htdflData); - }else{ + } else { setbdstTable([]); } }, [code, htdflRes]); @@ -114,11 +113,10 @@ export default function Home() {