diff --git a/src/components/estimate/popup/EstimateCopyPop.jsx b/src/components/estimate/popup/EstimateCopyPop.jsx
new file mode 100644
index 00000000..632f0851
--- /dev/null
+++ b/src/components/estimate/popup/EstimateCopyPop.jsx
@@ -0,0 +1,208 @@
+'use client'
+import { useEffect, useState, useContext, use } from 'react'
+import { useMessage } from '@/hooks/useMessage'
+import { useAxios } from '@/hooks/useAxios'
+import { useRecoilValue } from 'recoil'
+import { floorPlanObjectState } from '@/store/floorPlanObjectAtom'
+import Select, { components } from 'react-select'
+import { SessionContext } from '@/app/SessionProvider'
+import { isEmptyArray } from '@/util/common-utils'
+import { useEstimateController } from '@/hooks/floorPlan/estimate/useEstimateController'
+import { ManagementContext } from '@/app/management/ManagementProvider'
+
+import { estimateState } from '@/store/floorPlanObjectAtom'
+
+export default function EstimateCopyPop({ planNo, setEstimateCopyPopupOpen }) {
+ const { getMessage } = useMessage()
+ const { get, promisePost } = useAxios()
+ const { managementState } = useContext(ManagementContext)
+ const { handleEstimateCopy, state } = useEstimateController(planNo)
+
+ const { session } = useContext(SessionContext)
+
+ // recoil 물건번호
+ const objectRecoil = useRecoilValue(floorPlanObjectState)
+
+ const [saleStoreList, setSaleStoreList] = useState([]) // 판매점 리스트
+ const [favoriteStoreList, setFavoriteStoreList] = useState([]) //즐겨찾기한 판매점목록
+ const [showSaleStoreList, setShowSaleStoreList] = useState([]) //보여줄 판매점목록
+
+ const estimateRecoilState = useRecoilValue(estimateState)
+
+ const [otherSaleStoreList, setOtherSaleStoreList] = useState([])
+ const [originOtherSaleStoreList, setOriginOtherSaleStoreList] = useState([])
+
+ const [sendPlanNo, setSendPlanNo] = useState('1')
+ const [sendCharger, setSendCharger] = useState('')
+
+ // useEffect(() => {
+ // console.log(originState)
+ // }, [originState])
+
+ useEffect(() => {
+ if (state) {
+ console.log('state::::::::', state)
+ }
+ }, [state])
+ useEffect(() => {
+ let url
+ let firstList
+ let favList
+ let otherList
+ if (session.storeId === 'T01') {
+ url = `/api/object/saleStore/${session?.storeId}/firstList?userId=${session?.userId}`
+ } else {
+ if (session.storeLvl === '1') {
+ url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
+ } else {
+ url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
+ }
+ }
+
+ get({ url: url }).then((res) => {
+ if (!isEmptyArray(res)) {
+ res.map((row) => {
+ //자동완성 검색을 위한 필드명 셋팅
+ row.value = row.saleStoreId
+ row.label = row.saleStoreName
+ })
+
+ if (session.storeId === 'T01') {
+ console.log('T01:::::::::::', res)
+ } else {
+ if (session.storeLvl === '1') {
+ console.log('T01아닌 1차점', res)
+ } else {
+ console.log('1차점 아님::::::::', res)
+ }
+ }
+ }
+ })
+ }, [])
+
+ useEffect(() => {
+ if (planNo) {
+ setSendPlanNo(planNo)
+ }
+ }, [planNo])
+ return (
+
+
+
+
+
{getMessage('estimate.detail.estimateCopyPopup.title')}
+
+
+
+
+
{getMessage('estimate.detail.estimateCopyPopup.explane')}
+
+
+
+ {getMessage('estimate.detail.estimateCopyPopup.label.saleStoreId')} *
+
+ {session.storeId === 'T01' && (
+
+
+
+
+
로그인T01 선택한 1차점 아이디
+
+ )}
+ {session.storeId !== 'T01' && session.storeLvl === '1' && (
+
+
+
+
+
로그인 1차점 선택한 1차점 아이디
+
+ )}
+ {session.storeId !== 'T01' && session.storeLvl !== '1' && (
+
+
+
+
+
로그인 1차점 아님 선택한 1차점 아이디
+
+ )}
+
+
+
+ {getMessage('estimate.detail.estimateCopyPopup.label.otherSaleStoreId')} *
+
+
+
+
+
+ {getMessage('estimate.detail.estimateCopyPopup.label.receiveUser')} *
+
+
+ {
+ setSendCharger(e.target.value)
+ }}
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+}
diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx
index 4d1d1820..99694f12 100644
--- a/src/components/floor-plan/CanvasMenu.jsx
+++ b/src/components/floor-plan/CanvasMenu.jsx
@@ -36,6 +36,7 @@ import { useEstimateController } from '@/hooks/floorPlan/estimate/useEstimateCon
import { estimateState } from '@/store/floorPlanObjectAtom'
import DocDownOptionPop from '../estimate/popup/DocDownOptionPop'
import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider'
+import EstimateCopyPop from '../estimate/popup/EstimateCopyPop'
export default function CanvasMenu(props) {
const { menuNumber, setMenuNumber } = props
@@ -60,6 +61,7 @@ export default function CanvasMenu(props) {
const { handleEstimateSubmit } = useEstimateController()
const estimateRecoilState = useRecoilValue(estimateState)
const [estimatePopupOpen, setEstimatePopupOpen] = useState(false)
+ const [estimateCopyPopupOpen, setEstimateCopyPopupOpen] = useState(false)
const { getMessage } = useMessage()
const { currentCanvasPlan, saveCanvas } = usePlan()
@@ -163,19 +165,6 @@ export default function CanvasMenu(props) {
})
}
- /**
- * 견적서 복사버튼
- * (견적서 번호(estimateRecoilState.docNo)가 생성된 이후 버튼 활성화 )
- * T01관리자 계정 및 1차판매점에게만 제공
- */
-
- const handleEstimateCopy = () => {
- //objectNo, planNo
- console.log('복사')
- console.log('물건정보+도면+견적서를 모두 복사')
- console.log('견적서 가격은 정가를 표시')
- }
-
useEffect(() => {
if (globalLocale === 'ko') {
setAppMessageState(KO)
@@ -295,10 +284,9 @@ export default function CanvasMenu(props) {
{estimateRecoilState?.docNo !== null && (sessionState.storeId === 'T01' || sessionState.storeLvl === '1') && (
{/* 견적서(menuNumber=== 5) 상세화면인경우 문서다운로드 팝업 */}
{estimatePopupOpen &&