Merge branch 'dev' into dev-yj
This commit is contained in:
commit
5e62a3492f
@ -99,7 +99,9 @@ export default function Estimate({}) {
|
|||||||
|
|
||||||
const initEstimate = (currPid = currentPid) => {
|
const initEstimate = (currPid = currentPid) => {
|
||||||
console.log('🚀 ~ initEstimate ~ currPid:', currPid)
|
console.log('🚀 ~ initEstimate ~ currPid:', currPid)
|
||||||
|
closeAll()
|
||||||
setMenuNumber(5)
|
setMenuNumber(5)
|
||||||
|
|
||||||
setObjectNo(objectRecoil.floorPlanObjectNo)
|
setObjectNo(objectRecoil.floorPlanObjectNo)
|
||||||
|
|
||||||
setPlanNo(currPid)
|
setPlanNo(currPid)
|
||||||
@ -137,7 +139,6 @@ export default function Estimate({}) {
|
|||||||
}, [selectedPlan])
|
}, [selectedPlan])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
closeAll()
|
|
||||||
initEstimate()
|
initEstimate()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
@ -619,7 +620,7 @@ export default function Estimate({}) {
|
|||||||
updates.partAdd = '0'
|
updates.partAdd = '0'
|
||||||
updates.saleTotPrice = (Number(amount.replaceAll(',', '')) * estimateContextState.itemList[index].salePrice.replaceAll(',', '')).toLocaleString()
|
updates.saleTotPrice = (Number(amount.replaceAll(',', '')) * estimateContextState.itemList[index].salePrice.replaceAll(',', '')).toLocaleString()
|
||||||
updates.showSaleTotPrice = (
|
updates.showSaleTotPrice = (
|
||||||
Number(amount.replaceAll(',', '')) * estimateContextState.itemList[index].showSalePrice?.replaceAll(',', '')
|
Number(amount.replaceAll(',', '')) * estimateContextState.itemList[index].salePrice?.replaceAll(',', '')
|
||||||
).toLocaleString()
|
).toLocaleString()
|
||||||
|
|
||||||
updateList = estimateContextState.itemList.map((item) => {
|
updateList = estimateContextState.itemList.map((item) => {
|
||||||
@ -681,7 +682,6 @@ export default function Estimate({}) {
|
|||||||
let updateList = []
|
let updateList = []
|
||||||
let updates = {}
|
let updates = {}
|
||||||
get({ url: apiUrl }).then((res) => {
|
get({ url: apiUrl }).then((res) => {
|
||||||
// console.log('아이템디테일::::::::', res)
|
|
||||||
updates.objectNo = objectNo
|
updates.objectNo = objectNo
|
||||||
updates.planNo = planNo
|
updates.planNo = planNo
|
||||||
updates.itemId = res.itemId
|
updates.itemId = res.itemId
|
||||||
@ -706,7 +706,6 @@ export default function Estimate({}) {
|
|||||||
updates.openFlg = res.openFlg
|
updates.openFlg = res.openFlg
|
||||||
|
|
||||||
if (estimateContextState.estimateType === 'YJSS') {
|
if (estimateContextState.estimateType === 'YJSS') {
|
||||||
// console.log('YJSS:::,', res.pkgMaterialFlg)
|
|
||||||
if (res.pkgMaterialFlg === '0') {
|
if (res.pkgMaterialFlg === '0') {
|
||||||
updates.showSalePrice = '0'
|
updates.showSalePrice = '0'
|
||||||
updates.showSaleTotPrice = '0'
|
updates.showSaleTotPrice = '0'
|
||||||
@ -721,14 +720,19 @@ export default function Estimate({}) {
|
|||||||
//104671
|
//104671
|
||||||
let bomList = res.itemBomList
|
let bomList = res.itemBomList
|
||||||
|
|
||||||
// console.log('updates::', updates)
|
|
||||||
updateList = estimateContextState.itemList.map((item) => {
|
updateList = estimateContextState.itemList.map((item) => {
|
||||||
if (item.dispOrder === dispOrder) {
|
if (item.dispOrder === dispOrder) {
|
||||||
if (item?.addFlg) {
|
if (item?.addFlg) {
|
||||||
return { ...item, ...updates, saleTotPrice: '' }
|
return { ...item, ...updates, saleTotPrice: '' }
|
||||||
} else {
|
} else {
|
||||||
if (estimateContextState.estimateType === 'YJSS') {
|
if (estimateContextState.estimateType === 'YJSS') {
|
||||||
return { ...item, ...updates, salePrice: '', saleTotPrice: '' }
|
// return { ...item, ...updates, salePrice: '', saleTotPrice: '' }
|
||||||
|
//확인
|
||||||
|
if (updates.pkgMaterialFlg === '1') {
|
||||||
|
return { ...item, ...updates, showSalePrice: updates.salePrice }
|
||||||
|
} else {
|
||||||
|
return { ...item, ...updates, salePrice: '', saleTotPrice: '' }
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return { ...item, ...updates }
|
return { ...item, ...updates }
|
||||||
}
|
}
|
||||||
@ -739,7 +743,6 @@ export default function Estimate({}) {
|
|||||||
return item
|
return item
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
//paDispOrder
|
//paDispOrder
|
||||||
if (bomList) {
|
if (bomList) {
|
||||||
bomList.map((bomItem, index) => {
|
bomList.map((bomItem, index) => {
|
||||||
@ -879,7 +882,6 @@ export default function Estimate({}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const calculateYJSSTotals = (itemList) => {
|
const calculateYJSSTotals = (itemList) => {
|
||||||
// console.log(':::itemList::', itemList)
|
|
||||||
itemList.sort((a, b) => a.dispOrder - b.dispOrder)
|
itemList.sort((a, b) => a.dispOrder - b.dispOrder)
|
||||||
makeUniqueSpecialNoteCd(itemList)
|
makeUniqueSpecialNoteCd(itemList)
|
||||||
itemList.forEach((item) => {
|
itemList.forEach((item) => {
|
||||||
@ -918,7 +920,6 @@ export default function Estimate({}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// console.log('itemList::', itemList)
|
|
||||||
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
|
||||||
@ -949,30 +950,138 @@ export default function Estimate({}) {
|
|||||||
|
|
||||||
setItemChangeYn(false)
|
setItemChangeYn(false)
|
||||||
} else {
|
} else {
|
||||||
estimateContextState.itemList.forEach((item) => {
|
let totals = {
|
||||||
if (estimateContextState.estimateType === 'YJSS' && !item.paDispOrder && item.pkgMaterialFlg === '0') {
|
totAmount: 0,
|
||||||
item.showSalePrice = '0'
|
totVolKw: 0,
|
||||||
item.showSaleTotPrice = '0'
|
supplyPrice: 0,
|
||||||
}
|
vatPrice: 0,
|
||||||
if (estimateContextState.estimateType === 'YJSS' && item.openFlg === '1') {
|
totPrice: 0,
|
||||||
item.showSalePrice = '0'
|
addSupplyPrice: 0,
|
||||||
item.showSaleTotPrice = '0'
|
pkgTotPrice: 0,
|
||||||
}
|
}
|
||||||
if (estimateContextState.estimateType === 'YJSS' && item.paDispOrder) {
|
estimateContextState.itemList.sort((a, b) => a.dispOrder - b.dispOrder)
|
||||||
item.showSalePrice = '0'
|
makeUniqueSpecialNoteCd(estimateContextState.itemList)
|
||||||
item.showSaleTotPrice = '0'
|
|
||||||
}
|
if (estimateContextState.estimateType === 'YJSS') {
|
||||||
})
|
estimateContextState.itemList.forEach((item) => {
|
||||||
estimateContextState.itemList.forEach((item) => {
|
if (estimateContextState.estimateType === 'YJSS' && !item.paDispOrder && item.pkgMaterialFlg === '0') {
|
||||||
if (estimateContextState.estimateType === 'YJOD' && item.openFlg === '1') {
|
item.showSalePrice = '0'
|
||||||
item.showSalePrice = '0'
|
item.showSaleTotPrice = '0'
|
||||||
item.showSaleTotPrice = '0'
|
}
|
||||||
}
|
if (estimateContextState.estimateType === 'YJSS' && item.openFlg === '1') {
|
||||||
if (estimateContextState.estimateType === 'YJOD' && item.paDispOrder) {
|
item.showSalePrice = '0'
|
||||||
item.showSalePrice = '0'
|
item.showSaleTotPrice = '0'
|
||||||
item.showSaleTotPrice = '0'
|
}
|
||||||
}
|
if (estimateContextState.estimateType === 'YJSS' && item.paDispOrder) {
|
||||||
})
|
item.showSalePrice = '0'
|
||||||
|
item.showSaleTotPrice = '0'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
estimateContextState.itemList.forEach((item) => {
|
||||||
|
if (item.delFlg === '0') {
|
||||||
|
let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', '')) || 0
|
||||||
|
let salePrice
|
||||||
|
if (item.moduleFlg === '1') {
|
||||||
|
const volKw = (item.pnowW * amount) / 1000
|
||||||
|
totals.totVolKw += volKw
|
||||||
|
}
|
||||||
|
if (amount === 0) {
|
||||||
|
salePrice = 0
|
||||||
|
} else {
|
||||||
|
salePrice = Number(item.salePrice?.replaceAll(',', '')) || 0
|
||||||
|
}
|
||||||
|
|
||||||
|
totals.totAmount += amount
|
||||||
|
if (item.pkgMaterialFlg === '1') {
|
||||||
|
const saleTotPrice = amount * salePrice
|
||||||
|
totals.addSupplyPrice += saleTotPrice
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!item.paDispOrder) {
|
||||||
|
if (item.pkgMaterialFlg === '0') {
|
||||||
|
item.showSalePrice = '0'
|
||||||
|
item.showSaleTotPrice = '0'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
item.showSalePrice = '0'
|
||||||
|
item.showSaleTotPrice = '0'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.openFlg === '1') {
|
||||||
|
item.showSalePrice = '0'
|
||||||
|
item.showSaleTotPrice = '0'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
let pkgAsp = estimateContextState.pkgAsp ? Number(estimateContextState.pkgAsp.replaceAll(',', '')) : 0
|
||||||
|
|
||||||
|
totals.pkgTotPrice = pkgAsp * totals.totVolKw * 1000
|
||||||
|
totals.supplyPrice = totals.addSupplyPrice + totals.pkgTotPrice
|
||||||
|
totals.vatPrice = totals.supplyPrice * 0.1
|
||||||
|
totals.totPrice = totals.supplyPrice + totals.vatPrice
|
||||||
|
|
||||||
|
setEstimateContextState({
|
||||||
|
pkgTotPrice: totals.pkgTotPrice,
|
||||||
|
totAmount: totals.totAmount,
|
||||||
|
totVolKw: totals.totVolKw.toFixed(2),
|
||||||
|
supplyPrice: totals.supplyPrice.toFixed(0), //소수첫자리에서 반올림
|
||||||
|
vatPrice: totals.vatPrice.toFixed(0), //소수첫자리에서 반올림
|
||||||
|
totPrice: totals.totPrice.toFixed(0), //소수첫자리에서 반올림
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
estimateContextState.itemList.forEach((item) => {
|
||||||
|
if (estimateContextState.estimateType === 'YJOD' && item.openFlg === '1') {
|
||||||
|
item.showSalePrice = '0'
|
||||||
|
item.showSaleTotPrice = '0'
|
||||||
|
}
|
||||||
|
if (estimateContextState.estimateType === 'YJOD' && item.paDispOrder) {
|
||||||
|
item.showSalePrice = '0'
|
||||||
|
item.showSaleTotPrice = '0'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
estimateContextState.itemList.forEach((item) => {
|
||||||
|
delete item.showSalePrice
|
||||||
|
delete item.showSaleTotPrice
|
||||||
|
if (item.delFlg === '0') {
|
||||||
|
let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', '')) || 0
|
||||||
|
let price
|
||||||
|
if (amount === 0) {
|
||||||
|
price = 0
|
||||||
|
} else {
|
||||||
|
price = Number(item.saleTotPrice?.replaceAll(',', '')) || 0
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.moduleFlg === '1') {
|
||||||
|
const volKw = (item.pnowW * amount) / 1000
|
||||||
|
totals.totVolKw += volKw
|
||||||
|
}
|
||||||
|
totals.supplyPrice += price
|
||||||
|
totals.totAmount += amount
|
||||||
|
|
||||||
|
if (item.paDispOrder) {
|
||||||
|
item.showSalePrice = '0'
|
||||||
|
item.showSaleTotPrice = '0'
|
||||||
|
}
|
||||||
|
if (item.openFlg === '1') {
|
||||||
|
item.showSalePrice = '0'
|
||||||
|
item.showSaleTotPrice = '0'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
totals.vatPrice = totals.supplyPrice * 0.1
|
||||||
|
totals.totPrice = totals.supplyPrice + totals.vatPrice
|
||||||
|
|
||||||
|
setEstimateContextState({
|
||||||
|
totAmount: totals.totAmount,
|
||||||
|
totVolKw: totals.totVolKw.toFixed(2),
|
||||||
|
supplyPrice: totals.supplyPrice.toFixed(0), //소수첫자리에서 반올림
|
||||||
|
vatPrice: totals.vatPrice.toFixed(0), //소수첫자리에서 반올림
|
||||||
|
totPrice: totals.totPrice.toFixed(0), //소수첫자리에서 반올림
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, [itemChangeYn, estimateContextState.itemList])
|
}, [itemChangeYn, estimateContextState.itemList])
|
||||||
|
|
||||||
@ -1006,7 +1115,7 @@ export default function Estimate({}) {
|
|||||||
<div className="estimate-tit">{getMessage('estimate.detail.objectNo')}</div>
|
<div className="estimate-tit">{getMessage('estimate.detail.objectNo')}</div>
|
||||||
<div className="estimate-name">
|
<div className="estimate-name">
|
||||||
{/* {objectNo} (Plan No: {estimateContextState.planNo}) */}
|
{/* {objectNo} (Plan No: {estimateContextState.planNo}) */}
|
||||||
{objectNo} (Plan No: {planNo})
|
{currentObjectNo} (Plan No: {planNo})
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="estimate-box">
|
<div className="estimate-box">
|
||||||
@ -1076,7 +1185,6 @@ export default function Estimate({}) {
|
|||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<div className="input-wrap" style={{ width: '350px' }}>
|
<div className="input-wrap" style={{ width: '350px' }}>
|
||||||
{/* <input type="text" className="input-light" defaultValue={estimateContextState?.charger} onBlur={handleBlurCharger} /> */}
|
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
className="input-light"
|
className="input-light"
|
||||||
@ -1095,7 +1203,6 @@ export default function Estimate({}) {
|
|||||||
<td colSpan={3}>
|
<td colSpan={3}>
|
||||||
<div className="form-flex-wrap">
|
<div className="form-flex-wrap">
|
||||||
<div className="input-wrap mr5" style={{ width: '610px' }}>
|
<div className="input-wrap mr5" style={{ width: '610px' }}>
|
||||||
{/* <input type="text" className="input-light" defaultValue={estimateContextState?.objectName} onBlur={handleBlurObjectName} /> */}
|
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
className="input-light"
|
className="input-light"
|
||||||
|
|||||||
@ -203,7 +203,11 @@ export default function CanvasMenu(props) {
|
|||||||
setCurrentMenu(menu.title)
|
setCurrentMenu(menu.title)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pathname !== '/floor-plan') router.push(`/floor-plan?pid=${pid}&objectNo=${objectNo}`)
|
if (pathname !== '/floor-plan') {
|
||||||
|
if (menu.index !== 0) {
|
||||||
|
router.push(`/floor-plan?pid=${pid}&objectNo=${objectNo}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const changeSelectedRoofMaterial = (e) => {
|
const changeSelectedRoofMaterial = (e) => {
|
||||||
|
|||||||
@ -56,20 +56,25 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
]
|
]
|
||||||
|
|
||||||
// 데이터를 최초 한 번만 조회
|
// 데이터를 최초 한 번만 조회
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
if (!basicSetting || !currentRoof || Object.keys(currentRoof).length === 0 || Object.keys(basicSetting).length === 0) return
|
// if (!basicSetting || !currentRoof || Object.keys(currentRoof).length === 0 || Object.keys(basicSetting).length === 0) return
|
||||||
const raftCodeList = findCommonCode('203800')
|
// const raftCodeList = findCommonCode('203800')
|
||||||
setRaftCodes(raftCodeList)
|
// setRaftCodes(raftCodeList)
|
||||||
|
// console.log('🚀 ~ useEffect ~ >>>>>>>>>>>>> raftCodeList 11 :', raftCodeList)
|
||||||
|
|
||||||
if (addedRoofs[0].roofAngleSet && addedRoofs[0].roofAngleSet?.length > 0) {
|
|
||||||
setCurrentRoof({ ...currentRoof, roofSizeSet: String(addedRoofs[0].roofSizeSet), roofAngleSet: addedRoofs[0].roofAngleSet })
|
// if (addedRoofs[0].roofAngleSet && addedRoofs[0].roofAngleSet?.length > 0) {
|
||||||
} else if (basicSetting.roofAngleSet && basicSetting.roofAngleSet?.length > 0) {
|
// setCurrentRoof({ ...currentRoof, roofSizeSet: String(addedRoofs[0].roofSizeSet), roofAngleSet: addedRoofs[0].roofAngleSet })
|
||||||
setCurrentRoof({ ...currentRoof, roofSizeSet: String(basicSetting.roofSizeSet), roofAngleSet: basicSetting.roofAngleSet })
|
// } else if (basicSetting.roofAngleSet && basicSetting.roofAngleSet?.length > 0) {
|
||||||
}
|
// setCurrentRoof({ ...currentRoof, roofSizeSet: String(basicSetting.roofSizeSet), roofAngleSet: basicSetting.roofAngleSet })
|
||||||
}, [])
|
// }
|
||||||
|
// }, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (addedRoofs.length > 0) {
|
if (addedRoofs.length > 0) {
|
||||||
|
const raftCodeList = findCommonCode('203800')
|
||||||
|
setRaftCodes(raftCodeList)
|
||||||
|
|
||||||
setCurrentRoof({ ...addedRoofs[0] })
|
setCurrentRoof({ ...addedRoofs[0] })
|
||||||
}
|
}
|
||||||
}, [addedRoofs])
|
}, [addedRoofs])
|
||||||
@ -155,20 +160,20 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
...roofInfo,
|
...roofInfo,
|
||||||
},
|
},
|
||||||
//roofs: addedRoofs,
|
//roofs: addedRoofs,
|
||||||
roofsData: {
|
// roofsData: {
|
||||||
roofApply: true,
|
// roofApply: true,
|
||||||
roofSeq: 0,
|
// roofSeq: 0,
|
||||||
roofMatlCd: currentRoof.roofMatlCd,
|
// roofMatlCd: currentRoof.roofMatlCd,
|
||||||
roofWidth: currentRoof.width,
|
// roofWidth: currentRoof.width,
|
||||||
roofHeight: currentRoof.length,
|
// roofHeight: currentRoof.length,
|
||||||
roofHajebichi: currentRoof.hajebichi,
|
// roofHajebichi: currentRoof.hajebichi,
|
||||||
roofGap: currentRoof.raft,
|
// roofGap: currentRoof.raft,
|
||||||
roofLayout: currentRoof.layout,
|
// roofLayout: currentRoof.layout,
|
||||||
roofSizeSet: currentRoof.roofSizeSet,
|
// roofSizeSet: currentRoof.roofSizeSet,
|
||||||
roofAngleSet: currentRoof.roofAngleSet,
|
// roofAngleSet: currentRoof.roofAngleSet,
|
||||||
roofPitch: currentRoof.pitch,
|
// roofPitch: currentRoof.pitch,
|
||||||
roofAngle: currentRoof.angle,
|
// roofAngle: currentRoof.angle,
|
||||||
},
|
// },
|
||||||
})
|
})
|
||||||
|
|
||||||
basicSettingSave()
|
basicSettingSave()
|
||||||
@ -338,13 +343,13 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
{currentRoof && ['C', 'R'].includes(currentRoof.raftAuth) && (
|
{currentRoof && ['C', 'R'].includes(currentRoof.raftAuth) && (
|
||||||
<div className="flex-ment">
|
<div className="flex-ment">
|
||||||
<span>{getMessage('modal.placement.initial.setting.rafter')}</span>
|
<span>{getMessage('modal.placement.initial.setting.rafter')}</span>
|
||||||
{raftCodes.length > 0 && (
|
{raftCodes?.length > 0 && (
|
||||||
<div className="select-wrap" style={{ width: '160px' }}>
|
<div className="select-wrap" style={{ width: '160px' }}>
|
||||||
<QSelectBox
|
<QSelectBox
|
||||||
options={raftCodes}
|
options={raftCodes}
|
||||||
ref={roofRef.rafter}
|
ref={roofRef.rafter}
|
||||||
title={
|
title={
|
||||||
raftCodes.find((r) => r.clCode === (currentRoof?.raft === undefined ? currentRoof?.raftBaseCd : currentRoof?.raft)).clCodeNm
|
raftCodes?.find((r) => r.clCode === (currentRoof?.raft === undefined ? currentRoof?.raftBaseCd : currentRoof?.raft)).clCodeNm
|
||||||
}
|
}
|
||||||
value={currentRoof?.raft === undefined ? currentRoof?.raftBaseCd : currentRoof?.raft}
|
value={currentRoof?.raft === undefined ? currentRoof?.raftBaseCd : currentRoof?.raft}
|
||||||
onChange={(e) => handleRafterChange(e.clCode)}
|
onChange={(e) => handleRafterChange(e.clCode)}
|
||||||
|
|||||||
@ -304,6 +304,7 @@ export default function StuffDetail() {
|
|||||||
//mid:5(견적서), /pid:플랜번호
|
//mid:5(견적서), /pid:플랜번호
|
||||||
setFloorPlanObjectNo({ floorPlanObjectNo: params.data.objectNo })
|
setFloorPlanObjectNo({ floorPlanObjectNo: params.data.objectNo })
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
|
setMenuNumber(5)
|
||||||
router.push(`/floor-plan/estimate/5?pid=${params.data.planNo}&objectNo=${params.data.objectNo}`)
|
router.push(`/floor-plan/estimate/5?pid=${params.data.planNo}&objectNo=${params.data.objectNo}`)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -1357,7 +1358,7 @@ export default function StuffDetail() {
|
|||||||
//로그인이 2차점인데 otherSaleStoreId가 없으면 알럿
|
//로그인이 2차점인데 otherSaleStoreId가 없으면 알럿
|
||||||
if (session.storeLvl !== '1') {
|
if (session.storeLvl !== '1') {
|
||||||
if (params.saleStoreLevel === '1') {
|
if (params.saleStoreLevel === '1') {
|
||||||
return swalFire({ text: getMessage('stuff.detail.tempSave.message4'), type: 'alert' })
|
return swalFire({ text: getMessage('stuff.detail.tempSave.message3'), type: 'alert' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1447,6 +1448,13 @@ export default function StuffDetail() {
|
|||||||
params.saleStoreLevel = session.storeLvl
|
params.saleStoreLevel = session.storeLvl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (session.storeLvl !== '1') {
|
||||||
|
//로그인이 1차점이 아닌데 2차점을 안골라서 saleStoreLevel = 1로 셋팅되어있으면 알럿
|
||||||
|
if (params.saleStoreLevel === '1') {
|
||||||
|
return swalFire({ text: getMessage('stuff.detail.tempSave.message3'), type: 'alert' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 담당자 자리수 체크
|
// 담당자 자리수 체크
|
||||||
if (params?.receiveUser !== '') {
|
if (params?.receiveUser !== '') {
|
||||||
if (params?.receiveUser.trim().length > 10) {
|
if (params?.receiveUser.trim().length > 10) {
|
||||||
|
|||||||
@ -40,8 +40,8 @@ export default function StuffSubHeader({ type }) {
|
|||||||
if (isObjectNotEmpty(managementState)) {
|
if (isObjectNotEmpty(managementState)) {
|
||||||
if (managementState.createUser === 'T01') {
|
if (managementState.createUser === 'T01') {
|
||||||
if (session.userId !== 'T01') {
|
if (session.userId !== 'T01') {
|
||||||
//도면 작성은 이동 할 수 있도록 변경 #457
|
//도면 작성은 이동 할 수 있도록 변경 #457 다시 못하도록 변경#474
|
||||||
// setButtonStyle('none')
|
setButtonStyle('none')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,19 +8,12 @@ import SingleDatePicker from '@/components/common/datepicker/SingleDatePicker'
|
|||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import PlanRequestPopQGrid from './PlanRequestPopQGrid'
|
import PlanRequestPopQGrid from './PlanRequestPopQGrid'
|
||||||
import { isObjectNotEmpty, queryStringFormatter } from '@/util/common-utils'
|
import { isObjectNotEmpty, queryStringFormatter } from '@/util/common-utils'
|
||||||
import { useCommonCode } from '@/hooks/common/useCommonCode'
|
|
||||||
import Select from 'react-select'
|
|
||||||
import QPagination from '@/components/common/pagination/QPagination'
|
import QPagination from '@/components/common/pagination/QPagination'
|
||||||
export default function PlanRequestPop(props) {
|
export default function PlanRequestPop(props) {
|
||||||
const [pageNo, setPageNo] = useState(1) //현재 페이지 번호
|
const [pageNo, setPageNo] = useState(1) //현재 페이지 번호
|
||||||
const [pageSize, setPageSize] = useState(20) //페이지 당 게시물 개수
|
const [pageSize, setPageSize] = useState(20) //페이지 당 게시물 개수
|
||||||
const [totalCount, setTotalCount] = useState(0) //총 갯수
|
const [totalCount, setTotalCount] = useState(0) //총 갯수
|
||||||
|
|
||||||
//공통코드
|
|
||||||
const { commonCode, findCommonCode } = useCommonCode()
|
|
||||||
|
|
||||||
// const [planStatCdList, setPlanStatCdList] = useState([])
|
|
||||||
|
|
||||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||||
|
|
||||||
const [planReqObject, setPlanReqObject] = useState({})
|
const [planReqObject, setPlanReqObject] = useState({})
|
||||||
@ -71,16 +64,6 @@ export default function PlanRequestPop(props) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 상태 검색조건 변경
|
|
||||||
const onSelectionChange = (key) => {
|
|
||||||
if (isObjectNotEmpty(key)) {
|
|
||||||
setSchPlanStatCd(key.clCode)
|
|
||||||
} else {
|
|
||||||
//X누름
|
|
||||||
setSchPlanStatCd('')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 조회
|
// 조회
|
||||||
const onSubmit = (page, type) => {
|
const onSubmit = (page, type) => {
|
||||||
const params = {
|
const params = {
|
||||||
@ -194,7 +177,8 @@ export default function PlanRequestPop(props) {
|
|||||||
{
|
{
|
||||||
field: 'title',
|
field: 'title',
|
||||||
headerName: getMessage('stuff.planReqPopup.gridHeader.title'),
|
headerName: getMessage('stuff.planReqPopup.gridHeader.title'),
|
||||||
minWidth: 150,
|
minWidth: 250,
|
||||||
|
cellStyle: { textAlign: 'left' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'address1',
|
field: 'address1',
|
||||||
@ -234,13 +218,6 @@ export default function PlanRequestPop(props) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// const code1 = findCommonCode(115800) //상태
|
|
||||||
// if (code1 != null) {
|
|
||||||
// setPlanStatCdList(code1)
|
|
||||||
// }
|
|
||||||
// }, [commonCode])
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
onSubmit(pageNo, 'S')
|
onSubmit(pageNo, 'S')
|
||||||
}, [])
|
}, [])
|
||||||
@ -431,9 +408,11 @@ export default function PlanRequestPop(props) {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<PlanRequestPopQGrid {...gridProps} getSelectedRowdata={getSelectedRowdata} />
|
<div className="q-grid">
|
||||||
<div className="pagination-wrap">
|
<PlanRequestPopQGrid {...gridProps} getSelectedRowdata={getSelectedRowdata} />
|
||||||
<QPagination pageNo={pageNo} pageSize={pageSize} pagePerBlock={10} totalCount={totalCount} handleChangePage={handleChangePage} />
|
<div className="pagination-wrap">
|
||||||
|
<QPagination pageNo={pageNo} pageSize={pageSize} pagePerBlock={10} totalCount={totalCount} handleChangePage={handleChangePage} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -22,8 +22,8 @@ export default function PlanRequestPopQGrid(props) {
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
minWidth: 100,
|
minWidth: 100,
|
||||||
sortable: false,
|
sortable: false,
|
||||||
suppressMovable: false,
|
suppressMovable: true,
|
||||||
resizable: false,
|
resizable: true,
|
||||||
suppressSizeToFit: false,
|
suppressSizeToFit: false,
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
@ -58,6 +58,7 @@ export default function PlanRequestPopQGrid(props) {
|
|||||||
defaultColDef={defaultColDef}
|
defaultColDef={defaultColDef}
|
||||||
pagination={isPageable}
|
pagination={isPageable}
|
||||||
onSelectionChanged={onSelectionChanged}
|
onSelectionChanged={onSelectionChanged}
|
||||||
|
autoSizeAllColumns={true}
|
||||||
overlayNoRowsTemplate={`<span className="ag-overlay-loading-center">${getMessage('stuff.grid.noData')}</span>`}
|
overlayNoRowsTemplate={`<span className="ag-overlay-loading-center">${getMessage('stuff.grid.noData')}</span>`}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -80,6 +80,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
|
|
||||||
res.data.pkgAsp = roundedNumber.toString()
|
res.data.pkgAsp = roundedNumber.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
setEstimateContextState(res.data)
|
setEstimateContextState(res.data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -384,7 +385,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
estimateData.newFileList = []
|
estimateData.newFileList = []
|
||||||
swalFire({ text: getMessage('estimate.detail.save.alertMsg'), type: 'alert' })
|
swalFire({ text: getMessage('estimate.detail.save.alertMsg'), type: 'alert' })
|
||||||
fetchSetting(objectRecoil.floorPlanObjectNo, estimateData.planNo)
|
fetchSetting(estimateData.objectNo, estimateData.planNo)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -409,7 +410,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
const params = {
|
const params = {
|
||||||
saleStoreId: session.storeId,
|
saleStoreId: session.storeId,
|
||||||
sapSalesStoreCd: session.custCd,
|
sapSalesStoreCd: session.custCd,
|
||||||
objectNo: objectRecoil.floorPlanObjectNo,
|
objectNo: estimateData.objectNo,
|
||||||
planNo: sendPlanNo,
|
planNo: sendPlanNo,
|
||||||
copySaleStoreId: otherSaleStoreId ? otherSaleStoreId : saleStoreId,
|
copySaleStoreId: otherSaleStoreId ? otherSaleStoreId : saleStoreId,
|
||||||
copyReceiveUser: copyReceiveUser,
|
copyReceiveUser: copyReceiveUser,
|
||||||
|
|||||||
@ -48,7 +48,7 @@ const defaultDotLineGridSetting = {
|
|||||||
LINE: false,
|
LINE: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
let previousRoofMaterialsYn = 'N' // 지붕재 select 정보 비교 후 변경된 것이 없으면 1회만 실행
|
//let previousRoofMaterialsYn = 'N' // 지붕재 select 정보 비교 후 변경된 것이 없으면 1회만 실행
|
||||||
|
|
||||||
export function useCanvasSetting() {
|
export function useCanvasSetting() {
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
@ -159,21 +159,23 @@ export function useCanvasSetting() {
|
|||||||
setBasicSettings({ ...basicSetting, selectedRoofMaterial: selectedRoofMaterial })
|
setBasicSettings({ ...basicSetting, selectedRoofMaterial: selectedRoofMaterial })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const previousObjectNoRef = useRef(null)
|
||||||
const previousRoofMaterialsRef = useRef(null)
|
const previousRoofMaterialsRef = useRef(null)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// 지붕재 select 정보가 존재해야 배치면초기설정 DB 정보 비교 후 지붕재 정보를 가져올 수 있음
|
// 지붕재 select 정보가 존재해야 배치면초기설정 DB 정보 비교 후 지붕재 정보를 가져올 수 있음
|
||||||
if (roofMaterials.length !== 0 && JSON.stringify(previousRoofMaterialsRef.current) !== JSON.stringify(roofMaterials)) {
|
if (!previousObjectNoRef.current && !correntObjectNo && previousObjectNoRef.current !== correntObjectNo
|
||||||
// 지붕재 select 정보 비교 후 변경된 것이 없으면 1회만 실행
|
|| roofMaterials.length !== 0 && JSON.stringify(previousRoofMaterialsRef.current) !== JSON.stringify(roofMaterials)) {
|
||||||
if (roofMaterials && previousRoofMaterialsYn === 'N') {
|
|
||||||
|
if (roofMaterials) {
|
||||||
fetchBasicSettings()
|
fetchBasicSettings()
|
||||||
previousRoofMaterialsYn = 'Y'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 이전 값을 업데이트
|
// 이전 값을 업데이트
|
||||||
|
previousObjectNoRef.current = correntObjectNo
|
||||||
previousRoofMaterialsRef.current = roofMaterials
|
previousRoofMaterialsRef.current = roofMaterials
|
||||||
}
|
}
|
||||||
}, [roofMaterials])
|
}, [roofMaterials, correntObjectNo])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!canvas) {
|
if (!canvas) {
|
||||||
@ -297,7 +299,7 @@ export function useCanvasSetting() {
|
|||||||
})
|
})
|
||||||
roofsArray = res.map((item) => {
|
roofsArray = res.map((item) => {
|
||||||
return {
|
return {
|
||||||
roofApply: true,
|
roofApply: item.roofApply,
|
||||||
roofSeq: 0,
|
roofSeq: 0,
|
||||||
roofMatlCd: item.roofMatlCd,
|
roofMatlCd: item.roofMatlCd,
|
||||||
roofWidth: item.roofWidth,
|
roofWidth: item.roofWidth,
|
||||||
@ -328,6 +330,7 @@ export function useCanvasSetting() {
|
|||||||
roofGap: 'HEI_455',
|
roofGap: 'HEI_455',
|
||||||
roofLayout: 'P',
|
roofLayout: 'P',
|
||||||
roofPitch: 4,
|
roofPitch: 4,
|
||||||
|
roofAngle: 21.8,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -207,49 +207,54 @@ export function usePlan(params = {}) {
|
|||||||
const orderingNo = plans?.find((obj) => obj.id === newCurrentId).ordering
|
const orderingNo = plans?.find((obj) => obj.id === newCurrentId).ordering
|
||||||
const objectNo = floorPlanState.objectNo
|
const objectNo = floorPlanState.objectNo
|
||||||
//견적서 or 발전시뮬
|
//견적서 or 발전시뮬
|
||||||
|
|
||||||
if (pathname !== '/floor-plan') {
|
if (pathname !== '/floor-plan') {
|
||||||
await promiseGet({ url: `/api/estimate/${objectNo}/${orderingNo}/detail` })
|
await promiseGet({ url: `/api/estimate/${objectNo}/${orderingNo}/detail` })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
const estimateDetail = res.data
|
const estimateDetail = res.data
|
||||||
if (estimateDetail.docNo) {
|
if (pathname === '/floor-plan/estimate/5') {
|
||||||
res.data.resetFlag = 'N'
|
if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) {
|
||||||
|
console.log('이동')
|
||||||
|
res.data.resetFlag = 'N'
|
||||||
|
|
||||||
if (res.data.itemList.length > 0) {
|
if (res.data.itemList.length > 0) {
|
||||||
res.data.itemList.map((item) => {
|
res.data.itemList.map((item) => {
|
||||||
item.delFlg = '0'
|
item.delFlg = '0'
|
||||||
})
|
})
|
||||||
}
|
|
||||||
if (res.data.pkgAsp === null || res.data.pkgAsp == undefined) {
|
|
||||||
res.data.pkgAsp = '0.00'
|
|
||||||
} else {
|
|
||||||
const number = parseFloat(res.data.pkgAsp)
|
|
||||||
const roundedNumber = isNaN(number) ? '0.00' : number.toFixed(2)
|
|
||||||
|
|
||||||
res.data.pkgAsp = roundedNumber.toString()
|
|
||||||
}
|
|
||||||
setEstimateContextState(res.data)
|
|
||||||
|
|
||||||
if (pathname === '/floor-plan') {
|
|
||||||
if (!currentCanvasPlan || currentCanvasPlan.id !== newCurrentId) {
|
|
||||||
saveCanvas()
|
|
||||||
}
|
}
|
||||||
|
if (res.data.pkgAsp === null || res.data.pkgAsp == undefined) {
|
||||||
|
res.data.pkgAsp = '0.00'
|
||||||
|
} else {
|
||||||
|
const number = parseFloat(res.data.pkgAsp)
|
||||||
|
const roundedNumber = isNaN(number) ? '0.00' : number.toFixed(2)
|
||||||
|
|
||||||
|
res.data.pkgAsp = roundedNumber.toString()
|
||||||
|
}
|
||||||
|
setEstimateContextState(res.data)
|
||||||
|
// 클릭한 플랜 탭으로 이동
|
||||||
|
updateCurrentPlan(newCurrentId)
|
||||||
|
} else {
|
||||||
|
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
||||||
}
|
}
|
||||||
updateCurrentPlan(newCurrentId)
|
|
||||||
} else {
|
} else {
|
||||||
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
//발전시뮬레이션
|
||||||
|
// 클릭한 플랜 탭으로 이동
|
||||||
|
// updateCurrentPlan(newCurrentId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
if (pathname === '/floor-plan/estimate/5') {
|
||||||
|
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
||||||
|
} else {
|
||||||
|
swalFire({ text: getMessage('simulator.menu.move.valid1') })
|
||||||
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// if (pathname === '/floor-plan') {
|
|
||||||
if (!currentCanvasPlan || currentCanvasPlan.id !== newCurrentId) {
|
if (!currentCanvasPlan || currentCanvasPlan.id !== newCurrentId) {
|
||||||
saveCanvas()
|
saveCanvas()
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
updateCurrentPlan(newCurrentId)
|
updateCurrentPlan(newCurrentId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -673,6 +673,7 @@
|
|||||||
"stuff.detail.tooltip.surfaceType": "塩害地域の定義は各メーカーの設置マニュアルをご確認ください",
|
"stuff.detail.tooltip.surfaceType": "塩害地域の定義は各メーカーの設置マニュアルをご確認ください",
|
||||||
"stuff.detail.tempSave.message1": "一時保存されました。商品番号を取得するには、必須項目をすべて入力してください。",
|
"stuff.detail.tempSave.message1": "一時保存されました。商品番号を取得するには、必須項目をすべて入力してください。",
|
||||||
"stuff.detail.tempSave.message2": "担当者は10桁以下で入力してください.",
|
"stuff.detail.tempSave.message2": "担当者は10桁以下で入力してください.",
|
||||||
|
"stuff.detail.tempSave.message3": "二次販売店を選択してください.",
|
||||||
"stuff.detail.confirm.message1": "販売店情報を変更すると、設計依頼文書番号が削除されます。変更しますか?",
|
"stuff.detail.confirm.message1": "販売店情報を変更すると、設計依頼文書番号が削除されます。変更しますか?",
|
||||||
"stuff.detail.delete.message1": "仕様が確定したものは削除できません。",
|
"stuff.detail.delete.message1": "仕様が確定したものは削除できません。",
|
||||||
"stuff.detail.planList.title": "プランリスト",
|
"stuff.detail.planList.title": "プランリスト",
|
||||||
|
|||||||
@ -682,6 +682,7 @@
|
|||||||
"stuff.detail.tooltip.surfaceType": "염해지역 정의는 각 메이커의 설치 메뉴얼을 확인해주십시오",
|
"stuff.detail.tooltip.surfaceType": "염해지역 정의는 각 메이커의 설치 메뉴얼을 확인해주십시오",
|
||||||
"stuff.detail.tempSave.message1": "임시저장 되었습니다. 물건번호를 획득하려면 필수 항목을 모두 입력해 주십시오.",
|
"stuff.detail.tempSave.message1": "임시저장 되었습니다. 물건번호를 획득하려면 필수 항목을 모두 입력해 주십시오.",
|
||||||
"stuff.detail.tempSave.message2": "담당자는 10자리 이하로 입력해 주십시오.",
|
"stuff.detail.tempSave.message2": "담당자는 10자리 이하로 입력해 주십시오.",
|
||||||
|
"stuff.detail.tempSave.message3": "2차 판매점을 선택해주세요.",
|
||||||
"stuff.detail.confirm.message1": "판매점 정보를 변경하면, 설계의뢰 문서번호가 삭제됩니다. 변경하시겠습니까?",
|
"stuff.detail.confirm.message1": "판매점 정보를 변경하면, 설계의뢰 문서번호가 삭제됩니다. 변경하시겠습니까?",
|
||||||
"stuff.detail.delete.message1": "사양이 확정된 물건은 삭제할 수 없습니다.",
|
"stuff.detail.delete.message1": "사양이 확정된 물건은 삭제할 수 없습니다.",
|
||||||
"stuff.detail.planList.title": "플랜리스트",
|
"stuff.detail.planList.title": "플랜리스트",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user