견적서 & 발전시뮬레이션 이동 관련 pid 셋팅

This commit is contained in:
basssy 2025-01-17 10:36:27 +09:00
parent 5e62a3492f
commit eac19c7620
2 changed files with 9 additions and 6 deletions

View File

@ -44,6 +44,7 @@ import JA from '@/locales/ja.json'
import { MENU } from '@/common/common' import { MENU } from '@/common/common'
import { QcastContext } from '@/app/QcastProvider' import { QcastContext } from '@/app/QcastProvider'
export default function CanvasMenu(props) { export default function CanvasMenu(props) {
const { menuNumber, setMenuNumber } = props const { menuNumber, setMenuNumber } = props
const pathname = usePathname() const pathname = usePathname()
@ -101,6 +102,8 @@ export default function CanvasMenu(props) {
const { setIsGlobalLoading } = useContext(QcastContext) const { setIsGlobalLoading } = useContext(QcastContext)
//
const { selectedPlan } = usePlan()
const handleExcelPdfFileDown = async (donwloadType, drawingFlg) => { const handleExcelPdfFileDown = async (donwloadType, drawingFlg) => {
const url = '/api/estimate/excel-download' const url = '/api/estimate/excel-download'
@ -168,14 +171,14 @@ export default function CanvasMenu(props) {
break break
case 5: case 5:
// let pid = urlParams.get('pid') // 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) { if (res.status === 200) {
const estimateDetail = res.data const estimateDetail = res.data
if (estimateDetail.docNo) { if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) {
setMenuNumber(menu.index) setMenuNumber(menu.index)
setCurrentMenu(menu.title) setCurrentMenu(menu.title)
setFloorPlanObjectNo({ floorPlanObjectNo: objectNo }) 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 { } else {
swalFire({ text: getMessage('estimate.menu.move.valid1') }) swalFire({ text: getMessage('estimate.menu.move.valid1') })
} }
@ -183,13 +186,14 @@ export default function CanvasMenu(props) {
}) })
break break
case 6: 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) { if (res.status === 200) {
const estimateDetail = res.data const estimateDetail = res.data
//docno tempFlg0
if (estimateDetail.docNo) { if (estimateDetail.docNo) {
setMenuNumber(menu.index) setMenuNumber(menu.index)
setCurrentMenu(menu.title) 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 { } else {
swalFire({ text: getMessage('simulator.menu.move.valid1') }) swalFire({ text: getMessage('simulator.menu.move.valid1') })
} }

View File

@ -215,7 +215,6 @@ export function usePlan(params = {}) {
const estimateDetail = res.data const estimateDetail = res.data
if (pathname === '/floor-plan/estimate/5') { if (pathname === '/floor-plan/estimate/5') {
if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) { 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) {