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