견적서 첨부파일..
This commit is contained in:
parent
d68610440e
commit
f290491caa
@ -224,6 +224,13 @@ export default function Estimate({ params }) {
|
|||||||
//드래그영역 비워주기
|
//드래그영역 비워주기
|
||||||
setFiles([])
|
setFiles([])
|
||||||
setOriginFiles(estimateContextState.fileList)
|
setOriginFiles(estimateContextState.fileList)
|
||||||
|
} else {
|
||||||
|
// setOriginFiles([])
|
||||||
|
if (originFiles.length > 0) {
|
||||||
|
let file
|
||||||
|
file = originFiles.filter((item) => item.delFlg === '0')
|
||||||
|
setOriginFiles(file)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, [estimateContextState?.fileList])
|
}, [estimateContextState?.fileList])
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { useContext, useEffect, useReducer, useState } from 'react'
|
|||||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||||
import { globalLocaleStore } from '@/store/localeAtom'
|
import { globalLocaleStore } from '@/store/localeAtom'
|
||||||
import { estimateState, floorPlanObjectState } from '@/store/floorPlanObjectAtom'
|
import { estimateState, floorPlanObjectState } from '@/store/floorPlanObjectAtom'
|
||||||
import { isObjectNotEmpty, isEmptyArray } from '@/util/common-utils'
|
import { isObjectNotEmpty, isEmptyArray, isNotEmptyArray } from '@/util/common-utils'
|
||||||
import { SessionContext } from '@/app/SessionProvider'
|
import { SessionContext } from '@/app/SessionProvider'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
@ -158,8 +158,15 @@ export const useEstimateController = (planNo) => {
|
|||||||
|
|
||||||
//기존에 첨부된 파일이 있으면 파일첨부관련 통과
|
//기존에 첨부된 파일이 있으면 파일첨부관련 통과
|
||||||
if (estimateData?.originFiles?.length > 0) {
|
if (estimateData?.originFiles?.length > 0) {
|
||||||
originFileFlg = true
|
let cnt = estimateData.originFiles.filter((file) => file.delFlg === '0').length
|
||||||
|
|
||||||
|
if (cnt == 0) {
|
||||||
|
originFileFlg = false
|
||||||
|
} else {
|
||||||
|
originFileFlg = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
if (!originFileFlg) {
|
if (!originFileFlg) {
|
||||||
//기존에 첨부된 파일이 없으면
|
//기존에 첨부된 파일이 없으면
|
||||||
@ -318,7 +325,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
await promisePost({ url: `${ESTIMATE_API_ENDPOINT}/save-estimate`, data: estimateData }).then((res) => {
|
await promisePost({ url: `${ESTIMATE_API_ENDPOINT}/save-estimate`, data: estimateData }).then((res) => {
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
estimateData.newFileList = []
|
estimateData.newFileList = []
|
||||||
estimateData.originFileList = []
|
// estimateData.originFiles = []
|
||||||
alert(getMessage('estimate.detail.save.alertMsg'))
|
alert(getMessage('estimate.detail.save.alertMsg'))
|
||||||
//어디로 보낼지
|
//어디로 보낼지
|
||||||
fetchSetting(objectRecoil.floorPlanObjectNo, estimateData.planNo)
|
fetchSetting(objectRecoil.floorPlanObjectNo, estimateData.planNo)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user