Merge branch 'dev' into dev-yj
This commit is contained in:
commit
f27514a368
@ -28,11 +28,12 @@ export default function MainPage() {
|
|||||||
|
|
||||||
const [searchForm, setSearchForm] = useRecoilState(searchState)
|
const [searchForm, setSearchForm] = useRecoilState(searchState)
|
||||||
|
|
||||||
const { qcastState } = useContext(QcastContext)
|
const { qcastState, setIsGlobalLoading } = useContext(QcastContext)
|
||||||
|
|
||||||
// 엔터 이벤트
|
// 엔터 이벤트
|
||||||
const handleByOnKeyUp = (e) => {
|
const handleByOnKeyUp = (e) => {
|
||||||
if (e.key === 'Enter') {
|
if (e.key === 'Enter') {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
//물건번호 일떄
|
//물건번호 일떄
|
||||||
if (searchRadioType === 'object') {
|
if (searchRadioType === 'object') {
|
||||||
setStuffSearch({
|
setStuffSearch({
|
||||||
@ -55,6 +56,7 @@ export default function MainPage() {
|
|||||||
|
|
||||||
// 돋보기 클릭
|
// 돋보기 클릭
|
||||||
const handleOnSubmit = () => {
|
const handleOnSubmit = () => {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
if (searchRadioType === 'object') {
|
if (searchRadioType === 'object') {
|
||||||
setStuffSearch({
|
setStuffSearch({
|
||||||
...stuffSearch,
|
...stuffSearch,
|
||||||
|
|||||||
@ -7,12 +7,16 @@ import Search from '@/components/community/Search'
|
|||||||
import Pagination from '@/components/community/Pagination'
|
import Pagination from '@/components/community/Pagination'
|
||||||
import Table from '@/components/community/Table'
|
import Table from '@/components/community/Table'
|
||||||
|
|
||||||
|
import { useContext } from 'react'
|
||||||
|
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { useResetRecoilState, useRecoilValue, useRecoilState } from 'recoil'
|
import { useResetRecoilState, useRecoilValue, useRecoilState } from 'recoil'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
|
|
||||||
import { searchState } from '@/store/boardAtom'
|
import { searchState } from '@/store/boardAtom'
|
||||||
|
|
||||||
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
|
|
||||||
export default function Faq() {
|
export default function Faq() {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const resetSearch = useResetRecoilState(searchState)
|
const resetSearch = useResetRecoilState(searchState)
|
||||||
@ -21,10 +25,14 @@ export default function Faq() {
|
|||||||
const search = useRecoilValue(searchState)
|
const search = useRecoilValue(searchState)
|
||||||
const [searchForm, setSearchForm] = useRecoilState(searchState)
|
const [searchForm, setSearchForm] = useRecoilState(searchState)
|
||||||
|
|
||||||
|
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (search.mainFlag === 'N') {
|
if (search.mainFlag === 'N') {
|
||||||
resetSearch()
|
resetSearch()
|
||||||
} else {
|
} else {
|
||||||
|
//메인에서 FAQ 조회 왔을때 로딩바 해제
|
||||||
|
setIsGlobalLoading(false)
|
||||||
setSearchForm({ ...searchForm, mainFlag: 'N' })
|
setSearchForm({ ...searchForm, mainFlag: 'N' })
|
||||||
}
|
}
|
||||||
setIsInitialized(true)
|
setIsInitialized(true)
|
||||||
|
|||||||
@ -19,7 +19,10 @@ import { convertNumberToPriceDecimal, convertNumberToPriceDecimalToFixed } from
|
|||||||
import ProductFeaturesPop from './popup/ProductFeaturesPop'
|
import ProductFeaturesPop from './popup/ProductFeaturesPop'
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import { correntObjectNoState } from '@/store/settingAtom'
|
import { correntObjectNoState } from '@/store/settingAtom'
|
||||||
import { useSearchParams } from 'next/navigation'
|
import { useRouter, useSearchParams } from 'next/navigation'
|
||||||
|
import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider'
|
||||||
|
import { usePlan } from '@/hooks/usePlan'
|
||||||
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
|
|
||||||
export default function Estimate({}) {
|
export default function Estimate({}) {
|
||||||
const [uniqueData, setUniqueData] = useState([])
|
const [uniqueData, setUniqueData] = useState([])
|
||||||
@ -70,6 +73,9 @@ export default function Estimate({}) {
|
|||||||
//견적서 상세데이터
|
//견적서 상세데이터
|
||||||
const { estimateContextState, setEstimateContextState, addItem, handleEstimateFileDownload } = useEstimateController(currentPid)
|
const { estimateContextState, setEstimateContextState, addItem, handleEstimateFileDownload } = useEstimateController(currentPid)
|
||||||
|
|
||||||
|
const { selectedPlan } = usePlan()
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
//견적특이사항 List
|
//견적특이사항 List
|
||||||
const [specialNoteList, setSpecialNoteList] = useState([])
|
const [specialNoteList, setSpecialNoteList] = useState([])
|
||||||
const [popShowSpecialNoteList, setPopShowSpecialNoteList] = useState([])
|
const [popShowSpecialNoteList, setPopShowSpecialNoteList] = useState([])
|
||||||
@ -81,6 +87,8 @@ export default function Estimate({}) {
|
|||||||
|
|
||||||
const { setMenuNumber } = useCanvasMenu()
|
const { setMenuNumber } = useCanvasMenu()
|
||||||
|
|
||||||
|
const { closeAll } = usePopup()
|
||||||
|
|
||||||
const currentObjectNo = searchParams.get('objectNo')
|
const currentObjectNo = searchParams.get('objectNo')
|
||||||
setCurrentObjectNo(currentObjectNo)
|
setCurrentObjectNo(currentObjectNo)
|
||||||
|
|
||||||
@ -90,11 +98,12 @@ export default function Estimate({}) {
|
|||||||
setUploadFiles: setFiles,
|
setUploadFiles: setFiles,
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
const initEstimate = (currPid = currentPid) => {
|
||||||
|
console.log('🚀 ~ initEstimate ~ currPid:', currPid)
|
||||||
setMenuNumber(5)
|
setMenuNumber(5)
|
||||||
setObjectNo(objectRecoil.floorPlanObjectNo)
|
setObjectNo(objectRecoil.floorPlanObjectNo)
|
||||||
|
|
||||||
setPlanNo(currentPid)
|
setPlanNo(currPid)
|
||||||
|
|
||||||
// 공통코드
|
// 공통코드
|
||||||
const code1 = findCommonCode(200800)
|
const code1 = findCommonCode(200800)
|
||||||
@ -121,6 +130,16 @@ export default function Estimate({}) {
|
|||||||
setPopShowSpecialNoteList(res)
|
setPopShowSpecialNoteList(res)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log('🚀 ~ Estimate ~ selectedPlan:', selectedPlan)
|
||||||
|
if (selectedPlan) initEstimate(selectedPlan.ordering)
|
||||||
|
}, [selectedPlan])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
closeAll()
|
||||||
|
initEstimate()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -294,6 +313,7 @@ export default function Estimate({}) {
|
|||||||
|
|
||||||
const originReset = () => {
|
const originReset = () => {
|
||||||
setOriginFiles([])
|
setOriginFiles([])
|
||||||
|
estimateContextState.resetFlag = 'N'
|
||||||
}
|
}
|
||||||
// 삭제누른 첨부파일 복원
|
// 삭제누른 첨부파일 복원
|
||||||
const returnOriginFile = (no) => {
|
const returnOriginFile = (no) => {
|
||||||
@ -543,7 +563,8 @@ export default function Estimate({}) {
|
|||||||
//주택PKG input 변경
|
//주택PKG input 변경
|
||||||
const onChangePkgAsp = (value) => {
|
const onChangePkgAsp = (value) => {
|
||||||
if (estimateContextState.estimateType === 'YJSS') {
|
if (estimateContextState.estimateType === 'YJSS') {
|
||||||
let newValue = value.replace(/[^0-9.]/g, '')
|
// let newValue = value.replace(/[^0-9.]/g, '')
|
||||||
|
let newValue = (value || '0').replace(/[^0-9.]/g, '')
|
||||||
if (newValue.length > 1) {
|
if (newValue.length > 1) {
|
||||||
newValue = newValue.replace(/(^0+)/, '')
|
newValue = newValue.replace(/(^0+)/, '')
|
||||||
if (newValue.length === 0) {
|
if (newValue.length === 0) {
|
||||||
@ -894,6 +915,7 @@ export default function Estimate({}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// console.log('itemList::', itemList)
|
||||||
let pkgAsp = estimateContextState.pkgAsp ? Number(estimateContextState.pkgAsp.replaceAll(',', '')) : 0
|
let pkgAsp = estimateContextState.pkgAsp ? Number(estimateContextState.pkgAsp.replaceAll(',', '')) : 0
|
||||||
|
|
||||||
totals.pkgTotPrice = pkgAsp * totals.totVolKw * 1000
|
totals.pkgTotPrice = pkgAsp * totals.totVolKw * 1000
|
||||||
|
|||||||
@ -3,9 +3,9 @@ import { useState } from 'react'
|
|||||||
import { useMessage } from '@/hooks/useMessage'
|
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 } from '@/store/floorPlanObjectAtom'
|
import { floorPlanObjectState, estimateState } from '@/store/floorPlanObjectAtom'
|
||||||
|
|
||||||
export default function DocDownOptionPop({ planNo, setEstimatePopupOpen }) {
|
export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDownPopLockFlg }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { promisePost } = useAxios()
|
const { promisePost } = useAxios()
|
||||||
|
|
||||||
@ -22,6 +22,7 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen }) {
|
|||||||
|
|
||||||
// recoil 물건번호
|
// recoil 물건번호
|
||||||
const objectRecoil = useRecoilValue(floorPlanObjectState)
|
const objectRecoil = useRecoilValue(floorPlanObjectState)
|
||||||
|
const estimateRecoilState = useRecoilValue(estimateState)
|
||||||
|
|
||||||
//문서 다운로드
|
//문서 다운로드
|
||||||
const handleFileDown = async () => {
|
const handleFileDown = async () => {
|
||||||
@ -82,6 +83,9 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen }) {
|
|||||||
link.click()
|
link.click()
|
||||||
link.remove()
|
link.remove()
|
||||||
window.URL.revokeObjectURL(fileUrl)
|
window.URL.revokeObjectURL(fileUrl)
|
||||||
|
//문서 다운받으면 lockFlg = 1 잠금상태로!
|
||||||
|
estimateRecoilState.lockFlg = '1'
|
||||||
|
docDownPopLockFlg()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|||||||
@ -85,7 +85,11 @@ export default function CanvasMenu(props) {
|
|||||||
const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector)
|
const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector)
|
||||||
|
|
||||||
//견적서버튼 노출용
|
//견적서버튼 노출용
|
||||||
const [buttonStyle, setButtonStyle] = useState('')
|
const [buttonStyle1, setButtonStyle1] = useState('') //문서 다운로드 버튼
|
||||||
|
const [buttonStyle2, setButtonStyle2] = useState('') //저장 버튼
|
||||||
|
const [buttonStyle3, setButtonStyle3] = useState('') //초기화 버튼
|
||||||
|
const [buttonStyle4, setButtonStyle4] = useState('') //견적서 복사 버튼
|
||||||
|
const [buttonStyle5, setButtonStyle5] = useState('') //잠금 버튼
|
||||||
|
|
||||||
// 발전시뮬레이션 메뉴 이동
|
// 발전시뮬레이션 메뉴 이동
|
||||||
const { objectNo, pid } = floorPlanState
|
const { objectNo, pid } = floorPlanState
|
||||||
@ -191,7 +195,7 @@ export default function CanvasMenu(props) {
|
|||||||
setCurrentMenu(menu.title)
|
setCurrentMenu(menu.title)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pathname !== '/floor-plan' && pathname !== '/floor-plan/estimate/5') {
|
if (pathname !== '/floor-plan' && pathname !== '/floor-plan/estimate/5' && pathname !== '/floor-plan/simulator/6') {
|
||||||
router.push(`/floor-plan?pid=${pid}&objectNo=${objectNo}`)
|
router.push(`/floor-plan?pid=${pid}&objectNo=${objectNo}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -256,22 +260,19 @@ export default function CanvasMenu(props) {
|
|||||||
// 견적서 초기화 버튼
|
// 견적서 초기화 버튼
|
||||||
const handleEstimateReset = () => {
|
const handleEstimateReset = () => {
|
||||||
swalFire({
|
swalFire({
|
||||||
//저장된 견적서 정보가 초기화되고, 도면정보가 반영됩니다. 정말로 초기화 하시겠습니까?
|
|
||||||
//물건정보
|
|
||||||
text: getMessage('estimate.detail.reset.confirmMsg'),
|
text: getMessage('estimate.detail.reset.confirmMsg'),
|
||||||
type: 'confirm',
|
type: 'confirm',
|
||||||
confirmFn: async () => {
|
confirmFn: async () => {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
const params = {
|
const params = {
|
||||||
objectNo: objectNo,
|
objectNo: objectNo,
|
||||||
planNo: pid,
|
planNo: pid,
|
||||||
userId: sessionState.userId,
|
userId: sessionState.userId,
|
||||||
}
|
}
|
||||||
//디테일 호출
|
|
||||||
try {
|
try {
|
||||||
await promisePost({ url: '/api/estimate/reset-estimate', data: params }).then((res) => {
|
await promisePost({ url: '/api/estimate/reset-estimate', data: params }).then((res) => {
|
||||||
setIsGlobalLoading(true)
|
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
swalFire({ text: getMessage('estimate.detail.copy.alertMsg'), type: 'alert' })
|
swalFire({ text: getMessage('estimate.detail.reset.alertMsg'), type: 'alert' })
|
||||||
fetchSetting(objectNo, pid, 'R')
|
fetchSetting(objectNo, pid, 'R')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -281,7 +282,7 @@ export default function CanvasMenu(props) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
denyFn: () => {
|
denyFn: () => {
|
||||||
console.log('초기화하지 않음. 변경일시 갱신안함')
|
setIsGlobalLoading(false)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -295,16 +296,18 @@ export default function CanvasMenu(props) {
|
|||||||
}, [type, globalLocale])
|
}, [type, globalLocale])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if ([2, 3].some((num) => num === canvasSetting?.roofSizeSet)) {
|
if (Object.keys(basicSetting).length === 0) return
|
||||||
setMenuNumber(3)
|
// setMenuNumber(1)
|
||||||
setType('surface')
|
// if ([2, 3].some((num) => num === canvasSetting?.roofSizeSet)) {
|
||||||
setCurrentMenu(MENU.BATCH_CANVAS.BATCH_DRAWING)
|
// setMenuNumber(3)
|
||||||
} else {
|
// setType('surface')
|
||||||
setMenuNumber(2)
|
// setCurrentMenu(MENU.BATCH_CANVAS.BATCH_DRAWING)
|
||||||
setType('outline')
|
// } else {
|
||||||
setCurrentMenu(MENU.ROOF_COVERING.EXTERIOR_WALL_LINE)
|
// setMenuNumber(2)
|
||||||
}
|
// setType('outline')
|
||||||
}, [canvasSetting])
|
// setCurrentMenu(MENU.ROOF_COVERING.EXTERIOR_WALL_LINE)
|
||||||
|
// }
|
||||||
|
}, [basicSetting])
|
||||||
|
|
||||||
const checkMenuState = (menu) => {
|
const checkMenuState = (menu) => {
|
||||||
return (['2', '3'].includes(canvasSetting?.roofSizeSet) && menu.index === 2) || (menuNumber === 4 && menu.index === 2)
|
return (['2', '3'].includes(canvasSetting?.roofSizeSet) && menu.index === 2) || (menuNumber === 4 && menu.index === 2)
|
||||||
@ -314,12 +317,112 @@ export default function CanvasMenu(props) {
|
|||||||
if (isObjectNotEmpty(estimateRecoilState)) {
|
if (isObjectNotEmpty(estimateRecoilState)) {
|
||||||
if (estimateRecoilState?.createUser === 'T01') {
|
if (estimateRecoilState?.createUser === 'T01') {
|
||||||
if (sessionState.userId !== 'T01') {
|
if (sessionState.userId !== 'T01') {
|
||||||
setButtonStyle('none')
|
setButtonStyle1('none')
|
||||||
|
setButtonStyle2('none')
|
||||||
|
setButtonStyle3('none')
|
||||||
|
setButtonStyle4('none')
|
||||||
|
setButtonStyle5('none')
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (estimateRecoilState?.tempFlg === '1') {
|
||||||
|
setButtonStyle1('none')
|
||||||
|
setButtonStyle2('')
|
||||||
|
setButtonStyle3('none')
|
||||||
|
setButtonStyle4('none')
|
||||||
|
setButtonStyle5('none')
|
||||||
|
} else {
|
||||||
|
if (estimateRecoilState?.tempFlg === '0' && estimateRecoilState?.lockFlg === '0') {
|
||||||
|
setButtonStyle1('')
|
||||||
|
setButtonStyle2('')
|
||||||
|
setButtonStyle3('')
|
||||||
|
setButtonStyle4('')
|
||||||
|
setButtonStyle5('')
|
||||||
|
} else {
|
||||||
|
setButtonStyle1('')
|
||||||
|
setButtonStyle2('none')
|
||||||
|
setButtonStyle3('none')
|
||||||
|
setButtonStyle4('')
|
||||||
|
setButtonStyle5('')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [estimateRecoilState])
|
}, [estimateRecoilState])
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 견적서 잠금 / 해제
|
||||||
|
* lockFlg : 0 잠금해제상태 / 1 잠금상태
|
||||||
|
* --보낼때--
|
||||||
|
* 0잠금해제는 1잠금으로
|
||||||
|
* 1잠금 문서는 0 잠금해제로
|
||||||
|
*/
|
||||||
|
const handleEstimateLockController = (estimateRecoilState) => {
|
||||||
|
swalFire({
|
||||||
|
text: estimateRecoilState.lockFlg === '0' ? getMessage('estimate.detail.lock.alertMsg') : getMessage('estimate.detail.unlock.alertMsg'),
|
||||||
|
type: 'confirm',
|
||||||
|
confirmFn: async () => {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
|
const params = {
|
||||||
|
objectNo: estimateRecoilState.objectNo,
|
||||||
|
planNo: estimateRecoilState.planNo,
|
||||||
|
lockFlg: estimateRecoilState.lockFlg === '0' ? '1' : '0',
|
||||||
|
userId: sessionState.userId,
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await promisePost({ url: '/api/estimate/save-estimate-lock', data: params }).then((res) => {
|
||||||
|
if (res.status === 201) {
|
||||||
|
estimateRecoilState.lockFlg = estimateRecoilState.lockFlg === '0' ? '1' : '0'
|
||||||
|
if (estimateRecoilState?.createUser === 'T01') {
|
||||||
|
if (sessionState.userId !== 'T01') {
|
||||||
|
setButtonStyle1('none')
|
||||||
|
setButtonStyle2('none')
|
||||||
|
setButtonStyle3('none')
|
||||||
|
setButtonStyle4('none')
|
||||||
|
setButtonStyle5('none')
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (estimateRecoilState?.tempFlg === '1') {
|
||||||
|
setButtonStyle1('none')
|
||||||
|
setButtonStyle2('')
|
||||||
|
setButtonStyle3('none')
|
||||||
|
setButtonStyle4('none')
|
||||||
|
setButtonStyle5('none')
|
||||||
|
} else {
|
||||||
|
if (estimateRecoilState?.tempFlg === '0' && estimateRecoilState?.lockFlg === '0') {
|
||||||
|
setButtonStyle1('')
|
||||||
|
setButtonStyle2('')
|
||||||
|
setButtonStyle3('')
|
||||||
|
setButtonStyle4('')
|
||||||
|
setButtonStyle5('')
|
||||||
|
} else {
|
||||||
|
setButtonStyle1('')
|
||||||
|
setButtonStyle2('none')
|
||||||
|
setButtonStyle3('none')
|
||||||
|
setButtonStyle4('')
|
||||||
|
setButtonStyle5('')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setIsGlobalLoading(false)
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
setIsGlobalLoading(false)
|
||||||
|
console.log('error::::::::::::', e.response.data.message)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 문서다운로드 팝업에서 다운로드 하면 문서 잠금
|
||||||
|
const docDownPopLockFlg = () => {
|
||||||
|
setButtonStyle1('')
|
||||||
|
setButtonStyle2('none')
|
||||||
|
setButtonStyle3('none')
|
||||||
|
setButtonStyle4('')
|
||||||
|
setButtonStyle5('')
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`canvas-menu-wrap ${[2, 3, 4].some((num) => num === menuNumber) ? 'active' : ''}`}>
|
<div className={`canvas-menu-wrap ${[2, 3, 4].some((num) => num === menuNumber) ? 'active' : ''}`}>
|
||||||
<div className="canvas-menu-inner">
|
<div className="canvas-menu-inner">
|
||||||
@ -406,16 +509,17 @@ export default function CanvasMenu(props) {
|
|||||||
{menuNumber === 5 && (
|
{menuNumber === 5 && (
|
||||||
<>
|
<>
|
||||||
<div className="ico-btn-from">
|
<div className="ico-btn-from">
|
||||||
<button className="btn-frame gray ico-flx" onClick={() => setEstimatePopupOpen(true)}>
|
<button type="button" style={{ display: buttonStyle1 }} className="btn-frame gray ico-flx" onClick={() => setEstimatePopupOpen(true)}>
|
||||||
<span className="ico ico01"></span>
|
<span className="ico ico01"></span>
|
||||||
<span className="name">{getMessage('plan.menu.estimate.docDown')}</span>
|
<span className="name">{getMessage('plan.menu.estimate.docDown')}</span>
|
||||||
</button>
|
</button>
|
||||||
<button style={{ display: buttonStyle }} className="btn-frame gray ico-flx" onClick={handleEstimateSubmit}>
|
<button type="button" style={{ display: buttonStyle2 }} className="btn-frame gray ico-flx" onClick={handleEstimateSubmit}>
|
||||||
<span className="ico ico02"></span>
|
<span className="ico ico02"></span>
|
||||||
<span className="name">{getMessage('plan.menu.estimate.save')}</span>
|
<span className="name">{getMessage('plan.menu.estimate.save')}</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
style={{ display: buttonStyle }}
|
type="button"
|
||||||
|
style={{ display: buttonStyle3 }}
|
||||||
className="btn-frame gray ico-flx"
|
className="btn-frame gray ico-flx"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
handleEstimateReset()
|
handleEstimateReset()
|
||||||
@ -427,6 +531,8 @@ export default function CanvasMenu(props) {
|
|||||||
|
|
||||||
{estimateRecoilState?.docNo !== null && (sessionState.storeId === 'T01' || sessionState.storeLvl === '1') && (
|
{estimateRecoilState?.docNo !== null && (sessionState.storeId === 'T01' || sessionState.storeLvl === '1') && (
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
|
style={{ display: buttonStyle4 }}
|
||||||
className="btn-frame gray ico-flx"
|
className="btn-frame gray ico-flx"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setEstimateCopyPopupOpen(true)
|
setEstimateCopyPopupOpen(true)
|
||||||
@ -436,9 +542,20 @@ export default function CanvasMenu(props) {
|
|||||||
<span className="name">{getMessage('plan.menu.estimate.copy')}</span>
|
<span className="name">{getMessage('plan.menu.estimate.copy')}</span>
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
<button style={{ display: buttonStyle }} className="btn-frame gray ico-flx">
|
<button
|
||||||
|
type="button"
|
||||||
|
style={{ display: buttonStyle5 }}
|
||||||
|
className="btn-frame gray ico-flx"
|
||||||
|
onClick={() => {
|
||||||
|
//시연준비
|
||||||
|
alert('작업중입니다')
|
||||||
|
// handleEstimateLockController(estimateRecoilState)
|
||||||
|
}}
|
||||||
|
>
|
||||||
<span className="ico ico05"></span>
|
<span className="ico ico05"></span>
|
||||||
<span className="name">{getMessage('plan.menu.estimate.unLock')}</span>
|
<span className="name">
|
||||||
|
{estimateRecoilState?.lockFlg === '1' ? getMessage('plan.menu.estimate.unLock') : getMessage('plan.menu.estimate.lock')}
|
||||||
|
</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
@ -463,7 +580,9 @@ export default function CanvasMenu(props) {
|
|||||||
{[2, 3, 4].some((num) => num === menuNumber) && <MenuDepth01 />}
|
{[2, 3, 4].some((num) => num === menuNumber) && <MenuDepth01 />}
|
||||||
</div>
|
</div>
|
||||||
{/* 견적서(menuNumber=== 5) 상세화면인경우 문서다운로드 팝업 */}
|
{/* 견적서(menuNumber=== 5) 상세화면인경우 문서다운로드 팝업 */}
|
||||||
{estimatePopupOpen && <DocDownOptionPop planNo={estimateRecoilState?.planNo} setEstimatePopupOpen={setEstimatePopupOpen} />}
|
{estimatePopupOpen && (
|
||||||
|
<DocDownOptionPop planNo={estimateRecoilState?.planNo} setEstimatePopupOpen={setEstimatePopupOpen} docDownPopLockFlg={docDownPopLockFlg} />
|
||||||
|
)}
|
||||||
{/* 견적서(menuNumber ===5)복사 팝업 */}
|
{/* 견적서(menuNumber ===5)복사 팝업 */}
|
||||||
{estimateCopyPopupOpen && <EstimateCopyPop planNo={estimateRecoilState?.planNo} setEstimateCopyPopupOpen={setEstimateCopyPopupOpen} />}
|
{estimateCopyPopupOpen && <EstimateCopyPop planNo={estimateRecoilState?.planNo} setEstimateCopyPopupOpen={setEstimateCopyPopupOpen} />}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -43,59 +43,63 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
|
|
||||||
// 데이터를 최초 한 번만 조회
|
// 데이터를 최초 한 번만 조회
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!basicSetting || !currentRoof || Object.keys(currentRoof).length === 0 || Object.keys(basicSetting).length === 0) return
|
||||||
const raftCodeList = findCommonCode('203800')
|
const raftCodeList = findCommonCode('203800')
|
||||||
setRaftCodes(raftCodeList)
|
setRaftCodes(raftCodeList)
|
||||||
|
// setCurrentRoof({ ...currentRoof, roofSizeSet: basicSetting.roofMaterials.roofSizeSet, roofAngleSet: basicSetting.roofMaterials.roofAngleSet })
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('🚀 ~ useEffect ~ basicSetting:', currentRoof)
|
if (!currentRoof || Object.keys(currentRoof).length === 0) return
|
||||||
setBasicSettings({
|
console.log(basicSetting)
|
||||||
...basicSetting,
|
setBasicSettings({
|
||||||
roofSizeSet: currentRoof.roofSizeSet,
|
...basicSetting,
|
||||||
roofAngleSet: currentRoof.roofAngleSet,
|
roofSizeSet: String(currentRoof.roofSizeSet),
|
||||||
roofsData: {
|
roofAngleSet: currentRoof.roofAngleSet,
|
||||||
roofApply: true,
|
roofsData: {
|
||||||
roofSeq: 0,
|
roofApply: true,
|
||||||
roofMatlCd: currentRoof.roofMatlCd,
|
roofSeq: 0,
|
||||||
roofWidth: currentRoof.width,
|
roofMatlCd: currentRoof.roofMatlCd,
|
||||||
roofHeight: currentRoof.length,
|
roofWidth: currentRoof.width,
|
||||||
roofHajebichi: currentRoof.hajebichi,
|
roofHeight: currentRoof.length,
|
||||||
roofGap: currentRoof.raft,
|
roofHajebichi: currentRoof.hajebichi,
|
||||||
roofLayout: currentRoof.layout,
|
roofGap: currentRoof.raft,
|
||||||
},
|
roofLayout: currentRoof.layout,
|
||||||
})
|
roofPitch: currentRoof.pitch,
|
||||||
|
roofAngle: currentRoof.angle,
|
||||||
|
},
|
||||||
|
})
|
||||||
}, [currentRoof])
|
}, [currentRoof])
|
||||||
|
|
||||||
const handleRoofSizeSetChange = (value) => {
|
const handleRoofSizeSetChange = (value) => {
|
||||||
setCurrentRoof({...currentRoof, roofSizeSet: value})
|
setCurrentRoof({ ...currentRoof, roofSizeSet: value })
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleRoofAngleSetChange = (value) => {
|
const handleRoofAngleSetChange = (value) => {
|
||||||
setCurrentRoof({...currentRoof, roofAngleSet: value})
|
setCurrentRoof({ ...currentRoof, roofAngleSet: value })
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to update the roofType and corresponding values
|
// Function to update the roofType and corresponding values
|
||||||
const handleRoofTypeChange = (value) => {
|
const handleRoofTypeChange = (value) => {
|
||||||
const selectedRoofMaterial = roofMaterials.find((roof) => roof.roofMatlCd === value)
|
const selectedRoofMaterial = roofMaterials.find((roof) => roof.roofMatlCd === value)
|
||||||
console.log('🚀 ~ handleRoofTypeChange ~ selectedRoofMaterial:', selectedRoofMaterial)
|
setCurrentRoof({ ...selectedRoofMaterial, index: 0, roofSizeSet: String(currentRoof.roofSizeSet), roofAngleSet: currentRoof.roofAngleSet })
|
||||||
setCurrentRoof({...selectedRoofMaterial, index: 0, roofSizeSet: currentRoof.roofSizeSet, roofAngleSet: currentRoof.roofAngleSet})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const changeInput = (value, e) => {
|
const changeInput = (value, e) => {
|
||||||
const { name } = e.target
|
const { name } = e.target
|
||||||
setCurrentRoof({...currentRoof, [name]: Number(value)})
|
setCurrentRoof({ ...currentRoof, [name]: Number(value) })
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleRafterChange = (value) => {
|
const handleRafterChange = (value) => {
|
||||||
setCurrentRoof({...currentRoof, raft: value})
|
setCurrentRoof({ ...currentRoof, raft: value })
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleRoofLayoutChange = (value) => {
|
const handleRoofLayoutChange = (value) => {
|
||||||
setCurrentRoof({...currentRoof, layout: value})
|
setCurrentRoof({ ...currentRoof, layout: value })
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSaveBtn = () => {
|
const handleSaveBtn = () => {
|
||||||
const roofInfo = {
|
const roofInfo = {
|
||||||
...currentRoof,
|
...currentRoof,
|
||||||
roofCd: roofRef.roofCd.current?.value,
|
roofCd: roofRef.roofCd.current?.value,
|
||||||
width: roofRef.width.current?.value,
|
width: roofRef.width.current?.value,
|
||||||
@ -106,7 +110,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
layout: currentRoof.layout,
|
layout: currentRoof.layout,
|
||||||
index: 0,
|
index: 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
const newAddedRoofs = [...addedRoofs]
|
const newAddedRoofs = [...addedRoofs]
|
||||||
if (addedRoofs.length === 1) {
|
if (addedRoofs.length === 1) {
|
||||||
newAddedRoofs[0] = { ...roofInfo }
|
newAddedRoofs[0] = { ...roofInfo }
|
||||||
@ -118,7 +122,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
selectedRoofMaterial: {
|
selectedRoofMaterial: {
|
||||||
// 선택된 지붕재 정보
|
// 선택된 지붕재 정보
|
||||||
roofInfo,
|
roofInfo,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
setBasicSettings({
|
setBasicSettings({
|
||||||
@ -139,6 +143,8 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
roofLayout: currentRoof.layout,
|
roofLayout: currentRoof.layout,
|
||||||
roofSizeSet: currentRoof.roofSizeSet,
|
roofSizeSet: currentRoof.roofSizeSet,
|
||||||
roofAngleSet: currentRoof.roofAngleSet,
|
roofAngleSet: currentRoof.roofAngleSet,
|
||||||
|
roofPitch: currentRoof.pitch,
|
||||||
|
roofAngle: currentRoof.angle,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -181,9 +187,9 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
name="roofSizeSet"
|
name="roofSizeSet"
|
||||||
id="ra01"
|
id="ra01"
|
||||||
value="1" // roofSizeSet 값이 '1'인 경우
|
value="1" // roofSizeSet 값이 '1'인 경우
|
||||||
checked={currentRoof.roofSizeSet === '1'} // 선택 여부 확인
|
checked={currentRoof?.roofSizeSet === '1'} // 선택 여부 확인
|
||||||
//onChange={(e) => setBasicSettings({ ...basicSetting, roofSizeSet: e.target.value })} // 상태 업데이트
|
//onChange={(e) => setBasicSettings({ ...basicSetting, roofSizeSet: e.target.value })} // 상태 업데이트
|
||||||
onClick={() => handleRoofSizeSetChange(1)}
|
onClick={() => handleRoofSizeSetChange('1')}
|
||||||
/>
|
/>
|
||||||
<label htmlFor="ra01">{getMessage('modal.placement.initial.setting.size.roof')}</label>
|
<label htmlFor="ra01">{getMessage('modal.placement.initial.setting.size.roof')}</label>
|
||||||
</div>
|
</div>
|
||||||
@ -193,9 +199,9 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
name="roofSizeSet"
|
name="roofSizeSet"
|
||||||
id="ra02"
|
id="ra02"
|
||||||
value="2" // roofSizeSet 값이 '2'인 경우
|
value="2" // roofSizeSet 값이 '2'인 경우
|
||||||
checked={currentRoof.roofSizeSet === '2'} // 선택 여부 확인
|
checked={currentRoof?.roofSizeSet === '2'} // 선택 여부 확인
|
||||||
//onChange={(e) => setBasicSettings({ ...basicSetting, roofSizeSet: e.target.value })} // 상태 업데이트
|
//onChange={(e) => setBasicSettings({ ...basicSetting, roofSizeSet: e.target.value })} // 상태 업데이트
|
||||||
onClick={() => handleRoofSizeSetChange(2)}
|
onClick={() => handleRoofSizeSetChange('2')}
|
||||||
/>
|
/>
|
||||||
<label htmlFor="ra02">{getMessage('modal.placement.initial.setting.size.actual')}</label>
|
<label htmlFor="ra02">{getMessage('modal.placement.initial.setting.size.actual')}</label>
|
||||||
</div>
|
</div>
|
||||||
@ -205,9 +211,9 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
name="roofSizeSet"
|
name="roofSizeSet"
|
||||||
id="ra03"
|
id="ra03"
|
||||||
value="3" // roofSizeSet 값이 '3'인 경우
|
value="3" // roofSizeSet 값이 '3'인 경우
|
||||||
checked={currentRoof.roofSizeSet === '3'} // 선택 여부 확인
|
checked={currentRoof?.roofSizeSet === '3'} // 선택 여부 확인
|
||||||
//onChange={(e) => setBasicSettings({ ...basicSetting, roofSizeSet: e.target.value })} // 상태 업데이트
|
//onChange={(e) => setBasicSettings({ ...basicSetting, roofSizeSet: e.target.value })} // 상태 업데이트
|
||||||
onClick={() => handleRoofSizeSetChange(3)}
|
onClick={() => handleRoofSizeSetChange('3')}
|
||||||
/>
|
/>
|
||||||
<label htmlFor="ra03">{getMessage('modal.placement.initial.setting.size.none.pitch')}</label>
|
<label htmlFor="ra03">{getMessage('modal.placement.initial.setting.size.none.pitch')}</label>
|
||||||
</div>
|
</div>
|
||||||
@ -224,7 +230,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
name="roofAngleSet"
|
name="roofAngleSet"
|
||||||
id="ra04"
|
id="ra04"
|
||||||
value="slope" // 첫 번째 라디오 버튼의 값
|
value="slope" // 첫 번째 라디오 버튼의 값
|
||||||
checked={currentRoof.roofAngleSet === 'slope'} // 현재 선택된 값인지 확인
|
checked={currentRoof?.roofAngleSet === 'slope'} // 현재 선택된 값인지 확인
|
||||||
//onChange={(e) => setBasicSettings({ ...basicSetting, roofAngleSet: e.target.value })} // 상태 업데이트
|
//onChange={(e) => setBasicSettings({ ...basicSetting, roofAngleSet: e.target.value })} // 상태 업데이트
|
||||||
onClick={() => handleRoofAngleSetChange('slope')}
|
onClick={() => handleRoofAngleSetChange('slope')}
|
||||||
/>
|
/>
|
||||||
@ -236,7 +242,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
name="roofAngleSet"
|
name="roofAngleSet"
|
||||||
id="ra05"
|
id="ra05"
|
||||||
value="flat" // 두 번째 라디오 버튼의 값
|
value="flat" // 두 번째 라디오 버튼의 값
|
||||||
checked={currentRoof.roofAngleSet === 'flat'} // 현재 선택된 값인지 확인
|
checked={currentRoof?.roofAngleSet === 'flat'} // 현재 선택된 값인지 확인
|
||||||
//onChange={(e) => setBasicSettings({ ...basicSetting, roofAngleSet: e.target.value })} // 상태 업데이트
|
//onChange={(e) => setBasicSettings({ ...basicSetting, roofAngleSet: e.target.value })} // 상태 업데이트
|
||||||
onClick={() => handleRoofAngleSetChange('flat')}
|
onClick={() => handleRoofAngleSetChange('flat')}
|
||||||
/>
|
/>
|
||||||
@ -256,17 +262,19 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
<div className="placement-option">
|
<div className="placement-option">
|
||||||
<div className="grid-select no-flx" style={{ width: '171px' }}>
|
<div className="grid-select no-flx" style={{ width: '171px' }}>
|
||||||
<QSelectBox
|
<QSelectBox
|
||||||
title={currentRoof.roofSizeSet == 3 ? getMessage('modal.placement.initial.setting.size.none.pitch') : currentRoof.roofMatlNm}
|
title={
|
||||||
|
currentRoof?.roofSizeSet === '3' ? getMessage('modal.placement.initial.setting.size.none.pitch') : currentRoof?.roofMatlNm
|
||||||
|
}
|
||||||
ref={roofRef.roofCd}
|
ref={roofRef.roofCd}
|
||||||
options={roofMaterials.map((roof, index) => {
|
options={roofMaterials.map((roof, index) => {
|
||||||
return { ...roof, name: globalLocale === 'ko' ? roof.roofMatlNm : roof.roofMatlNmJp }
|
return { ...roof, name: globalLocale === 'ko' ? roof.roofMatlNm : roof.roofMatlNmJp }
|
||||||
})}
|
})}
|
||||||
value={currentRoof.roofSizeSet == 3 ? null : currentRoof.roofMatlCd}
|
value={currentRoof?.roofSizeSet === '3' ? null : currentRoof?.roofMatlCd}
|
||||||
onChange={(e) => handleRoofTypeChange(e.roofMatlCd)}
|
onChange={(e) => handleRoofTypeChange(e.roofMatlCd)}
|
||||||
sourceKey="id"
|
sourceKey="id"
|
||||||
targetKey="id"
|
targetKey="id"
|
||||||
showKey="name"
|
showKey="name"
|
||||||
disabled={currentRoof.roofSizeSet == 3}
|
disabled={currentRoof?.roofSizeSet === '3'}
|
||||||
/>
|
/>
|
||||||
{/* <select
|
{/* <select
|
||||||
className="select-light dark"
|
className="select-light dark"
|
||||||
@ -295,10 +303,10 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
name={`width`}
|
name={`width`}
|
||||||
ref={roofRef.width}
|
ref={roofRef.width}
|
||||||
value={parseInt(currentRoof.width)}
|
value={parseInt(currentRoof?.width)}
|
||||||
onChange={(e) => onlyNumberInputChange(e, changeInput)}
|
onChange={(e) => onlyNumberInputChange(e, changeInput)}
|
||||||
readOnly={currentRoof.widAuth === 'R'}
|
readOnly={currentRoof?.widAuth === 'R'}
|
||||||
disabled={currentRoof.roofSizeSet == 3}
|
disabled={currentRoof?.roofSizeSet === '3'}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{/* <div className="input-grid" style={{ width: '63px' }}>
|
{/* <div className="input-grid" style={{ width: '63px' }}>
|
||||||
@ -320,10 +328,10 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
name={`length`}
|
name={`length`}
|
||||||
ref={roofRef.length}
|
ref={roofRef.length}
|
||||||
value={parseInt(currentRoof.length)}
|
value={parseInt(currentRoof?.length)}
|
||||||
onChange={(e) => onlyNumberInputChange(e, changeInput)}
|
onChange={(e) => onlyNumberInputChange(e, changeInput)}
|
||||||
readOnly={currentRoof.lenAuth === 'R'}
|
readOnly={currentRoof?.lenAuth === 'R'}
|
||||||
disabled={currentRoof.roofSizeSet == 3}
|
disabled={currentRoof?.roofSizeSet === '3'}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{/* <div className="input-grid" style={{ width: '63px' }}>
|
{/* <div className="input-grid" style={{ width: '63px' }}>
|
||||||
@ -340,19 +348,22 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
<div className="flex-ment">
|
<div className="flex-ment">
|
||||||
<span>{getMessage('modal.placement.initial.setting.rafter')}</span>
|
<span>{getMessage('modal.placement.initial.setting.rafter')}</span>
|
||||||
{raftCodes.length > 0 && (
|
{raftCodes.length > 0 && (
|
||||||
<div className="select-wrap" style={{ width: '160px' }}>
|
<div className="select-wrap" style={{ width: '160px' }}>
|
||||||
<QSelectBox
|
<QSelectBox
|
||||||
options={raftCodes}
|
options={raftCodes}
|
||||||
ref={roofRef.rafter}
|
ref={roofRef.rafter}
|
||||||
title={raftCodes.find((r) => r.clCode === (currentRoof.raft === undefined ? currentRoof.raftBaseCd : currentRoof.raft)).clCodeNm}
|
title={
|
||||||
value={currentRoof.raft === undefined ? currentRoof.raftBaseCd : currentRoof.raft}
|
raftCodes.find((r) => r.clCode === (currentRoof?.raft === undefined ? currentRoof?.raftBaseCd : currentRoof?.raft))
|
||||||
onChange={(e) => handleRafterChange(e.clCode)}
|
.clCodeNm
|
||||||
sourceKey="clCode"
|
}
|
||||||
targetKey={currentRoof.raft ? 'raft' : 'raftBaseCd'}
|
value={currentRoof?.raft === undefined ? currentRoof?.raftBaseCd : currentRoof?.raft}
|
||||||
showKey="clCodeNm"
|
onChange={(e) => handleRafterChange(e.clCode)}
|
||||||
disabled={currentRoof.roofSizeSet == 3}
|
sourceKey="clCode"
|
||||||
/>
|
targetKey={currentRoof?.raft ? 'raft' : 'raftBaseCd'}
|
||||||
{/* <select className="select-light dark" name="roofGap" ref={roofRef.rafter}>
|
showKey="clCodeNm"
|
||||||
|
disabled={currentRoof?.roofSizeSet === '3'}
|
||||||
|
/>
|
||||||
|
{/* <select className="select-light dark" name="roofGap" ref={roofRef.rafter}>
|
||||||
{raftCodes.map((raft, index) => {
|
{raftCodes.map((raft, index) => {
|
||||||
return (
|
return (
|
||||||
<option key={index} value={raft.clCode} selected={currentRoofMaterial.raft === raft.clCode}>
|
<option key={index} value={raft.clCode} selected={currentRoofMaterial.raft === raft.clCode}>
|
||||||
@ -361,7 +372,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</select> */}
|
</select> */}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -377,31 +388,33 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
value={parseInt(currentRoof.hajebichi)}
|
value={parseInt(currentRoof.hajebichi)}
|
||||||
onChange={(e) => onlyNumberInputChange(e, changeInput)}
|
onChange={(e) => onlyNumberInputChange(e, changeInput)}
|
||||||
readOnly={currentRoof.roofPchAuth === 'R'}
|
readOnly={currentRoof.roofPchAuth === 'R'}
|
||||||
disabled={currentRoof.roofSizeSet == 3}
|
disabled={currentRoof.roofSizeSet === '3'}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="placement-roof-btn-wrap">
|
{currentRoof && (
|
||||||
<div className="icon-btn-wrap mt10">
|
<div className="placement-roof-btn-wrap">
|
||||||
<button
|
<div className="icon-btn-wrap mt10">
|
||||||
className={`${currentRoof.layout === ROOF_MATERIAL_LAYOUT.PARALLEL && 'act'}`}
|
<button
|
||||||
value={ROOF_MATERIAL_LAYOUT.PARALLEL}
|
className={`${currentRoof?.layout === ROOF_MATERIAL_LAYOUT.PARALLEL && 'act'}`}
|
||||||
onClick={() => handleRoofLayoutChange(ROOF_MATERIAL_LAYOUT.PARALLEL)}
|
value={ROOF_MATERIAL_LAYOUT.PARALLEL}
|
||||||
>
|
onClick={() => handleRoofLayoutChange(ROOF_MATERIAL_LAYOUT.PARALLEL)}
|
||||||
{getMessage('modal.roof.alloc.select.parallel')}
|
>
|
||||||
<i className="allocation01"></i>
|
{getMessage('modal.roof.alloc.select.parallel')}
|
||||||
</button>
|
<i className="allocation01"></i>
|
||||||
<button
|
</button>
|
||||||
className={`${currentRoof.layout === ROOF_MATERIAL_LAYOUT.STAIRS && 'act'}`}
|
<button
|
||||||
value={ROOF_MATERIAL_LAYOUT.STAIRS}
|
className={`${currentRoof.layout === ROOF_MATERIAL_LAYOUT.STAIRS && 'act'}`}
|
||||||
onClick={() => handleRoofLayoutChange(ROOF_MATERIAL_LAYOUT.STAIRS)}
|
value={ROOF_MATERIAL_LAYOUT.STAIRS}
|
||||||
>
|
onClick={() => handleRoofLayoutChange(ROOF_MATERIAL_LAYOUT.STAIRS)}
|
||||||
{getMessage('modal.roof.alloc.select.stairs')} <i className="allocation02"></i>
|
>
|
||||||
</button>
|
{getMessage('modal.roof.alloc.select.stairs')} <i className="allocation02"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import { basicSettingState } from '@/store/settingAtom'
|
|||||||
import { ROOF_MATERIAL_LAYOUT } from '@/components/floor-plan/modal/placementShape/PlacementShapeSetting'
|
import { ROOF_MATERIAL_LAYOUT } from '@/components/floor-plan/modal/placementShape/PlacementShapeSetting'
|
||||||
import { useCanvasSetting } from '@/hooks/option/useCanvasSetting'
|
import { useCanvasSetting } from '@/hooks/option/useCanvasSetting'
|
||||||
import { useCommonCode } from '@/hooks/common/useCommonCode'
|
import { useCommonCode } from '@/hooks/common/useCommonCode'
|
||||||
|
import { currentAngleTypeSelector, pitchTextSelector } from '@/store/canvasAtom'
|
||||||
|
|
||||||
export default function ContextRoofAllocationSetting(props) {
|
export default function ContextRoofAllocationSetting(props) {
|
||||||
const contextPopupPosition = useRecoilValue(contextPopupPositionState)
|
const contextPopupPosition = useRecoilValue(contextPopupPositionState)
|
||||||
@ -29,9 +30,12 @@ export default function ContextRoofAllocationSetting(props) {
|
|||||||
handleChangeLayout,
|
handleChangeLayout,
|
||||||
handleSaveContext,
|
handleSaveContext,
|
||||||
currentRoofList,
|
currentRoofList,
|
||||||
|
handleChangeInput,
|
||||||
} = useRoofAllocationSetting(id)
|
} = useRoofAllocationSetting(id)
|
||||||
|
|
||||||
const { findCommonCode } = useCommonCode()
|
const { findCommonCode } = useCommonCode()
|
||||||
|
const pitchText = useRecoilValue(pitchTextSelector)
|
||||||
|
const currentAngleType = useRecoilValue(currentAngleTypeSelector)
|
||||||
const [raftCodes, setRaftCodes] = useState([])
|
const [raftCodes, setRaftCodes] = useState([])
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const raftCodeList = findCommonCode('203800')
|
const raftCodeList = findCommonCode('203800')
|
||||||
@ -104,6 +108,22 @@ export default function ContextRoofAllocationSetting(props) {
|
|||||||
{index !== 0 && <button className="delete" onClick={() => onDeleteRoofMaterial(index)}></button>}
|
{index !== 0 && <button className="delete" onClick={() => onDeleteRoofMaterial(index)}></button>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="block-box">
|
||||||
|
<div className="flex-ment">
|
||||||
|
<span>{getMessage('slope')}</span>
|
||||||
|
<div className="input-grid" style={{ width: '214px' }}>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
className="input-origin block"
|
||||||
|
onChange={(e) => {
|
||||||
|
handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index)
|
||||||
|
}}
|
||||||
|
defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<span>{pitchText}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{(roof.widAuth || roof.lenAuth) && (
|
{(roof.widAuth || roof.lenAuth) && (
|
||||||
<div className="block-box">
|
<div className="block-box">
|
||||||
{roof.widAuth && (
|
{roof.widAuth && (
|
||||||
|
|||||||
@ -119,7 +119,7 @@ export default function RoofAllocationSetting(props) {
|
|||||||
type="text"
|
type="text"
|
||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
handleChangeInput(e, 'pitch', index)
|
handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index)
|
||||||
}}
|
}}
|
||||||
defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle}
|
defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import { globalLocaleStore } from '@/store/localeAtom'
|
|||||||
import { isEmptyArray, isNotEmptyArray, isObjectNotEmpty, queryStringFormatter } from '@/util/common-utils'
|
import { isEmptyArray, isNotEmptyArray, isObjectNotEmpty, queryStringFormatter } from '@/util/common-utils'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { useForm } from 'react-hook-form'
|
import { useForm } from 'react-hook-form'
|
||||||
import { useRecoilValue, useSetRecoilState, useResetRecoilState } from 'recoil'
|
import { useRecoilValue, useSetRecoilState, useResetRecoilState, useRecoilState } from 'recoil'
|
||||||
import { SessionContext } from '@/app/SessionProvider'
|
import { SessionContext } from '@/app/SessionProvider'
|
||||||
import FindAddressPop from './popup/FindAddressPop'
|
import FindAddressPop from './popup/FindAddressPop'
|
||||||
import PlanRequestPop from './popup/PlanRequestPop'
|
import PlanRequestPop from './popup/PlanRequestPop'
|
||||||
@ -23,7 +23,12 @@ import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
|||||||
import DocDownOptionPop from '../estimate/popup/DocDownOptionPop'
|
import DocDownOptionPop from '../estimate/popup/DocDownOptionPop'
|
||||||
import { stuffSearchState } from '@/store/stuffAtom'
|
import { stuffSearchState } from '@/store/stuffAtom'
|
||||||
import { QcastContext } from '@/app/QcastProvider'
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
|
|
||||||
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
|
|
||||||
export default function StuffDetail() {
|
export default function StuffDetail() {
|
||||||
|
const [stuffSearch, setStuffSearch] = useRecoilState(stuffSearchState)
|
||||||
|
const { swalFire } = useSwal()
|
||||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||||
const resetStuffRecoil = useResetRecoilState(stuffSearchState)
|
const resetStuffRecoil = useResetRecoilState(stuffSearchState)
|
||||||
const stuffSearchParams = useRecoilValue(stuffSearchState)
|
const stuffSearchParams = useRecoilValue(stuffSearchState)
|
||||||
@ -118,13 +123,13 @@ export default function StuffDetail() {
|
|||||||
field: 'planNo',
|
field: 'planNo',
|
||||||
headerName: getMessage('stuff.detail.planGridHeader.planNo'),
|
headerName: getMessage('stuff.detail.planGridHeader.planNo'),
|
||||||
width: 100,
|
width: 100,
|
||||||
cellStyle: { justifyContent: 'center' },
|
cellStyle: { justifyContent: 'center', cursor: 'pointer' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'orderFlg',
|
field: 'orderFlg',
|
||||||
headerName: getMessage('stuff.detail.planGridHeader.orderFlg'),
|
headerName: getMessage('stuff.detail.planGridHeader.orderFlg'),
|
||||||
width: 80,
|
width: 80,
|
||||||
cellStyle: { justifyContent: 'center' },
|
cellStyle: { justifyContent: 'center', cursor: 'pointer' },
|
||||||
cellRenderer: (params) => {
|
cellRenderer: (params) => {
|
||||||
//1일때만 동그라미
|
//1일때만 동그라미
|
||||||
let orderFlg
|
let orderFlg
|
||||||
@ -137,13 +142,31 @@ export default function StuffDetail() {
|
|||||||
headerName: getMessage('stuff.detail.planGridHeader.moduleModel'),
|
headerName: getMessage('stuff.detail.planGridHeader.moduleModel'),
|
||||||
flex: 1,
|
flex: 1,
|
||||||
wrapText: true,
|
wrapText: true,
|
||||||
cellStyle: { justifyContent: 'flex-start' /* 좌측정렬*/ },
|
cellStyle: { justifyContent: 'flex-start' /* 좌측정렬*/, cursor: 'pointer' },
|
||||||
|
// cellRenderer: (params) => {
|
||||||
|
// let origin = params.value
|
||||||
|
// console.log('모듈:::', origin)
|
||||||
|
// if (origin !== null) {
|
||||||
|
// return (
|
||||||
|
// <>
|
||||||
|
// {origin?.split('、').map((it, idx) => (
|
||||||
|
// <span key={idx} className="block">
|
||||||
|
// {it}
|
||||||
|
// <br />
|
||||||
|
// </span>
|
||||||
|
// ))}
|
||||||
|
// </>
|
||||||
|
// )
|
||||||
|
// } else {
|
||||||
|
// return null
|
||||||
|
// }
|
||||||
|
// },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'capacity',
|
field: 'capacity',
|
||||||
headerName: getMessage('stuff.detail.planGridHeader.capacity'),
|
headerName: getMessage('stuff.detail.planGridHeader.capacity'),
|
||||||
width: 120,
|
width: 120,
|
||||||
cellStyle: { justifyContent: 'flex-end' /* 우측정렬*/ },
|
cellStyle: { justifyContent: 'flex-end' /* 우측정렬*/, cursor: 'pointer' },
|
||||||
cellRenderer: (params) => {
|
cellRenderer: (params) => {
|
||||||
let origin = params.value
|
let origin = params.value
|
||||||
let capacity
|
let capacity
|
||||||
@ -162,9 +185,8 @@ export default function StuffDetail() {
|
|||||||
width: 140,
|
width: 140,
|
||||||
wrapText: true,
|
wrapText: true,
|
||||||
autoHeight: true,
|
autoHeight: true,
|
||||||
cellStyle: { justifyContent: 'flex-start' /* 좌측정렬*/ },
|
cellStyle: { justifyContent: 'flex-start' /* 좌측정렬*/, cursor: 'pointer' },
|
||||||
cellRenderer: (params) => {
|
cellRenderer: (params) => {
|
||||||
//콤마가 아니라 、.. 일본콤마?
|
|
||||||
let origin = params.value
|
let origin = params.value
|
||||||
if (origin !== null) {
|
if (origin !== null) {
|
||||||
return (
|
return (
|
||||||
@ -187,7 +209,7 @@ export default function StuffDetail() {
|
|||||||
headerName: getMessage('stuff.detail.planGridHeader.constructSpecificationMulti'),
|
headerName: getMessage('stuff.detail.planGridHeader.constructSpecificationMulti'),
|
||||||
wrapText: true,
|
wrapText: true,
|
||||||
autoHeight: true,
|
autoHeight: true,
|
||||||
cellStyle: { justifyContent: 'flex-start' /* 좌측정렬*/ },
|
cellStyle: { justifyContent: 'flex-start' /* 좌측정렬*/, cursor: 'pointer' },
|
||||||
cellRenderer: (params) => {
|
cellRenderer: (params) => {
|
||||||
let origin = params.value
|
let origin = params.value
|
||||||
if (origin !== null) {
|
if (origin !== null) {
|
||||||
@ -211,7 +233,7 @@ export default function StuffDetail() {
|
|||||||
headerName: getMessage('stuff.detail.planGridHeader.supportMethodIdMulti'),
|
headerName: getMessage('stuff.detail.planGridHeader.supportMethodIdMulti'),
|
||||||
wrapText: true,
|
wrapText: true,
|
||||||
autoHeight: true,
|
autoHeight: true,
|
||||||
cellStyle: { justifyContent: 'flex-start' /* 좌측정렬*/ },
|
cellStyle: { justifyContent: 'flex-start' /* 좌측정렬*/, cursor: 'pointer' },
|
||||||
cellRenderer: (params) => {
|
cellRenderer: (params) => {
|
||||||
let origin = params.value
|
let origin = params.value
|
||||||
if (origin !== null) {
|
if (origin !== null) {
|
||||||
@ -236,7 +258,7 @@ export default function StuffDetail() {
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
wrapText: true,
|
wrapText: true,
|
||||||
autoHeight: true,
|
autoHeight: true,
|
||||||
cellStyle: { justifyContent: 'flex-start' /* 좌측정렬*/ },
|
cellStyle: { justifyContent: 'flex-start' /* 좌측정렬*/, cursor: 'pointer' },
|
||||||
cellRenderer: (params) => {
|
cellRenderer: (params) => {
|
||||||
let origin = params.value
|
let origin = params.value
|
||||||
if (origin !== null) {
|
if (origin !== null) {
|
||||||
@ -282,7 +304,7 @@ export default function StuffDetail() {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
//mid:5(견적서), /pid:플랜번호
|
//mid:5(견적서), /pid:플랜번호
|
||||||
setFloorPlanObjectNo({ floorPlanObjectNo: params.data.objectNo })
|
setFloorPlanObjectNo({ floorPlanObjectNo: params.data.objectNo })
|
||||||
// router.push(`/floor-plan/estimate/5/${params.data.planNo}`)
|
setIsGlobalLoading(true)
|
||||||
router.push(`/floor-plan/estimate/5?pid=${params.data.planNo}&objectNo=${params.data.objectNo}`)
|
router.push(`/floor-plan/estimate/5?pid=${params.data.planNo}&objectNo=${params.data.objectNo}`)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -325,13 +347,10 @@ export default function StuffDetail() {
|
|||||||
}
|
}
|
||||||
promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
|
promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
// console.log(res.data.createUser)
|
|
||||||
// console.log(session)
|
|
||||||
if (res?.data?.createUser === 'T01' && session?.userId !== 'T01') {
|
if (res?.data?.createUser === 'T01' && session?.userId !== 'T01') {
|
||||||
//createUser가 T01인데 로그인사용자가 T01이 아니면 버튼숨기기
|
//createUser가 T01인데 로그인사용자가 T01이 아니면 버튼숨기기
|
||||||
setShowButton('none')
|
setShowButton('none')
|
||||||
}
|
}
|
||||||
// console.log('상세::', res.data)
|
|
||||||
if (isObjectNotEmpty(res.data)) {
|
if (isObjectNotEmpty(res.data)) {
|
||||||
let surfaceTypeValue
|
let surfaceTypeValue
|
||||||
if (res.data.surfaceType === 'Ⅲ・Ⅳ') {
|
if (res.data.surfaceType === 'Ⅲ・Ⅳ') {
|
||||||
@ -342,8 +361,13 @@ export default function StuffDetail() {
|
|||||||
setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue })
|
setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue })
|
||||||
} else {
|
} else {
|
||||||
setManagementState({})
|
setManagementState({})
|
||||||
alert(getMessage('stuff.detail.header.notExistObjectNo'))
|
swalFire({
|
||||||
router.push('/management/stuff', { scroll: false })
|
text: getMessage('stuff.detail.header.notExistObjectNo'),
|
||||||
|
type: 'alert',
|
||||||
|
confirmFn: () => {
|
||||||
|
router.push('/management/stuff', { scroll: false })
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
if (isNotEmptyArray(res.data.planList)) {
|
if (isNotEmptyArray(res.data.planList)) {
|
||||||
setPlanGridProps({ ...planGridProps, planGridData: res.data.planList })
|
setPlanGridProps({ ...planGridProps, planGridData: res.data.planList })
|
||||||
@ -354,8 +378,13 @@ export default function StuffDetail() {
|
|||||||
setManagementState({})
|
setManagementState({})
|
||||||
setPlanGridProps({ ...planGridProps, planGridData: [] })
|
setPlanGridProps({ ...planGridProps, planGridData: [] })
|
||||||
|
|
||||||
alert(getMessage('stuff.detail.header.notExistObjectNo'))
|
swalFire({
|
||||||
router.push('/management/stuff', { scroll: false })
|
text: getMessage('stuff.detail.header.notExistObjectNo'),
|
||||||
|
type: 'alert',
|
||||||
|
confirmFn: () => {
|
||||||
|
router.push('/management/stuff', { scroll: false })
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@ -923,9 +952,6 @@ export default function StuffDetail() {
|
|||||||
|
|
||||||
//팝업에서 넘어온 설계의뢰 정보로 바꾸기
|
//팝업에서 넘어온 설계의뢰 정보로 바꾸기
|
||||||
const setPlanReqInfo = (info) => {
|
const setPlanReqInfo = (info) => {
|
||||||
// console.log('session 정보:::::::', session)
|
|
||||||
// console.log('설계의뢰에서 넘어온 정보:::::::', info)
|
|
||||||
|
|
||||||
form.setValue('planReqNo', info.planReqNo)
|
form.setValue('planReqNo', info.planReqNo)
|
||||||
|
|
||||||
form.setValue('objectStatusId', info.building)
|
form.setValue('objectStatusId', info.building)
|
||||||
@ -1118,7 +1144,7 @@ export default function StuffDetail() {
|
|||||||
const onSearchDesignRequestPopOpen = () => {
|
const onSearchDesignRequestPopOpen = () => {
|
||||||
const saleStoreId = form.watch('saleStoreId')
|
const saleStoreId = form.watch('saleStoreId')
|
||||||
if (saleStoreId === '') {
|
if (saleStoreId === '') {
|
||||||
alert(getMessage('stuff.planReqPopup.error.message2'))
|
swalFire({ text: getMessage('stuff.planReqPopup.error.message2'), type: 'alert' })
|
||||||
} else {
|
} else {
|
||||||
setShowDesignRequestButtonValid(true)
|
setShowDesignRequestButtonValid(true)
|
||||||
}
|
}
|
||||||
@ -1128,7 +1154,7 @@ export default function StuffDetail() {
|
|||||||
const onSearchWindSpeedPopOpen = () => {
|
const onSearchWindSpeedPopOpen = () => {
|
||||||
const prefName = form.watch('prefName')
|
const prefName = form.watch('prefName')
|
||||||
if (prefName === '') {
|
if (prefName === '') {
|
||||||
alert(getMessage('stuff.windSelectPopup.error.message1'))
|
swalFire({ text: getMessage('stuff.windSelectPopup.error.message1'), type: 'alert' })
|
||||||
} else {
|
} else {
|
||||||
setShowWindSpeedButtonValid(true)
|
setShowWindSpeedButtonValid(true)
|
||||||
}
|
}
|
||||||
@ -1219,7 +1245,7 @@ export default function StuffDetail() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Object.keys(errors).length > 0) {
|
if (Object.keys(errors).length > 0) {
|
||||||
return alert(getMessage('stuff.detail.save.valierror3', [errors]))
|
return swalFire({ text: getMessage('stuff.detail.save.valierror3', [errors]), type: 'alert' })
|
||||||
}
|
}
|
||||||
|
|
||||||
const apiUrl = '/api/object/save-object'
|
const apiUrl = '/api/object/save-object'
|
||||||
@ -1259,10 +1285,10 @@ export default function StuffDetail() {
|
|||||||
let height = params.installHeight
|
let height = params.installHeight
|
||||||
|
|
||||||
if (snow === '0') {
|
if (snow === '0') {
|
||||||
return alert(getMessage('stuff.detail.save.valierror1'))
|
return swalFire({ text: getMessage('stuff.detail.save.valierror1'), type: 'alert' })
|
||||||
}
|
}
|
||||||
if (height === '0') {
|
if (height === '0') {
|
||||||
return alert(getMessage('stuff.detail.save.valierror2'))
|
return swalFire({ text: getMessage('stuff.detail.save.valierror2'), type: 'alert' })
|
||||||
}
|
}
|
||||||
|
|
||||||
if (managementState) {
|
if (managementState) {
|
||||||
@ -1316,50 +1342,65 @@ export default function StuffDetail() {
|
|||||||
delete params_sort.workName
|
delete params_sort.workName
|
||||||
|
|
||||||
if (Object.entries(detail_sort).toString() === Object.entries(params_sort).toString()) {
|
if (Object.entries(detail_sort).toString() === Object.entries(params_sort).toString()) {
|
||||||
return alert(getMessage('stuff.detail.noChgData'))
|
return swalFire({ text: getMessage('stuff.detail.noChgData'), type: 'alert' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params?.receiveUser !== '') {
|
if (params?.receiveUser !== '') {
|
||||||
if (params?.receiveUser.trim().length > 10) {
|
if (params?.receiveUser.trim().length > 10) {
|
||||||
return alert(getMessage('stuff.detail.tempSave.message2'))
|
return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//로그인이 2차점인데 otherSaleStoreId가 없으면 알럿
|
//로그인이 2차점인데 otherSaleStoreId가 없으면 알럿
|
||||||
if (session.storeLvl !== '1') {
|
if (session.storeLvl !== '1') {
|
||||||
if (params.saleStoreLevel === '1') {
|
if (params.saleStoreLevel === '1') {
|
||||||
return alert(getMessage('stuff.detail.tempSave.message4'))
|
return swalFire({ text: getMessage('stuff.detail.tempSave.message4'), type: 'alert' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (editMode === 'NEW') {
|
if (editMode === 'NEW') {
|
||||||
await promisePost({ url: apiUrl, data: params })
|
await promisePost({ url: apiUrl, data: params })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
//상세화면으로 전환
|
//상세화면으로 전환
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
alert(getMessage('stuff.detail.save'))
|
|
||||||
setFloorPlanObjectNo({ floorPlanObjectNo: objectNo })
|
setFloorPlanObjectNo({ floorPlanObjectNo: objectNo })
|
||||||
router.push(`/management/stuff/detail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
swalFire({
|
||||||
|
text: getMessage('stuff.detail.save'),
|
||||||
|
type: 'alert',
|
||||||
|
confirmFn: () => {
|
||||||
|
setIsGlobalLoading(false)
|
||||||
|
|
||||||
|
router.push(`/management/stuff/detail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log('error::::::', error)
|
console.log('error::::::', error)
|
||||||
alert(error?.response.data.message)
|
setIsGlobalLoading(false)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// 수정모드일때는 PUT
|
// 수정모드일때는 PUT
|
||||||
// await promisePut({ url: apiUrl, data: params }).then((res) => {
|
|
||||||
await promisePut({ url: apiUrl, data: params })
|
await promisePut({ url: apiUrl, data: params })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
|
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
setFloorPlanObjectNo({ floorPlanObjectNo: res.data.objectNo })
|
setFloorPlanObjectNo({ floorPlanObjectNo: res.data.objectNo })
|
||||||
alert(getMessage('stuff.detail.save'))
|
swalFire({
|
||||||
router.push(`/management/stuff/detail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
text: getMessage('stuff.detail.save'),
|
||||||
|
type: 'alert',
|
||||||
|
confirmFn: () => {
|
||||||
|
setIsGlobalLoading(false)
|
||||||
|
router.push(`/management/stuff/detail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log('error::::::', error)
|
console.log('error::::::', error)
|
||||||
alert(error?.response.data.message)
|
setIsGlobalLoading(false)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1406,7 +1447,7 @@ export default function StuffDetail() {
|
|||||||
// 담당자 자리수 체크
|
// 담당자 자리수 체크
|
||||||
if (params?.receiveUser !== '') {
|
if (params?.receiveUser !== '') {
|
||||||
if (params?.receiveUser.trim().length > 10) {
|
if (params?.receiveUser.trim().length > 10) {
|
||||||
return alert(getMessage('stuff.detail.tempSave.message2'))
|
return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1414,26 +1455,40 @@ export default function StuffDetail() {
|
|||||||
if (objectNo) {
|
if (objectNo) {
|
||||||
await promisePut({ url: apiUrl, data: params })
|
await promisePut({ url: apiUrl, data: params })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
alert(getMessage('stuff.detail.tempSave.message1'))
|
swalFire({
|
||||||
router.push(`/management/stuff/tempdetail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
text: getMessage('stuff.detail.tempSave.message1'),
|
||||||
|
type: 'alert',
|
||||||
|
confirmFn: () => {
|
||||||
|
setIsGlobalLoading(false)
|
||||||
|
router.push(`/management/stuff/tempdetail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
setIsGlobalLoading(false)
|
||||||
console.log('error::::::', error)
|
console.log('error::::::', error)
|
||||||
alert(error?.response.data.message)
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
await promisePost({ url: apiUrl, data: params })
|
await promisePost({ url: apiUrl, data: params })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
alert(getMessage('stuff.detail.tempSave.message1'))
|
swalFire({
|
||||||
router.push(`/management/stuff/tempdetail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
text: getMessage('stuff.detail.tempSave.message1'),
|
||||||
|
type: 'alert',
|
||||||
|
confirmFn: () => {
|
||||||
|
setIsGlobalLoading(false)
|
||||||
|
router.push(`/management/stuff/tempdetail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log('error::::::', error)
|
console.log('error::::::', error)
|
||||||
alert(error?.response.data.message)
|
setIsGlobalLoading(false)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1445,25 +1500,63 @@ export default function StuffDetail() {
|
|||||||
userId: session.userId,
|
userId: session.userId,
|
||||||
}
|
}
|
||||||
if (specificationConfirmDate != null) {
|
if (specificationConfirmDate != null) {
|
||||||
alert(getMessage('stuff.detail.delete.message1'))
|
swalFire({ text: getMessage('stuff.detail.delete.message1'), type: 'alert' })
|
||||||
} else {
|
} else {
|
||||||
if (confirm(getMessage('common.message.data.delete'))) {
|
swalFire({
|
||||||
// setIsGlobalLoading(true)
|
text: getMessage('common.message.data.delete'),
|
||||||
del({ url: `/api/object/${objectNo}?${queryStringFormatter(delParams)}` })
|
type: 'confirm',
|
||||||
.then(() => {
|
confirmFn: () => {
|
||||||
setFloorPlanObjectNo({ floorPlanObjectNo: '' })
|
setFloorPlanObjectNo({ floorPlanObjectNo: '' })
|
||||||
if (session.storeId === 'T01') {
|
del({ url: `/api/object/${objectNo}?${queryStringFormatter(delParams)}` })
|
||||||
stuffSearchParams.code = 'DELETE'
|
.then((res) => {
|
||||||
} else {
|
setIsGlobalLoading(true)
|
||||||
resetStuffRecoil()
|
setFloorPlanObjectNo({ floorPlanObjectNo: '' })
|
||||||
}
|
if (session.storeId === 'T01') {
|
||||||
// setIsGlobalLoading(false)
|
stuffSearchParams.code = 'DELETE'
|
||||||
router.push('/management/stuff', { scroll: false })
|
} else {
|
||||||
})
|
if (session.storeLvl === '1') {
|
||||||
.catch(() => {
|
stuffSearch.schObjectNo = ''
|
||||||
// setIsGlobalLoading(false)
|
stuffSearch.schAddress = ''
|
||||||
})
|
stuffSearch.schObjectName = ''
|
||||||
}
|
stuffSearch.schSaleStoreName = ''
|
||||||
|
stuffSearch.schReceiveUser = ''
|
||||||
|
stuffSearch.schDispCompanyName = ''
|
||||||
|
stuffSearch.schDateType = 'U'
|
||||||
|
stuffSearch.schTempFlg = ''
|
||||||
|
stuffSearch.schMyDataCheck = false
|
||||||
|
stuffSearch.startRow = 1
|
||||||
|
stuffSearch.endRow = 100
|
||||||
|
stuffSearch.schSortType = 'U'
|
||||||
|
stuffSearch.pageNo = 1
|
||||||
|
stuffSearch.pageSize = 100
|
||||||
|
stuffSearch.code = 'S'
|
||||||
|
} else {
|
||||||
|
stuffSearch.schObjectNo = ''
|
||||||
|
stuffSearch.schAddress = ''
|
||||||
|
stuffSearch.schObjectName = ''
|
||||||
|
stuffSearch.schSaleStoreName = ''
|
||||||
|
stuffSearch.schReceiveUser = ''
|
||||||
|
stuffSearch.schDispCompanyName = ''
|
||||||
|
stuffSearch.schDateType = 'U'
|
||||||
|
stuffSearch.schTempFlg = ''
|
||||||
|
stuffSearch.schMyDataCheck = false
|
||||||
|
stuffSearch.startRow = 1
|
||||||
|
stuffSearch.endRow = 100
|
||||||
|
stuffSearch.schSortType = 'U'
|
||||||
|
stuffSearch.pageNo = 1
|
||||||
|
stuffSearch.pageSize = 100
|
||||||
|
stuffSearch.code = 'S'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setIsGlobalLoading(false)
|
||||||
|
router.push('/management/stuff', { scroll: false })
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log('error::::::', error)
|
||||||
|
setIsGlobalLoading(false)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1491,11 +1584,14 @@ export default function StuffDetail() {
|
|||||||
|
|
||||||
// 그리드 더블 클릭
|
// 그리드 더블 클릭
|
||||||
const getCellDoubleClicked = (params) => {
|
const getCellDoubleClicked = (params) => {
|
||||||
if (params?.column?.colId !== 'estimateDate') {
|
if (params.data.estimateDate != null) {
|
||||||
if (params?.data?.planNo && params?.data?.objectNo) {
|
if (params?.column?.colId !== 'estimateDate') {
|
||||||
let objectNo = params?.data?.objectNo
|
if (params?.data?.planNo && params?.data?.objectNo) {
|
||||||
let planNo = params?.data?.planNo
|
setIsGlobalLoading(true)
|
||||||
router.push(`/floor-plan/estimate/5?pid=${planNo}&objectNo=${objectNo}`)
|
let objectNo = params?.data?.objectNo
|
||||||
|
let planNo = params?.data?.planNo
|
||||||
|
router.push(`/floor-plan/estimate/5?pid=${planNo}&objectNo=${objectNo}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -343,7 +343,6 @@ export default function StuffSearchCondition() {
|
|||||||
} else {
|
} else {
|
||||||
if (session?.storeLvl === '2') {
|
if (session?.storeLvl === '2') {
|
||||||
if (otherSaleStoreList.length > 1) {
|
if (otherSaleStoreList.length > 1) {
|
||||||
// handleClear2()
|
|
||||||
setOtherSaleStoreId(session.storeId)
|
setOtherSaleStoreId(session.storeId)
|
||||||
stuffSearch.schOtherSelSaleStoreId = session.storeId
|
stuffSearch.schOtherSelSaleStoreId = session.storeId
|
||||||
stuffSearch.schObjectNo = ''
|
stuffSearch.schObjectNo = ''
|
||||||
|
|||||||
@ -15,6 +15,8 @@ import { useMessage } from '@/hooks/useMessage'
|
|||||||
import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
|
import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
|
||||||
|
|
||||||
import { convertNumberToPriceDecimal } from '@/util/common-utils'
|
import { convertNumberToPriceDecimal } from '@/util/common-utils'
|
||||||
|
import { usePlan } from '@/hooks/usePlan'
|
||||||
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
// import { useSearchParams } from 'next/navigation'
|
// import { useSearchParams } from 'next/navigation'
|
||||||
|
|
||||||
export default function Simulator() {
|
export default function Simulator() {
|
||||||
@ -24,6 +26,7 @@ export default function Simulator() {
|
|||||||
// const searchParams = useSearchParams()
|
// const searchParams = useSearchParams()
|
||||||
// const objectNo = searchParams.get('objectNo')
|
// const objectNo = searchParams.get('objectNo')
|
||||||
// const pid = searchParams.get('pid')
|
// const pid = searchParams.get('pid')
|
||||||
|
const { selectedPlan } = usePlan()
|
||||||
|
|
||||||
const chartRef = useRef(null)
|
const chartRef = useRef(null)
|
||||||
|
|
||||||
@ -40,6 +43,12 @@ export default function Simulator() {
|
|||||||
// 차트 관련
|
// 차트 관련
|
||||||
const [chartData, setChartData] = useState([])
|
const [chartData, setChartData] = useState([])
|
||||||
|
|
||||||
|
const { closeAll } = usePopup()
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
closeAll()
|
||||||
|
}, [])
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
labels: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
labels: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
||||||
datasets: [
|
datasets: [
|
||||||
@ -105,6 +114,7 @@ export default function Simulator() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
console.log('🚀 ~ useEffect ~ selectedPlan:', selectedPlan)
|
||||||
/* 초기화 작업 */
|
/* 초기화 작업 */
|
||||||
setChartData([])
|
setChartData([])
|
||||||
setObjectDetail({})
|
setObjectDetail({})
|
||||||
@ -121,7 +131,7 @@ export default function Simulator() {
|
|||||||
setPwrGnrSimType('D')
|
setPwrGnrSimType('D')
|
||||||
setPwrRecoil({ ...pwrRecoil, type: 'D' })
|
setPwrRecoil({ ...pwrRecoil, type: 'D' })
|
||||||
}
|
}
|
||||||
}, [objectNo, pid])
|
}, [objectNo, pid, selectedPlan])
|
||||||
|
|
||||||
// 물건 상세 정보 조회
|
// 물건 상세 정보 조회
|
||||||
const [objectDetail, setObjectDetail] = useState({})
|
const [objectDetail, setObjectDetail] = useState({})
|
||||||
@ -224,8 +234,8 @@ export default function Simulator() {
|
|||||||
</div>
|
</div>
|
||||||
{/* 시스템용량 */}
|
{/* 시스템용량 */}
|
||||||
<div className="estimate-box">
|
<div className="estimate-box">
|
||||||
<div className="estimate-tit">{getMessage('simulator.title.sub3')}</div>
|
<div className="estimate-tit">{getMessage('simulator.title.sub3')}</div>
|
||||||
<div className="estimate-name">{objectDetail.capacity ? `${convertNumberToPriceDecimal(objectDetail.capacity)}kW` : ''}</div>
|
<div className="estimate-name">{objectDetail.capacity ? `${convertNumberToPriceDecimal(objectDetail.capacity)} kW` : ''}</div>
|
||||||
</div>
|
</div>
|
||||||
{/* 연간예측발전량 */}
|
{/* 연간예측발전량 */}
|
||||||
<div className="estimate-box">
|
<div className="estimate-box">
|
||||||
@ -247,7 +257,7 @@ export default function Simulator() {
|
|||||||
{/* 적설조건 */}
|
{/* 적설조건 */}
|
||||||
<div className="estimate-box">
|
<div className="estimate-box">
|
||||||
<div className="estimate-tit">{getMessage('simulator.title.sub7')}</div>
|
<div className="estimate-tit">{getMessage('simulator.title.sub7')}</div>
|
||||||
<div className="estimate-name">{objectDetail.snowfall}</div>
|
<div className="estimate-name">{objectDetail.snowfall} cm</div>
|
||||||
</div>
|
</div>
|
||||||
{/* 풍속조건 */}
|
{/* 풍속조건 */}
|
||||||
<div className="estimate-box">
|
<div className="estimate-box">
|
||||||
@ -346,7 +356,7 @@ export default function Simulator() {
|
|||||||
{/* 지붕면 */}
|
{/* 지붕면 */}
|
||||||
<td>{moduleInfo.roofSurface}</td>
|
<td>{moduleInfo.roofSurface}</td>
|
||||||
{/* 경사각 */}
|
{/* 경사각 */}
|
||||||
<td>{convertNumberToPriceDecimal(moduleInfo.slopeAngle)}寸</td>
|
<td>{convertNumberToPriceDecimal(moduleInfo.slopeAngle)}{moduleInfo.classType == 0 ? "寸":"º"}</td>
|
||||||
{/* 방위각(도) */}
|
{/* 방위각(도) */}
|
||||||
<td>{convertNumberToPriceDecimal(moduleInfo.azimuth)}</td>
|
<td>{convertNumberToPriceDecimal(moduleInfo.azimuth)}</td>
|
||||||
{/* 태양전지모듈 */}
|
{/* 태양전지모듈 */}
|
||||||
|
|||||||
@ -58,9 +58,9 @@ export default function useMenu() {
|
|||||||
|
|
||||||
if (type === 'surface') {
|
if (type === 'surface') {
|
||||||
switch (currentMenu) {
|
switch (currentMenu) {
|
||||||
case MENU.BATCH_CANVAS.SLOPE_SETTING:
|
// case MENU.BATCH_CANVAS.SLOPE_SETTING:
|
||||||
addPopup(popupId, 1, <Slope id={popupId} />)
|
// addPopup(popupId, 1, <Slope id={popupId} />)
|
||||||
break
|
// break
|
||||||
case MENU.BATCH_CANVAS.BATCH_DRAWING:
|
case MENU.BATCH_CANVAS.BATCH_DRAWING:
|
||||||
addPopup(popupId, 1, <PlacementShapeDrawing id={popupId} />)
|
addPopup(popupId, 1, <PlacementShapeDrawing id={popupId} />)
|
||||||
break
|
break
|
||||||
|
|||||||
@ -61,6 +61,8 @@ export const useEstimateController = (planNo) => {
|
|||||||
res.data.originFiles = []
|
res.data.originFiles = []
|
||||||
res.data.originFile = []
|
res.data.originFile = []
|
||||||
res.data.resetFlag = 'Y'
|
res.data.resetFlag = 'Y'
|
||||||
|
} else {
|
||||||
|
res.data.resetFlag = 'N'
|
||||||
}
|
}
|
||||||
if (res.data.itemList.length > 0) {
|
if (res.data.itemList.length > 0) {
|
||||||
res.data.itemList.map((item) => {
|
res.data.itemList.map((item) => {
|
||||||
@ -160,16 +162,19 @@ export const useEstimateController = (planNo) => {
|
|||||||
let itemFlg = true
|
let itemFlg = true
|
||||||
if (estimateData?.charger === null || estimateData?.charger?.trim().length === 0) {
|
if (estimateData?.charger === null || estimateData?.charger?.trim().length === 0) {
|
||||||
flag = false
|
flag = false
|
||||||
|
setIsGlobalLoading(false)
|
||||||
return alert(getMessage('estimate.detail.save.requiredCharger'))
|
return alert(getMessage('estimate.detail.save.requiredCharger'))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (estimateData?.objectName === null || estimateData?.objectName?.trim().length === 0) {
|
if (estimateData?.objectName === null || estimateData?.objectName?.trim().length === 0) {
|
||||||
flag = false
|
flag = false
|
||||||
|
setIsGlobalLoading(false)
|
||||||
return alert(getMessage('estimate.detail.save.requiredObjectName'))
|
return alert(getMessage('estimate.detail.save.requiredObjectName'))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNaN(Date.parse(estimateData.estimateDate))) {
|
if (isNaN(Date.parse(estimateData.estimateDate))) {
|
||||||
flag = false
|
flag = false
|
||||||
|
setIsGlobalLoading(false)
|
||||||
return alert(getMessage('estimate.detail.save.requiredEstimateDate'))
|
return alert(getMessage('estimate.detail.save.requiredEstimateDate'))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,6 +182,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
let pkgAsp = estimateData.pkgAsp
|
let pkgAsp = estimateData.pkgAsp
|
||||||
if (pkgAsp === '0') {
|
if (pkgAsp === '0') {
|
||||||
flag = false
|
flag = false
|
||||||
|
setIsGlobalLoading(false)
|
||||||
return alert(getMessage('estimate.detail.save.requiredPkgAsp'))
|
return alert(getMessage('estimate.detail.save.requiredPkgAsp'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -204,6 +210,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
if (fileFlg) {
|
if (fileFlg) {
|
||||||
if (estimateData.fileFlg === '0') {
|
if (estimateData.fileFlg === '0') {
|
||||||
fileFlg = false
|
fileFlg = false
|
||||||
|
setIsGlobalLoading(false)
|
||||||
return alert(getMessage('estimate.detail.save.requiredFileUpload'))
|
return alert(getMessage('estimate.detail.save.requiredFileUpload'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -221,6 +228,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
if (item.addFlg) {
|
if (item.addFlg) {
|
||||||
if (item.itemId === '') {
|
if (item.itemId === '') {
|
||||||
itemFlg = false
|
itemFlg = false
|
||||||
|
setIsGlobalLoading(false)
|
||||||
return alert(getMessage('estimate.detail.save.requiredItemId'))
|
return alert(getMessage('estimate.detail.save.requiredItemId'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -236,6 +244,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
|
|
||||||
if (item.amount < 1) {
|
if (item.amount < 1) {
|
||||||
itemFlg = false
|
itemFlg = false
|
||||||
|
setIsGlobalLoading(false)
|
||||||
return alert(getMessage('estimate.detail.save.requiredAmount'))
|
return alert(getMessage('estimate.detail.save.requiredAmount'))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,6 +256,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
if (item.openFlg !== '1') {
|
if (item.openFlg !== '1') {
|
||||||
if (item.salePrice < 1) {
|
if (item.salePrice < 1) {
|
||||||
itemFlg = false
|
itemFlg = false
|
||||||
|
setIsGlobalLoading(false)
|
||||||
return alert(getMessage('estimate.detail.save.requiredSalePrice'))
|
return alert(getMessage('estimate.detail.save.requiredSalePrice'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -257,6 +267,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
if (item.pkgMaterialFlg === '1') {
|
if (item.pkgMaterialFlg === '1') {
|
||||||
if (isNaN(item.salePrice)) {
|
if (isNaN(item.salePrice)) {
|
||||||
itemFlg = false
|
itemFlg = false
|
||||||
|
setIsGlobalLoading(false)
|
||||||
return alert(getMessage('estimate.detail.save.requiredSalePrice'))
|
return alert(getMessage('estimate.detail.save.requiredSalePrice'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -274,6 +285,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (delCnt === estimateData.itemList.length) {
|
if (delCnt === estimateData.itemList.length) {
|
||||||
|
setIsGlobalLoading(false)
|
||||||
return alert(getMessage('estimate.detail.save.requiredItem'))
|
return alert(getMessage('estimate.detail.save.requiredItem'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -292,6 +304,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
|
|
||||||
await post({ url: '/api/file/fileUpload', data: formData }).then((res) => {
|
await post({ url: '/api/file/fileUpload', data: formData }).then((res) => {
|
||||||
setFileList(res)
|
setFileList(res)
|
||||||
|
setIsGlobalLoading(false)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
setFileList([])
|
setFileList([])
|
||||||
@ -360,15 +373,12 @@ export const useEstimateController = (planNo) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//2. 상세데이터 저장
|
//2. 상세데이터 저장
|
||||||
// return
|
|
||||||
try {
|
try {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
await promisePost({ url: `${ESTIMATE_API_ENDPOINT}/save-estimate`, data: estimateData }).then((res) => {
|
await promisePost({ url: `${ESTIMATE_API_ENDPOINT}/save-estimate`, data: estimateData }).then((res) => {
|
||||||
setIsGlobalLoading(true)
|
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
estimateData.newFileList = []
|
estimateData.newFileList = []
|
||||||
//알럿창 변경
|
|
||||||
swalFire({ text: getMessage('estimate.detail.save.alertMsg'), type: 'alert' })
|
swalFire({ text: getMessage('estimate.detail.save.alertMsg'), type: 'alert' })
|
||||||
// alert(getMessage('estimate.detail.save.alertMsg'))
|
|
||||||
fetchSetting(objectRecoil.floorPlanObjectNo, estimateData.planNo)
|
fetchSetting(objectRecoil.floorPlanObjectNo, estimateData.planNo)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -401,7 +411,6 @@ export const useEstimateController = (planNo) => {
|
|||||||
userId: session.userId,
|
userId: session.userId,
|
||||||
}
|
}
|
||||||
|
|
||||||
// return
|
|
||||||
await promisePost({ url: '/api/estimate/save-estimate-copy', data: params }).then((res) => {
|
await promisePost({ url: '/api/estimate/save-estimate-copy', data: params }).then((res) => {
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
if (isObjectNotEmpty(res.data)) {
|
if (isObjectNotEmpty(res.data)) {
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import {
|
|||||||
planSizeSettingState,
|
planSizeSettingState,
|
||||||
dotLineGridSettingState,
|
dotLineGridSettingState,
|
||||||
canvasSettingState,
|
canvasSettingState,
|
||||||
|
currentMenuState,
|
||||||
} from '@/store/canvasAtom'
|
} from '@/store/canvasAtom'
|
||||||
import { globalLocaleStore } from '@/store/localeAtom'
|
import { globalLocaleStore } from '@/store/localeAtom'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
@ -23,13 +24,15 @@ import {
|
|||||||
selectedRoofMaterialSelector,
|
selectedRoofMaterialSelector,
|
||||||
addedRoofsState,
|
addedRoofsState,
|
||||||
} from '@/store/settingAtom'
|
} from '@/store/settingAtom'
|
||||||
import { POLYGON_TYPE } from '@/common/common'
|
import { MENU, POLYGON_TYPE } from '@/common/common'
|
||||||
import { globalFontAtom } from '@/store/fontAtom'
|
import { globalFontAtom } from '@/store/fontAtom'
|
||||||
import { dimensionLineSettingsState } from '@/store/commonUtilsAtom'
|
import { dimensionLineSettingsState } from '@/store/commonUtilsAtom'
|
||||||
import { gridColorState } from '@/store/gridAtom'
|
import { gridColorState } from '@/store/gridAtom'
|
||||||
import { useColor } from 'react-color-palette'
|
import { useColor } from 'react-color-palette'
|
||||||
import { useMasterController } from '@/hooks/common/useMasterController'
|
import { useMasterController } from '@/hooks/common/useMasterController'
|
||||||
import { ROOF_MATERIAL_LAYOUT } from '@/components/floor-plan/modal/placementShape/PlacementShapeSetting'
|
import { ROOF_MATERIAL_LAYOUT } from '@/components/floor-plan/modal/placementShape/PlacementShapeSetting'
|
||||||
|
import { useCanvasMenu } from '../common/useCanvasMenu'
|
||||||
|
import { menuTypeState } from '@/store/menuAtom'
|
||||||
|
|
||||||
const defaultDotLineGridSetting = {
|
const defaultDotLineGridSetting = {
|
||||||
INTERVAL: {
|
INTERVAL: {
|
||||||
@ -43,7 +46,7 @@ const defaultDotLineGridSetting = {
|
|||||||
LINE: false,
|
LINE: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
let previousRoofMaterialsYn = 'N'; // 지붕재 select 정보 비교 후 변경된 것이 없으면 1회만 실행
|
let previousRoofMaterialsYn = 'N' // 지붕재 select 정보 비교 후 변경된 것이 없으면 1회만 실행
|
||||||
|
|
||||||
export function useCanvasSetting() {
|
export function useCanvasSetting() {
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
@ -73,7 +76,7 @@ export function useCanvasSetting() {
|
|||||||
)
|
)
|
||||||
const [gridColor, setGridColor] = useRecoilState(gridColorState)
|
const [gridColor, setGridColor] = useRecoilState(gridColorState)
|
||||||
const [color, setColor] = useColor(gridColor ?? '#FF0000')
|
const [color, setColor] = useColor(gridColor ?? '#FF0000')
|
||||||
|
const { menuNumber, setMenuNumber } = useCanvasMenu()
|
||||||
const [settingsData, setSettingsData] = useState({
|
const [settingsData, setSettingsData] = useState({
|
||||||
...settingModalFirstOptions,
|
...settingModalFirstOptions,
|
||||||
...settingModalSecondOptions,
|
...settingModalSecondOptions,
|
||||||
@ -99,7 +102,8 @@ export function useCanvasSetting() {
|
|||||||
const { getRoofMaterialList, getModuleTypeItemList } = useMasterController()
|
const { getRoofMaterialList, getModuleTypeItemList } = useMasterController()
|
||||||
const [roofMaterials, setRoofMaterials] = useRecoilState(roofMaterialsAtom)
|
const [roofMaterials, setRoofMaterials] = useRecoilState(roofMaterialsAtom)
|
||||||
const [addedRoofs, setAddedRoofs] = useRecoilState(addedRoofsState)
|
const [addedRoofs, setAddedRoofs] = useRecoilState(addedRoofsState)
|
||||||
|
const [type, setType] = useRecoilState(menuTypeState)
|
||||||
|
const setCurrentMenu = useSetRecoilState(currentMenuState)
|
||||||
const SelectOptions = [
|
const SelectOptions = [
|
||||||
{ id: 1, name: getMessage('modal.canvas.setting.grid.dot.line.setting.line.origin'), value: 1 },
|
{ id: 1, name: getMessage('modal.canvas.setting.grid.dot.line.setting.line.origin'), value: 1 },
|
||||||
{ id: 2, name: '1/2', value: 1 / 2 },
|
{ id: 2, name: '1/2', value: 1 / 2 },
|
||||||
@ -113,7 +117,7 @@ export function useCanvasSetting() {
|
|||||||
if (roofMaterials.length !== 0) {
|
if (roofMaterials.length !== 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
addRoofMaterials()
|
addRoofMaterials()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
//지붕재 초기세팅
|
//지붕재 초기세팅
|
||||||
@ -149,21 +153,21 @@ export function useCanvasSetting() {
|
|||||||
setBasicSettings({ ...basicSetting, selectedRoofMaterial: selectedRoofMaterial })
|
setBasicSettings({ ...basicSetting, selectedRoofMaterial: selectedRoofMaterial })
|
||||||
}
|
}
|
||||||
|
|
||||||
const previousRoofMaterialsRef = useRef(null);
|
const previousRoofMaterialsRef = useRef(null)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// 지붕재 select 정보가 존재해야 배치면초기설정 DB 정보 비교 후 지붕재 정보를 가져올 수 있음
|
// 지붕재 select 정보가 존재해야 배치면초기설정 DB 정보 비교 후 지붕재 정보를 가져올 수 있음
|
||||||
if (roofMaterials.length !== 0 && JSON.stringify(previousRoofMaterialsRef.current) !== JSON.stringify(roofMaterials)) {
|
if (roofMaterials.length !== 0 && JSON.stringify(previousRoofMaterialsRef.current) !== JSON.stringify(roofMaterials)) {
|
||||||
// 지붕재 select 정보 비교 후 변경된 것이 없으면 1회만 실행
|
// 지붕재 select 정보 비교 후 변경된 것이 없으면 1회만 실행
|
||||||
if (roofMaterials && previousRoofMaterialsYn === 'N') {
|
if (roofMaterials && previousRoofMaterialsYn === 'N') {
|
||||||
fetchBasicSettings();
|
fetchBasicSettings()
|
||||||
previousRoofMaterialsYn = 'Y';
|
previousRoofMaterialsYn = 'Y'
|
||||||
}
|
}
|
||||||
|
|
||||||
// 이전 값을 업데이트
|
// 이전 값을 업데이트
|
||||||
previousRoofMaterialsRef.current = roofMaterials;
|
previousRoofMaterialsRef.current = roofMaterials
|
||||||
}
|
}
|
||||||
}, [roofMaterials]);
|
}, [roofMaterials])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!canvas) {
|
if (!canvas) {
|
||||||
@ -275,14 +279,13 @@ export function useCanvasSetting() {
|
|||||||
const fetchBasicSettings = async () => {
|
const fetchBasicSettings = async () => {
|
||||||
try {
|
try {
|
||||||
await get({ url: `/api/canvas-management/canvas-basic-settings/by-object/${correntObjectNo}` }).then((res) => {
|
await get({ url: `/api/canvas-management/canvas-basic-settings/by-object/${correntObjectNo}` }).then((res) => {
|
||||||
|
|
||||||
let roofsRow = {}
|
let roofsRow = {}
|
||||||
let roofsArray = {}
|
let roofsArray = {}
|
||||||
|
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
roofsRow = res.map((item) => {
|
roofsRow = res.map((item) => {
|
||||||
return {
|
return {
|
||||||
roofSizeSet: item.roofSizeSet,
|
roofSizeSet: String(item.roofSizeSet),
|
||||||
roofAngleSet: item.roofAngleSet,
|
roofAngleSet: item.roofAngleSet,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -296,12 +299,14 @@ export function useCanvasSetting() {
|
|||||||
roofHajebichi: item.roofHajebichi,
|
roofHajebichi: item.roofHajebichi,
|
||||||
roofGap: item.roofGap,
|
roofGap: item.roofGap,
|
||||||
roofLayout: item.roofLayout,
|
roofLayout: item.roofLayout,
|
||||||
|
roofPitch: item.roofPitch,
|
||||||
|
roofAngle: item.roofAngle,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
roofsRow = [
|
roofsRow = [
|
||||||
{
|
{
|
||||||
roofSizeSet: 1,
|
roofSizeSet: '1',
|
||||||
roofAngleSet: 'slope',
|
roofAngleSet: 'slope',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@ -316,6 +321,7 @@ export function useCanvasSetting() {
|
|||||||
roofHajebichi: 0,
|
roofHajebichi: 0,
|
||||||
roofGap: 'HEI_455',
|
roofGap: 'HEI_455',
|
||||||
roofLayout: 'P',
|
roofLayout: 'P',
|
||||||
|
roofPitch: 4,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -324,23 +330,30 @@ export function useCanvasSetting() {
|
|||||||
const addRoofs = []
|
const addRoofs = []
|
||||||
roofMaterials?.map((material) => {
|
roofMaterials?.map((material) => {
|
||||||
if (material.roofMatlCd === roofsArray[0].roofMatlCd) {
|
if (material.roofMatlCd === roofsArray[0].roofMatlCd) {
|
||||||
addRoofs.push({ ...material, selected: true
|
addRoofs.push({
|
||||||
, index: 0
|
...material,
|
||||||
, width: roofsArray[0].roofWidth
|
selected: true,
|
||||||
, length: roofsArray[0].roofHeight
|
index: 0,
|
||||||
, hajebichi: roofsArray[0].roofHajebichi
|
width: roofsArray[0].roofWidth,
|
||||||
, raft: roofsArray[0].roofGap
|
length: roofsArray[0].roofHeight,
|
||||||
, layout: roofsArray[0].roofLayout
|
hajebichi: roofsArray[0].roofHajebichi,
|
||||||
, roofSizeSet: roofsRow[0].roofSizeSet
|
raft: roofsArray[0].roofGap,
|
||||||
, roofAngleSet: roofsRow[0].roofAngleSet
|
layout: roofsArray[0].roofLayout,
|
||||||
})
|
roofSizeSet: roofsRow[0].roofSizeSet,
|
||||||
|
roofAngleSet: roofsRow[0].roofAngleSet,
|
||||||
|
pitch: roofsArray[0].roofPitch,
|
||||||
|
angle: roofsArray[0].roofAngle,
|
||||||
|
})
|
||||||
|
|
||||||
setAddedRoofs(addRoofs)
|
setAddedRoofs(addRoofs)
|
||||||
setBasicSettings({ ...basicSetting, roofMaterials: addRoofs[0]
|
setBasicSettings({
|
||||||
, roofSizeSet: roofsRow[0].roofSizeSet
|
...basicSetting,
|
||||||
, roofAngleSet: roofsRow[0].roofAngleSet
|
roofMaterials: addRoofs[0],
|
||||||
, roofsData: roofsArray
|
roofSizeSet: roofsRow[0].roofSizeSet,
|
||||||
, selectedRoofMaterial: addRoofs[0] })
|
roofAngleSet: roofsRow[0].roofAngleSet,
|
||||||
|
roofsData: roofsArray,
|
||||||
|
selectedRoofMaterial: addRoofs[0],
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -359,20 +372,32 @@ export function useCanvasSetting() {
|
|||||||
try {
|
try {
|
||||||
const patternData = {
|
const patternData = {
|
||||||
objectNo: correntObjectNo,
|
objectNo: correntObjectNo,
|
||||||
roofSizeSet: basicSetting.roofSizeSet,
|
roofSizeSet: Number(basicSetting.roofSizeSet),
|
||||||
roofAngleSet: basicSetting.roofAngleSet,
|
roofAngleSet: basicSetting.roofAngleSet,
|
||||||
roofMaterialsAddList: [
|
roofMaterialsAddList: [
|
||||||
{
|
{
|
||||||
roofApply: true,
|
roofApply: true,
|
||||||
roofSeq: 0,
|
roofSeq: 0,
|
||||||
roofMatlCd: basicSetting.roofsData.roofMatlCd === null || basicSetting.roofsData.roofMatlCd === undefined ? 'ROOF_ID_WA_53A' : basicSetting.roofsData.roofMatlCd,
|
roofMatlCd:
|
||||||
roofWidth: basicSetting.roofsData.roofWidth === null || basicSetting.roofsData.roofWidth === undefined ? 0 : basicSetting.roofsData.roofWidth,
|
basicSetting.roofsData.roofMatlCd === null || basicSetting.roofsData.roofMatlCd === undefined
|
||||||
roofHeight: basicSetting.roofsData.roofHeight === null || basicSetting.roofsData.roofHeight === undefined ? 0 : basicSetting.roofsData.roofHeight,
|
? 'ROOF_ID_WA_53A'
|
||||||
roofHajebichi: basicSetting.roofsData.roofHajebichi === null || basicSetting.roofsData.roofHajebichi === undefined ? 0 : basicSetting.roofsData.roofHajebichi,
|
: basicSetting.roofsData.roofMatlCd,
|
||||||
roofGap: basicSetting.roofsData.roofGap === null || basicSetting.roofsData.roofGap === undefined ? 'HEI_455' : basicSetting.roofsData.roofGap,
|
roofWidth:
|
||||||
roofLayout: basicSetting.roofsData.roofLayout === null || basicSetting.roofsData.roofLayout === undefined ? 'P' : basicSetting.roofsData.roofLayout,
|
basicSetting.roofsData.roofWidth === null || basicSetting.roofsData.roofWidth === undefined ? 0 : basicSetting.roofsData.roofWidth,
|
||||||
roofPitch: 4,
|
roofHeight:
|
||||||
roofAngle: 21.8,
|
basicSetting.roofsData.roofHeight === null || basicSetting.roofsData.roofHeight === undefined ? 0 : basicSetting.roofsData.roofHeight,
|
||||||
|
roofHajebichi:
|
||||||
|
basicSetting.roofsData.roofHajebichi === null || basicSetting.roofsData.roofHajebichi === undefined
|
||||||
|
? 0
|
||||||
|
: basicSetting.roofsData.roofHajebichi,
|
||||||
|
roofGap:
|
||||||
|
basicSetting.roofsData.roofGap === null || basicSetting.roofsData.roofGap === undefined ? 'HEI_455' : basicSetting.roofsData.roofGap,
|
||||||
|
roofLayout:
|
||||||
|
basicSetting.roofsData.roofLayout === null || basicSetting.roofsData.roofLayout === undefined ? 'P' : basicSetting.roofsData.roofLayout,
|
||||||
|
roofPitch:
|
||||||
|
basicSetting.roofsData.roofPitch === null || basicSetting.roofsData.roofPitch === undefined ? 0 : basicSetting.roofsData.roofPitch,
|
||||||
|
roofAngle:
|
||||||
|
basicSetting.roofsData.roofAngle === null || basicSetting.roofsData.roofAngle === undefined ? 0 : basicSetting.roofsData.roofAngle,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
@ -380,12 +405,23 @@ export function useCanvasSetting() {
|
|||||||
console.log('basicSettingSave patternData ', patternData)
|
console.log('basicSettingSave patternData ', patternData)
|
||||||
|
|
||||||
await post({ url: `/api/canvas-management/canvas-basic-settings`, data: patternData }).then((res) => {
|
await post({ url: `/api/canvas-management/canvas-basic-settings`, data: patternData }).then((res) => {
|
||||||
|
console.log('basicSettingSave res ', res)
|
||||||
swalFire({ text: getMessage(res.returnMessage) })
|
swalFire({ text: getMessage(res.returnMessage) })
|
||||||
})
|
})
|
||||||
|
|
||||||
//Recoil 설정
|
//Recoil 설정
|
||||||
setCanvasSetting({ ...basicSetting })
|
//setCanvasSetting({ ...basicSetting })\
|
||||||
|
console.log(basicSetting)
|
||||||
fetchBasicSettings()
|
fetchBasicSettings()
|
||||||
|
if (['2', '3'].includes(basicSetting?.roofSizeSet)) {
|
||||||
|
setMenuNumber(3)
|
||||||
|
setType('surface')
|
||||||
|
setCurrentMenu(MENU.BATCH_CANVAS.BATCH_DRAWING)
|
||||||
|
} else {
|
||||||
|
setMenuNumber(2)
|
||||||
|
setType('outline')
|
||||||
|
setCurrentMenu(MENU.ROOF_COVERING.EXTERIOR_WALL_LINE)
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
swalFire({ text: error.message, icon: 'error' })
|
swalFire({ text: error.message, icon: 'error' })
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,9 +33,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
const { drawDirectionArrow, addLengthText, splitPolygonWithLines, splitPolygonWithSeparate } = usePolygon()
|
const { drawDirectionArrow, addLengthText, splitPolygonWithLines, splitPolygonWithSeparate } = usePolygon()
|
||||||
const [popupId, setPopupId] = useState(uuidv4())
|
const [popupId, setPopupId] = useState(uuidv4())
|
||||||
const { addPopup, closePopup, closeAll } = usePopup()
|
const { addPopup, closePopup, closeAll } = usePopup()
|
||||||
const { getMessage } = useMessage()
|
const currentObject = useRecoilValue(currentObjectState)
|
||||||
const currentObject = useRecoilValue(currentObjectState)
|
|
||||||
const { swalFire } = useSwal()
|
|
||||||
const { setMenuNumber } = useCanvasMenu()
|
const { setMenuNumber } = useCanvasMenu()
|
||||||
const setMenuType = useSetRecoilState(menuTypeState)
|
const setMenuType = useSetRecoilState(menuTypeState)
|
||||||
const roofMaterials = useRecoilValue(roofMaterialsSelector)
|
const roofMaterials = useRecoilValue(roofMaterialsSelector)
|
||||||
@ -46,9 +44,10 @@ export function useRoofAllocationSetting(id) {
|
|||||||
const [editingLines, setEditingLines] = useState([])
|
const [editingLines, setEditingLines] = useState([])
|
||||||
const [currentRoofList, setCurrentRoofList] = useState(roofList)
|
const [currentRoofList, setCurrentRoofList] = useState(roofList)
|
||||||
const currentAngleType = useRecoilValue(currentAngleTypeSelector)
|
const currentAngleType = useRecoilValue(currentAngleTypeSelector)
|
||||||
|
|
||||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||||
const { get, post } = useAxios(globalLocaleState)
|
const { get, post } = useAxios(globalLocaleState)
|
||||||
|
const { getMessage } = useMessage()
|
||||||
|
const { swalFire } = useSwal()
|
||||||
|
|
||||||
const { setSurfaceShapePattern } = useRoofFn()
|
const { setSurfaceShapePattern } = useRoofFn()
|
||||||
|
|
||||||
@ -165,38 +164,38 @@ export function useRoofAllocationSetting(id) {
|
|||||||
|
|
||||||
// 지붕면 할당 저장
|
// 지붕면 할당 저장
|
||||||
const basicSettingSave = async () => {
|
const basicSettingSave = async () => {
|
||||||
const patternData = {
|
try {
|
||||||
objectNo: correntObjectNo,
|
const patternData = {
|
||||||
roofSizeSet: basicSetting.roofSizeSet,
|
objectNo: correntObjectNo,
|
||||||
roofAngleSet: basicSetting.roofAngleSet,
|
roofSizeSet: Number(basicSetting.roofSizeSet),
|
||||||
roofMaterialsAddList: currentRoofList.map((item, index) => ({
|
roofAngleSet: basicSetting.roofAngleSet,
|
||||||
roofApply: item.selected === null || item.selected === undefined ? 'true' : item.selected,
|
roofAllocationList: currentRoofList.map((item, index) => ({
|
||||||
roofSeq: index,
|
roofApply: item.selected === null || item.selected === undefined ? 'true' : item.selected,
|
||||||
roofMatlCd: item.roofMatlCd === null || item.roofMatlCd === undefined ? 'ROOF_ID_WA_53A' : item.roofMatlCd,
|
roofSeq: index,
|
||||||
roofWidth: item.width === null || item.width === undefined ? 0 : item.width,
|
roofMatlCd: item.roofMatlCd === null || item.roofMatlCd === undefined ? 'ROOF_ID_WA_53A' : item.roofMatlCd,
|
||||||
roofHeight: item.length === null || item.length === undefined ? 0 : item.length,
|
roofWidth: item.width === null || item.width === undefined ? 0 : Number(item.width),
|
||||||
roofHajebichi: item.hajebichi === null || item.hajebichi === undefined ? 0 : item.hajebichi,
|
roofHeight: item.length === null || item.length === undefined ? 0 : Number(item.length),
|
||||||
roofGap: item.raft === null || item.raft === undefined ? 'HEI_455' : item.raft,
|
roofHajebichi: item.hajebichi === null || item.hajebichi === undefined ? 0 : Number(item.hajebichi),
|
||||||
roofLayout: item.layout === null || item.layout === undefined ? 'P' : item.layout,
|
roofGap: item.raft === null || item.raft === undefined ? 'HEI_455' : item.raft,
|
||||||
roofPitch: item.pitch === null || item.pitch === undefined ? 4 : item.pitch,
|
roofLayout: item.layout === null || item.layout === undefined ? 'P' : item.layout,
|
||||||
roofAngle: item.angle === null || item.angle === undefined ? 21.8 : item.angle,
|
roofPitch: item.pitch === null || item.pitch === undefined ? 4 : Number(item.pitch),
|
||||||
})),
|
roofAngle: item.angle === null || item.angle === undefined ? 21.8 : Number(item.angle),
|
||||||
}
|
})),
|
||||||
|
}
|
||||||
|
|
||||||
console.log('🚀 ~ basicSettingSave ~ patternData >>>>>>>>>>>>> :', patternData)
|
console.log('🚀 ~ basicSettingSave ~ patternData >>>>>>>>>>>>> :', patternData)
|
||||||
|
|
||||||
// HTTP POST 요청 보내기
|
await post({ url: `/api/canvas-management/roof-allocation-settings`, data: patternData }).then((res) => {
|
||||||
await post({ url: `/api/canvas-management/roof-allocation-settings`, data: patternData })
|
console.log('roof-allocation-settings res ', res)
|
||||||
.then((res) => {
|
swalFire({ text: getMessage(res.returnMessage) })
|
||||||
swalFire({ text: getMessage(res.returnMessage) })
|
})
|
||||||
|
|
||||||
//Recoil 설정
|
//Recoil 설정
|
||||||
// setCanvasSetting({ ...basicSetting })
|
//setCanvasSetting({ ...basicSetting })
|
||||||
fetchBasicSettings()
|
fetchBasicSettings()
|
||||||
})
|
} catch (error) {
|
||||||
.catch((error) => {
|
swalFire({ text: error.message, icon: 'error' })
|
||||||
swalFire({ text: error.message, icon: 'error' })
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onAddRoofMaterial = () => {
|
const onAddRoofMaterial = () => {
|
||||||
@ -457,6 +456,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const newRoofList = currentRoofList.map((roof, idx) => {
|
const newRoofList = currentRoofList.map((roof, idx) => {
|
||||||
if (idx === index) {
|
if (idx === index) {
|
||||||
return { ...roof, [type]: value }
|
return { ...roof, [type]: value }
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useContext, useEffect, useState } from 'react'
|
import { useContext, useEffect, useState } from 'react'
|
||||||
import { usePathname, useRouter } from 'next/navigation'
|
import { usePathname, useRouter, useSearchParams } from 'next/navigation'
|
||||||
|
|
||||||
import { useRecoilState } from 'recoil'
|
import { useRecoilState } from 'recoil'
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
@ -218,16 +218,18 @@ export function usePlan(params = {}) {
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setCurrentCanvasPlan(plans.find((plan) => plan.isCurrent) || null)
|
setCurrentCanvasPlan(plans.find((plan) => plan.isCurrent) || null)
|
||||||
setSelectedPlan(plans.find((plan) => plan.isCurrent))
|
setSelectedPlan(plans.find((plan) => plan.isCurrent))
|
||||||
|
handleCurrentPlanUrl()
|
||||||
// setBgImage()
|
// setBgImage()
|
||||||
}, [plans])
|
}, [plans])
|
||||||
|
|
||||||
// 현재 plan이 변경될 때 마다 현재 plan의 링크로 이동
|
const handleCurrentPlanUrl = () => {
|
||||||
useEffect(() => {
|
const currentPlan = plans.find((plan) => plan.isCurrent)
|
||||||
handlePlanMove()
|
if (currentPlan) router.push(`${pathname}?pid=${currentPlan?.ordering}&objectNo=${floorPlanState?.objectNo}`)
|
||||||
}, [currentCanvasPlan])
|
}
|
||||||
|
|
||||||
const setBgImage = () => {
|
const setBgImage = () => {
|
||||||
// readImage(selectedPlan?.id)
|
// readImage(selectedPlan?.id)
|
||||||
|
|||||||
@ -168,6 +168,7 @@
|
|||||||
"plan.menu.estimate.reset": "初期化",
|
"plan.menu.estimate.reset": "初期化",
|
||||||
"plan.menu.estimate.copy": "見積書のコピー",
|
"plan.menu.estimate.copy": "見積書のコピー",
|
||||||
"plan.menu.estimate.unLock": "ロック解除",
|
"plan.menu.estimate.unLock": "ロック解除",
|
||||||
|
"plan.menu.estimate.lock": "ロック",
|
||||||
"plan.menu.simulation": "発展シミュレーション",
|
"plan.menu.simulation": "発展シミュレーション",
|
||||||
"plan.menu.simulation.excel": "Excel",
|
"plan.menu.simulation.excel": "Excel",
|
||||||
"plan.menu.simulation.pdf": "PDF",
|
"plan.menu.simulation.pdf": "PDF",
|
||||||
@ -931,7 +932,10 @@
|
|||||||
"estimate.detail.save.requiredItemId": "製品を選択してください.",
|
"estimate.detail.save.requiredItemId": "製品を選択してください.",
|
||||||
"estimate.detail.save.requiredAmount": "数量は0より大きい値を入力してください.",
|
"estimate.detail.save.requiredAmount": "数量は0より大きい値を入力してください.",
|
||||||
"estimate.detail.save.requiredSalePrice": "単価は0より大きい値を入力してください.",
|
"estimate.detail.save.requiredSalePrice": "単価は0より大きい値を入力してください.",
|
||||||
|
"estimate.detail.reset.alertMsg": "初期化されました.",
|
||||||
"estimate.detail.reset.confirmMsg": "保存した見積書情報が初期化され、図面情報が反映されます。本当に初期化しますか?",
|
"estimate.detail.reset.confirmMsg": "保存した見積書情報が初期化され、図面情報が反映されます。本当に初期化しますか?",
|
||||||
|
"estimate.detail.lock.alertMsg": "見積書を[ロック]すると、変更できません。見積もりを編集するには、ロックを解除してください.",
|
||||||
|
"estimate.detail.unlock.alertMsg": "見積書を修正して保存",
|
||||||
"estimate.detail.alert.delFile": "添付ファイルを完全に削除するには[保存]ボタンをクリックしてください",
|
"estimate.detail.alert.delFile": "添付ファイルを完全に削除するには[保存]ボタンをクリックしてください",
|
||||||
"estimate.detail.alert.selectDelItem": "削除する商品を選択してください.",
|
"estimate.detail.alert.selectDelItem": "削除する商品を選択してください.",
|
||||||
"simulator.title.sub1": "物件番号",
|
"simulator.title.sub1": "物件番号",
|
||||||
|
|||||||
@ -172,6 +172,7 @@
|
|||||||
"plan.menu.estimate.reset": "초기화",
|
"plan.menu.estimate.reset": "초기화",
|
||||||
"plan.menu.estimate.copy": "견적서 복사",
|
"plan.menu.estimate.copy": "견적서 복사",
|
||||||
"plan.menu.estimate.unLock": "잠금 해제",
|
"plan.menu.estimate.unLock": "잠금 해제",
|
||||||
|
"plan.menu.estimate.lock": "잠금",
|
||||||
"plan.menu.simulation": "발전 시뮬레이션",
|
"plan.menu.simulation": "발전 시뮬레이션",
|
||||||
"plan.menu.simulation.excel": "Excel",
|
"plan.menu.simulation.excel": "Excel",
|
||||||
"plan.menu.simulation.pdf": "PDF",
|
"plan.menu.simulation.pdf": "PDF",
|
||||||
@ -940,7 +941,10 @@
|
|||||||
"estimate.detail.save.requiredItemId": "제품을 선택해주세요.",
|
"estimate.detail.save.requiredItemId": "제품을 선택해주세요.",
|
||||||
"estimate.detail.save.requiredAmount": "수량은 0보다 큰값을 입력해주세요.",
|
"estimate.detail.save.requiredAmount": "수량은 0보다 큰값을 입력해주세요.",
|
||||||
"estimate.detail.save.requiredSalePrice": "단가는 0보다 큰값을 입력해주세요.",
|
"estimate.detail.save.requiredSalePrice": "단가는 0보다 큰값을 입력해주세요.",
|
||||||
|
"estimate.detail.reset.alertMsg": "초기화 되었습니다.",
|
||||||
"estimate.detail.reset.confirmMsg": "수기 변경(저장)한 견적 정보가 초기화되고, 최근 저장된 도면정보가 반영됩니다. 정말로 초기화하시겠습니까?",
|
"estimate.detail.reset.confirmMsg": "수기 변경(저장)한 견적 정보가 초기화되고, 최근 저장된 도면정보가 반영됩니다. 정말로 초기화하시겠습니까?",
|
||||||
|
"estimate.detail.lock.alertMsg": "견적서를 [잠금]하면, 수정할 수 없습니다. 견적서를 수정하려면 잠금해제를 하십시오",
|
||||||
|
"estimate.detail.unlock.alertMsg": "견적서를 수정하고, 저장하십시오",
|
||||||
"estimate.detail.alert.delFile": "첨부파일을 완전히 삭제하려면 [저장]버튼을 클릭하십시오.",
|
"estimate.detail.alert.delFile": "첨부파일을 완전히 삭제하려면 [저장]버튼을 클릭하십시오.",
|
||||||
"estimate.detail.alert.selectDelItem": "삭제할 제품을 선택하세요.",
|
"estimate.detail.alert.selectDelItem": "삭제할 제품을 선택하세요.",
|
||||||
"simulator.title.sub1": "물건번호",
|
"simulator.title.sub1": "물건번호",
|
||||||
|
|||||||
@ -49,11 +49,11 @@ export const subMenusState = atom({
|
|||||||
],
|
],
|
||||||
surface: [
|
surface: [
|
||||||
// 배치면
|
// 배치면
|
||||||
{ id: 0, name: 'plan.menu.placement.surface.slope.setting', menu: MENU.BATCH_CANVAS.SLOPE_SETTING },
|
// { id: 0, name: 'plan.menu.placement.surface.slope.setting', menu: MENU.BATCH_CANVAS.SLOPE_SETTING },
|
||||||
{ id: 1, name: 'plan.menu.placement.surface.drawing', menu: MENU.BATCH_CANVAS.BATCH_DRAWING },
|
{ id: 0, name: 'plan.menu.placement.surface.drawing', menu: MENU.BATCH_CANVAS.BATCH_DRAWING },
|
||||||
{ id: 2, name: 'plan.menu.placement.surface.arrangement', menu: MENU.BATCH_CANVAS.SURFACE_SHAPE_BATCH },
|
{ id: 1, name: 'plan.menu.placement.surface.arrangement', menu: MENU.BATCH_CANVAS.SURFACE_SHAPE_BATCH },
|
||||||
{ id: 3, name: 'plan.menu.placement.surface.object', menu: MENU.BATCH_CANVAS.OBJECT_BATCH },
|
{ id: 2, name: 'plan.menu.placement.surface.object', menu: MENU.BATCH_CANVAS.OBJECT_BATCH },
|
||||||
{ id: 4, name: 'plan.menu.placement.surface.all.remove', menu: MENU.BATCH_CANVAS.ALL_REMOVE },
|
{ id: 3, name: 'plan.menu.placement.surface.all.remove', menu: MENU.BATCH_CANVAS.ALL_REMOVE },
|
||||||
],
|
],
|
||||||
module: [
|
module: [
|
||||||
// 모듈, 회로 구성
|
// 모듈, 회로 구성
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user