견적서 상세

This commit is contained in:
basssy 2024-11-14 15:38:17 +09:00
parent 706ad9aed8
commit 3a3b32b1d1
3 changed files with 38 additions and 31 deletions

View File

@ -17,6 +17,8 @@ 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' import ProductFeaturesPop from './popup/ProductFeaturesPop'
import { v4 as uuidv4 } from 'uuid'
export default function Estimate({ params }) { export default function Estimate({ params }) {
const [itemChangeYn, setItemChangeYn] = useState(false) const [itemChangeYn, setItemChangeYn] = useState(false)
const { session } = useContext(SessionContext) const { session } = useContext(SessionContext)
@ -307,22 +309,25 @@ export default function Estimate({ params }) {
// //
const removeItem = () => { const removeItem = () => {
const array = [...selection] const array = [...selection]
let tempList = [] let delList = []
state.itemList.filter((row) => { state.itemList.filter((row) => {
array.map((row2) => { array.map((row2) => {
if (row2 === row.dispOrder) { if (row2 === row.dispOrder) {
tempList.push({ ...row }) delList.push({ ...row })
} }
}) })
}) })
// const updateList = state.itemList.map((item) => {
const result = state.itemList.filter((item) => { const isDeleted = delList.some((row) => item.dispOrder === row.dispOrder)
return !tempList.some((other) => other.dispOrder === item.dispOrder) return {
...item,
delFlg: isDeleted ? '1' : '0',
}
}) })
setState({ setState({
itemList: result, itemList: updateList,
}) })
setSelection(new Set()) setSelection(new Set())
@ -331,8 +336,8 @@ export default function Estimate({ params }) {
useEffect(() => { useEffect(() => {
if (itemChangeYn) { if (itemChangeYn) {
// console.log(' ', itemChangeYn) console.log('아이템에 뭔가 변화가 일어났어', itemChangeYn)
// console.log('::::::::::', state.itemList) console.log('아이템상태가져오기::::::::::', state.itemList)
} }
// false .. // false ..
@ -527,8 +532,8 @@ export default function Estimate({ params }) {
return ( return (
<> <>
<div className={`form-flex-wrap ${style}`}> <div className={`form-flex-wrap ${style}`} key={uuidv4()}>
<div className="input-wrap mr5" style={{ width: '610px' }}> <div className="input-wrap mr5" style={{ width: '610px' }} key={`roof${index}`}>
<input type="text" className="input-light" defaultValue={roofList} readOnly /> <input type="text" className="input-light" defaultValue={roofList} readOnly />
</div> </div>
<div className="input-wrap" style={{ width: '200px' }}> <div className="input-wrap" style={{ width: '200px' }}>
@ -613,7 +618,7 @@ export default function Estimate({ params }) {
{originFiles.length > 0 && {originFiles.length > 0 &&
originFiles.map((originFile) => { originFiles.map((originFile) => {
return ( return (
<li className="file-item"> <li className="file-item" key={uuidv4()}>
<span onClick={() => handleEstimateFileDownload(originFile)}> <span onClick={() => handleEstimateFileDownload(originFile)}>
{originFile.faileName} {originFile.faileName}
<button <button
@ -657,6 +662,7 @@ export default function Estimate({ params }) {
specialNoteList.map((row) => { specialNoteList.map((row) => {
return ( return (
<div <div
key={uuidv4()}
className="special-note-check-item" className="special-note-check-item"
onClick={(event) => { onClick={(event) => {
settingShowContent(row.code, event) settingShowContent(row.code, event)
@ -686,7 +692,7 @@ export default function Estimate({ params }) {
{specialNoteList.map((row) => { {specialNoteList.map((row) => {
if (row.code === showContentCode) { if (row.code === showContentCode) {
return ( return (
<dl> <dl key={uuidv4()}>
<dt>{row.codeNm}</dt> <dt>{row.codeNm}</dt>
<dd dangerouslySetInnerHTML={{ __html: row.remarks }}></dd> <dd dangerouslySetInnerHTML={{ __html: row.remarks }}></dd>
</dl> </dl>
@ -710,24 +716,24 @@ export default function Estimate({ params }) {
<div className="esimate-wrap"> <div className="esimate-wrap">
<div className="estimate-list-wrap one"> <div className="estimate-list-wrap one">
<div className="estimate-box"> <div className="estimate-box">
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.totPcs')}</div> <div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.totAmount')}</div>
<div className="estimate-name blue">74</div> <div className="estimate-name blue">{convertNumberToPriceDecimal(state?.totAmount)}</div>
</div> </div>
<div className="estimate-box"> <div className="estimate-box">
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.vol')}</div> <div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.totVolKw')}</div>
<div className="estimate-name blue">8300</div> <div className="estimate-name blue">{convertNumberToPriceDecimal(state?.totVolKw)}</div>
</div> </div>
<div className="estimate-box"> <div className="estimate-box">
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.netAmt')}</div> <div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.supplyPrice')}</div>
<div className="estimate-name blue">6,798,900</div> <div className="estimate-name blue">{convertNumberToPriceDecimal(state?.supplyPrice)}</div>
</div> </div>
<div className="estimate-box"> <div className="estimate-box">
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.vat')}</div> <div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.vatPrice')}</div>
<div className="estimate-name blue">679,890</div> <div className="estimate-name blue">{convertNumberToPriceDecimal(state?.vatPrice)}</div>
</div> </div>
<div className="estimate-box"> <div className="estimate-box">
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.totPrice')}</div> <div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.totPrice')}</div>
<div className="estimate-name red">7,478,790</div> <div className="estimate-name red">{convertNumberToPriceDecimal(state?.totPrice)}</div>
</div> </div>
</div> </div>
</div> </div>
@ -769,6 +775,7 @@ export default function Estimate({ params }) {
<div className="select-wrap"> <div className="select-wrap">
{session?.storeLvl === '1' ? ( {session?.storeLvl === '1' ? (
<select <select
key={uuidv4()}
className="select-light" className="select-light"
onChange={(e) => { onChange={(e) => {
setTempPriceCd(e.target.value) setTempPriceCd(e.target.value)
@ -777,7 +784,7 @@ export default function Estimate({ params }) {
{storePriceList.length > 0 && storePriceList.map((row) => <option value={row.priceCd}>{row.priceNm}</option>)} {storePriceList.length > 0 && storePriceList.map((row) => <option value={row.priceCd}>{row.priceNm}</option>)}
</select> </select>
) : ( ) : (
<select className="select-light"> <select key={uuidv4()} className="select-light">
<option value="UNIT_PRICE">{getMessage('estimate.detail.header.unitPrice')}</option> <option value="UNIT_PRICE">{getMessage('estimate.detail.header.unitPrice')}</option>
</select> </select>
)} )}
@ -857,7 +864,7 @@ export default function Estimate({ params }) {
{state?.itemList.length > 0 && {state?.itemList.length > 0 &&
state.itemList.map((item, index) => { state.itemList.map((item, index) => {
return ( return (
<tr key={index}> <tr key={uuidv4()}>
<td className="al-c"> <td className="al-c">
<div className="d-check-box light no-text"> <div className="d-check-box light no-text">
<input <input

View File

@ -831,10 +831,10 @@
"estimate.detail.header.fileList2": "添付ファイル一覧", "estimate.detail.header.fileList2": "添付ファイル一覧",
"estimate.detail.header.specialEstimate": "見積もりの具体的な", "estimate.detail.header.specialEstimate": "見積もりの具体的な",
"estimate.detail.header.specialEstimateProductInfo": "製品情報", "estimate.detail.header.specialEstimateProductInfo": "製品情報",
"estimate.detail.sepcialEstimateProductInfo.totPcs": "数量 (PCS)", "estimate.detail.sepcialEstimateProductInfo.totAmount": "数量 (PCS)",
"estimate.detail.sepcialEstimateProductInfo.vol": "容量 (Kw)", "estimate.detail.sepcialEstimateProductInfo.totVolKw": "容量 (Kw)",
"estimate.detail.sepcialEstimateProductInfo.netAmt": "供給価格", "estimate.detail.sepcialEstimateProductInfo.supplyPrice": "供給価格",
"estimate.detail.sepcialEstimateProductInfo.vat": "付加価値税 (10%)", "estimate.detail.sepcialEstimateProductInfo.vatPrice": "付加価値税 (10%)",
"estimate.detail.sepcialEstimateProductInfo.totPrice": "総額", "estimate.detail.sepcialEstimateProductInfo.totPrice": "総額",
"estimate.detail.sepcialEstimateProductInfo.pkgUnitPrice": "住宅PKG単価 (W)", "estimate.detail.sepcialEstimateProductInfo.pkgUnitPrice": "住宅PKG単価 (W)",
"estimate.detail.sepcialEstimateProductInfo.pkgWeight": "PKG容量 (Kw)", "estimate.detail.sepcialEstimateProductInfo.pkgWeight": "PKG容量 (Kw)",

View File

@ -841,10 +841,10 @@
"estimate.detail.header.fileList2": "첨부파일 목록", "estimate.detail.header.fileList2": "첨부파일 목록",
"estimate.detail.header.specialEstimate": "견적특이사항", "estimate.detail.header.specialEstimate": "견적특이사항",
"estimate.detail.header.specialEstimateProductInfo": "제품정보", "estimate.detail.header.specialEstimateProductInfo": "제품정보",
"estimate.detail.sepcialEstimateProductInfo.totPcs": "수량 (PCS)", "estimate.detail.sepcialEstimateProductInfo.totAmount": "수량 (PCS)",
"estimate.detail.sepcialEstimateProductInfo.vol": "용량 (Kw)", "estimate.detail.sepcialEstimateProductInfo.totVolKw": "용량 (Kw)",
"estimate.detail.sepcialEstimateProductInfo.netAmt": "공급가액", "estimate.detail.sepcialEstimateProductInfo.supplyPrice": "공급가액",
"estimate.detail.sepcialEstimateProductInfo.vat": "부가세 (10)", "estimate.detail.sepcialEstimateProductInfo.vatPrice": "부가세 (10)",
"estimate.detail.sepcialEstimateProductInfo.totPrice": "총액", "estimate.detail.sepcialEstimateProductInfo.totPrice": "총액",
"estimate.detail.sepcialEstimateProductInfo.pkgUnitPrice": "주택PKG단가 (W)", "estimate.detail.sepcialEstimateProductInfo.pkgUnitPrice": "주택PKG단가 (W)",
"estimate.detail.sepcialEstimateProductInfo.pkgWeight": "PKG 용량 (Kw)", "estimate.detail.sepcialEstimateProductInfo.pkgWeight": "PKG 용량 (Kw)",