From 5fa98b486471e64c06d899f8b6757712de1f262f Mon Sep 17 00:00:00 2001 From: basssy Date: Tue, 7 Jan 2025 15:52:32 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=EC=83=81=EC=84=B8=20?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EA=B2=AC=EC=A0=81=EC=84=9C=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=ED=99=94=EB=A9=B4=20=EC=9D=B4=EB=8F=99=EC=8B=9C=20?= =?UTF-8?q?=EA=B5=AC=EC=A1=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../estimate/[mid]/{[pid] => }/page.jsx | 4 ++-- src/components/estimate/Estimate.jsx | 22 +++++++++---------- src/components/management/StuffDetail.jsx | 4 +++- 3 files changed, 16 insertions(+), 14 deletions(-) rename src/app/floor-plan/estimate/[mid]/{[pid] => }/page.jsx (66%) diff --git a/src/app/floor-plan/estimate/[mid]/[pid]/page.jsx b/src/app/floor-plan/estimate/[mid]/page.jsx similarity index 66% rename from src/app/floor-plan/estimate/[mid]/[pid]/page.jsx rename to src/app/floor-plan/estimate/[mid]/page.jsx index 6e793bf5..ba20ac68 100644 --- a/src/app/floor-plan/estimate/[mid]/[pid]/page.jsx +++ b/src/app/floor-plan/estimate/[mid]/page.jsx @@ -1,12 +1,12 @@ import Estimate from '@/components/estimate/Estimate' -export default function EstimatePage({ params }) { +export default function EstimatePage({}) { //floor-plan/estimate/mid/pid //mid :5 견적탭 //pid : 넘어온 플랜번호 return ( <> - + ) } diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index d92ba071..3c9b4f2e 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -21,7 +21,7 @@ import { v4 as uuidv4 } from 'uuid' import { correntObjectNoState } from '@/store/settingAtom' import { useSearchParams } from 'next/navigation' -export default function Estimate({ params }) { +export default function Estimate({}) { const [uniqueData, setUniqueData] = useState([]) const [handlePricingFlag, setHandlePricingFlag] = useState(false) const [specialNoteFirstFlg, setSpecialNoteFirstFlg] = useState(false) @@ -58,11 +58,16 @@ export default function Estimate({ params }) { startDate, setStartDate, } - + /** + * objectNo 셋팅 + * url로 넘어온 objectNo을 리코일에 세팅 + */ + const setCurrentObjectNo = useSetRecoilState(correntObjectNoState) + const searchParams = useSearchParams() const objectRecoil = useRecoilValue(floorPlanObjectState) - + const currentPid = searchParams.get('pid') //견적서 상세데이터 - const { estimateContextState, setEstimateContextState, addItem, handleEstimateFileDownload } = useEstimateController(params.pid) + const { estimateContextState, setEstimateContextState, addItem, handleEstimateFileDownload } = useEstimateController(currentPid) //견적특이사항 List const [specialNoteList, setSpecialNoteList] = useState([]) @@ -75,12 +80,6 @@ export default function Estimate({ params }) { const { setMenuNumber } = useCanvasMenu() - /** - * objectNo 셋팅 - * url로 넘어온 objectNo을 리코일에 세팅 - */ - const setCurrentObjectNo = useSetRecoilState(correntObjectNoState) - const searchParams = useSearchParams() const currentObjectNo = searchParams.get('objectNo') setCurrentObjectNo(currentObjectNo) @@ -93,7 +92,8 @@ export default function Estimate({ params }) { useEffect(() => { setMenuNumber(5) setObjectNo(objectRecoil.floorPlanObjectNo) - setPlanNo(params.pid) + + setPlanNo(currentPid) // 공통코드 const code1 = findCommonCode(200800) diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index 77bbafcc..141a2d3f 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -282,7 +282,9 @@ export default function StuffDetail() { onClick={() => { //mid:5(견적서), /pid:플랜번호 setFloorPlanObjectNo({ floorPlanObjectNo: params.data.objectNo }) - router.push(`/floor-plan/estimate/5/${params.data.planNo}`) + // router.push(`/floor-plan/estimate/5/${params.data.planNo}`) + // /floor-plan/estimate/5?pid=플랜번호&objectNo=물건번호 + router.push(`/floor-plan/estimate/5?pid=${params.data.planNo}&objectNo=${objectNo}`) }} > From 44e02641195b7feabc6428ddac57ba438ba434af Mon Sep 17 00:00:00 2001 From: basssy Date: Tue, 7 Jan 2025 15:53:04 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EC=A3=BC=EC=84=9D=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/floor-plan/estimate/[mid]/page.jsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/app/floor-plan/estimate/[mid]/page.jsx b/src/app/floor-plan/estimate/[mid]/page.jsx index ba20ac68..216ee940 100644 --- a/src/app/floor-plan/estimate/[mid]/page.jsx +++ b/src/app/floor-plan/estimate/[mid]/page.jsx @@ -1,9 +1,6 @@ import Estimate from '@/components/estimate/Estimate' export default function EstimatePage({}) { - //floor-plan/estimate/mid/pid - //mid :5 견적탭 - //pid : 넘어온 플랜번호 return ( <>