견적서 & 발전시뮬레이션 탭에서 플랜 클릭시 체크 분기
This commit is contained in:
parent
28b0a5a65a
commit
3ae8ef5dea
@ -207,12 +207,15 @@ export function usePlan(params = {}) {
|
|||||||
const orderingNo = plans?.find((obj) => obj.id === newCurrentId).ordering
|
const orderingNo = plans?.find((obj) => obj.id === newCurrentId).ordering
|
||||||
const objectNo = floorPlanState.objectNo
|
const objectNo = floorPlanState.objectNo
|
||||||
//견적서 or 발전시뮬
|
//견적서 or 발전시뮬
|
||||||
|
|
||||||
if (pathname !== '/floor-plan') {
|
if (pathname !== '/floor-plan') {
|
||||||
await promiseGet({ url: `/api/estimate/${objectNo}/${orderingNo}/detail` })
|
await promiseGet({ url: `/api/estimate/${objectNo}/${orderingNo}/detail` })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
const estimateDetail = res.data
|
const estimateDetail = res.data
|
||||||
if (estimateDetail.docNo) {
|
if (pathname === '/floor-plan/estimate/5') {
|
||||||
|
if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) {
|
||||||
|
console.log('이동')
|
||||||
res.data.resetFlag = 'N'
|
res.data.resetFlag = 'N'
|
||||||
|
|
||||||
if (res.data.itemList.length > 0) {
|
if (res.data.itemList.length > 0) {
|
||||||
@ -229,27 +232,29 @@ export function usePlan(params = {}) {
|
|||||||
res.data.pkgAsp = roundedNumber.toString()
|
res.data.pkgAsp = roundedNumber.toString()
|
||||||
}
|
}
|
||||||
setEstimateContextState(res.data)
|
setEstimateContextState(res.data)
|
||||||
|
// 클릭한 플랜 탭으로 이동
|
||||||
if (pathname === '/floor-plan') {
|
|
||||||
if (!currentCanvasPlan || currentCanvasPlan.id !== newCurrentId) {
|
|
||||||
saveCanvas()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
updateCurrentPlan(newCurrentId)
|
updateCurrentPlan(newCurrentId)
|
||||||
} else {
|
} else {
|
||||||
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
//발전시뮬레이션
|
||||||
|
// 클릭한 플랜 탭으로 이동
|
||||||
|
// updateCurrentPlan(newCurrentId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
if (pathname === '/floor-plan/estimate/5') {
|
||||||
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
||||||
|
} else {
|
||||||
|
swalFire({ text: getMessage('simulator.menu.move.valid1') })
|
||||||
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// if (pathname === '/floor-plan') {
|
|
||||||
if (!currentCanvasPlan || currentCanvasPlan.id !== newCurrentId) {
|
if (!currentCanvasPlan || currentCanvasPlan.id !== newCurrentId) {
|
||||||
saveCanvas()
|
saveCanvas()
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
updateCurrentPlan(newCurrentId)
|
updateCurrentPlan(newCurrentId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user