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

@@ -3,7 +3,7 @@ const props = defineProps({
cartItem: Object,
deleteable: Boolean,
});
const { $deleteapi, $numtoString, $snackbar } = useNuxtApp();
const { $deleteapi, $formatNum, $snackbar } = useNuxtApp();
const { getCarts } = inject("pos");
const showConfirmModal = ref();
const isDeleting = ref(false);
@@ -51,7 +51,7 @@ async function removeFromCart() {
</div>
</div>
<p class="has-text-primary-50 font-medium">
{{ $numtoString(cartItem.imei__variant__price, { hasUnit: true }) }}
{{ $formatNum(cartItem.imei__variant__price, { hasUnit: true }) }}
</p>
</div>
<button

View File

@@ -200,12 +200,12 @@ async function createOrder() {
<span>Tạm tính</span>
<span> ({{ activeCartItems.length }} sản phẩm)</span>
</td>
<td class="has-text-right">{{ $numtoString(subtotal, { hasUnit: true }) }}</td>
<td class="has-text-right">{{ $formatNum(subtotal, { hasUnit: true }) }}</td>
</tr>
<tr>
<td class="font-bold fs-14">Tổng cộng</td>
<td class="has-text-right has-text-success-35 font-bold fs-17">
{{ $numtoString(subtotal, { hasUnit: true }) }}
{{ $formatNum(subtotal, { hasUnit: true }) }}
</td>
</tr>
</tbody>

View File

@@ -9,7 +9,7 @@ import useOrderInfo from "~/components/pos/composables/useOrderInfo";
import SearchBox from "~/components/SearchBox.vue";
const store = useStore();
const { $numtoString } = useNuxtApp();
const { $formatNum } = useNuxtApp();
const { carts, cartItems, customers, getCarts, isPending } = useCartData();
@@ -313,12 +313,12 @@ provide("pos", {
<span>Tạm tính</span>
<span> ({{ activeCartItems?.length || 0 }} sản phẩm)</span>
</td>
<td class="has-text-right">{{ $numtoString(subtotal, { hasUnit: true }) }}</td>
<td class="has-text-right">{{ $formatNum(subtotal, { hasUnit: true }) }}</td>
</tr>
<tr>
<td class="font-bold fs-14">Tổng cộng</td>
<td class="has-text-right has-text-success-35 font-bold fs-17">
{{ $numtoString(subtotal, { hasUnit: true }) }}
{{ $formatNum(subtotal, { hasUnit: true }) }}
</td>
</tr>
</tbody>