diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index c5fb9194..19db2fde 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -44,6 +44,7 @@ import JA from '@/locales/ja.json' import { MENU } from '@/common/common' import { QcastContext } from '@/app/QcastProvider' + export default function CanvasMenu(props) { const { menuNumber, setMenuNumber } = props const pathname = usePathname() @@ -101,6 +102,8 @@ export default function CanvasMenu(props) { const { setIsGlobalLoading } = useContext(QcastContext) + //임시 + const { selectedPlan } = usePlan() const handleExcelPdfFileDown = async (donwloadType, drawingFlg) => { const url = '/api/estimate/excel-download' @@ -168,14 +171,14 @@ export default function CanvasMenu(props) { break case 5: // let pid = urlParams.get('pid') - promiseGet({ url: `/api/estimate/${objectNo}/${pid}/detail` }).then((res) => { + promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.ordering}/detail` }).then((res) => { if (res.status === 200) { const estimateDetail = res.data - if (estimateDetail.docNo) { + if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) { setMenuNumber(menu.index) setCurrentMenu(menu.title) setFloorPlanObjectNo({ floorPlanObjectNo: objectNo }) - router.push(`/floor-plan/estimate/5?pid=${pid}&objectNo=${objectNo}`) + router.push(`/floor-plan/estimate/${menu.index}?pid=${selectedPlan.ordering}&objectNo=${objectNo}`) } else { swalFire({ text: getMessage('estimate.menu.move.valid1') }) } @@ -183,13 +186,14 @@ export default function CanvasMenu(props) { }) break case 6: - promiseGet({ url: `/api/estimate/${objectNo}/${pid}/detail` }).then((res) => { + promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.ordering}/detail` }).then((res) => { if (res.status === 200) { const estimateDetail = res.data + //docno tempFlg0 if (estimateDetail.docNo) { setMenuNumber(menu.index) setCurrentMenu(menu.title) - router.push(`/floor-plan/simulator/${menu.index}?pid=${pid}&objectNo=${objectNo}`) + router.push(`/floor-plan/simulator/${menu.index}?pid=${selectedPlan.ordering}&objectNo=${objectNo}`) } else { swalFire({ text: getMessage('simulator.menu.move.valid1') }) } diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index fb743828..10c1dc2d 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -215,7 +215,6 @@ export function usePlan(params = {}) { const estimateDetail = res.data if (pathname === '/floor-plan/estimate/5') { if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) { - console.log('이동') res.data.resetFlag = 'N' if (res.data.itemList.length > 0) {