diff --git a/src/components/estimate/popup/DocDownOptionPop.jsx b/src/components/estimate/popup/DocDownOptionPop.jsx index 50dfd018..13477b63 100644 --- a/src/components/estimate/popup/DocDownOptionPop.jsx +++ b/src/components/estimate/popup/DocDownOptionPop.jsx @@ -4,20 +4,21 @@ import { useMessage } from '@/hooks/useMessage' import { useAxios } from '@/hooks/useAxios' import { useRecoilValue } from 'recoil' import { floorPlanObjectState, estimateState } from '@/store/floorPlanObjectAtom' -import { usePathname } from 'next/navigation' +import { usePathname, useSearchParams } from 'next/navigation' export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDownPopLockFlg }) { const { getMessage } = useMessage() const { promisePost } = useAxios() const pathName = usePathname() + const searchParams = useSearchParams() //EXCEL, PDF 구분 const [schDownload, setSchDownload] = useState('EXCEL') //다운로드 파일 EXCEL const [schUnitPriceFlg, setSchUnitPriceFlg] = useState('0') //견적제출서 표시명 - const [schDisplayFlg, setSchSchDisplayFlg] = useState('0') + const [schDisplayFlg, setSchDisplayFlg] = useState('0') //가대 중량표 포함(포함:1 미포함 : 0) const [schWeightFlg, setSchWeightFlg] = useState('1') //도면/시뮬레이션 파일 포함 @@ -53,8 +54,9 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDown defaultSchDrawingFlg = defaultSchDrawingFlg.concat('|', '2', '|', '3') } + //objectRecoil.floorPlanObjectNo가 비워지는 경우가 있어서 없으면 url에서 뺴오도록 추가 const params = { - objectNo: objectRecoil.floorPlanObjectNo, + objectNo: objectRecoil?.floorPlanObjectNo ? objectRecoil.floorPlanObjectNo : searchParams.get('objectNo'), planNo: planNo, schDownload: schDownload, schUnitPriceFlg: sendUnitPriceFlg, @@ -206,7 +208,7 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDown value={'0'} checked={schDisplayFlg === '0'} onChange={(e) => { - setSchSchDisplayFlg(e.target.value) + setSchDisplayFlg(e.target.value) }} /> @@ -219,7 +221,7 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDown value={'1'} checked={schDisplayFlg === '1'} onChange={(e) => { - setSchSchDisplayFlg(e.target.value) + setSchDisplayFlg(e.target.value) }} /> diff --git a/src/components/estimate/popup/EstimateCopyPop.jsx b/src/components/estimate/popup/EstimateCopyPop.jsx index 001de6e9..35d8d54b 100644 --- a/src/components/estimate/popup/EstimateCopyPop.jsx +++ b/src/components/estimate/popup/EstimateCopyPop.jsx @@ -69,7 +69,7 @@ export default function EstimateCopyPop({ planNo, setEstimateCopyPopupOpen }) { get({ url: url }).then((res) => { if (!isEmptyArray(res)) { res.map((row) => { - row.value == row.saleStoreId + row.value = row.saleStoreId row.label = row.saleStoreName }) otherList = res diff --git a/src/components/estimate/popup/ProductFeaturesPop.jsx b/src/components/estimate/popup/ProductFeaturesPop.jsx index f2d98800..b6b02c64 100644 --- a/src/components/estimate/popup/ProductFeaturesPop.jsx +++ b/src/components/estimate/popup/ProductFeaturesPop.jsx @@ -7,16 +7,16 @@ export default function ProductFeaturesPop({ popShowSpecialNoteList, showProduct useEffect(() => { let pushData = [] - popShowSpecialNoteList.map((row) => { + popShowSpecialNoteList.forEach((row) => { let option = showProductFeatureData.split('、') - option.map((row2) => { + option.forEach((row2) => { if (row.code === row2) { pushData.push(row) } }) }) setShowSpecialNoteList(pushData) - }, [popShowSpecialNoteList]) + }, [popShowSpecialNoteList, showProductFeatureData]) return (
diff --git a/src/components/floor-plan/CanvasLayout.jsx b/src/components/floor-plan/CanvasLayout.jsx index bc1a4007..499fac57 100644 --- a/src/components/floor-plan/CanvasLayout.jsx +++ b/src/components/floor-plan/CanvasLayout.jsx @@ -1,6 +1,7 @@ 'use client' import { useContext, useEffect } from 'react' +import { usePathname } from 'next/navigation' import { useRecoilValue } from 'recoil' import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider' import { SessionContext } from '@/app/SessionProvider' @@ -12,6 +13,7 @@ import { globalLocaleStore } from '@/store/localeAtom' export default function CanvasLayout({ children }) { // const { menuNumber } = props + const pathname = usePathname() const { menuNumber } = useCanvasMenu() const { session } = useContext(SessionContext) const { floorPlanState } = useContext(FloorPlanContext) @@ -54,7 +56,7 @@ export default function CanvasLayout({ children }) { ))}
- {plans.length < 10 && ( + {plans.length < 10 && !pathname.includes('/estimate') && !pathname.includes('/simulator') && (