diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index 613db2bd..e3da458c 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -33,6 +33,7 @@ import useMenu from '@/hooks/common/useMenu' import { MENU } from '@/common/common' import { useEstimateController } from '@/hooks/floorPlan/estimate/useEstimateController' +import { estimateState } from '@/store/floorPlanObjectAtom' export default function CanvasMenu(props) { const { menuNumber, setMenuNumber } = props @@ -54,6 +55,7 @@ export default function CanvasMenu(props) { const { handleZoomClear, handleZoom } = useCanvasEvent() const { handleMenu } = useMenu() const { handleEstimateSubmit } = useEstimateController() + const estimateRecoilState = useRecoilValue(estimateState) const { getMessage } = useMessage() const { currentCanvasPlan, saveCanvas } = usePlan() @@ -138,6 +140,38 @@ export default function CanvasMenu(props) { addPopup(id, 1, , true) } + // 견적서 초기화 버튼 + const handleEstimateReset = () => { + // console.log('estimateRecoilState::', estimateRecoilState) + //objectNo, planNo + swalFire({ + //저장된 견적서 정보가 초기화되고, 도면정보가 반영됩니다. 정말로 초기화 하시겠습니까? + //물건정보 + text: getMessage('estimate.detail.reset.confirmMsg'), + type: 'confirm', + confirmFn: () => { + console.log('내용초기화 및 변경일시 갱신') + }, + denyFn: () => { + console.log('초기화하지 않음. 변경일시 갱신안함') + }, + }) + } + + /** + * 견적서 복사버튼 + * (견적서 번호(estimateRecoilState.docNo)가 생성된 이후 버튼 활성화 ) + * T01관리자 계정 및 1차판매점에게만 제공 + */ + + const handleEstimateCopy = () => { + // console.log('estimateRecoilState::', estimateRecoilState) + //objectNo, planNo + console.log('복사') + console.log('물건정보+도면+견적서를 모두 복사') + console.log('견적서 가격은 정가를 표시') + } + useEffect(() => { if (globalLocale === 'ko') { setAppMessageState(KO) @@ -228,7 +262,7 @@ export default function CanvasMenu(props) { {menuNumber === 5 && ( <>
- @@ -236,11 +270,24 @@ export default function CanvasMenu(props) { {getMessage('plan.menu.estimate.save')} - - diff --git a/src/hooks/floorPlan/estimate/useEstimateController.js b/src/hooks/floorPlan/estimate/useEstimateController.js index aeec4f1c..5a0c49e1 100644 --- a/src/hooks/floorPlan/estimate/useEstimateController.js +++ b/src/hooks/floorPlan/estimate/useEstimateController.js @@ -135,7 +135,7 @@ export const useEstimateController = (planNo) => { estimateData.itemList.map((row) => { if (row.fileUploadFlg === '1') { if (estimateData.fileFlg === '0') { - alert(getMessage('estimate.detail.save.alertMsg')) + alert(getMessage('estimate.detail.save.requiredMsg')) flag = false } } @@ -166,6 +166,7 @@ export const useEstimateController = (planNo) => { url: ESTIMATE_API_ENDPOINT, data: estimateData, }) + alert(getMessage('estimate.detail.save.alertMsg')) return result } catch (error) { console.error('Failed to submit estimate:', error) diff --git a/src/locales/ja.json b/src/locales/ja.json index 8e32a8a4..b5636db5 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -850,5 +850,7 @@ "estimate.detail.itemTableHeader.col5": "単位", "estimate.detail.itemTableHeader.col6": "単価", "estimate.detail.itemTableHeader.col7": "金額 (税別別)", - "estimate.detail.save.alertMsg": "ファイル添付が必須のアイテムがあります。ファイルを添付するか、後日添付をチェックしてください." + "estimate.detail.save.alertMsg": "保存されている見積書で製品を変更した場合、図面や回路には反映されません.", + "estimate.detail.save.requiredMsg": "ファイル添付が必須のアイテムがあります。ファイルを添付するか、後日添付をチェックしてください.", + "estimate.detail.reset.confirmMsg": "保存した見積書情報が初期化され、図面情報が反映されます。本当に初期化しますか?" } diff --git a/src/locales/ko.json b/src/locales/ko.json index 30b3f130..60dc6279 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -856,5 +856,7 @@ "estimate.detail.itemTableHeader.col5": "단위", "estimate.detail.itemTableHeader.col6": "단가", "estimate.detail.itemTableHeader.col7": "금액(부가세별도)", - "estimate.detail.save.alertMsg": "파일첨부가 필수인 아이템이 있습니다. 파일을 첨부하거나 후일첨부를 체크해주십시오." + "estimate.detail.save.alertMsg": "저장되었습니다. 견적서에서 제품을 변경할 경우, 도면 및 회로에 반영되지 않습니다.", + "estimate.detail.save.requiredMsg": "파일첨부가 필수인 아이템이 있습니다. 파일을 첨부하거나 후일첨부를 체크해주십시오.", + "estimate.detail.reset.confirmMsg": "저장된 견적서 정보가 초기화되고, 도면정보가 반영됩니다. 정말로 초기화 하시겠습니까?" }