diff --git a/src/app/QcastProvider.js b/src/app/QcastProvider.js
index 23ad5a75..16a62d63 100644
--- a/src/app/QcastProvider.js
+++ b/src/app/QcastProvider.js
@@ -34,7 +34,7 @@ export const QcastProvider = ({ children }) => {
const targetElement = document.getElementById('canvas')
if (!targetElement && currentCanvasPlan?.id && planSave) {
setPlanSave((prev) => !prev)
- checkUnsavedCanvasPlan(currentCanvasPlan.userId)
+ checkUnsavedCanvasPlan()
} else if (targetElement && currentCanvasPlan?.id) {
setPlanSave(true)
}
diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx
index a14622f7..ff9e7af2 100644
--- a/src/components/estimate/Estimate.jsx
+++ b/src/components/estimate/Estimate.jsx
@@ -191,9 +191,9 @@ export default function Estimate({ params }) {
}, [specialNoteList])
// 견적특이사항 remark 보여주기
- const settingShowContent = (code, event) => {
+ const settingShowContent = (code) => {
setShowContentCode(code)
- event.stopPropagation()
+ // event.stopPropagation()
}
// 추가한 첨부파일 estimateContextState에 넣기
@@ -227,7 +227,15 @@ export default function Estimate({ params }) {
}, [estimateContextState?.fileList])
// 기존첨부파일 삭제 (플래그값 추가?) 저장할때 플래그값에 따라 진짜 삭제
- const deleteOriginFile = async (objectNo, no) => {
+ const deleteOriginFile = (objectNo, no) => {
+ originFiles.map((file) => {
+ if (file.no === no) {
+ file.delFlg = '1'
+ }
+ })
+
+ // console.log('originFiles::', originFiles)
+ setOriginFiles(originFiles)
const delParams = {
userId: session.userId,
objectNo: objectNo,
@@ -407,25 +415,43 @@ export default function Estimate({ params }) {
if (isNotEmptyArray(data.data2)) {
estimateContextState.itemList.map((item) => {
+ // console.log('기존아이템::', item)
let checkYn = false
- data.data2.map((item2) => {
- if (item2) {
- if (item2.itemId === item.itemId) {
+ for (let i = 0; i < data.data2.length; i++) {
+ // console.log('프라이싱결과아이템:::', data.data2[i])
+ if (data.data2[i]) {
+ if (data.data2[i].itemId === item.itemId) {
updateList.push({
...item,
- openFlg: item2.unitPrice === '0.0' ? '1' : '0',
- salePrice: item2.unitPrice === null ? '0' : item2.unitPrice,
- saleTotPrice: (item.amount * item2.unitPrice).toString(),
+ openFlg: data.data2[i].unitPrice === '0.0' ? '1' : '0',
+ salePrice: data.data2[i].unitPrice === null ? '0' : data.data2[i].unitPrice,
+ saleTotPrice: (item.amount * data.data2[i].unitPrice).toString(),
})
checkYn = true
+ break
}
}
- })
+ }
+ // data.data2.map((item2) => {
+ // if (item2) {
+ // // console.log('프라이싱아이템::::', item2)
+ // if (item2.itemId === item.itemId) {
+ // updateList.push({
+ // ...item,
+ // openFlg: item2.unitPrice === '0.0' ? '1' : '0',
+ // salePrice: item2.unitPrice === null ? '0' : item2.unitPrice,
+ // saleTotPrice: (item.amount * item2.unitPrice).toString(),
+ // })
+ // checkYn = true
+ // }
+ // }
+ // })
if (!checkYn) {
updateList.push({ ...item, salePrice: '0', saleTotPrice: '0' })
}
})
+
setEstimateContextState({
priceCd: showPriceCd,
itemList: updateList,
@@ -472,7 +498,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.replace(/[^-\.0-9]/g, '').replaceAll(',', ''))
if (isNaN(pkgAsp)) {
pkgAsp = 0
} else {
@@ -725,6 +751,7 @@ export default function Estimate({ params }) {
makeUniqueSpecialNoteCd(itemList)
itemList.forEach((item) => {
+ // console.log('YJOD::::::', item)
delete item.showSalePrice
delete item.showSaleTotPrice
if (item.delFlg === '0') {
@@ -753,10 +780,10 @@ export default function Estimate({ params }) {
itemList.sort((a, b) => a.dispOrder - b.dispOrder)
makeUniqueSpecialNoteCd(itemList)
itemList.forEach((item) => {
+ // console.log('YJSSS::', item)
if (item.delFlg === '0') {
let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', '')) || 0
let salePrice = Number(item.salePrice?.replaceAll(',', '')) || 0
-
if (item.moduleFlg === '1') {
const volKw = (item.pnowW * amount) / 1000
totals.totVolKw += volKw
@@ -1111,17 +1138,26 @@ export default function Estimate({ params }) {
{originFiles.map((originFile) => {
return (
- handleEstimateFileDownload(originFile)}>
- {originFile.faileName}
-
-
+
+
+ {originFile.faileName}
+
+
+ {/*
+ {originFile.faileName}
+
+
*/}
+
)
})}
@@ -1155,21 +1191,29 @@ export default function Estimate({ params }) {
specialNoteList.map((row) => {
return (
-
)
@@ -1501,7 +1545,9 @@ export default function Estimate({ params }) {
- {convertNumberToPriceDecimal(item?.showSaleTotPrice === '0' ? null : item?.saleTotPrice?.replaceAll(',', ''))}
+ {convertNumberToPriceDecimal(
+ item?.showSaleTotPrice === '0' ? null : item?.saleTotPrice === '0' ? null : item?.saleTotPrice?.replaceAll(',', ''),
+ )}
|
)
diff --git a/src/components/floor-plan/CanvasLayout.jsx b/src/components/floor-plan/CanvasLayout.jsx
index fcaabb6f..9e48873e 100644
--- a/src/components/floor-plan/CanvasLayout.jsx
+++ b/src/components/floor-plan/CanvasLayout.jsx
@@ -20,7 +20,7 @@ export default function CanvasLayout({ children }) {
const { getMessage } = useMessage()
const { swalFire } = useSwal()
- const { plans, initCanvasPlans, modifiedPlans, loadCanvasPlanData, handleCurrentPlan, handleAddPlan, handleDeletePlan } = usePlan()
+ const { plans, modifiedPlans, loadCanvasPlanData, handleCurrentPlan, handleAddPlan, handleDeletePlan } = usePlan()
useEffect(() => {
loadCanvasPlanData(session.userId, objectNo, pid)
@@ -34,10 +34,9 @@ export default function CanvasLayout({ children }) {