Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
a0d7d158a3
@ -272,9 +272,11 @@ export default function Estimate({ params }) {
|
|||||||
estimateContextState.itemList.map((item) => {
|
estimateContextState.itemList.map((item) => {
|
||||||
let checkYn = false
|
let checkYn = false
|
||||||
data.data2.map((item2) => {
|
data.data2.map((item2) => {
|
||||||
if (item2.itemId === item.itemId) {
|
if (item2) {
|
||||||
updateList.push({ ...item, unitPrice: item2.unitPrice })
|
if (item2.itemId === item.itemId) {
|
||||||
checkYn = true
|
updateList.push({ ...item, unitPrice: item2.unitPrice })
|
||||||
|
checkYn = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -510,6 +512,7 @@ export default function Estimate({ params }) {
|
|||||||
estimateContextState.itemList.map((item) => {
|
estimateContextState.itemList.map((item) => {
|
||||||
if (item.delFlg === '0') {
|
if (item.delFlg === '0') {
|
||||||
const amount = Number(item.amount.replace(/[^0-9]/g, '').replaceAll(',', ''))
|
const amount = Number(item.amount.replace(/[^0-9]/g, '').replaceAll(',', ''))
|
||||||
|
|
||||||
const price = Number(item.saleTotPrice.replaceAll(',', ''))
|
const price = Number(item.saleTotPrice.replaceAll(',', ''))
|
||||||
|
|
||||||
if (item.moduleFlg === '1') {
|
if (item.moduleFlg === '1') {
|
||||||
@ -1175,7 +1178,8 @@ export default function Estimate({ params }) {
|
|||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
className="input-light al-r"
|
className="input-light al-r"
|
||||||
value={item?.amount}
|
// value={item?.amount}
|
||||||
|
value={convertNumberToPriceDecimal(item?.amount.replaceAll(',', ''))}
|
||||||
disabled={item.itemId === '' || !!item?.paDispOrder}
|
disabled={item.itemId === '' || !!item?.paDispOrder}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
onChangeAmount(e.target.value, item.dispOrder, index)
|
onChangeAmount(e.target.value, item.dispOrder, index)
|
||||||
|
|||||||
@ -185,17 +185,26 @@ export const useEstimateController = (planNo) => {
|
|||||||
return alert(getMessage('estimate.detail.save.requiredItem'))
|
return alert(getMessage('estimate.detail.save.requiredItem'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
estimateData.itemList.map((item) => {
|
||||||
|
item.amount = item.amount.replaceAll(',', '')
|
||||||
|
item.salePrice = parseFloat(item.salePrice.replaceAll(',', '')).toFixed(2)
|
||||||
|
item.saleTotPrice = parseFloat(item.saleTotPrice.replaceAll(',', '')).toFixed(2)
|
||||||
|
})
|
||||||
console.log('최종 정보::;', estimateData)
|
console.log('최종 정보::;', estimateData)
|
||||||
|
|
||||||
//2. 상세데이터 저장
|
//2. 상세데이터 저장
|
||||||
// return
|
// return
|
||||||
await promisePost({ url: `${ESTIMATE_API_ENDPOINT}/save-estimate`, data: estimateData }).then((res) => {
|
try {
|
||||||
if (res.status === 201) {
|
await promisePost({ url: `${ESTIMATE_API_ENDPOINT}/save-estimate`, data: estimateData }).then((res) => {
|
||||||
alert(getMessage('estimate.detail.save.alertMsg'))
|
if (res.status === 201) {
|
||||||
//어디로 보낼지
|
alert(getMessage('estimate.detail.save.alertMsg'))
|
||||||
fetchSetting(objectRecoil.floorPlanObjectNo, estimateData.planNo)
|
//어디로 보낼지
|
||||||
}
|
fetchSetting(objectRecoil.floorPlanObjectNo, estimateData.planNo)
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
console.log('error::::::::::::', e.response.data.message)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user