Merge branch 'dev' into dev-yj

This commit is contained in:
yjnoh 2024-11-11 10:19:59 +09:00
commit d61d67db91
6 changed files with 135 additions and 100 deletions

View File

@ -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 (
<div className="sub-content estimate">
<div className="sub-content-inner">
@ -549,32 +559,33 @@ export default function Estimate({ params }) {
<div className="estimate-check-inner">
<div className="special-note-check-wrap">
{/* SpecialNoteList반복문 */}
{specialNoteList.map((row) => {
return (
<div
className="special-note-check-item"
onClick={(event) => {
settingShowContent(row.code, event)
}}
>
<div className="d-check-box light">
<input
type="checkbox"
id={row.code}
checked={!!row.text}
disabled={row.code === 'ATTR001' ? true : false}
onChange={(event) => {
setSpecialNoteList((specialNote) =>
specialNote.map((temp) => (temp.code === row.code ? { ...temp, text: !temp.text } : temp)),
)
settingShowContent(row.code, event)
}}
/>
<label htmlFor={row.code}>{row.codeNm}</label>
{specialNoteList.length > 0 &&
specialNoteList.map((row) => {
return (
<div
className="special-note-check-item"
onClick={(event) => {
settingShowContent(row.code, event)
}}
>
<div className="d-check-box light">
<input
type="checkbox"
id={row.code}
checked={!!row.text}
disabled={row.code === 'ATTR001' ? true : false}
onChange={(event) => {
setSpecialNoteList((specialNote) =>
specialNote.map((temp) => (temp.code === row.code ? { ...temp, text: !temp.text } : temp)),
)
settingShowContent(row.code, event)
}}
/>
<label htmlFor={row.code}>{row.codeNm}</label>
</div>
</div>
</div>
)
})}
)
})}
</div>
{/* 견적특이사항 선택한 내용 영역시작 */}
<div className="calculation-estimate">
@ -706,13 +717,13 @@ export default function Estimate({ params }) {
</li>
</ul>
<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>
{getMessage('estimate.detail.showPrice.btn2')}
{getMessage('estimate.detail.showPrice.addItem')}
</button>
<button className="btn-origin grey">
<span className="minus"></span>
{getMessage('estimate.detail.showPrice.btn3')}
{getMessage('estimate.detail.showPrice.delItem')}
</button>
</div>
</div>
@ -763,7 +774,21 @@ export default function Estimate({ params }) {
<td>
<div className="form-flex-wrap">
<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>
{item?.itemChangeFlg === '1' && (
<div className="btn-area">
@ -782,7 +807,8 @@ export default function Estimate({ params }) {
type="button"
className="grid-tip"
onClick={() => {
console.log('제품특이사항 모달팝업:::::::::', item?.specialNoteCd)
setProductFeaturesPopupOpen(true)
setShowProductFeatureData(item?.specialNoteCd)
}}
></button>
)}
@ -809,49 +835,6 @@ export default function Estimate({ params }) {
</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>
</table>
</div>
@ -861,6 +844,13 @@ export default function Estimate({ params }) {
</div>
{/* 기본정보끝 */}
</div>
{productFeaturesPopupOpen && (
<ProductFeaturesPop
specialNoteList={specialNoteList}
showProductFeatureData={showProductFeatureData}
setProductFeaturesPopupOpen={setProductFeaturesPopupOpen}
/>
)}
</div>
)
}

View 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>
)
}

View File

@ -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', //금액(부가세별도)
},
],
})

View File

@ -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)
}

View File

@ -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": "保存した見積書情報が初期化され、図面情報が反映されます。本当に初期化しますか?",

View File

@ -857,8 +857,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": "형명",
@ -884,6 +884,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": "저장된 견적서 정보가 초기화되고, 도면정보가 반영됩니다. 정말로 초기화 하시겠습니까?",