물건상세 에서 견적서 상세화면 이동시 구조 변경

This commit is contained in:
basssy 2025-01-07 15:52:32 +09:00
parent 82bc00e2aa
commit 5fa98b4864
3 changed files with 16 additions and 14 deletions

View File

@ -1,12 +1,12 @@
import Estimate from '@/components/estimate/Estimate' import Estimate from '@/components/estimate/Estimate'
export default function EstimatePage({ params }) { export default function EstimatePage({}) {
//floor-plan/estimate/mid/pid //floor-plan/estimate/mid/pid
//mid :5 //mid :5
//pid : //pid :
return ( return (
<> <>
<Estimate params={params} /> <Estimate />
</> </>
) )
} }

View File

@ -21,7 +21,7 @@ import { v4 as uuidv4 } from 'uuid'
import { correntObjectNoState } from '@/store/settingAtom' import { correntObjectNoState } from '@/store/settingAtom'
import { useSearchParams } from 'next/navigation' import { useSearchParams } from 'next/navigation'
export default function Estimate({ params }) { export default function Estimate({}) {
const [uniqueData, setUniqueData] = useState([]) const [uniqueData, setUniqueData] = useState([])
const [handlePricingFlag, setHandlePricingFlag] = useState(false) const [handlePricingFlag, setHandlePricingFlag] = useState(false)
const [specialNoteFirstFlg, setSpecialNoteFirstFlg] = useState(false) const [specialNoteFirstFlg, setSpecialNoteFirstFlg] = useState(false)
@ -58,11 +58,16 @@ export default function Estimate({ params }) {
startDate, startDate,
setStartDate, setStartDate,
} }
/**
* objectNo 셋팅
* url로 넘어온 objectNo을 리코일에 세팅
*/
const setCurrentObjectNo = useSetRecoilState(correntObjectNoState)
const searchParams = useSearchParams()
const objectRecoil = useRecoilValue(floorPlanObjectState) 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 // List
const [specialNoteList, setSpecialNoteList] = useState([]) const [specialNoteList, setSpecialNoteList] = useState([])
@ -75,12 +80,6 @@ export default function Estimate({ params }) {
const { setMenuNumber } = useCanvasMenu() const { setMenuNumber } = useCanvasMenu()
/**
* objectNo 셋팅
* url로 넘어온 objectNo을 리코일에 세팅
*/
const setCurrentObjectNo = useSetRecoilState(correntObjectNoState)
const searchParams = useSearchParams()
const currentObjectNo = searchParams.get('objectNo') const currentObjectNo = searchParams.get('objectNo')
setCurrentObjectNo(currentObjectNo) setCurrentObjectNo(currentObjectNo)
@ -93,7 +92,8 @@ export default function Estimate({ params }) {
useEffect(() => { useEffect(() => {
setMenuNumber(5) setMenuNumber(5)
setObjectNo(objectRecoil.floorPlanObjectNo) setObjectNo(objectRecoil.floorPlanObjectNo)
setPlanNo(params.pid)
setPlanNo(currentPid)
// //
const code1 = findCommonCode(200800) const code1 = findCommonCode(200800)

View File

@ -282,7 +282,9 @@ export default function StuffDetail() {
onClick={() => { onClick={() => {
//mid:5(), /pid: //mid:5(), /pid:
setFloorPlanObjectNo({ floorPlanObjectNo: params.data.objectNo }) 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}`)
}} }}
> >
<span className="file"></span> <span className="file"></span>