Merge branch 'dev' into dev-yj
This commit is contained in:
commit
17378dc3ad
@ -4,20 +4,21 @@ import { useMessage } from '@/hooks/useMessage'
|
|||||||
import { useAxios } from '@/hooks/useAxios'
|
import { useAxios } from '@/hooks/useAxios'
|
||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilValue } from 'recoil'
|
||||||
import { floorPlanObjectState, estimateState } from '@/store/floorPlanObjectAtom'
|
import { floorPlanObjectState, estimateState } from '@/store/floorPlanObjectAtom'
|
||||||
import { usePathname } from 'next/navigation'
|
import { usePathname, useSearchParams } from 'next/navigation'
|
||||||
|
|
||||||
export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDownPopLockFlg }) {
|
export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDownPopLockFlg }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { promisePost } = useAxios()
|
const { promisePost } = useAxios()
|
||||||
|
|
||||||
const pathName = usePathname()
|
const pathName = usePathname()
|
||||||
|
const searchParams = useSearchParams()
|
||||||
|
|
||||||
//EXCEL, PDF 구분
|
//EXCEL, PDF 구분
|
||||||
const [schDownload, setSchDownload] = useState('EXCEL')
|
const [schDownload, setSchDownload] = useState('EXCEL')
|
||||||
//다운로드 파일 EXCEL
|
//다운로드 파일 EXCEL
|
||||||
const [schUnitPriceFlg, setSchUnitPriceFlg] = useState('0')
|
const [schUnitPriceFlg, setSchUnitPriceFlg] = useState('0')
|
||||||
//견적제출서 표시명
|
//견적제출서 표시명
|
||||||
const [schDisplayFlg, setSchSchDisplayFlg] = useState('0')
|
const [schDisplayFlg, setSchDisplayFlg] = useState('0')
|
||||||
//가대 중량표 포함(포함:1 미포함 : 0)
|
//가대 중량표 포함(포함:1 미포함 : 0)
|
||||||
const [schWeightFlg, setSchWeightFlg] = useState('1')
|
const [schWeightFlg, setSchWeightFlg] = useState('1')
|
||||||
//도면/시뮬레이션 파일 포함
|
//도면/시뮬레이션 파일 포함
|
||||||
@ -53,8 +54,9 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDown
|
|||||||
defaultSchDrawingFlg = defaultSchDrawingFlg.concat('|', '2', '|', '3')
|
defaultSchDrawingFlg = defaultSchDrawingFlg.concat('|', '2', '|', '3')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//objectRecoil.floorPlanObjectNo가 비워지는 경우가 있어서 없으면 url에서 뺴오도록 추가
|
||||||
const params = {
|
const params = {
|
||||||
objectNo: objectRecoil.floorPlanObjectNo,
|
objectNo: objectRecoil?.floorPlanObjectNo ? objectRecoil.floorPlanObjectNo : searchParams.get('objectNo'),
|
||||||
planNo: planNo,
|
planNo: planNo,
|
||||||
schDownload: schDownload,
|
schDownload: schDownload,
|
||||||
schUnitPriceFlg: sendUnitPriceFlg,
|
schUnitPriceFlg: sendUnitPriceFlg,
|
||||||
@ -206,7 +208,7 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDown
|
|||||||
value={'0'}
|
value={'0'}
|
||||||
checked={schDisplayFlg === '0'}
|
checked={schDisplayFlg === '0'}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setSchSchDisplayFlg(e.target.value)
|
setSchDisplayFlg(e.target.value)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<label htmlFor="schDisplayFlg0">{getMessage('estimate.detail.docPopup.schDisplayFlg.schDisplayFlg0')}</label>
|
<label htmlFor="schDisplayFlg0">{getMessage('estimate.detail.docPopup.schDisplayFlg.schDisplayFlg0')}</label>
|
||||||
@ -219,7 +221,7 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDown
|
|||||||
value={'1'}
|
value={'1'}
|
||||||
checked={schDisplayFlg === '1'}
|
checked={schDisplayFlg === '1'}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setSchSchDisplayFlg(e.target.value)
|
setSchDisplayFlg(e.target.value)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<label htmlFor="schDisplayFlg1">{getMessage('estimate.detail.docPopup.schDisplayFlg.schDisplayFlg1')}</label>
|
<label htmlFor="schDisplayFlg1">{getMessage('estimate.detail.docPopup.schDisplayFlg.schDisplayFlg1')}</label>
|
||||||
|
|||||||
@ -69,7 +69,7 @@ export default function EstimateCopyPop({ planNo, setEstimateCopyPopupOpen }) {
|
|||||||
get({ url: url }).then((res) => {
|
get({ url: url }).then((res) => {
|
||||||
if (!isEmptyArray(res)) {
|
if (!isEmptyArray(res)) {
|
||||||
res.map((row) => {
|
res.map((row) => {
|
||||||
row.value == row.saleStoreId
|
row.value = row.saleStoreId
|
||||||
row.label = row.saleStoreName
|
row.label = row.saleStoreName
|
||||||
})
|
})
|
||||||
otherList = res
|
otherList = res
|
||||||
|
|||||||
@ -7,16 +7,16 @@ export default function ProductFeaturesPop({ popShowSpecialNoteList, showProduct
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let pushData = []
|
let pushData = []
|
||||||
popShowSpecialNoteList.map((row) => {
|
popShowSpecialNoteList.forEach((row) => {
|
||||||
let option = showProductFeatureData.split('、')
|
let option = showProductFeatureData.split('、')
|
||||||
option.map((row2) => {
|
option.forEach((row2) => {
|
||||||
if (row.code === row2) {
|
if (row.code === row2) {
|
||||||
pushData.push(row)
|
pushData.push(row)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
setShowSpecialNoteList(pushData)
|
setShowSpecialNoteList(pushData)
|
||||||
}, [popShowSpecialNoteList])
|
}, [popShowSpecialNoteList, showProductFeatureData])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="modal-popup">
|
<div className="modal-popup">
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useContext, useEffect } from 'react'
|
import { useContext, useEffect } from 'react'
|
||||||
|
import { usePathname } from 'next/navigation'
|
||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilValue } from 'recoil'
|
||||||
import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider'
|
import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider'
|
||||||
import { SessionContext } from '@/app/SessionProvider'
|
import { SessionContext } from '@/app/SessionProvider'
|
||||||
@ -12,6 +13,7 @@ import { globalLocaleStore } from '@/store/localeAtom'
|
|||||||
|
|
||||||
export default function CanvasLayout({ children }) {
|
export default function CanvasLayout({ children }) {
|
||||||
// const { menuNumber } = props
|
// const { menuNumber } = props
|
||||||
|
const pathname = usePathname()
|
||||||
const { menuNumber } = useCanvasMenu()
|
const { menuNumber } = useCanvasMenu()
|
||||||
const { session } = useContext(SessionContext)
|
const { session } = useContext(SessionContext)
|
||||||
const { floorPlanState } = useContext(FloorPlanContext)
|
const { floorPlanState } = useContext(FloorPlanContext)
|
||||||
@ -54,7 +56,7 @@ export default function CanvasLayout({ children }) {
|
|||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
{plans.length < 10 && (
|
{plans.length < 10 && !pathname.includes('/estimate') && !pathname.includes('/simulator') && (
|
||||||
<button
|
<button
|
||||||
className="plane-add"
|
className="plane-add"
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
|
|||||||
@ -119,6 +119,7 @@ export default function CanvasMenu(props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const options = { responseType: 'blob' }
|
const options = { responseType: 'blob' }
|
||||||
|
setIsGlobalLoading(true)
|
||||||
await promisePost({ url: url, data: params, option: options })
|
await promisePost({ url: url, data: params, option: options })
|
||||||
.then((resultData) => {
|
.then((resultData) => {
|
||||||
if (resultData) {
|
if (resultData) {
|
||||||
@ -145,6 +146,7 @@ export default function CanvasMenu(props) {
|
|||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
alert('File does not exist.')
|
alert('File does not exist.')
|
||||||
})
|
})
|
||||||
|
setIsGlobalLoading(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
const onClickNav = (menu) => {
|
const onClickNav = (menu) => {
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import { getDegreeByChon } from '@/util/canvas-util'
|
|||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import { useMasterController } from '@/hooks/common/useMasterController'
|
import { useMasterController } from '@/hooks/common/useMasterController'
|
||||||
import { basicSettingState } from '@/store/settingAtom'
|
import { basicSettingState } from '@/store/settingAtom'
|
||||||
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
|
|
||||||
// 회로 및 가대설정
|
// 회로 및 가대설정
|
||||||
export const useTrestle = () => {
|
export const useTrestle = () => {
|
||||||
@ -14,7 +15,7 @@ export const useTrestle = () => {
|
|||||||
const { getQuotationItem } = useMasterController()
|
const { getQuotationItem } = useMasterController()
|
||||||
const currentAngleType = useRecoilValue(currentAngleTypeSelector)
|
const currentAngleType = useRecoilValue(currentAngleTypeSelector)
|
||||||
const roofSizeSet = useRecoilValue(basicSettingState).roofSizeSet
|
const roofSizeSet = useRecoilValue(basicSettingState).roofSizeSet
|
||||||
|
const { swalFire } = useSwal()
|
||||||
const apply = () => {
|
const apply = () => {
|
||||||
try {
|
try {
|
||||||
//처마력바가 체크되어 있는 경우 exposedBottomPoints를 이용해 처마력바 그려줘야함.
|
//처마력바가 체크되어 있는 경우 exposedBottomPoints를 이용해 처마력바 그려줘야함.
|
||||||
@ -616,11 +617,13 @@ export const useTrestle = () => {
|
|||||||
})
|
})
|
||||||
const params = { trestles: surfaces.map((surface) => surface.quotationParam), pcses }
|
const params = { trestles: surfaces.map((surface) => surface.quotationParam), pcses }
|
||||||
//견적서 itemList 조회
|
//견적서 itemList 조회
|
||||||
const res = await getQuotationItem(params)
|
const { data: itemList, data2, result } = await getQuotationItem(params)
|
||||||
if (!res.data) {
|
|
||||||
|
if (result.resultCode === 'E') {
|
||||||
|
swalFire({ text: result.resultMsg, icon: 'error' })
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
const itemList = res.data
|
|
||||||
//northArrangement 북면 설치 여부
|
//northArrangement 북면 설치 여부
|
||||||
const northArrangement = getNorthArrangement()
|
const northArrangement = getNorthArrangement()
|
||||||
// circuitItemList의 경우는 moduleList에서 circuitId만 groupBy한다.
|
// circuitItemList의 경우는 moduleList에서 circuitId만 groupBy한다.
|
||||||
@ -678,10 +681,7 @@ export const useTrestle = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const estimateParam = { itemList, northArrangement, roofSurfaceList, circuitItemList }
|
return { itemList, northArrangement, roofSurfaceList, circuitItemList }
|
||||||
|
|
||||||
// 정상적으로 완료 되면 true 반환
|
|
||||||
return estimateParam
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const getNorthArrangement = () => {
|
const getNorthArrangement = () => {
|
||||||
|
|||||||
@ -296,7 +296,12 @@ export function usePlan(params = {}) {
|
|||||||
|
|
||||||
const handleCurrentPlanUrl = () => {
|
const handleCurrentPlanUrl = () => {
|
||||||
const currentPlan = plans.find((plan) => plan.isCurrent)
|
const currentPlan = plans.find((plan) => plan.isCurrent)
|
||||||
if (currentPlan) router.push(`${pathname}?pid=${currentPlan?.planNo}&objectNo=${floorPlanState?.objectNo}`)
|
// if (currentPlan) router.push(`${pathname}?pid=${currentPlan?.planNo}&objectNo=${floorPlanState?.objectNo}`)
|
||||||
|
if (currentPlan !== currentCanvasPlan) {
|
||||||
|
// todo: [유상욱] 현재 플랜과 현재 캔버스 플랜이 다른 경우 플랜 이동
|
||||||
|
// 우선 주석처리
|
||||||
|
// router.push(`${pathname}?pid=${currentPlan?.planNo}&objectNo=${currentPlan.objectNo}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const setBgImage = () => {
|
const setBgImage = () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user