From ad05fdea25df4b0fd164f5e036a3d5a2a3dc1393 Mon Sep 17 00:00:00 2001 From: basssy Date: Sat, 23 Nov 2024 13:38:13 +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 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index 0e8803b7..21553c52 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -212,6 +212,9 @@ export default function Estimate({ params }) { } }) } + + //YJSS UNIT_PIRCE로 프라이싱 실행 + handlePricing('UNIT_PRICE') } else { if (specialNoteList.length > 0) { specialNoteList.map((item) => { @@ -285,8 +288,15 @@ export default function Estimate({ params }) { //기존itemList랑 프라이싱결과랑 비교해서 단가만 업뎃 서로 갯수가 안맞을 수 있음 없는 itemId면 unitPrice 0으로 //itemId로 비교해서 salePrice만 업데이트 if (data.result.code === 200) { + console.log('data::확인해서 넣기:::::::::', data.data.pkgUnitPrice) + setEstimateContextState({ + pkgAsp: data.data.pkgUnitPrice, + }) + //주택PKG단가 체인지 이벤트 발생시키기 + onChangePkgAsp(data.data.pkgUnitPrice) + if (isNotEmptyArray(data.data2)) { - estimateContextState.itemList.map((item, itemIndex) => { + estimateContextState.itemList.map((item) => { let checkYn = false data.data2.map((item2) => { if (item2) { @@ -330,7 +340,7 @@ export default function Estimate({ params }) { //주택PKG input 변경 const onChangePkgAsp = (value) => { if (estimateContextState.estimateType === 'YJSS') { - let pkgAsp = Number(value.replace(/[^0-9]/g, '').replaceAll(',', '')) + let pkgAsp = Number(value.replaceAll(',', '')) if (isNaN(pkgAsp)) { pkgAsp = 0 } else { @@ -339,14 +349,14 @@ export default function Estimate({ params }) { //현재 PKG용량값 가져오기 let totVolKw = estimateContextState.totVolKw * 1000 - let pkgTotPrice = pkgAsp * totVolKw + let pkgTotPrice = pkgAsp.replaceAll(',', '') * totVolKw setEstimateContextState({ pkgAsp: pkgAsp, pkgTotPrice: pkgTotPrice.toFixed(3), }) - //아이템들 중 조건에 맞는애들 뽑아서 상단 공급가액 부가세 총액 수정 + // setItemChangeYn(true) } }