diff --git a/src/app/floor-plan/estimate/[mid]/[pid]/page.jsx b/src/app/floor-plan/estimate/[mid]/[pid]/page.jsx deleted file mode 100644 index 6e793bf5..00000000 --- a/src/app/floor-plan/estimate/[mid]/[pid]/page.jsx +++ /dev/null @@ -1,12 +0,0 @@ -import Estimate from '@/components/estimate/Estimate' - -export default function EstimatePage({ params }) { - //floor-plan/estimate/mid/pid - //mid :5 견적탭 - //pid : 넘어온 플랜번호 - return ( - <> - - - ) -} diff --git a/src/app/floor-plan/estimate/[mid]/page.jsx b/src/app/floor-plan/estimate/[mid]/page.jsx new file mode 100644 index 00000000..216ee940 --- /dev/null +++ b/src/app/floor-plan/estimate/[mid]/page.jsx @@ -0,0 +1,9 @@ +import Estimate from '@/components/estimate/Estimate' + +export default function EstimatePage({}) { + 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}`) }} >