From 1b3accc7bcc1e75a62fac92824426618624d2397 Mon Sep 17 00:00:00 2001 From: basssy Date: Wed, 27 Nov 2024 15:40:07 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/estimate/Estimate.jsx | 27 +++++++++++++++++-- .../estimate/useEstimateController.js | 12 +++++++-- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index 3b5f72d7..fb1e17b5 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -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) }} >
@@ -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) diff --git a/src/hooks/floorPlan/estimate/useEstimateController.js b/src/hooks/floorPlan/estimate/useEstimateController.js index 9ac68243..af97cb11 100644 --- a/src/hooks/floorPlan/estimate/useEstimateController.js +++ b/src/hooks/floorPlan/estimate/useEstimateController.js @@ -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) {