diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index 531dcaa9..7bedc1c7 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -600,7 +600,13 @@ export default function Estimate({ params }) { updates.showSalePrice = '0' updates.showSaleTotPrice = '0' } + } else { + if (res.openFlg === '1') { + updates.showSalePrice = '0' + updates.showSaleTotPrice = '0' + } } + //104671 let bomList = res.itemBomList @@ -719,8 +725,6 @@ export default function Estimate({ params }) { makeUniqueSpecialNoteCd(itemList) itemList.forEach((item) => { - delete item.showSalePrice - delete item.showSaleTotPrice if (item.delFlg === '0') { let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', '')) || 0 let price = Number(item.saleTotPrice?.replaceAll(',', '')) || 0 @@ -731,6 +735,11 @@ export default function Estimate({ params }) { } totals.totAmount += amount totals.supplyPrice += price + + if (item.openFlg === '1') { + item.showSalePrice = '0' + item.showSaleTotPrice = '0' + } } }) @@ -802,6 +811,13 @@ export default function Estimate({ params }) { item.showSaleTotPrice = '0' } }) + + estimateContextState.itemList.forEach((item) => { + if (estimateContextState.estimateType === 'YJOD' && item.openFlg === '1') { + item.showSalePrice = '0' + item.showSaleTotPrice = '0' + } + }) } }, [itemChangeYn, estimateContextState.itemList]) @@ -1465,6 +1481,10 @@ export default function Estimate({ params }) { ? true : item.pkgMaterialFlg !== '1' : item.itemId === '' || !!item?.paDispOrder + ? true + : item.openFlg === '1' + ? true + : false } onChange={(e) => { onChangeSalePrice(e.target.value, item.dispOrder, index) diff --git a/src/hooks/floorPlan/estimate/useEstimateController.js b/src/hooks/floorPlan/estimate/useEstimateController.js index 414e9a06..016fda78 100644 --- a/src/hooks/floorPlan/estimate/useEstimateController.js +++ b/src/hooks/floorPlan/estimate/useEstimateController.js @@ -153,7 +153,7 @@ export const useEstimateController = (planNo) => { } if (flag) { if (!originFileFlg) { - if (estimateData.newFileList.length < 1) { + if (estimateData.newFileList?.length < 1) { if (estimateData.itemList.length > 1) { estimateData.itemList.map((row) => { if (row.delFlg === '0') { @@ -195,9 +195,11 @@ export const useEstimateController = (planNo) => { item.salePrice = '0' } - if (item.salePrice < 1) { - itemFlg = false - return alert(getMessage('estimate.detail.save.requiredSalePrice')) + if (item.openFlg !== '1') { + if (item.salePrice < 1) { + itemFlg = false + return alert(getMessage('estimate.detail.save.requiredSalePrice')) + } } estimateData.pkgAsp = '0'