견적서 첨부파일
This commit is contained in:
parent
a143927df3
commit
f2ce118431
@ -197,8 +197,11 @@ export default function Estimate({ params }) {
|
|||||||
// 추가한 첨부파일 estimateContextState에 넣기
|
// 추가한 첨부파일 estimateContextState에 넣기
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isNotEmptyArray(files)) {
|
if (isNotEmptyArray(files)) {
|
||||||
|
let fileList = []
|
||||||
files.map((row) => {
|
files.map((row) => {
|
||||||
setEstimateContextState({ fileList: row.data })
|
fileList.push(row.data)
|
||||||
|
|
||||||
|
setEstimateContextState({ fileList: row.data, tempFileList: fileList })
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
setEstimateContextState({ fileList: [] })
|
setEstimateContextState({ fileList: [] })
|
||||||
@ -212,8 +215,6 @@ export default function Estimate({ params }) {
|
|||||||
setFiles([])
|
setFiles([])
|
||||||
setOriginFiles(estimateContextState.fileList)
|
setOriginFiles(estimateContextState.fileList)
|
||||||
}
|
}
|
||||||
|
|
||||||
// setFiles([])
|
|
||||||
}, [estimateContextState?.fileList])
|
}, [estimateContextState?.fileList])
|
||||||
|
|
||||||
// 기존첨부파일 삭제
|
// 기존첨부파일 삭제
|
||||||
@ -549,7 +550,11 @@ export default function Estimate({ params }) {
|
|||||||
if (item?.addFlg) {
|
if (item?.addFlg) {
|
||||||
return { ...item, ...updates, saleTotPrice: '' }
|
return { ...item, ...updates, saleTotPrice: '' }
|
||||||
} else {
|
} else {
|
||||||
return { ...item, ...updates, salePrice: '', saleTotPrice: '' }
|
if (estimateContextState.estimateType === 'YJSS') {
|
||||||
|
return { ...item, ...updates, salePrice: '', saleTotPrice: '' }
|
||||||
|
} else {
|
||||||
|
return { ...item, ...updates }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (item.paDispOrder === dispOrder) {
|
} else if (item.paDispOrder === dispOrder) {
|
||||||
//봄제품을 바꿨을떄
|
//봄제품을 바꿨을떄
|
||||||
@ -558,6 +563,7 @@ export default function Estimate({ params }) {
|
|||||||
return item
|
return item
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
//paDispOrder
|
//paDispOrder
|
||||||
if (bomList) {
|
if (bomList) {
|
||||||
bomList.map((bomItem, index) => {
|
bomList.map((bomItem, index) => {
|
||||||
|
|||||||
@ -202,10 +202,10 @@ export const useEstimateController = (planNo) => {
|
|||||||
if (flag && fileFlg && itemFlg) {
|
if (flag && fileFlg && itemFlg) {
|
||||||
//1. 첨부파일 저장시작
|
//1. 첨부파일 저장시작
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
// estimateData.tempFileList.forEach((file) => {
|
estimateData.tempFileList.forEach((file) => {
|
||||||
// formData.append('file', file)
|
formData.append('file', file)
|
||||||
// })
|
})
|
||||||
formData.append('file', estimateData.flieList)
|
// formData.append('file', estimateData.flieList)
|
||||||
formData.append('objectNo', estimateData.objectNo)
|
formData.append('objectNo', estimateData.objectNo)
|
||||||
formData.append('planNo', estimateData.planNo)
|
formData.append('planNo', estimateData.planNo)
|
||||||
formData.append('category', '10')
|
formData.append('category', '10')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user