견적서 상세에서 CanvasMenu.jsx 버튼 정의
This commit is contained in:
parent
863faac937
commit
23681ee3d7
@ -33,6 +33,7 @@ import useMenu from '@/hooks/common/useMenu'
|
|||||||
import { MENU } from '@/common/common'
|
import { MENU } from '@/common/common'
|
||||||
|
|
||||||
import { useEstimateController } from '@/hooks/floorPlan/estimate/useEstimateController'
|
import { useEstimateController } from '@/hooks/floorPlan/estimate/useEstimateController'
|
||||||
|
import { estimateState } from '@/store/floorPlanObjectAtom'
|
||||||
|
|
||||||
export default function CanvasMenu(props) {
|
export default function CanvasMenu(props) {
|
||||||
const { menuNumber, setMenuNumber } = props
|
const { menuNumber, setMenuNumber } = props
|
||||||
@ -54,6 +55,7 @@ export default function CanvasMenu(props) {
|
|||||||
const { handleZoomClear, handleZoom } = useCanvasEvent()
|
const { handleZoomClear, handleZoom } = useCanvasEvent()
|
||||||
const { handleMenu } = useMenu()
|
const { handleMenu } = useMenu()
|
||||||
const { handleEstimateSubmit } = useEstimateController()
|
const { handleEstimateSubmit } = useEstimateController()
|
||||||
|
const estimateRecoilState = useRecoilValue(estimateState)
|
||||||
|
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { currentCanvasPlan, saveCanvas } = usePlan()
|
const { currentCanvasPlan, saveCanvas } = usePlan()
|
||||||
@ -138,6 +140,38 @@ export default function CanvasMenu(props) {
|
|||||||
addPopup(id, 1, <SettingModal01 id={id} />, true)
|
addPopup(id, 1, <SettingModal01 id={id} />, 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(() => {
|
useEffect(() => {
|
||||||
if (globalLocale === 'ko') {
|
if (globalLocale === 'ko') {
|
||||||
setAppMessageState(KO)
|
setAppMessageState(KO)
|
||||||
@ -228,7 +262,7 @@ export default function CanvasMenu(props) {
|
|||||||
{menuNumber === 5 && (
|
{menuNumber === 5 && (
|
||||||
<>
|
<>
|
||||||
<div className="ico-btn-from">
|
<div className="ico-btn-from">
|
||||||
<button className="btn-frame gray ico-flx act">
|
<button className="btn-frame gray ico-flx">
|
||||||
<span className="ico ico01"></span>
|
<span className="ico ico01"></span>
|
||||||
<span>{getMessage('plan.menu.estimate.docDown')}</span>
|
<span>{getMessage('plan.menu.estimate.docDown')}</span>
|
||||||
</button>
|
</button>
|
||||||
@ -236,11 +270,24 @@ export default function CanvasMenu(props) {
|
|||||||
<span className="ico ico02"></span>
|
<span className="ico ico02"></span>
|
||||||
<span>{getMessage('plan.menu.estimate.save')}</span>
|
<span>{getMessage('plan.menu.estimate.save')}</span>
|
||||||
</button>
|
</button>
|
||||||
<button className="btn-frame gray ico-flx">
|
{/* {estimateRecoilState?.docNo != null && ( */}
|
||||||
|
<button
|
||||||
|
className="btn-frame gray ico-flx"
|
||||||
|
onClick={() => {
|
||||||
|
handleEstimateReset()
|
||||||
|
}}
|
||||||
|
>
|
||||||
<span className="ico ico03"></span>
|
<span className="ico ico03"></span>
|
||||||
<span>{getMessage('plan.menu.estimate.reset')}</span>
|
<span>{getMessage('plan.menu.estimate.reset')}</span>
|
||||||
</button>
|
</button>
|
||||||
<button className="btn-frame gray ico-flx">
|
{/* )} */}
|
||||||
|
|
||||||
|
<button
|
||||||
|
className="btn-frame gray ico-flx"
|
||||||
|
onClick={() => {
|
||||||
|
handleEstimateCopy()
|
||||||
|
}}
|
||||||
|
>
|
||||||
<span className="ico ico04"></span>
|
<span className="ico ico04"></span>
|
||||||
<span>{getMessage('plan.menu.estimate.copy')}</span>
|
<span>{getMessage('plan.menu.estimate.copy')}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -135,7 +135,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
estimateData.itemList.map((row) => {
|
estimateData.itemList.map((row) => {
|
||||||
if (row.fileUploadFlg === '1') {
|
if (row.fileUploadFlg === '1') {
|
||||||
if (estimateData.fileFlg === '0') {
|
if (estimateData.fileFlg === '0') {
|
||||||
alert(getMessage('estimate.detail.save.alertMsg'))
|
alert(getMessage('estimate.detail.save.requiredMsg'))
|
||||||
flag = false
|
flag = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -166,6 +166,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
url: ESTIMATE_API_ENDPOINT,
|
url: ESTIMATE_API_ENDPOINT,
|
||||||
data: estimateData,
|
data: estimateData,
|
||||||
})
|
})
|
||||||
|
alert(getMessage('estimate.detail.save.alertMsg'))
|
||||||
return result
|
return result
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to submit estimate:', error)
|
console.error('Failed to submit estimate:', error)
|
||||||
|
|||||||
@ -850,5 +850,7 @@
|
|||||||
"estimate.detail.itemTableHeader.col5": "単位",
|
"estimate.detail.itemTableHeader.col5": "単位",
|
||||||
"estimate.detail.itemTableHeader.col6": "単価",
|
"estimate.detail.itemTableHeader.col6": "単価",
|
||||||
"estimate.detail.itemTableHeader.col7": "金額 (税別別)",
|
"estimate.detail.itemTableHeader.col7": "金額 (税別別)",
|
||||||
"estimate.detail.save.alertMsg": "ファイル添付が必須のアイテムがあります。ファイルを添付するか、後日添付をチェックしてください."
|
"estimate.detail.save.alertMsg": "保存されている見積書で製品を変更した場合、図面や回路には反映されません.",
|
||||||
|
"estimate.detail.save.requiredMsg": "ファイル添付が必須のアイテムがあります。ファイルを添付するか、後日添付をチェックしてください.",
|
||||||
|
"estimate.detail.reset.confirmMsg": "保存した見積書情報が初期化され、図面情報が反映されます。本当に初期化しますか?"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -856,5 +856,7 @@
|
|||||||
"estimate.detail.itemTableHeader.col5": "단위",
|
"estimate.detail.itemTableHeader.col5": "단위",
|
||||||
"estimate.detail.itemTableHeader.col6": "단가",
|
"estimate.detail.itemTableHeader.col6": "단가",
|
||||||
"estimate.detail.itemTableHeader.col7": "금액(부가세별도)",
|
"estimate.detail.itemTableHeader.col7": "금액(부가세별도)",
|
||||||
"estimate.detail.save.alertMsg": "파일첨부가 필수인 아이템이 있습니다. 파일을 첨부하거나 후일첨부를 체크해주십시오."
|
"estimate.detail.save.alertMsg": "저장되었습니다. 견적서에서 제품을 변경할 경우, 도면 및 회로에 반영되지 않습니다.",
|
||||||
|
"estimate.detail.save.requiredMsg": "파일첨부가 필수인 아이템이 있습니다. 파일을 첨부하거나 후일첨부를 체크해주십시오.",
|
||||||
|
"estimate.detail.reset.confirmMsg": "저장된 견적서 정보가 초기화되고, 도면정보가 반영됩니다. 정말로 초기화 하시겠습니까?"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user