From b6873f4d27674e73b13ac1eb1a1fe287485cb90e Mon Sep 17 00:00:00 2001 From: basssy Date: Wed, 27 Nov 2024 11:24:26 +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 | 8 +++++--- src/hooks/floorPlan/estimate/useEstimateController.js | 10 ++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index 29fe5c84..bbe7c4e0 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -422,7 +422,8 @@ export default function Estimate({ params }) { //현재 PKG용량값 가져오기 let totVolKw = estimateContextState.totVolKw * 1000 - let pkgTotPrice = pkgAsp.replaceAll(',', '') * totVolKw + let pkgTotPrice = pkgAsp.replaceAll(',', '') * totVolKw * 1000 + setEstimateContextState({ pkgAsp: pkgAsp, pkgTotPrice: pkgTotPrice.toFixed(3), @@ -655,6 +656,7 @@ export default function Estimate({ params }) { if (item.moduleFlg === '1') { //용량(Kw)은 모듈플래그 1만 합산 const volKw = (item.pnowW * amount) / 1000 + // const volKw = item.pnowW * amount totVolKw += volKw } // const price @@ -699,11 +701,11 @@ export default function Estimate({ params }) { if (item.moduleFlg === '1') { //용량(Kw)은 모듈플래그 1만 합산 const volKw = (item.pnowW * amount) / 1000 + // const volKw = item.pnowW * amount totVolKw += volKw } - setEstimateContextState({ - pkgTotPrice: estimateContextState.pkgAsp.replaceAll(',', '') * totVolKw, + pkgTotPrice: estimateContextState.pkgAsp.replaceAll(',', '') * totVolKw * 1000, }) //pkgTotPrice // const saleTotPrice diff --git a/src/hooks/floorPlan/estimate/useEstimateController.js b/src/hooks/floorPlan/estimate/useEstimateController.js index b854bac7..e7775408 100644 --- a/src/hooks/floorPlan/estimate/useEstimateController.js +++ b/src/hooks/floorPlan/estimate/useEstimateController.js @@ -173,7 +173,7 @@ export const useEstimateController = (planNo) => { if (isNaN(item.amount)) { item.amount = 0 } else { - Number(item.amount) + item.amount = Number(item.amount) } if (item.amount < 1) { @@ -181,7 +181,13 @@ export const useEstimateController = (planNo) => { return alert(getMessage('estimate.detail.save.requiredAmount')) } - if (Number(item.salePrice) < 1) { + if (isNaN(item.salePrice)) { + item.salePrice = 0 + } else { + item.salePrice = Number(item.salePrice) + } + + if (item.salePrice < 1) { itemFlg = false return alert(getMessage('estimate.detail.save.requiredSalePrice')) }