From 83260e0adb18a95b6a65a9b5a30da890519dfafc Mon Sep 17 00:00:00 2001 From: basssy Date: Sat, 11 Jan 2025 20:56:21 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C=20=EB=B3=B5?= =?UTF-8?q?=EC=82=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/estimate/Estimate.jsx | 77 ++++++++++++++++++++++-- src/components/floor-plan/CanvasMenu.jsx | 18 +++++- src/locales/ja.json | 1 + src/locales/ko.json | 1 + 4 files changed, 88 insertions(+), 9 deletions(-) diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index d3edfbea..71affac4 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -127,6 +127,48 @@ export default function Estimate({}) { //견적특이사항 API호출 //여러개 선택하면 구분자로 (、) //체크용 + if (estimateContextState.resetFlag === 'Y') { + let url = `/api/estimate/special-note-title-list` + get({ url: url }).then((res) => { + if (isNotEmptyArray(res)) { + if (estimateContextState?.estimateOption) { + res.map((row) => { + let estimateOption = estimateContextState?.estimateOption?.split('、') + row.check = false + estimateOption.map((row2) => { + if (row.pkgYn === '0') { + if (row2 === row.code) { + row.check = true + } + } else { + if (row.code.includes(row2)) { + row.check = true + return + } + } + }) + if (row.code === 'ATTR003') { + //row.check = true + } + if (row.code === 'ATTR007') { + //row.check = true + } + + if (estimateContextState.estimateType === 'YJOD') { + if (row.code === 'ATTR002') { + row.check = true + } + } + }) + + setSpecialNoteList(res) + + setSpecialNoteFirstFlg(true) + } + } + }) + } + if (!specialNoteFirstFlg) { let url = `/api/estimate/special-note-title-list` get({ url: url }).then((res) => { @@ -194,7 +236,6 @@ export default function Estimate({}) { useEffect(() => { //선택된 견적특이사항 setEstimateContextState - if (isNotEmptyArray(specialNoteList)) { const liveCheckedData = specialNoteList.filter((row) => row.check === true) @@ -365,7 +406,6 @@ export default function Estimate({}) { } } }) - setUniqueData(pushData) specialNoteList.map((item) => { if (item.pkgYn === '1') { @@ -384,6 +424,7 @@ export default function Estimate({}) { } } }) + setEstimateContextState({ specialNoteList: specialNoteList, uniqueData: uniqueData, @@ -761,6 +802,9 @@ export default function Estimate({}) { } useEffect(() => { + if (estimateContextState.resetFlag === 'Y') { + makeUniqueSpecialNoteCd(estimateContextState.itemList) + } if (itemChangeYn) { let totals = { totAmount: 0, @@ -923,7 +967,7 @@ export default function Estimate({}) { } useEffect(() => { - // console.log('리셋여부::', estimateContextState.resetFlag) + setSpecialNoteFirstFlg(false) }, [estimateContextState.resetFlag]) return ( @@ -1006,7 +1050,14 @@ export default function Estimate({}) {
- + {/* */} +
@@ -1018,7 +1069,14 @@ export default function Estimate({}) {
- + {/* */} +
+ {/* */} +
diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index 79108d67..b06f5e6e 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -43,6 +43,7 @@ import JA from '@/locales/ja.json' import { MENU } from '@/common/common' +import { QcastContext } from '@/app/QcastProvider' export default function CanvasMenu(props) { const { menuNumber, setMenuNumber } = props const pathname = usePathname() @@ -93,6 +94,8 @@ export default function CanvasMenu(props) { const { promiseGet, promisePost } = useAxios(globalLocale) const pwrGnrSimTypeRecoil = useRecoilValue(pwrGnrSimTypeState) + const { setIsGlobalLoading } = useContext(QcastContext) + const handleExcelPdfFileDown = async (donwloadType, drawingFlg) => { const url = '/api/estimate/excel-download' @@ -264,9 +267,18 @@ export default function CanvasMenu(props) { userId: sessionState.userId, } //디테일 호출 - await promisePost({ url: '/api/estimate/reset-estimate', data: params }).then((res) => { - fetchSetting(objectNo, pid, 'R') - }) + try { + await promisePost({ url: '/api/estimate/reset-estimate', data: params }).then((res) => { + setIsGlobalLoading(true) + if (res.status === 201) { + swalFire({ text: getMessage('estimate.detail.copy.alertMsg'), type: 'alert' }) + fetchSetting(objectNo, pid, 'R') + } + }) + } catch (error) { + setIsGlobalLoading(false) + console.log('error::::::::::::', e.response.data.message) + } }, denyFn: () => { console.log('초기화하지 않음. 변경일시 갱신안함') diff --git a/src/locales/ja.json b/src/locales/ja.json index 74d13d6b..abf15ebc 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -921,6 +921,7 @@ "estimate.detail.productFeaturesPopup.requiredStoreId": "一次販売店は必須です.", "estimate.detail.productFeaturesPopup.requiredReceiveUser": "担当者は必須です.", "estimate.detail.save.alertMsg": "保存されている見積書で製品を変更した場合、図面や回路には反映されません.", + "estimate.detail.copy.alertMsg": "コピーしました.", "estimate.detail.save.requiredFileUpload": "ファイル添付が必須のアイテムがあります。ファイルを添付するか、後日添付をチェックしてください.", "estimate.detail.save.requiredItem": "製品は1つ以上登録する必要があります.", "estimate.detail.save.requiredCharger": "担当者は必須です.", diff --git a/src/locales/ko.json b/src/locales/ko.json index 7293b7fe..72d6f194 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -930,6 +930,7 @@ "estimate.detail.productFeaturesPopup.requiredStoreId": "1차 판매점은 필수값 입니다.", "estimate.detail.productFeaturesPopup.requiredReceiveUser": "담당자는 필수값 입니다.", "estimate.detail.save.alertMsg": "저장되었습니다. 견적서에서 제품을 변경할 경우, 도면 및 회로에 반영되지 않습니다.", + "estimate.detail.copy.alertMsg": "복사되었습니다.", "estimate.detail.save.requiredFileUpload": "파일첨부가 필수인 아이템이 있습니다. 파일을 첨부하거나 후일첨부를 체크해주십시오.", "estimate.detail.save.requiredItem": "제품은 1개이상 등록해야 됩니다.", "estimate.detail.save.requiredCharger": "담당자는 필수값 입니다.",