견적서 순서 변경
This commit is contained in:
parent
60513374ce
commit
2e115887c2
@ -54,7 +54,7 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
const [seletedOption, setSeletedOption] = useState(null)
|
||||
const { setModuleStatisticsData } = useCircuitTrestle()
|
||||
const { handleCanvasToPng } = useImgLoader()
|
||||
const { saveCanvas } = usePlan()
|
||||
|
||||
const passivityCircuitAllocationRef = useRef()
|
||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||
|
||||
@ -361,11 +361,8 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
|
||||
if (result) {
|
||||
handleCanvasToPng(2)
|
||||
// 캔버스 저장
|
||||
await saveCanvas(false)
|
||||
// 견적서 저장
|
||||
await saveEstimate(result)
|
||||
setAllModuleSurfaceIsComplete(true)
|
||||
} else {
|
||||
setIsGlobalLoading(false)
|
||||
}
|
||||
|
||||
@ -9,6 +9,8 @@ import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
||||
import { QcastContext } from '@/app/QcastProvider'
|
||||
import { currentCanvasPlanState } from '@/store/canvasAtom'
|
||||
import { loginUserStore } from '@/store/commonAtom'
|
||||
import { useTrestle } from '@/hooks/module/useTrestle'
|
||||
import { usePlan } from '@/hooks/usePlan'
|
||||
|
||||
export function useEstimate() {
|
||||
const { managementStateLoaded } = useContext(GlobalDataContext)
|
||||
@ -20,13 +22,15 @@ export function useEstimate() {
|
||||
const { promisePost } = useAxios()
|
||||
const { swalFire } = useSwal()
|
||||
|
||||
const { setAllModuleSurfaceIsComplete } = useTrestle()
|
||||
const { saveCanvas } = usePlan()
|
||||
|
||||
/**
|
||||
* 도면 견적서 저장
|
||||
*
|
||||
* @param {Object} estimateParam - 견적서 저장 데이터
|
||||
*/
|
||||
const saveEstimate = async (estimateParam) => {
|
||||
|
||||
const userId = loginUserState.userId
|
||||
const saleStoreId = managementStateLoaded.saleStoreId
|
||||
const objectNo = currentCanvasPlan.objectNo
|
||||
@ -56,6 +60,11 @@ export function useEstimate() {
|
||||
|
||||
await promisePost({ url: '/api/estimate/save-estimate', data: saveEstimateData })
|
||||
.then(async () => {
|
||||
setAllModuleSurfaceIsComplete(true)
|
||||
|
||||
// 캔버스 저장
|
||||
await saveCanvas(false)
|
||||
|
||||
/* 견적서 저장이 완료되면 견적서 페이지로 이동 */
|
||||
moveEstimate(planNo, objectNo)
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user