견적서

This commit is contained in:
basssy 2024-11-27 16:29:03 +09:00
parent a9fc8b0f30
commit 74f64cce56

View File

@ -146,7 +146,6 @@ export default function Estimate({ params }) {
} }
}) })
console.log('최초::::::::', res)
setSpecialNoteList(res) setSpecialNoteList(res)
setSpecialNoteFirstFlg(true) setSpecialNoteFirstFlg(true)
@ -176,7 +175,6 @@ export default function Estimate({ params }) {
useEffect(() => { useEffect(() => {
// setEstimateContextState // setEstimateContextState
if (isNotEmptyArray(specialNoteList)) { if (isNotEmptyArray(specialNoteList)) {
console.log('specialNoteList::', specialNoteList)
const liveCheckedData = specialNoteList.filter((row) => row.check === true) const liveCheckedData = specialNoteList.filter((row) => row.check === true)
const data = [] const data = []
@ -643,6 +641,51 @@ export default function Estimate({ params }) {
}) })
console.log('YJOD 토탈만들어주기::::::::::', estimateContextState.itemList) console.log('YJOD 토탈만들어주기::::::::::', estimateContextState.itemList)
let pushData = []
let uniquSet = new Set()
estimateContextState.itemList.forEach((item) => {
if (item.delFlg === '1') {
if (item.specialNoteCd) {
let splitData = item.specialNoteCd.split('、')
splitData.forEach((note) => {
if (!uniquSet.has(note)) {
uniquSet.add(note)
pushData.push(note)
}
})
setSpecialNoteFirstFlg(false)
}
}
})
let estimateOption = estimateContextState?.estimateOption?.split('、')
estimateOption = estimateOption.filter((option) => !pushData.includes(option))
let estimateOptionString = estimateOption.join('、')
console.log('바꾼값:::::::', estimateOptionString)
console.log('SpecialNoteLis::', specialNoteList)
// ..
// specialNoteList.map((row) => {
// let spnAttrCds = res?.spnAttrCds?.split('')
// let estimateOption = estimateContextState?.estimateOption?.split('')
// let combineArray = Array.from(new Set([...spnAttrCds, ...estimateOption])).sort()
// row.check = false
// combineArray.map((row2) => {
// if (row.pkgYn === '0') {
// if (row2 === row.code) {
// row.check = true
// }
// } else {
// if (row.code.includes(row2)) {
// row.check = true
// return
// }
// }
// })
// })
estimateContextState.itemList.map((item) => { estimateContextState.itemList.map((item) => {
delete item.showSalePrice delete item.showSalePrice
delete item.showSaleTotPrice delete item.showSaleTotPrice
@ -740,27 +783,6 @@ export default function Estimate({ params }) {
}) })
} }
// ..
console.log('specialNoteList::', specialNoteList)
// specialNoteList.map((row) => {
// let spnAttrCds = res?.spnAttrCds?.split('')
// let estimateOption = estimateContextState?.estimateOption?.split('')
// let combineArray = Array.from(new Set([...spnAttrCds, ...estimateOption])).sort()
// row.check = false
// combineArray.map((row2) => {
// if (row.pkgYn === '0') {
// if (row2 === row.code) {
// row.check = true
// }
// } else {
// if (row.code.includes(row2)) {
// row.check = true
// return
// }
// }
// })
// })
setItemChangeYn(false) setItemChangeYn(false)
} }
}, [itemChangeYn, estimateContextState.itemList]) }, [itemChangeYn, estimateContextState.itemList])