parent
4bff451dc4
commit
5b322d0143
@ -60,7 +60,7 @@ export default function Estimate({}) {
|
||||
|
||||
const [cableItemList, setCableItemList] = useState([]) //케이블 리스트
|
||||
const [cableItem, setCableItem] = useState('') //케이블 선택값
|
||||
|
||||
const [cableDbItem, setCableDbItem] = useState('') //케이블 선택값
|
||||
const [startDate, setStartDate] = useState(new Date())
|
||||
const singleDatePickerProps = {
|
||||
startDate,
|
||||
@ -98,7 +98,7 @@ export default function Estimate({}) {
|
||||
}
|
||||
|
||||
const initEstimate = (currPid = currentPid) => {
|
||||
console.log('🚀 ~ initEstimate ~ currPid:', currPid)
|
||||
// console.log('🚀 ~ initEstimate ~ currPid:', currPid)
|
||||
closeAll()
|
||||
setObjectNo(objectRecoil.floorPlanObjectNo)
|
||||
|
||||
@ -117,6 +117,7 @@ export default function Estimate({}) {
|
||||
item.value = item.clRefChr1
|
||||
item.label = item.clRefChr2
|
||||
})
|
||||
// console.log(code2)
|
||||
setCableItemList(code2)
|
||||
}
|
||||
|
||||
@ -152,7 +153,7 @@ export default function Estimate({}) {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
console.log('🚀 ~ Estimate ~ selectedPlan:', selectedPlan)
|
||||
// console.log('🚀 ~ Estimate ~ selectedPlan:', selectedPlan)
|
||||
if (selectedPlan) initEstimate(selectedPlan.planNo)
|
||||
}, [selectedPlan])
|
||||
|
||||
@ -739,6 +740,18 @@ export default function Estimate({}) {
|
||||
setCableItem(value)
|
||||
}
|
||||
|
||||
/* 케이블 select 변경시 */
|
||||
const onChangeDisplayDoubleCableItem = (value, itemList) => {
|
||||
itemList.map((item, index) => {
|
||||
if (item.dispCableFlg === '1' && item.itemTpCd === 'M12') {
|
||||
if (value !== '') {
|
||||
onChangeDisplayItem(value, item.dispOrder, index, true)
|
||||
}
|
||||
}
|
||||
})
|
||||
setCableDbItem(value)
|
||||
}
|
||||
|
||||
// 아이템 자동완성 검색시 아이템 추가/변경시
|
||||
const onChangeDisplayItem = (itemId, dispOrder, index, flag) => {
|
||||
const param = {
|
||||
@ -1088,15 +1101,20 @@ export default function Estimate({}) {
|
||||
item.showSaleTotPrice = '0'
|
||||
}
|
||||
|
||||
if (item.dispCableFlg === '1' && item.itemTpCd !== 'M12') {
|
||||
if (item.dispCableFlg === '1' ) {
|
||||
dispCableFlgCnt++
|
||||
setCableItem(item.itemId)
|
||||
if(item.itemTpCd === 'M12') {
|
||||
setCableDbItem(item.itemId)
|
||||
}else{
|
||||
setCableItem(item.itemId)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if (dispCableFlgCnt === 0) {
|
||||
setCableItem('100038')
|
||||
setCableDbItem('100037')
|
||||
}
|
||||
|
||||
let pkgAsp = estimateContextState.pkgAsp ? Number(estimateContextState.pkgAsp.replaceAll(',', '')) : 0
|
||||
@ -1159,14 +1177,20 @@ export default function Estimate({}) {
|
||||
dispCableFlgCnt++
|
||||
}
|
||||
|
||||
if (item.dispCableFlg === '1' && item.itemTpCd !== 'M12') {
|
||||
setCableItem(item.itemId)
|
||||
if (item.dispCableFlg === '1'){
|
||||
|
||||
if(item.itemTpCd === 'M12') {
|
||||
setCableDbItem(item.itemId)
|
||||
}else{
|
||||
setCableItem(item.itemId)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if (dispCableFlgCnt === 0) {
|
||||
setCableItem('100038')
|
||||
setCableDbItem('100037')
|
||||
}
|
||||
|
||||
totals.vatPrice = totals.supplyPrice * 0.1
|
||||
@ -1227,6 +1251,7 @@ export default function Estimate({}) {
|
||||
|
||||
if (dispCableFlgCnt === 0) {
|
||||
setCableItem('100038')
|
||||
setCableDbItem('100037')
|
||||
}
|
||||
}
|
||||
}, [estimateContextState?.itemList, cableItemList])
|
||||
@ -1831,6 +1856,7 @@ export default function Estimate({}) {
|
||||
</button>
|
||||
</div>
|
||||
<div className="product-price-wrap ml10">
|
||||
<div className="product-price-tit">{getMessage('estimate.detail.header.singleCable')}</div>
|
||||
<div className="select-wrap">
|
||||
<select
|
||||
className="select-light"
|
||||
@ -1840,11 +1866,34 @@ export default function Estimate({}) {
|
||||
value={cableItem}
|
||||
>
|
||||
{cableItemList.length > 0 &&
|
||||
cableItemList.map((row) => (
|
||||
<option key={row.clRefChr1} value={row.clRefChr1}>
|
||||
{row.clRefChr2}
|
||||
</option>
|
||||
))}
|
||||
cableItemList.map((row) => {
|
||||
if(!row.clRefChr2.includes('S')){
|
||||
return <option key={row.clRefChr1} value={row.clRefChr1}>
|
||||
{row.clRefChr2}
|
||||
</option>
|
||||
}
|
||||
})}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div className="product-price-wrap ml10">
|
||||
<div className="product-price-tit">{getMessage('estimate.detail.header.doubleCable')}</div>
|
||||
<div className="select-wrap">
|
||||
<select
|
||||
className="select-light"
|
||||
onChange={(e) => {
|
||||
onChangeDisplayDoubleCableItem(e.target.value, estimateContextState.itemList)
|
||||
}}
|
||||
value={cableDbItem}
|
||||
>
|
||||
{cableItemList.length > 0 &&
|
||||
cableItemList.map((row) => {
|
||||
if(row.clRefChr2.includes('S')){
|
||||
return <option key={row.clRefChr1} value={row.clRefChr1}>
|
||||
{row.clRefChr2.replace('S','')}
|
||||
</option>
|
||||
}
|
||||
})}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@ -1927,7 +1976,7 @@ export default function Estimate({}) {
|
||||
<input
|
||||
type="checkbox"
|
||||
id={item?.dispOrder}
|
||||
disabled={!!item?.paDispOrder || item.dispCableFlg === '1'}
|
||||
disabled={!!item?.paDispOrder || item.dispCableFlg === '1X'}
|
||||
onChange={() => onChangeSelect(item.dispOrder)}
|
||||
checked={!!selection.has(item.dispOrder)}
|
||||
/>
|
||||
|
||||
@ -944,6 +944,8 @@
|
||||
"estimate.detail.sepcialEstimateProductInfo.pkgPrice": "PKG金額",
|
||||
"estimate.detail.header.showPrice": "価格表示",
|
||||
"estimate.detail.header.unitPrice": "定価",
|
||||
"estimate.detail.header.singleCable": "片端ケーブル長さ",
|
||||
"estimate.detail.header.doubleCable": "両端ケーブル長さ",
|
||||
"estimate.detail.showPrice.pricingBtn": "Pricing",
|
||||
"estimate.detail.showPrice.pricingBtn.noItemId": "Pricingが欠落しているアイテムがあります。 Pricingを進めてください。",
|
||||
"estimate.detail.showPrice.pricingBtn.confirm": "価格登録初期化されますがよろしいですか?",
|
||||
|
||||
@ -945,6 +945,8 @@
|
||||
"estimate.detail.sepcialEstimateProductInfo.pkgPrice": "PKG 금액",
|
||||
"estimate.detail.header.showPrice": "가격표시",
|
||||
"estimate.detail.header.unitPrice": "정가",
|
||||
"estimate.detail.header.singleCable": "편당케이블 길이",
|
||||
"estimate.detail.header.doubleCable": "양단케이블 길이",
|
||||
"estimate.detail.showPrice.pricingBtn": "Pricing",
|
||||
"estimate.detail.showPrice.pricingBtn.noItemId": "Pricing이 누락된 아이템이 있습니다. 제품 선택 후 Pricing을 진행해주세요.",
|
||||
"estimate.detail.showPrice.pricingBtn.confirm": "가격등록을 초기화 하시겠습니까?",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user