견적서

This commit is contained in:
basssy 2024-11-27 15:40:07 +09:00
parent 6a4a3f42ed
commit 1b3accc7bc
2 changed files with 35 additions and 4 deletions

View File

@ -146,6 +146,7 @@ export default function Estimate({ params }) {
}
})
console.log('최초::::::::', res)
setSpecialNoteList(res)
setSpecialNoteFirstFlg(true)
@ -175,6 +176,7 @@ export default function Estimate({ params }) {
useEffect(() => {
// setEstimateContextState
if (isNotEmptyArray(specialNoteList)) {
console.log('specialNoteList::', specialNoteList)
const liveCheckedData = specialNoteList.filter((row) => row.check === true)
const data = []
@ -738,6 +740,27 @@ 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)
}
}, [itemChangeYn, estimateContextState.itemList])
@ -1077,7 +1100,7 @@ export default function Estimate({ params }) {
key={uuidv4()}
className="special-note-check-item"
onClick={(event) => {
settingShowContent(row.code, event)
// settingShowContent(row.code, event)
}}
>
<div className="d-check-box light">
@ -1119,7 +1142,7 @@ export default function Estimate({ params }) {
} else {
let pushData = []
popShowSpecialNoteList.map((item) => {
let option = showContentCode.split(',')
let option = showContentCode.split('')
option.map((item2) => {
if (item.code === item2) {
pushData.push(item)

View File

@ -219,10 +219,18 @@ export const useEstimateController = (planNo) => {
return alert(getMessage('estimate.detail.save.requiredItem'))
}
console.log('최종 아이템 정보::;', estimateData.itemList)
// console.log('최종 아이템 정보::;', estimateData.itemList)
let option = []
estimateData.itemList.forEach((item) => {
if (item.specialNoteCd) {
let split2 = item.specialNoteCd.split('、')
option = option.concat(split2)
}
})
console.log('최종 정보::;', estimateData)
//2. 상세데이터 저장
// return
return
try {
await promisePost({ url: `${ESTIMATE_API_ENDPOINT}/save-estimate`, data: estimateData }).then((res) => {
if (res.status === 201) {