selectedPlan?.planNo?? currentPid or pid #98
@ -154,7 +154,7 @@ export default function Estimate({}) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// console.log('🚀 ~ Estimate ~ selectedPlan:', selectedPlan)
|
// console.log('🚀 ~ Estimate ~ selectedPlan:', selectedPlan)
|
||||||
if (selectedPlan) initEstimate(selectedPlan.planNo)
|
if (selectedPlan) initEstimate(selectedPlan?.planNo?? currentPid)
|
||||||
}, [selectedPlan])
|
}, [selectedPlan])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@ -241,7 +241,7 @@ export default function CanvasMenu(props) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.planNo}/detail` }).then((res) => {
|
promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan?.planNo??pid}/detail` }).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
const estimateDetail = res.data
|
const estimateDetail = res.data
|
||||||
if (estimateDetail.estimateDate !== null) {
|
if (estimateDetail.estimateDate !== null) {
|
||||||
@ -249,7 +249,7 @@ export default function CanvasMenu(props) {
|
|||||||
setCurrentMenu(menu.title)
|
setCurrentMenu(menu.title)
|
||||||
setFloorPlanObjectNo({ floorPlanObjectNo: objectNo })
|
setFloorPlanObjectNo({ floorPlanObjectNo: objectNo })
|
||||||
setIsGlobalLoading(false)
|
setIsGlobalLoading(false)
|
||||||
router.push(`/floor-plan/estimate/5?pid=${selectedPlan.planNo}&objectNo=${objectNo}`)
|
router.push(`/floor-plan/estimate/5?pid=${selectedPlan?.planNo??pid}&objectNo=${objectNo}`)
|
||||||
if (pathname === '/floor-plan/estimate/5') {
|
if (pathname === '/floor-plan/estimate/5') {
|
||||||
setIsGlobalLoading(false)
|
setIsGlobalLoading(false)
|
||||||
}
|
}
|
||||||
@ -262,13 +262,13 @@ export default function CanvasMenu(props) {
|
|||||||
break
|
break
|
||||||
case 'simulation':
|
case 'simulation':
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.planNo}/detail` }).then((res) => {
|
promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan?.planNo??pid}/detail` }).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
const estimateDetail = res.data
|
const estimateDetail = res.data
|
||||||
if (estimateDetail.estimateDate !== null && estimateDetail.docNo) {
|
if (estimateDetail.estimateDate !== null && estimateDetail.docNo) {
|
||||||
setSelectedMenu(menu.type)
|
setSelectedMenu(menu.type)
|
||||||
setCurrentMenu(menu.title)
|
setCurrentMenu(menu.title)
|
||||||
router.push(`/floor-plan/simulator/6?pid=${selectedPlan.planNo}&objectNo=${objectNo}`)
|
router.push(`/floor-plan/simulator/6?pid=${selectedPlan?.planNo??pid}&objectNo=${objectNo}`)
|
||||||
if (pathname === '/floor-plan/simulator/6') {
|
if (pathname === '/floor-plan/simulator/6') {
|
||||||
setIsGlobalLoading(false)
|
setIsGlobalLoading(false)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -114,7 +114,7 @@ export default function Simulator() {
|
|||||||
setHatsudenryouPeakcutAllSnow([])
|
setHatsudenryouPeakcutAllSnow([])
|
||||||
|
|
||||||
if (objectNo && pid && selectedPlan) {
|
if (objectNo && pid && selectedPlan) {
|
||||||
fetchObjectDetail(objectNo, selectedPlan.planNo)
|
fetchObjectDetail(objectNo, selectedPlan?.planNo??pid)
|
||||||
fetchSimulatorNotice()
|
fetchSimulatorNotice()
|
||||||
setPwrGnrSimType('D')
|
setPwrGnrSimType('D')
|
||||||
setPwrRecoil({ ...pwrRecoil, type: 'D' })
|
setPwrRecoil({ ...pwrRecoil, type: 'D' })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user