From cf6e5da7a0269b455c1459eafa95b2cf02f66d47 Mon Sep 17 00:00:00 2001 From: basssy Date: Wed, 27 Nov 2024 18:46:02 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../estimate/useEstimateController.js | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/hooks/floorPlan/estimate/useEstimateController.js b/src/hooks/floorPlan/estimate/useEstimateController.js index b3c662d7..ec0bbe77 100644 --- a/src/hooks/floorPlan/estimate/useEstimateController.js +++ b/src/hooks/floorPlan/estimate/useEstimateController.js @@ -167,29 +167,31 @@ export const useEstimateController = (planNo) => { if (fileFlg) { estimateData.itemList.map((item) => { - item.amount = item.amount?.replaceAll(',', '') - item.salePrice = parseFloat(item.salePrice?.replaceAll(',', '')).toFixed(2) - item.saleTotPrice = parseFloat(item.saleTotPrice?.replaceAll(',', '')).toFixed(2) + if (item.delFlg === '0') { + item.amount = item.amount?.replaceAll(',', '') + item.salePrice = parseFloat(item.salePrice?.replaceAll(',', '')).toFixed(2) + item.saleTotPrice = parseFloat(item.saleTotPrice?.replaceAll(',', '')).toFixed(2) - if (!item.paDispOrder) { - if (itemFlg) { - if (isNaN(item.amount)) { - item.amount = '0' - } - - if (item.amount < 1) { - itemFlg = false - return alert(getMessage('estimate.detail.save.requiredAmount')) - } - - if (estimateData.estimateType !== 'YJSS') { - if (isNaN(item.salePrice)) { - item.salePrice = '0' + if (!item.paDispOrder) { + if (itemFlg) { + if (isNaN(item.amount)) { + item.amount = '0' } - if (item.salePrice < 1) { + if (item.amount < 1) { itemFlg = false - return alert(getMessage('estimate.detail.save.requiredSalePrice')) + return alert(getMessage('estimate.detail.save.requiredAmount')) + } + + if (estimateData.estimateType !== 'YJSS') { + if (isNaN(item.salePrice)) { + item.salePrice = '0' + } + + if (item.salePrice < 1) { + itemFlg = false + return alert(getMessage('estimate.detail.save.requiredSalePrice')) + } } } }