견적서 순서 변경

This commit is contained in:
hyojun.choi 2025-03-06 10:51:09 +09:00
parent 60513374ce
commit 2e115887c2
2 changed files with 11 additions and 5 deletions

View File

@ -54,7 +54,7 @@ export default function CircuitTrestleSetting({ id }) {
const [seletedOption, setSeletedOption] = useState(null) const [seletedOption, setSeletedOption] = useState(null)
const { setModuleStatisticsData } = useCircuitTrestle() const { setModuleStatisticsData } = useCircuitTrestle()
const { handleCanvasToPng } = useImgLoader() const { handleCanvasToPng } = useImgLoader()
const { saveCanvas } = usePlan()
const passivityCircuitAllocationRef = useRef() const passivityCircuitAllocationRef = useRef()
const { setIsGlobalLoading } = useContext(QcastContext) const { setIsGlobalLoading } = useContext(QcastContext)
@ -361,11 +361,8 @@ export default function CircuitTrestleSetting({ id }) {
if (result) { if (result) {
handleCanvasToPng(2) handleCanvasToPng(2)
//
await saveCanvas(false)
// //
await saveEstimate(result) await saveEstimate(result)
setAllModuleSurfaceIsComplete(true)
} else { } else {
setIsGlobalLoading(false) setIsGlobalLoading(false)
} }

View File

@ -9,6 +9,8 @@ import { GlobalDataContext } from '@/app/GlobalDataProvider'
import { QcastContext } from '@/app/QcastProvider' import { QcastContext } from '@/app/QcastProvider'
import { currentCanvasPlanState } from '@/store/canvasAtom' import { currentCanvasPlanState } from '@/store/canvasAtom'
import { loginUserStore } from '@/store/commonAtom' import { loginUserStore } from '@/store/commonAtom'
import { useTrestle } from '@/hooks/module/useTrestle'
import { usePlan } from '@/hooks/usePlan'
export function useEstimate() { export function useEstimate() {
const { managementStateLoaded } = useContext(GlobalDataContext) const { managementStateLoaded } = useContext(GlobalDataContext)
@ -20,13 +22,15 @@ export function useEstimate() {
const { promisePost } = useAxios() const { promisePost } = useAxios()
const { swalFire } = useSwal() const { swalFire } = useSwal()
const { setAllModuleSurfaceIsComplete } = useTrestle()
const { saveCanvas } = usePlan()
/** /**
* 도면 견적서 저장 * 도면 견적서 저장
* *
* @param {Object} estimateParam - 견적서 저장 데이터 * @param {Object} estimateParam - 견적서 저장 데이터
*/ */
const saveEstimate = async (estimateParam) => { const saveEstimate = async (estimateParam) => {
const userId = loginUserState.userId const userId = loginUserState.userId
const saleStoreId = managementStateLoaded.saleStoreId const saleStoreId = managementStateLoaded.saleStoreId
const objectNo = currentCanvasPlan.objectNo const objectNo = currentCanvasPlan.objectNo
@ -56,6 +60,11 @@ export function useEstimate() {
await promisePost({ url: '/api/estimate/save-estimate', data: saveEstimateData }) await promisePost({ url: '/api/estimate/save-estimate', data: saveEstimateData })
.then(async () => { .then(async () => {
setAllModuleSurfaceIsComplete(true)
// 캔버스 저장
await saveCanvas(false)
/* 견적서 저장이 완료되면 견적서 페이지로 이동 */ /* 견적서 저장이 완료되면 견적서 페이지로 이동 */
moveEstimate(planNo, objectNo) moveEstimate(planNo, objectNo)
}) })