Merge branch 'dev' into dev-yj
This commit is contained in:
commit
d61d67db91
@ -16,6 +16,7 @@ import { useEstimateController } from '@/hooks/floorPlan/estimate/useEstimateCon
|
|||||||
import { SessionContext } from '@/app/SessionProvider'
|
import { SessionContext } from '@/app/SessionProvider'
|
||||||
import Select, { components } from 'react-select'
|
import Select, { components } from 'react-select'
|
||||||
import { convertNumberToPriceDecimal } from '@/util/common-utils'
|
import { convertNumberToPriceDecimal } from '@/util/common-utils'
|
||||||
|
import ProductFeaturesPop from './popup/ProductFeaturesPop'
|
||||||
|
|
||||||
export default function Estimate({ params }) {
|
export default function Estimate({ params }) {
|
||||||
const { session } = useContext(SessionContext)
|
const { session } = useContext(SessionContext)
|
||||||
@ -27,6 +28,9 @@ export default function Estimate({ params }) {
|
|||||||
|
|
||||||
const [showContentCode, setShowContentCode] = useState('ATTR001')
|
const [showContentCode, setShowContentCode] = useState('ATTR001')
|
||||||
|
|
||||||
|
const [productFeaturesPopupOpen, setProductFeaturesPopupOpen] = useState(false) //견적특이사항 팝업
|
||||||
|
const [showProductFeatureData, setShowProductFeatureData] = useState([]) //팝업에 보여줄 견적특이사항 데이터
|
||||||
|
|
||||||
//견적특이사항 접고 펼치기
|
//견적특이사항 접고 펼치기
|
||||||
const [hidden, setHidden] = useState(false)
|
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 (
|
return (
|
||||||
<div className="sub-content estimate">
|
<div className="sub-content estimate">
|
||||||
<div className="sub-content-inner">
|
<div className="sub-content-inner">
|
||||||
@ -549,32 +559,33 @@ export default function Estimate({ params }) {
|
|||||||
<div className="estimate-check-inner">
|
<div className="estimate-check-inner">
|
||||||
<div className="special-note-check-wrap">
|
<div className="special-note-check-wrap">
|
||||||
{/* SpecialNoteList반복문 */}
|
{/* SpecialNoteList반복문 */}
|
||||||
{specialNoteList.map((row) => {
|
{specialNoteList.length > 0 &&
|
||||||
return (
|
specialNoteList.map((row) => {
|
||||||
<div
|
return (
|
||||||
className="special-note-check-item"
|
<div
|
||||||
onClick={(event) => {
|
className="special-note-check-item"
|
||||||
settingShowContent(row.code, event)
|
onClick={(event) => {
|
||||||
}}
|
settingShowContent(row.code, event)
|
||||||
>
|
}}
|
||||||
<div className="d-check-box light">
|
>
|
||||||
<input
|
<div className="d-check-box light">
|
||||||
type="checkbox"
|
<input
|
||||||
id={row.code}
|
type="checkbox"
|
||||||
checked={!!row.text}
|
id={row.code}
|
||||||
disabled={row.code === 'ATTR001' ? true : false}
|
checked={!!row.text}
|
||||||
onChange={(event) => {
|
disabled={row.code === 'ATTR001' ? true : false}
|
||||||
setSpecialNoteList((specialNote) =>
|
onChange={(event) => {
|
||||||
specialNote.map((temp) => (temp.code === row.code ? { ...temp, text: !temp.text } : temp)),
|
setSpecialNoteList((specialNote) =>
|
||||||
)
|
specialNote.map((temp) => (temp.code === row.code ? { ...temp, text: !temp.text } : temp)),
|
||||||
settingShowContent(row.code, event)
|
)
|
||||||
}}
|
settingShowContent(row.code, event)
|
||||||
/>
|
}}
|
||||||
<label htmlFor={row.code}>{row.codeNm}</label>
|
/>
|
||||||
|
<label htmlFor={row.code}>{row.codeNm}</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)
|
||||||
)
|
})}
|
||||||
})}
|
|
||||||
</div>
|
</div>
|
||||||
{/* 견적특이사항 선택한 내용 영역시작 */}
|
{/* 견적특이사항 선택한 내용 영역시작 */}
|
||||||
<div className="calculation-estimate">
|
<div className="calculation-estimate">
|
||||||
@ -706,13 +717,13 @@ export default function Estimate({ params }) {
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div className="product-edit-btn">
|
<div className="product-edit-btn">
|
||||||
<button className="btn-origin navy mr5" type="submit">
|
<button className="btn-origin navy mr5" type="button" onClick={() => addItemTest()}>
|
||||||
<span className="plus"></span>
|
<span className="plus"></span>
|
||||||
{getMessage('estimate.detail.showPrice.btn2')}
|
{getMessage('estimate.detail.showPrice.addItem')}
|
||||||
</button>
|
</button>
|
||||||
<button className="btn-origin grey">
|
<button className="btn-origin grey">
|
||||||
<span className="minus"></span>
|
<span className="minus"></span>
|
||||||
{getMessage('estimate.detail.showPrice.btn3')}
|
{getMessage('estimate.detail.showPrice.delItem')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -763,7 +774,21 @@ export default function Estimate({ params }) {
|
|||||||
<td>
|
<td>
|
||||||
<div className="form-flex-wrap">
|
<div className="form-flex-wrap">
|
||||||
<div className="select-wrap mr5">
|
<div className="select-wrap mr5">
|
||||||
<Select />
|
<Select
|
||||||
|
id=""
|
||||||
|
instanceId=""
|
||||||
|
className="react-select-custom"
|
||||||
|
classNamePrefix="custom"
|
||||||
|
placeholder="Select"
|
||||||
|
options={[]}
|
||||||
|
// getOptionLabel={(x) => x.saleStoreName}
|
||||||
|
// getOptionValue={(x) => x.saleStoreId}
|
||||||
|
isClearable={true}
|
||||||
|
isDisabled={false}
|
||||||
|
// value={saleStoreList.filter(function (option) {
|
||||||
|
// return option.saleStoreId === selOptions
|
||||||
|
// })}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
{item?.itemChangeFlg === '1' && (
|
{item?.itemChangeFlg === '1' && (
|
||||||
<div className="btn-area">
|
<div className="btn-area">
|
||||||
@ -782,7 +807,8 @@ export default function Estimate({ params }) {
|
|||||||
type="button"
|
type="button"
|
||||||
className="grid-tip"
|
className="grid-tip"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
console.log('제품특이사항 모달팝업:::::::::', item?.specialNoteCd)
|
setProductFeaturesPopupOpen(true)
|
||||||
|
setShowProductFeatureData(item?.specialNoteCd)
|
||||||
}}
|
}}
|
||||||
></button>
|
></button>
|
||||||
)}
|
)}
|
||||||
@ -809,49 +835,6 @@ export default function Estimate({ params }) {
|
|||||||
</tr>
|
</tr>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
{/* <tr>
|
|
||||||
<td className="al-c">
|
|
||||||
<div className="d-check-box light no-text">
|
|
||||||
<input type="checkbox" id="ch98" />
|
|
||||||
<label htmlFor="ch98"></label>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td className="al-r">100</td>
|
|
||||||
<td>
|
|
||||||
<div className="form-flex-wrap">
|
|
||||||
<div className="select-wrap mr5"></div>
|
|
||||||
<div className="btn-area">
|
|
||||||
<span className="tb_ico change_check"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<div className="form-flex-wrap">
|
|
||||||
<div className="name">HNW-MC4-CHN30</div>
|
|
||||||
<div className="icon-wrap">
|
|
||||||
<span className="tb_ico file_check"></span>
|
|
||||||
<button className="grid-tip"></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<div className="input-wrap" style={{ width: '100%' }}>
|
|
||||||
<input type="text" className="input-light al-r" defaultValue={'20'} />
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td>セット</td>
|
|
||||||
<td>
|
|
||||||
<div className="form-flex-wrap">
|
|
||||||
<div className="input-wrap mr5">
|
|
||||||
<input type="text" className="input-light al-r" defaultValue={'278,050'} />
|
|
||||||
</div>
|
|
||||||
<div className="btn-area">
|
|
||||||
<span className="tb_ico open_check"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td className="al-r">5,561,000</td>
|
|
||||||
</tr> */}
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@ -861,6 +844,13 @@ export default function Estimate({ params }) {
|
|||||||
</div>
|
</div>
|
||||||
{/* 기본정보끝 */}
|
{/* 기본정보끝 */}
|
||||||
</div>
|
</div>
|
||||||
|
{productFeaturesPopupOpen && (
|
||||||
|
<ProductFeaturesPop
|
||||||
|
specialNoteList={specialNoteList}
|
||||||
|
showProductFeatureData={showProductFeatureData}
|
||||||
|
setProductFeaturesPopupOpen={setProductFeaturesPopupOpen}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
51
src/components/estimate/popup/ProductFeaturesPop.jsx
Normal file
51
src/components/estimate/popup/ProductFeaturesPop.jsx
Normal file
@ -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 (
|
||||||
|
<div className="modal-popup">
|
||||||
|
<div className="modal-dialog">
|
||||||
|
<div className="modal-content">
|
||||||
|
<div className="modal-header">
|
||||||
|
<h1 className="title">{getMessage('estimate.detail.productFeaturesPopup.title')}</h1>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="modal-close"
|
||||||
|
onClick={() => {
|
||||||
|
setProductFeaturesPopupOpen(false)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{getMessage('estimate.detail.productFeaturesPopup.close')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="modal-body">
|
||||||
|
<div className="modal-body-inner border">
|
||||||
|
<div className="calculation-estimate usemodal">
|
||||||
|
<dl>
|
||||||
|
<dt>제목</dt>
|
||||||
|
<dd>내용</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="footer-btn-wrap">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="btn-origin navy"
|
||||||
|
onClick={() => {
|
||||||
|
setProductFeaturesPopupOpen(false)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{getMessage('estimate.detail.productFeaturesPopup.close')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@ -76,27 +76,20 @@ export const useEstimateController = (planNo) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const addItem = () => {
|
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({
|
setState({
|
||||||
itemList: [
|
itemList: [
|
||||||
...state.itemList,
|
...state.itemList,
|
||||||
{
|
{
|
||||||
dispOrder: '1',
|
dispOrder: newItemDispOrder,
|
||||||
itemId: newItemId,
|
itemId: '', //제품번호
|
||||||
amount: '',
|
itemNo: '', //형명
|
||||||
fileUploadFlg: '0',
|
|
||||||
itemChangeFlg: '0',
|
|
||||||
pkgMaterialFlg: '0',
|
|
||||||
specialNoteCd: '',
|
|
||||||
itemGroup: '',
|
|
||||||
itemName: '',
|
itemName: '',
|
||||||
itemNo: '',
|
amount: '', //수량
|
||||||
moduleFlg: '',
|
unitPrice: '0',
|
||||||
pnowW: '',
|
unit: '', //단위
|
||||||
salePrice: '',
|
salePrice: '0', //단가
|
||||||
saleTotPrice: '',
|
saleTotPrice: '0', //금액(부가세별도)
|
||||||
specification: '',
|
|
||||||
unit: '',
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|||||||
@ -167,8 +167,6 @@ export function useRoofShapeSetting(id) {
|
|||||||
]
|
]
|
||||||
|
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
//기존 wallLine 삭제
|
|
||||||
|
|
||||||
let outerLines
|
let outerLines
|
||||||
let direction
|
let direction
|
||||||
|
|
||||||
@ -379,20 +377,20 @@ export function useRoofShapeSetting(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 기존 wallLine, roofBase 제거
|
// 기존 wallLine, roofBase 제거
|
||||||
canvas
|
/*canvas
|
||||||
.getObjects()
|
.getObjects()
|
||||||
.filter((obj) => obj.name === POLYGON_TYPE.WALL)
|
.filter((obj) => obj.name === POLYGON_TYPE.WALL)
|
||||||
.forEach((line) => {
|
.forEach((line) => {
|
||||||
canvas.remove(line)
|
canvas.remove(line)
|
||||||
})
|
})*/
|
||||||
|
|
||||||
canvas
|
/*canvas
|
||||||
.getObjects()
|
.getObjects()
|
||||||
.filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
.filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
||||||
.forEach((obj) => {
|
.forEach((obj) => {
|
||||||
canvas.remove(...obj.innerLines)
|
canvas.remove(...obj.innerLines)
|
||||||
canvas.remove(obj)
|
canvas.remove(obj)
|
||||||
})
|
})*/
|
||||||
|
|
||||||
const polygon = addPolygonByLines(outerLines, { name: POLYGON_TYPE.WALL, direction })
|
const polygon = addPolygonByLines(outerLines, { name: POLYGON_TYPE.WALL, direction })
|
||||||
polygon.lines = [...outerLines]
|
polygon.lines = [...outerLines]
|
||||||
@ -402,7 +400,6 @@ export function useRoofShapeSetting(id) {
|
|||||||
|
|
||||||
canvas?.renderAll()
|
canvas?.renderAll()
|
||||||
roof.drawHelpLine()
|
roof.drawHelpLine()
|
||||||
// setShowRoofShapeSettingModal(false)
|
|
||||||
isFixRef.current = true
|
isFixRef.current = true
|
||||||
closePopup(id)
|
closePopup(id)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -847,8 +847,8 @@
|
|||||||
"estimate.detail.showPrice.description2": "追加, 変更資材",
|
"estimate.detail.showPrice.description2": "追加, 変更資材",
|
||||||
"estimate.detail.showPrice.description3": "添付必須",
|
"estimate.detail.showPrice.description3": "添付必須",
|
||||||
"estimate.detail.showPrice.description4": "クリックして製品の特異性を確認する",
|
"estimate.detail.showPrice.description4": "クリックして製品の特異性を確認する",
|
||||||
"estimate.detail.showPrice.btn2": "製品を追加",
|
"estimate.detail.showPrice.addItem": "製品を追加",
|
||||||
"estimate.detail.showPrice.btn3": "製品削除",
|
"estimate.detail.showPrice.delItem": "製品削除",
|
||||||
"estimate.detail.itemTableHeader.dispOrder": "アイテム",
|
"estimate.detail.itemTableHeader.dispOrder": "アイテム",
|
||||||
"estimate.detail.itemTableHeader.itemId": "品番",
|
"estimate.detail.itemTableHeader.itemId": "品番",
|
||||||
"estimate.detail.itemTableHeader.itemNo": "型板",
|
"estimate.detail.itemTableHeader.itemNo": "型板",
|
||||||
@ -874,6 +874,8 @@
|
|||||||
"estimate.detail.docPopup.schDrawingFlg.schDrawingFlg1": "含まない",
|
"estimate.detail.docPopup.schDrawingFlg.schDrawingFlg1": "含まない",
|
||||||
"estimate.detail.docPopup.close": "閉じる",
|
"estimate.detail.docPopup.close": "閉じる",
|
||||||
"estimate.detail.docPopup.docDownload": "文書のダウンロード",
|
"estimate.detail.docPopup.docDownload": "文書のダウンロード",
|
||||||
|
"estimate.detail.productFeaturesPopup.title": "製品特異事項",
|
||||||
|
"estimate.detail.productFeaturesPopup.close": "閉じる",
|
||||||
"estimate.detail.save.alertMsg": "保存されている見積書で製品を変更した場合、図面や回路には反映されません.",
|
"estimate.detail.save.alertMsg": "保存されている見積書で製品を変更した場合、図面や回路には反映されません.",
|
||||||
"estimate.detail.save.requiredMsg": "ファイル添付が必須のアイテムがあります。ファイルを添付するか、後日添付をチェックしてください.",
|
"estimate.detail.save.requiredMsg": "ファイル添付が必須のアイテムがあります。ファイルを添付するか、後日添付をチェックしてください.",
|
||||||
"estimate.detail.reset.confirmMsg": "保存した見積書情報が初期化され、図面情報が反映されます。本当に初期化しますか?",
|
"estimate.detail.reset.confirmMsg": "保存した見積書情報が初期化され、図面情報が反映されます。本当に初期化しますか?",
|
||||||
|
|||||||
@ -857,8 +857,8 @@
|
|||||||
"estimate.detail.showPrice.description2": "추가, 변경 자재",
|
"estimate.detail.showPrice.description2": "추가, 변경 자재",
|
||||||
"estimate.detail.showPrice.description3": "첨부필수",
|
"estimate.detail.showPrice.description3": "첨부필수",
|
||||||
"estimate.detail.showPrice.description4": "클릭하여 제품 특이사항 확인",
|
"estimate.detail.showPrice.description4": "클릭하여 제품 특이사항 확인",
|
||||||
"estimate.detail.showPrice.btn2": "제품추가",
|
"estimate.detail.showPrice.addItem": "제품추가",
|
||||||
"estimate.detail.showPrice.btn3": "제품삭제",
|
"estimate.detail.showPrice.delItem": "제품삭제",
|
||||||
"estimate.detail.itemTableHeader.dispOrder": "Item",
|
"estimate.detail.itemTableHeader.dispOrder": "Item",
|
||||||
"estimate.detail.itemTableHeader.itemId": "품번",
|
"estimate.detail.itemTableHeader.itemId": "품번",
|
||||||
"estimate.detail.itemTableHeader.itemNo": "형명",
|
"estimate.detail.itemTableHeader.itemNo": "형명",
|
||||||
@ -884,6 +884,8 @@
|
|||||||
"estimate.detail.docPopup.schDrawingFlg.schDrawingFlg1": "미포함",
|
"estimate.detail.docPopup.schDrawingFlg.schDrawingFlg1": "미포함",
|
||||||
"estimate.detail.docPopup.close": "닫기",
|
"estimate.detail.docPopup.close": "닫기",
|
||||||
"estimate.detail.docPopup.docDownload": "문서 다운로드",
|
"estimate.detail.docPopup.docDownload": "문서 다운로드",
|
||||||
|
"estimate.detail.productFeaturesPopup.title": "제품특이사항",
|
||||||
|
"estimate.detail.productFeaturesPopup.close": "닫기",
|
||||||
"estimate.detail.save.alertMsg": "저장되었습니다. 견적서에서 제품을 변경할 경우, 도면 및 회로에 반영되지 않습니다.",
|
"estimate.detail.save.alertMsg": "저장되었습니다. 견적서에서 제품을 변경할 경우, 도면 및 회로에 반영되지 않습니다.",
|
||||||
"estimate.detail.save.requiredMsg": "파일첨부가 필수인 아이템이 있습니다. 파일을 첨부하거나 후일첨부를 체크해주십시오.",
|
"estimate.detail.save.requiredMsg": "파일첨부가 필수인 아이템이 있습니다. 파일을 첨부하거나 후일첨부를 체크해주십시오.",
|
||||||
"estimate.detail.reset.confirmMsg": "저장된 견적서 정보가 초기화되고, 도면정보가 반영됩니다. 정말로 초기화 하시겠습니까?",
|
"estimate.detail.reset.confirmMsg": "저장된 견적서 정보가 초기화되고, 도면정보가 반영됩니다. 정말로 초기화 하시겠습니까?",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user