From 9f7fedab799f3bb0f8864eb784aa074fccd76c08 Mon Sep 17 00:00:00 2001 From: ysCha Date: Fri, 11 Jul 2025 15:59:30 +0900 Subject: [PATCH] =?UTF-8?q?[1182]=20=EC=B6=94=EA=B0=80=20=EA=B2=AC?= =?UTF-8?q?=EC=A0=81=20=EC=B6=9C=EB=A0=A5=20=EB=A9=94=EC=8B=9C=EC=A7=80=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=20=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20POPUP=20?= =?UTF-8?q?=EB=A9=94=EC=8B=9C=EC=A7=80=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/floor-plan/FloorPlanProvider.js | 2 ++ src/components/estimate/Estimate.jsx | 3 ++- .../estimate/useEstimateController.js | 25 ++++++++++++++++++- src/locales/ja.json | 7 +++--- src/locales/ko.json | 1 + 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/app/floor-plan/FloorPlanProvider.js b/src/app/floor-plan/FloorPlanProvider.js index 1e5c536d..a9595aa5 100644 --- a/src/app/floor-plan/FloorPlanProvider.js +++ b/src/app/floor-plan/FloorPlanProvider.js @@ -21,6 +21,8 @@ const defaultEstimateData = { fileList: [], fileFlg: '0', //후일 자료 제출 (체크 1 노체크 0) priceCd: '', + pricingFlag: false, // 가격 처리 플래그 추가 + } /** diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index 9a3dd74d..2fe098cf 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -507,6 +507,7 @@ export default function Estimate({}) { icon: 'warning', confirmFn: () => { handlePricing(showPriceCd) + setEstimateContextState({ pricingFlag:true }) }, }) } @@ -1437,7 +1438,7 @@ export default function Estimate({}) { onChange={(e) => { //주문분류 setHandlePricingFlag(true) - setEstimateContextState({ estimateType: e.target.value }) + setEstimateContextState({ estimateType: e.target.value, setEstimateContextState }) }} /> diff --git a/src/hooks/floorPlan/estimate/useEstimateController.js b/src/hooks/floorPlan/estimate/useEstimateController.js index 9acb79f7..4cbe4521 100644 --- a/src/hooks/floorPlan/estimate/useEstimateController.js +++ b/src/hooks/floorPlan/estimate/useEstimateController.js @@ -167,13 +167,34 @@ export const useEstimateController = (planNo, flag) => { }) } - //견적서 저장 + const handleEstimateSubmit = async () => { + if(estimateContextState.pricingFlag) { + await handleEstimateSubmitCore(); + }else { + swalFire({ + text: getMessage('estimate.detail.save.pricingFlag'), + type: 'confirm', + icon: 'warning', + confirmFn: async () => { + await handleEstimateSubmitCore(); + + }, + denyFn: () => false + }) + return false + } + } + //견적서 저장 + const handleEstimateSubmitCore = async () => { //0. 필수체크 let flag = true let originFileFlg = false let fileFlg = true let itemFlg = true + + + if (estimateData?.charger === null || estimateData?.charger?.trim().length === 0) { flag = false setIsGlobalLoading(false) @@ -355,6 +376,8 @@ export const useEstimateController = (planNo, flag) => { } const realSave = async (fileList) => { + + setEstimateContextState({pricingFlag: false}) //첨부파일저장끝 let option = [] diff --git a/src/locales/ja.json b/src/locales/ja.json index ed372e18..5cd08828 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -993,10 +993,10 @@ "estimate.detail.docPopup.title": "見積書出力オプションの設定", "estimate.detail.docPopup.explane": "ダウンロードする文書オプションを選択し、[見積書出力]ボタンをクリックします。", "estimate.detail.docPopup.schUnitPriceFlg": "ダウンロードファイル", - "estimate.detail.docPopup.schUnitPriceFlg.excelFlg0": "仕切用Excel", + "estimate.detail.docPopup.schUnitPriceFlg.excelFlg0": "見積書Excel", "estimate.detail.docPopup.schUnitPriceFlg.excelFlg1": "定価用Excel", - "estimate.detail.docPopup.schUnitPriceFlg.excelFlg2": "見積書", - "estimate.detail.docPopup.schUnitPriceFlg.pdfFlg0": "仕切用PDF", + "estimate.detail.docPopup.schUnitPriceFlg.excelFlg2": "旧見積書書式", + "estimate.detail.docPopup.schUnitPriceFlg.pdfFlg0": "見積書PDF", "estimate.detail.docPopup.schUnitPriceFlg.pdfFlg1": "定価用PDF", "estimate.detail.docPopup.schDisplayFlg": "見積提出書の表示名", "estimate.detail.docPopup.schDisplayFlg.schDisplayFlg0": "販売店名", @@ -1034,6 +1034,7 @@ "estimate.detail.save.requiredItemId": "製品を選択してください。", "estimate.detail.save.requiredAmount": "数量は0より大きい値を入力してください。", "estimate.detail.save.requiredSalePrice": "単価は0より大きい値を入力してください。", + "estimate.detail.save.pricingFlag": "設定した価格見積が作成されます。このまま進めてよろしいですか?", "estimate.detail.reset.alertMsg": "初期化されました。", "estimate.detail.reset.confirmMsg": "保存した見積情報が初期化され、最近保存された図面情報が反映されます。本当に初期化しますか?", "estimate.detail.lock.alertMsg": "見積もりを[ロック]すると変更できません。
見積もりを修正するには、ロックを解除してください。", diff --git a/src/locales/ko.json b/src/locales/ko.json index c0cd43af..19864ac4 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -1034,6 +1034,7 @@ "estimate.detail.save.requiredItemId": "제품을 선택해주세요.", "estimate.detail.save.requiredAmount": "수량은 0보다 큰값을 입력해주세요.", "estimate.detail.save.requiredSalePrice": "단가는 0보다 큰값을 입력해주세요.", + "estimate.detail.save.pricingFlag": "설정한 가격 견적이 작성됩니다. 이대로 진행해도 괜찮으시겠습니까?", "estimate.detail.reset.alertMsg": "초기화 되었습니다.", "estimate.detail.reset.confirmMsg": "수기 변경(저장)한 견적 정보가 초기화되고 최근 저장된 도면정보가 반영됩니다. 정말로 초기화하시겠습니까?", "estimate.detail.lock.alertMsg": "견적서를 [잠금]하면 수정할 수 없습니다.
견적서를 수정하려면 잠금해제를 하십시오.",