From d213f59ff93380d05eba8cc65f76bb6b019d1c1d Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Mon, 11 Nov 2024 09:50:25 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EC=A7=80=EB=B6=95=ED=98=95=EC=83=81=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=EC=8B=9C=20=EB=8B=A4=EB=A5=B8=20roof=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0=EB=90=98=EB=8A=94=20=ED=98=84=EC=83=81=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/roofcover/useRoofShapeSetting.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/hooks/roofcover/useRoofShapeSetting.js b/src/hooks/roofcover/useRoofShapeSetting.js index 21948de0..af55e557 100644 --- a/src/hooks/roofcover/useRoofShapeSetting.js +++ b/src/hooks/roofcover/useRoofShapeSetting.js @@ -167,8 +167,6 @@ export function useRoofShapeSetting(id) { ] const handleSave = () => { - //기존 wallLine 삭제 - let outerLines let direction @@ -379,20 +377,20 @@ export function useRoofShapeSetting(id) { } // 기존 wallLine, roofBase 제거 - canvas + /*canvas .getObjects() .filter((obj) => obj.name === POLYGON_TYPE.WALL) .forEach((line) => { canvas.remove(line) - }) + })*/ - canvas + /*canvas .getObjects() .filter((obj) => obj.name === POLYGON_TYPE.ROOF) .forEach((obj) => { canvas.remove(...obj.innerLines) canvas.remove(obj) - }) + })*/ const polygon = addPolygonByLines(outerLines, { name: POLYGON_TYPE.WALL, direction }) polygon.lines = [...outerLines] @@ -402,7 +400,6 @@ export function useRoofShapeSetting(id) { canvas?.renderAll() roof.drawHelpLine() - // setShowRoofShapeSettingModal(false) isFixRef.current = true closePopup(id) } From 084ebad39465e6e7c8a35c4c60f24425b6f23e44 Mon Sep 17 00:00:00 2001 From: basssy Date: Mon, 11 Nov 2024 10:09:48 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C=20=EC=A0=9C?= =?UTF-8?q?=ED=92=88=ED=8A=B9=EC=9D=B4=EC=82=AC=ED=95=AD=20=ED=8C=9D?= =?UTF-8?q?=EC=97=85=20=EC=9E=91=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/estimate/Estimate.jsx | 136 ++++++++---------- .../estimate/popup/ProductFeaturesPop.jsx | 51 +++++++ .../estimate/useEstimateController.js | 25 ++-- src/locales/ja.json | 6 +- src/locales/ko.json | 6 +- 5 files changed, 131 insertions(+), 93 deletions(-) create mode 100644 src/components/estimate/popup/ProductFeaturesPop.jsx diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index 4d816f4b..ca7059ec 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -16,6 +16,7 @@ import { useEstimateController } from '@/hooks/floorPlan/estimate/useEstimateCon import { SessionContext } from '@/app/SessionProvider' import Select, { components } from 'react-select' import { convertNumberToPriceDecimal } from '@/util/common-utils' +import ProductFeaturesPop from './popup/ProductFeaturesPop' export default function Estimate({ params }) { const { session } = useContext(SessionContext) @@ -27,6 +28,9 @@ export default function Estimate({ params }) { const [showContentCode, setShowContentCode] = useState('ATTR001') + const [productFeaturesPopupOpen, setProductFeaturesPopupOpen] = useState(false) //견적특이사항 팝업 + const [showProductFeatureData, setShowProductFeatureData] = useState([]) //팝업에 보여줄 견적특이사항 데이터 + //견적특이사항 접고 펼치기 const [hidden, setHidden] = useState(false) @@ -242,6 +246,12 @@ export default function Estimate({ params }) { }) } + // 제품 추가 테스트 + const addItemTest = () => { + const newItemDispOrder = (Math.max(...state.itemList.map((item) => item.dispOrder)) + 1) * 100 + console.log('newItemDispOrder::', newItemDispOrder) + } + return (
@@ -549,32 +559,33 @@ export default function Estimate({ params }) {
{/* SpecialNoteList반복문 */} - {specialNoteList.map((row) => { - return ( -
{ - settingShowContent(row.code, event) - }} - > -
- { - setSpecialNoteList((specialNote) => - specialNote.map((temp) => (temp.code === row.code ? { ...temp, text: !temp.text } : temp)), - ) - settingShowContent(row.code, event) - }} - /> - + {specialNoteList.length > 0 && + specialNoteList.map((row) => { + return ( +
{ + settingShowContent(row.code, event) + }} + > +
+ { + setSpecialNoteList((specialNote) => + specialNote.map((temp) => (temp.code === row.code ? { ...temp, text: !temp.text } : temp)), + ) + settingShowContent(row.code, event) + }} + /> + +
-
- ) - })} + ) + })}
{/* 견적특이사항 선택한 내용 영역시작 */}
@@ -706,13 +717,13 @@ export default function Estimate({ params }) {
-
@@ -763,7 +774,21 @@ export default function Estimate({ params }) {
- x.saleStoreName} + // getOptionValue={(x) => x.saleStoreId} + isClearable={true} + isDisabled={false} + // value={saleStoreList.filter(function (option) { + // return option.saleStoreId === selOptions + // })} + />
{item?.itemChangeFlg === '1' && (
@@ -782,7 +807,8 @@ export default function Estimate({ params }) { type="button" className="grid-tip" onClick={() => { - console.log('제품특이사항 모달팝업:::::::::', item?.specialNoteCd) + setProductFeaturesPopupOpen(true) + setShowProductFeatureData(item?.specialNoteCd) }} > )} @@ -809,49 +835,6 @@ export default function Estimate({ params }) { ) })} - {/* - -
- - -
- - 100 - -
-
-
- -
-
- - -
-
HNW-MC4-CHN30
-
- - -
-
- - -
- -
- - セット - -
-
- -
-
- -
-
- - 5,561,000 - */}
@@ -861,6 +844,13 @@ export default function Estimate({ params }) {
{/* 기본정보끝 */}
+ {productFeaturesPopupOpen && ( + + )}
) } diff --git a/src/components/estimate/popup/ProductFeaturesPop.jsx b/src/components/estimate/popup/ProductFeaturesPop.jsx new file mode 100644 index 00000000..428c6a8e --- /dev/null +++ b/src/components/estimate/popup/ProductFeaturesPop.jsx @@ -0,0 +1,51 @@ +'use client' +import { useState } from 'react' +import { useMessage } from '@/hooks/useMessage' +export default function ProductFeaturesPop({ specialNoteList, showProductFeatureData, setProductFeaturesPopupOpen }) { + console.log('위에서 넘어온거::', specialNoteList) + console.log('위에서 넘어온거::', showProductFeatureData) + //split('、') + + const { getMessage } = useMessage() + return ( +
+
+
+
+

{getMessage('estimate.detail.productFeaturesPopup.title')}

+ +
+
+
+
+
+
제목
+
내용
+
+
+
+
+ +
+
+
+
+
+ ) +} diff --git a/src/hooks/floorPlan/estimate/useEstimateController.js b/src/hooks/floorPlan/estimate/useEstimateController.js index df3e4450..05d10554 100644 --- a/src/hooks/floorPlan/estimate/useEstimateController.js +++ b/src/hooks/floorPlan/estimate/useEstimateController.js @@ -76,27 +76,20 @@ export const useEstimateController = (planNo) => { } const addItem = () => { - const newItemId = Math.max(...state.itemList.map((item) => item.itemId)) + 1 + const newItemDispOrder = (Math.max(...state.itemList.map((item) => item.dispOrder)) + 1) * 100 setState({ itemList: [ ...state.itemList, { - dispOrder: '1', - itemId: newItemId, - amount: '', - fileUploadFlg: '0', - itemChangeFlg: '0', - pkgMaterialFlg: '0', - specialNoteCd: '', - itemGroup: '', + dispOrder: newItemDispOrder, + itemId: '', //제품번호 + itemNo: '', //형명 itemName: '', - itemNo: '', - moduleFlg: '', - pnowW: '', - salePrice: '', - saleTotPrice: '', - specification: '', - unit: '', + amount: '', //수량 + unitPrice: '0', + unit: '', //단위 + salePrice: '0', //단가 + saleTotPrice: '0', //금액(부가세별도) }, ], }) diff --git a/src/locales/ja.json b/src/locales/ja.json index 3e79412e..ec6a7b69 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -847,8 +847,8 @@ "estimate.detail.showPrice.description2": "追加, 変更資材", "estimate.detail.showPrice.description3": "添付必須", "estimate.detail.showPrice.description4": "クリックして製品の特異性を確認する", - "estimate.detail.showPrice.btn2": "製品を追加", - "estimate.detail.showPrice.btn3": "製品削除", + "estimate.detail.showPrice.addItem": "製品を追加", + "estimate.detail.showPrice.delItem": "製品削除", "estimate.detail.itemTableHeader.dispOrder": "アイテム", "estimate.detail.itemTableHeader.itemId": "品番", "estimate.detail.itemTableHeader.itemNo": "型板", @@ -874,6 +874,8 @@ "estimate.detail.docPopup.schDrawingFlg.schDrawingFlg1": "含まない", "estimate.detail.docPopup.close": "閉じる", "estimate.detail.docPopup.docDownload": "文書のダウンロード", + "estimate.detail.productFeaturesPopup.title": "製品特異事項", + "estimate.detail.productFeaturesPopup.close": "閉じる", "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 a2ef69b3..c8bde290 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -853,8 +853,8 @@ "estimate.detail.showPrice.description2": "추가, 변경 자재", "estimate.detail.showPrice.description3": "첨부필수", "estimate.detail.showPrice.description4": "클릭하여 제품 특이사항 확인", - "estimate.detail.showPrice.btn2": "제품추가", - "estimate.detail.showPrice.btn3": "제품삭제", + "estimate.detail.showPrice.addItem": "제품추가", + "estimate.detail.showPrice.delItem": "제품삭제", "estimate.detail.itemTableHeader.dispOrder": "Item", "estimate.detail.itemTableHeader.itemId": "품번", "estimate.detail.itemTableHeader.itemNo": "형명", @@ -880,6 +880,8 @@ "estimate.detail.docPopup.schDrawingFlg.schDrawingFlg1": "미포함", "estimate.detail.docPopup.close": "닫기", "estimate.detail.docPopup.docDownload": "문서 다운로드", + "estimate.detail.productFeaturesPopup.title": "제품특이사항", + "estimate.detail.productFeaturesPopup.close": "닫기", "estimate.detail.save.alertMsg": "저장되었습니다. 견적서에서 제품을 변경할 경우, 도면 및 회로에 반영되지 않습니다.", "estimate.detail.save.requiredMsg": "파일첨부가 필수인 아이템이 있습니다. 파일을 첨부하거나 후일첨부를 체크해주십시오.", "estimate.detail.reset.confirmMsg": "저장된 견적서 정보가 초기화되고, 도면정보가 반영됩니다. 정말로 초기화 하시겠습니까?",