diff --git a/src/api/charge_status.js b/src/api/charge_status.js
index 2e49658..6859cac 100644
--- a/src/api/charge_status.js
+++ b/src/api/charge_status.js
@@ -4,8 +4,11 @@ async function getChargeStatus(startDate, endDate) {
return Vue.axios.get('/admin/charge/status?startDateStr=' + startDate + '&endDateStr=' + endDate);
}
-async function getChargeStatusDetail(startDate, paymentGateway) {
- return Vue.axios.get('/admin/charge/status/detail?startDateStr=' + startDate + '&paymentGateway=' + paymentGateway);
+async function getChargeStatusDetail(startDate, paymentGateway, currency) {
+ return Vue.axios.get('/admin/charge/status/detail?startDateStr=' + startDate
+ + '&paymentGateway=' + paymentGateway
+ + '¤cy=' + currency
+ );
}
export { getChargeStatus, getChargeStatusDetail }
diff --git a/src/views/Can/CanStatus.vue b/src/views/Can/CanStatus.vue
index feadbef..def15eb 100644
--- a/src/views/Can/CanStatus.vue
+++ b/src/views/Can/CanStatus.vue
@@ -62,7 +62,7 @@
- {{ item.chargeAmount.toLocaleString() }} 원
+ {{ formatMoney(item.chargeAmount, item.currency) }}
@@ -107,7 +107,7 @@
- {{ item.amount.toLocaleString() }} 원
+ {{ formatMoney(item.amount, item.locale) }}
@@ -204,6 +204,12 @@ export default {
sortable: false,
value: 'chargeCount',
},
+ {
+ text: '화폐단위',
+ align: 'center',
+ sortable: false,
+ value: 'currency',
+ },
{
text: 'PG',
sortable: false,
@@ -248,6 +254,15 @@ export default {
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() {
this.is_loading = true
@@ -271,7 +286,7 @@ export default {
this.is_loading = true
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) {
this.detail_items = res.data.data
this.show_popup_dialog = true