#746 견적서 케이블 관련
This commit is contained in:
parent
9104771a46
commit
53f35a5e7c
@ -99,7 +99,6 @@ export default function Estimate({}) {
|
|||||||
|
|
||||||
const initEstimate = (currPid = currentPid) => {
|
const initEstimate = (currPid = currentPid) => {
|
||||||
console.log('🚀 ~ initEstimate ~ currPid:', currPid)
|
console.log('🚀 ~ initEstimate ~ currPid:', currPid)
|
||||||
setCableItem('')
|
|
||||||
closeAll()
|
closeAll()
|
||||||
setObjectNo(objectRecoil.floorPlanObjectNo)
|
setObjectNo(objectRecoil.floorPlanObjectNo)
|
||||||
|
|
||||||
@ -1031,8 +1030,9 @@ export default function Estimate({}) {
|
|||||||
item.showSaleTotPrice = '0'
|
item.showSaleTotPrice = '0'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
let dispCableFlgCnt = 0
|
||||||
estimateContextState.itemList.forEach((item) => {
|
estimateContextState.itemList.forEach((item) => {
|
||||||
|
// console.log('YJSS::::::::', item)
|
||||||
if (item.delFlg === '0') {
|
if (item.delFlg === '0') {
|
||||||
let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', '')) || 0
|
let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', '')) || 0
|
||||||
let salePrice
|
let salePrice
|
||||||
@ -1066,8 +1066,19 @@ export default function Estimate({}) {
|
|||||||
item.showSalePrice = '0'
|
item.showSalePrice = '0'
|
||||||
item.showSaleTotPrice = '0'
|
item.showSaleTotPrice = '0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item.dispCableFlg === '1') {
|
||||||
|
// console.log('YJSS22222::::::::', item)
|
||||||
|
dispCableFlgCnt++
|
||||||
|
setCableItem(item.itemId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (dispCableFlgCnt === 0) {
|
||||||
|
setCableItem('100038')
|
||||||
|
}
|
||||||
|
|
||||||
let pkgAsp = estimateContextState.pkgAsp ? Number(estimateContextState.pkgAsp.replaceAll(',', '')) : 0
|
let pkgAsp = estimateContextState.pkgAsp ? Number(estimateContextState.pkgAsp.replaceAll(',', '')) : 0
|
||||||
|
|
||||||
totals.pkgTotPrice = pkgAsp * totals.totVolKw * 1000
|
totals.pkgTotPrice = pkgAsp * totals.totVolKw * 1000
|
||||||
@ -1095,6 +1106,7 @@ export default function Estimate({}) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
let dispCableFlgCnt = 0
|
||||||
estimateContextState.itemList.forEach((item) => {
|
estimateContextState.itemList.forEach((item) => {
|
||||||
delete item.showSalePrice
|
delete item.showSalePrice
|
||||||
delete item.showSaleTotPrice
|
delete item.showSaleTotPrice
|
||||||
@ -1122,9 +1134,21 @@ export default function Estimate({}) {
|
|||||||
item.showSalePrice = '0'
|
item.showSalePrice = '0'
|
||||||
item.showSaleTotPrice = '0'
|
item.showSaleTotPrice = '0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item.dispCableFlg === '1') {
|
||||||
|
dispCableFlgCnt++
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.dispCableFlg === '1') {
|
||||||
|
setCableItem(item.itemId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (dispCableFlgCnt === 0) {
|
||||||
|
setCableItem('100038')
|
||||||
|
}
|
||||||
|
|
||||||
totals.vatPrice = totals.supplyPrice * 0.1
|
totals.vatPrice = totals.supplyPrice * 0.1
|
||||||
totals.totPrice = totals.supplyPrice + totals.vatPrice
|
totals.totPrice = totals.supplyPrice + totals.vatPrice
|
||||||
|
|
||||||
@ -1167,6 +1191,26 @@ export default function Estimate({}) {
|
|||||||
}
|
}
|
||||||
}, [estimateContextState])
|
}, [estimateContextState])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (cableItemList.lenght > 0 || estimateContextState?.itemList.length > 0) {
|
||||||
|
let dispCableFlgCnt = 0
|
||||||
|
estimateContextState.itemList.map((item) => {
|
||||||
|
if (item.dispCableFlg === '1') {
|
||||||
|
dispCableFlgCnt++
|
||||||
|
cableItemList.map((cable) => {
|
||||||
|
if (item.itemId === cable.clRefChr1) {
|
||||||
|
cable.clRefChr3 = item.itemName
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (dispCableFlgCnt === 0) {
|
||||||
|
setCableItem('100038')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [estimateContextState?.itemList, cableItemList])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="sub-content estimate">
|
<div className="sub-content estimate">
|
||||||
<div className="sub-content-inner">
|
<div className="sub-content-inner">
|
||||||
@ -1718,7 +1762,6 @@ export default function Estimate({}) {
|
|||||||
}}
|
}}
|
||||||
value={cableItem}
|
value={cableItem}
|
||||||
>
|
>
|
||||||
{/* <option value={''}>selected</option> */}
|
|
||||||
{cableItemList.length > 0 &&
|
{cableItemList.length > 0 &&
|
||||||
cableItemList.map((row) => (
|
cableItemList.map((row) => (
|
||||||
<option key={row.clRefChr1} value={row.clRefChr1}>
|
<option key={row.clRefChr1} value={row.clRefChr1}>
|
||||||
@ -1858,9 +1901,10 @@ export default function Estimate({}) {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
menuPlacement={'auto'}
|
menuPlacement={'auto'}
|
||||||
getOptionLabel={(x) => x.clRefChr2}
|
getOptionLabel={(x) => x.clRefChr3}
|
||||||
getOptionValue={(x) => x.clRefChr1}
|
getOptionValue={(x) => x.clRefChr1}
|
||||||
isClearable={false}
|
isClearable={false}
|
||||||
|
isDisabled={true}
|
||||||
value={cableItemList.filter(function (option) {
|
value={cableItemList.filter(function (option) {
|
||||||
return option.clRefChr1 === item.itemId
|
return option.clRefChr1 === item.itemId
|
||||||
})}
|
})}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user