feat(admin-can-status): 화폐단위 추가, 충전금액에 NumberFormat style: currency 적용하여 화폐단위 표시
This commit is contained in:
@@ -4,8 +4,11 @@ async function getChargeStatus(startDate, endDate) {
|
|||||||
return Vue.axios.get('/admin/charge/status?startDateStr=' + startDate + '&endDateStr=' + endDate);
|
return Vue.axios.get('/admin/charge/status?startDateStr=' + startDate + '&endDateStr=' + endDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getChargeStatusDetail(startDate, paymentGateway) {
|
async function getChargeStatusDetail(startDate, paymentGateway, currency) {
|
||||||
return Vue.axios.get('/admin/charge/status/detail?startDateStr=' + startDate + '&paymentGateway=' + paymentGateway);
|
return Vue.axios.get('/admin/charge/status/detail?startDateStr=' + startDate
|
||||||
|
+ '&paymentGateway=' + paymentGateway
|
||||||
|
+ '¤cy=' + currency
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export { getChargeStatus, getChargeStatusDetail }
|
export { getChargeStatus, getChargeStatusDetail }
|
||||||
|
@@ -62,7 +62,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:item.chargeAmount="{ item }">
|
<template v-slot:item.chargeAmount="{ item }">
|
||||||
{{ item.chargeAmount.toLocaleString() }} 원
|
{{ formatMoney(item.chargeAmount, item.currency) }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:item.locale="{ item }">
|
<template v-slot:item.locale="{ item }">
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:item.amount="{ item }">
|
<template v-slot:item.amount="{ item }">
|
||||||
{{ item.amount.toLocaleString() }} 원
|
{{ formatMoney(item.amount, item.locale) }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:item.datetime="{ item }">
|
<template v-slot:item.datetime="{ item }">
|
||||||
@@ -204,6 +204,12 @@ export default {
|
|||||||
sortable: false,
|
sortable: false,
|
||||||
value: 'chargeCount',
|
value: 'chargeCount',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
text: '화폐단위',
|
||||||
|
align: 'center',
|
||||||
|
sortable: false,
|
||||||
|
value: 'currency',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: 'PG',
|
text: 'PG',
|
||||||
sortable: false,
|
sortable: false,
|
||||||
@@ -248,6 +254,15 @@ export default {
|
|||||||
this.show_popup_dialog = false
|
this.show_popup_dialog = false
|
||||||
},
|
},
|
||||||
|
|
||||||
|
formatMoney(price, currencyCode, locale = navigator.language) {
|
||||||
|
const formatted = new Intl.NumberFormat(locale, {
|
||||||
|
style: 'currency',
|
||||||
|
currency: currencyCode
|
||||||
|
}).format(price);
|
||||||
|
|
||||||
|
return formatted.replace(/([^\d\s])(\d)/, '$1 $2');
|
||||||
|
},
|
||||||
|
|
||||||
async getChargeStatus() {
|
async getChargeStatus() {
|
||||||
this.is_loading = true
|
this.is_loading = true
|
||||||
|
|
||||||
@@ -271,7 +286,7 @@ export default {
|
|||||||
this.is_loading = true
|
this.is_loading = true
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await api.getChargeStatusDetail(value.date, value.pg)
|
const res = await api.getChargeStatusDetail(value.date, value.pg, value.currency)
|
||||||
if (res.status === 200 && res.data.success === true) {
|
if (res.status === 200 && res.data.success === true) {
|
||||||
this.detail_items = res.data.data
|
this.detail_items = res.data.data
|
||||||
this.show_popup_dialog = true
|
this.show_popup_dialog = true
|
||||||
|
Reference in New Issue
Block a user