This commit is contained in:
Viet An
2026-06-18 09:10:36 +07:00
parent b7c82e944d
commit 87397be8bf
18 changed files with 78 additions and 90 deletions

View File

@@ -2,7 +2,7 @@
const props = defineProps({
invoice: Object,
});
const { $numtoString } = useNuxtApp();
const { $formatNum } = useNuxtApp();
</script>
<template>
@@ -11,7 +11,7 @@ const { $numtoString } = useNuxtApp();
<div class="is-flex-grow-1 p-3 rounded-md has-background-white-bis">
<p class="fs-13 has-text-grey">Tổng tiền</p>
<p class="font-bold">
{{ $numtoString(invoice.total, { hasUnit: true }) }}
{{ $formatNum(invoice.total, { hasUnit: true }) }}
</p>
</div>
<div class="is-flex-grow-1 p-3 rounded-md has-background-success-95">
@@ -22,7 +22,7 @@ const { $numtoString } = useNuxtApp();
<div class="p-4 mt-4 rounded-md has-background-danger-95">
<p class="fs-13 has-text-danger-50">Còn lại</p>
<p class="fs-20 font-bold has-text-danger-40">
{{ $numtoString(invoice.total, { hasUnit: true }) }}
{{ $formatNum(invoice.total, { hasUnit: true }) }}
</p>
</div>
</div>

View File

@@ -3,7 +3,7 @@ const props = defineProps({
invoice: Object,
});
const { $getdata, $numtoString } = useNuxtApp();
const { $getdata, $formatNum } = useNuxtApp();
const invoiceDetails = ref([]);
onMounted(async () => {
invoiceDetails.value = await $getdata("Invoice_Detail", { filter: { invoice: props.invoice.id } });
@@ -22,12 +22,12 @@ onMounted(async () => {
<div class="fs-15 is-flex is-justify-content-space-between">
<p>{{ invoiceDetail.variant__product__name }}</p>
<p class="font-semibold">
{{ $numtoString(invoiceDetail.price, { hasUnit: true }) }}
{{ $formatNum(invoiceDetail.price, { hasUnit: true }) }}
</p>
</div>
<div class="is-flex is-gap-8 fs-13 has-text-grey-dark mt-1">
<p>SL: {{ invoiceDetail.quantity }}</p>
<p>Đơn giá: {{ $numtoString(invoiceDetail.price, { hasUnit: true }) }}</p>
<p>Đơn giá: {{ $formatNum(invoiceDetail.price, { hasUnit: true }) }}</p>
<p>
Giảm:
{{ new Intl.NumberFormat("vi-VN", { style: "percent" }).format(invoiceDetail.discount) }}
@@ -40,19 +40,19 @@ onMounted(async () => {
<tbody class="has-text-right">
<tr>
<td class="has-text-grey-dark">Tổng tiền hàng</td>
<td>{{ $numtoString(invoice.total_amount, { hasUnit: true }) }}</td>
<td>{{ $formatNum(invoice.total_amount, { hasUnit: true }) }}</td>
</tr>
<tr>
<td class="has-text-grey-dark">Phí vận chuyển</td>
<td>{{ $numtoString(invoice.shipping_fee, { hasUnit: true }) }}</td>
<td>{{ $formatNum(invoice.shipping_fee, { hasUnit: true }) }}</td>
</tr>
<tr>
<td class="has-text-grey-dark">Giảm giá</td>
<td>{{ $numtoString(invoice.discount_amount, { hasUnit: true }) }}</td>
<td>{{ $formatNum(invoice.discount_amount, { hasUnit: true }) }}</td>
</tr>
<tr class="font-bold">
<td>Tổng cộng</td>
<td class="fs-17">{{ $numtoString(invoice.final_amount, { hasUnit: true }) }}</td>
<td class="fs-17">{{ $formatNum(invoice.final_amount, { hasUnit: true }) }}</td>
</tr>
</tbody>
</table>

View File

@@ -9,7 +9,7 @@ const props = defineProps({
invoice: Object,
});
const { $dayjs, $numtoString } = useNuxtApp();
const { $dayjs, $formatNum } = useNuxtApp();
const emit = defineEmits(["unselect"]);
const tabs = [
@@ -89,7 +89,7 @@ const activeTab = ref(tabs[0]);
<div class="px-6 py-4 has-background-primary-95 rounded-lg mt-6">
<p>Tổng giá trị đơn hàng</p>
<p class="font-bold fs-25">
{{ $numtoString(invoice.total_amount, { hasUnit: true }) }}
{{ $formatNum(invoice.total_amount, { hasUnit: true }) }}
</p>
</div>
</div>