견적서
This commit is contained in:
parent
6a4a3f42ed
commit
1b3accc7bc
@ -146,6 +146,7 @@ export default function Estimate({ params }) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.log('최초::::::::', res)
|
||||||
setSpecialNoteList(res)
|
setSpecialNoteList(res)
|
||||||
|
|
||||||
setSpecialNoteFirstFlg(true)
|
setSpecialNoteFirstFlg(true)
|
||||||
@ -175,6 +176,7 @@ 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 = []
|
||||||
@ -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)
|
setItemChangeYn(false)
|
||||||
}
|
}
|
||||||
}, [itemChangeYn, estimateContextState.itemList])
|
}, [itemChangeYn, estimateContextState.itemList])
|
||||||
@ -1077,7 +1100,7 @@ export default function Estimate({ params }) {
|
|||||||
key={uuidv4()}
|
key={uuidv4()}
|
||||||
className="special-note-check-item"
|
className="special-note-check-item"
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
settingShowContent(row.code, event)
|
// settingShowContent(row.code, event)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="d-check-box light">
|
<div className="d-check-box light">
|
||||||
@ -1119,7 +1142,7 @@ export default function Estimate({ params }) {
|
|||||||
} else {
|
} else {
|
||||||
let pushData = []
|
let pushData = []
|
||||||
popShowSpecialNoteList.map((item) => {
|
popShowSpecialNoteList.map((item) => {
|
||||||
let option = showContentCode.split(',')
|
let option = showContentCode.split('、')
|
||||||
option.map((item2) => {
|
option.map((item2) => {
|
||||||
if (item.code === item2) {
|
if (item.code === item2) {
|
||||||
pushData.push(item)
|
pushData.push(item)
|
||||||
|
|||||||
@ -219,10 +219,18 @@ export const useEstimateController = (planNo) => {
|
|||||||
return alert(getMessage('estimate.detail.save.requiredItem'))
|
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)
|
console.log('최종 정보::;', estimateData)
|
||||||
//2. 상세데이터 저장
|
//2. 상세데이터 저장
|
||||||
// return
|
return
|
||||||
try {
|
try {
|
||||||
await promisePost({ url: `${ESTIMATE_API_ENDPOINT}/save-estimate`, data: estimateData }).then((res) => {
|
await promisePost({ url: `${ESTIMATE_API_ENDPOINT}/save-estimate`, data: estimateData }).then((res) => {
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user