견적서 상세
This commit is contained in:
parent
706ad9aed8
commit
3a3b32b1d1
@ -17,6 +17,8 @@ import { SessionContext } from '@/app/SessionProvider'
|
||||
import Select, { components } from 'react-select'
|
||||
import { convertNumberToPriceDecimal } from '@/util/common-utils'
|
||||
import ProductFeaturesPop from './popup/ProductFeaturesPop'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
|
||||
export default function Estimate({ params }) {
|
||||
const [itemChangeYn, setItemChangeYn] = useState(false)
|
||||
const { session } = useContext(SessionContext)
|
||||
@ -307,22 +309,25 @@ export default function Estimate({ params }) {
|
||||
//제품 삭제
|
||||
const removeItem = () => {
|
||||
const array = [...selection]
|
||||
let tempList = []
|
||||
let delList = []
|
||||
state.itemList.filter((row) => {
|
||||
array.map((row2) => {
|
||||
if (row2 === row.dispOrder) {
|
||||
tempList.push({ ...row })
|
||||
delList.push({ ...row })
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// 필터안하고 플래그로 관리하는거로 변경하기
|
||||
const result = state.itemList.filter((item) => {
|
||||
return !tempList.some((other) => other.dispOrder === item.dispOrder)
|
||||
const updateList = state.itemList.map((item) => {
|
||||
const isDeleted = delList.some((row) => item.dispOrder === row.dispOrder)
|
||||
return {
|
||||
...item,
|
||||
delFlg: isDeleted ? '1' : '0',
|
||||
}
|
||||
})
|
||||
|
||||
setState({
|
||||
itemList: result,
|
||||
itemList: updateList,
|
||||
})
|
||||
|
||||
setSelection(new Set())
|
||||
@ -331,8 +336,8 @@ export default function Estimate({ params }) {
|
||||
|
||||
useEffect(() => {
|
||||
if (itemChangeYn) {
|
||||
// console.log('아이템에 뭔가 변화가 일어났어', itemChangeYn)
|
||||
// console.log('아이템상태가져오기::::::::::', state.itemList)
|
||||
console.log('아이템에 뭔가 변화가 일어났어', itemChangeYn)
|
||||
console.log('아이템상태가져오기::::::::::', state.itemList)
|
||||
}
|
||||
|
||||
//다시 false로 돌리기 여기서할지 가격정보 변경하는거 끝나고할지..
|
||||
@ -527,8 +532,8 @@ export default function Estimate({ params }) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={`form-flex-wrap ${style}`}>
|
||||
<div className="input-wrap mr5" style={{ width: '610px' }}>
|
||||
<div className={`form-flex-wrap ${style}`} key={uuidv4()}>
|
||||
<div className="input-wrap mr5" style={{ width: '610px' }} key={`roof${index}`}>
|
||||
<input type="text" className="input-light" defaultValue={roofList} readOnly />
|
||||
</div>
|
||||
<div className="input-wrap" style={{ width: '200px' }}>
|
||||
@ -613,7 +618,7 @@ export default function Estimate({ params }) {
|
||||
{originFiles.length > 0 &&
|
||||
originFiles.map((originFile) => {
|
||||
return (
|
||||
<li className="file-item">
|
||||
<li className="file-item" key={uuidv4()}>
|
||||
<span onClick={() => handleEstimateFileDownload(originFile)}>
|
||||
{originFile.faileName}
|
||||
<button
|
||||
@ -657,6 +662,7 @@ export default function Estimate({ params }) {
|
||||
specialNoteList.map((row) => {
|
||||
return (
|
||||
<div
|
||||
key={uuidv4()}
|
||||
className="special-note-check-item"
|
||||
onClick={(event) => {
|
||||
settingShowContent(row.code, event)
|
||||
@ -686,7 +692,7 @@ export default function Estimate({ params }) {
|
||||
{specialNoteList.map((row) => {
|
||||
if (row.code === showContentCode) {
|
||||
return (
|
||||
<dl>
|
||||
<dl key={uuidv4()}>
|
||||
<dt>{row.codeNm}</dt>
|
||||
<dd dangerouslySetInnerHTML={{ __html: row.remarks }}></dd>
|
||||
</dl>
|
||||
@ -710,24 +716,24 @@ export default function Estimate({ params }) {
|
||||
<div className="esimate-wrap">
|
||||
<div className="estimate-list-wrap one">
|
||||
<div className="estimate-box">
|
||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.totPcs')}</div>
|
||||
<div className="estimate-name blue">74</div>
|
||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.totAmount')}</div>
|
||||
<div className="estimate-name blue">{convertNumberToPriceDecimal(state?.totAmount)}</div>
|
||||
</div>
|
||||
<div className="estimate-box">
|
||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.vol')}</div>
|
||||
<div className="estimate-name blue">8300</div>
|
||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.totVolKw')}</div>
|
||||
<div className="estimate-name blue">{convertNumberToPriceDecimal(state?.totVolKw)}</div>
|
||||
</div>
|
||||
<div className="estimate-box">
|
||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.netAmt')}</div>
|
||||
<div className="estimate-name blue">6,798,900</div>
|
||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.supplyPrice')}</div>
|
||||
<div className="estimate-name blue">{convertNumberToPriceDecimal(state?.supplyPrice)}</div>
|
||||
</div>
|
||||
<div className="estimate-box">
|
||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.vat')}</div>
|
||||
<div className="estimate-name blue">679,890</div>
|
||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.vatPrice')}</div>
|
||||
<div className="estimate-name blue">{convertNumberToPriceDecimal(state?.vatPrice)}</div>
|
||||
</div>
|
||||
<div className="estimate-box">
|
||||
<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>
|
||||
@ -769,6 +775,7 @@ export default function Estimate({ params }) {
|
||||
<div className="select-wrap">
|
||||
{session?.storeLvl === '1' ? (
|
||||
<select
|
||||
key={uuidv4()}
|
||||
className="select-light"
|
||||
onChange={(e) => {
|
||||
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>)}
|
||||
</select>
|
||||
) : (
|
||||
<select className="select-light">
|
||||
<select key={uuidv4()} className="select-light">
|
||||
<option value="UNIT_PRICE">{getMessage('estimate.detail.header.unitPrice')}</option>
|
||||
</select>
|
||||
)}
|
||||
@ -857,7 +864,7 @@ export default function Estimate({ params }) {
|
||||
{state?.itemList.length > 0 &&
|
||||
state.itemList.map((item, index) => {
|
||||
return (
|
||||
<tr key={index}>
|
||||
<tr key={uuidv4()}>
|
||||
<td className="al-c">
|
||||
<div className="d-check-box light no-text">
|
||||
<input
|
||||
|
||||
@ -831,10 +831,10 @@
|
||||
"estimate.detail.header.fileList2": "添付ファイル一覧",
|
||||
"estimate.detail.header.specialEstimate": "見積もりの具体的な",
|
||||
"estimate.detail.header.specialEstimateProductInfo": "製品情報",
|
||||
"estimate.detail.sepcialEstimateProductInfo.totPcs": "数量 (PCS)",
|
||||
"estimate.detail.sepcialEstimateProductInfo.vol": "容量 (Kw)",
|
||||
"estimate.detail.sepcialEstimateProductInfo.netAmt": "供給価格",
|
||||
"estimate.detail.sepcialEstimateProductInfo.vat": "付加価値税 (10%)",
|
||||
"estimate.detail.sepcialEstimateProductInfo.totAmount": "数量 (PCS)",
|
||||
"estimate.detail.sepcialEstimateProductInfo.totVolKw": "容量 (Kw)",
|
||||
"estimate.detail.sepcialEstimateProductInfo.supplyPrice": "供給価格",
|
||||
"estimate.detail.sepcialEstimateProductInfo.vatPrice": "付加価値税 (10%)",
|
||||
"estimate.detail.sepcialEstimateProductInfo.totPrice": "総額",
|
||||
"estimate.detail.sepcialEstimateProductInfo.pkgUnitPrice": "住宅PKG単価 (W)",
|
||||
"estimate.detail.sepcialEstimateProductInfo.pkgWeight": "PKG容量 (Kw)",
|
||||
|
||||
@ -841,10 +841,10 @@
|
||||
"estimate.detail.header.fileList2": "첨부파일 목록",
|
||||
"estimate.detail.header.specialEstimate": "견적특이사항",
|
||||
"estimate.detail.header.specialEstimateProductInfo": "제품정보",
|
||||
"estimate.detail.sepcialEstimateProductInfo.totPcs": "수량 (PCS)",
|
||||
"estimate.detail.sepcialEstimateProductInfo.vol": "용량 (Kw)",
|
||||
"estimate.detail.sepcialEstimateProductInfo.netAmt": "공급가액",
|
||||
"estimate.detail.sepcialEstimateProductInfo.vat": "부가세 (10%)",
|
||||
"estimate.detail.sepcialEstimateProductInfo.totAmount": "수량 (PCS)",
|
||||
"estimate.detail.sepcialEstimateProductInfo.totVolKw": "용량 (Kw)",
|
||||
"estimate.detail.sepcialEstimateProductInfo.supplyPrice": "공급가액",
|
||||
"estimate.detail.sepcialEstimateProductInfo.vatPrice": "부가세 (10%)",
|
||||
"estimate.detail.sepcialEstimateProductInfo.totPrice": "총액",
|
||||
"estimate.detail.sepcialEstimateProductInfo.pkgUnitPrice": "주택PKG단가 (W)",
|
||||
"estimate.detail.sepcialEstimateProductInfo.pkgWeight": "PKG 용량 (Kw)",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user