#1068 [오류] 견적서 생성된 플랜복사 --> 복사된 플랜에서 모듈삭제 --> 견적서 진입이 됨..
This commit is contained in:
parent
8ab41c8eda
commit
4e8cc409d4
@ -50,6 +50,7 @@ import JA from '@/locales/ja.json'
|
||||
import { QcastContext } from '@/app/QcastProvider'
|
||||
import { useRoofFn } from '@/hooks/common/useRoofFn'
|
||||
import { usePolygon } from '@/hooks/usePolygon'
|
||||
import { useTrestle } from '@/hooks/module/useTrestle'
|
||||
export default function CanvasMenu(props) {
|
||||
const { selectedMenu, setSelectedMenu } = props
|
||||
const pathname = usePathname()
|
||||
@ -67,6 +68,7 @@ export default function CanvasMenu(props) {
|
||||
const globalLocale = useRecoilValue(globalLocaleStore)
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const { handleZoomClear, handleZoom } = useCanvasEvent()
|
||||
const { setAllModuleSurfaceIsComplete, isAllComplete } = useTrestle()
|
||||
const { handleMenu } = useMenu()
|
||||
// const urlParams = useSearchParams()
|
||||
const { handleEstimateSubmit, fetchSetting, estimateContextState, setEstimateContextState } = useEstimateController()
|
||||
@ -194,6 +196,7 @@ export default function CanvasMenu(props) {
|
||||
confirmFn: () => {
|
||||
//해당 메뉴 이동시 배치면 삭제
|
||||
|
||||
setAllModuleSurfaceIsComplete(false)
|
||||
const moduleSurfacesArray = canvas
|
||||
.getObjects()
|
||||
.filter((obj) => [POLYGON_TYPE.MODULE_SETUP_SURFACE, POLYGON_TYPE.MODULE, POLYGON_TYPE.OBJECT_SURFACE].includes(obj.name))
|
||||
@ -233,6 +236,10 @@ export default function CanvasMenu(props) {
|
||||
await reloadCanvasStatus(objectNo, pid)
|
||||
break
|
||||
case 'estimate':
|
||||
if (!isAllComplete()) {
|
||||
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
||||
return
|
||||
}
|
||||
setIsGlobalLoading(true)
|
||||
promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.planNo}/detail` }).then((res) => {
|
||||
if (res.status === 200) {
|
||||
|
||||
@ -154,6 +154,7 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
getPcsVoltageChk(pcsVoltageChkParams).then((res) => {
|
||||
if (res.resultCode === 'S') {
|
||||
setTabNum(2)
|
||||
setAllModuleSurfaceIsComplete(false)
|
||||
} else {
|
||||
swalFire({
|
||||
title: res.resultMsg,
|
||||
@ -187,6 +188,7 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
}).then((res) => {
|
||||
if (res?.result.resultCode === 'S' && res?.data) {
|
||||
setTabNum(2)
|
||||
setAllModuleSurfaceIsComplete(false)
|
||||
} else {
|
||||
swalFire({ text: getMessage('common.message.send.error') })
|
||||
}
|
||||
@ -286,6 +288,7 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
setSelectedModels(pcsItemList)
|
||||
getPcsVoltageChk(pcsVoltageChkParams).then((res) => {
|
||||
setAllocationType(ALLOCATION_TYPE.PASSIVITY)
|
||||
setAllModuleSurfaceIsComplete(false)
|
||||
})
|
||||
} else {
|
||||
swalFire({
|
||||
@ -654,6 +657,7 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
return
|
||||
} else {
|
||||
setTabNum(2)
|
||||
setAllModuleSurfaceIsComplete(false)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -3077,6 +3077,9 @@ export const useTrestle = () => {
|
||||
// 배치면 전체에 가대 설치 여부
|
||||
const isAllComplete = () => {
|
||||
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||
if (surfaces.length === 0) {
|
||||
return false
|
||||
}
|
||||
return surfaces.every((surface) => surface.isComplete)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user