견적서
This commit is contained in:
parent
c7188da100
commit
4fccfbb621
@ -123,6 +123,7 @@ export default function Estimate({ params }) {
|
||||
if (estimateContextState?.estimateOption) {
|
||||
res.map((row) => {
|
||||
let estimateOption = estimateContextState?.estimateOption?.split('、')
|
||||
// console.log('최초:::', estimateOption)
|
||||
row.check = false
|
||||
estimateOption.map((row2) => {
|
||||
if (row.pkgYn === '0') {
|
||||
@ -207,8 +208,12 @@ export default function Estimate({ params }) {
|
||||
//상세에서 내려온 첨부파일 set 만들기
|
||||
useEffect(() => {
|
||||
if (isNotEmptyArray(estimateContextState.fileList)) {
|
||||
//드래그영역 비워주기
|
||||
setFiles([])
|
||||
setOriginFiles(estimateContextState.fileList)
|
||||
}
|
||||
|
||||
// setFiles([])
|
||||
}, [estimateContextState?.fileList])
|
||||
|
||||
// 기존첨부파일 삭제
|
||||
@ -520,12 +525,14 @@ export default function Estimate({ params }) {
|
||||
updates.pkgMaterialFlg = res.pkgMaterialFlg
|
||||
updates.pnowW = res.pnowW
|
||||
updates.salePrice = res.salePrice
|
||||
// updates.salePrice = ''
|
||||
updates.specification = res.specification
|
||||
updates.unit = res.unit
|
||||
updates.specialNoteCd = res.spnAttrCds
|
||||
updates.itemGroup = res.itemGroup
|
||||
updates.delFlg = '0' // 삭제플래그 0
|
||||
updates.saleTotPrice = (res.salePrice * estimateContextState.itemList[index].amount).toString()
|
||||
// updates.saleTotPrice = ''
|
||||
updates.amount = ''
|
||||
|
||||
if (estimateContextState.estimateType === 'YJSS') {
|
||||
@ -539,7 +546,11 @@ export default function Estimate({ params }) {
|
||||
|
||||
updateList = estimateContextState.itemList.map((item) => {
|
||||
if (item.dispOrder === dispOrder) {
|
||||
return { ...item, ...updates }
|
||||
if (item?.addFlg) {
|
||||
return { ...item, ...updates, saleTotPrice: '' }
|
||||
} else {
|
||||
return { ...item, ...updates, salePrice: '', saleTotPrice: '' }
|
||||
}
|
||||
} else if (item.paDispOrder === dispOrder) {
|
||||
//봄제품을 바꿨을떄
|
||||
return { ...item, delFlg: '1' }
|
||||
@ -557,14 +568,12 @@ export default function Estimate({ params }) {
|
||||
bomItem.salePrice = '0'
|
||||
bomItem.saleTotPrice = '0'
|
||||
bomItem.unitPrice = '0'
|
||||
// bomItem.amount = null
|
||||
} else {
|
||||
bomItem.dispOrder = (index + 1 + Number(dispOrder)).toString()
|
||||
bomItem.paDispOrder = dispOrder
|
||||
bomItem.salePrice = '0'
|
||||
bomItem.saleTotPrice = '0'
|
||||
bomItem.unitPrice = '0'
|
||||
// bomItem.amount = null
|
||||
}
|
||||
|
||||
bomItem.delFlg = '0'
|
||||
@ -639,7 +648,7 @@ export default function Estimate({ params }) {
|
||||
estimateContextState.itemList.sort((a, b) => {
|
||||
return a.dispOrder - b.dispOrder
|
||||
})
|
||||
console.log('YJOD 토탈만들어주기::::::::::', estimateContextState.itemList)
|
||||
// console.log('YJOD 토탈만들어주기::::::::::', estimateContextState.itemList)
|
||||
|
||||
let pushData = []
|
||||
let uniquSet = new Set()
|
||||
@ -660,25 +669,33 @@ export default function Estimate({ params }) {
|
||||
}
|
||||
})
|
||||
let estimateOption = estimateContextState?.estimateOption?.split('、')
|
||||
let removeEstimateOption = estimateOption.filter((option) => pushData.includes(option))
|
||||
// let estimateOptionString = estimateOption.join('、')
|
||||
// console.log('오리진::', estimateOption)
|
||||
let removeEstimateOption = estimateOption.filter((option) => !pushData.includes(option))
|
||||
// console.log('남길거?? ', removeEstimateOption)
|
||||
let removeEstimateOptionString = removeEstimateOption.join('、')
|
||||
|
||||
// console.log('SpecialNoteLis::', specialNoteList)
|
||||
|
||||
specialNoteList.map((row) => {
|
||||
row.check = false
|
||||
estimateOption.map((row2) => {
|
||||
if (row.pkgYn === '0') {
|
||||
if (row2 === row.code) {
|
||||
row.check = true
|
||||
}
|
||||
} else {
|
||||
console.log('제품가대세팅::::', row.code)
|
||||
console.log('removeEstimateOption::::', removeEstimateOption)
|
||||
return
|
||||
}
|
||||
})
|
||||
})
|
||||
// specialNoteList.map((row) => {
|
||||
// row.check = false
|
||||
// estimateOption.map((row2) => {
|
||||
// if (row.pkgYn === '0') {
|
||||
// if (row2 === row.code) {
|
||||
// row.check = true
|
||||
// }
|
||||
// } else {
|
||||
// // console.log('지울꺼::', removeEstimateOptionString)
|
||||
// if (row.code.includes(removeEstimateOptionString)) {
|
||||
// // console.log('removeEstimateOption::::', removeEstimateOption)
|
||||
// // row.check = false
|
||||
// return
|
||||
// } else {
|
||||
// // console.log('제품가대세팅::::', row.code)
|
||||
// // row.check = true
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
|
||||
estimateContextState.itemList.map((item) => {
|
||||
delete item.showSalePrice
|
||||
@ -701,7 +718,6 @@ export default function Estimate({ params }) {
|
||||
// const price
|
||||
totAmount += amount
|
||||
supplyPrice += price
|
||||
console.log('공급가액::::::::::::::::::::::', supplyPrice)
|
||||
}
|
||||
})
|
||||
|
||||
@ -717,7 +733,7 @@ export default function Estimate({ params }) {
|
||||
})
|
||||
} else {
|
||||
//YJSS
|
||||
console.log('YJSS 토탈만들어주기::::::::::', estimateContextState.itemList)
|
||||
// console.log('YJSS 토탈만들어주기::::::::::', estimateContextState.itemList)
|
||||
estimateContextState.itemList.sort((a, b) => {
|
||||
return a.dispOrder - b.dispOrder
|
||||
})
|
||||
|
||||
@ -88,6 +88,7 @@ export const useEstimateController = (planNo) => {
|
||||
itemChangeFlg: '1', //추가시 체인지플래그 1로
|
||||
partAdd: '1', //NEW 체인지 플래그
|
||||
delFlg: '0', //삭제 플래그 0 삭제하면 1
|
||||
addFlg: true,
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user