This commit is contained in:
fhm 2025-06-16 00:40:01 +07:00
parent e009306325
commit a3a3aea351
2 changed files with 6 additions and 3 deletions

View File

@ -5,7 +5,6 @@
<DashboardDatasetProductModalAdd @created="() => refresh()" /> <DashboardDatasetProductModalAdd @created="() => refresh()" />
<DashboardDatasetProductModalCategory /> <DashboardDatasetProductModalCategory />
</div> </div>
{{ modal.update.data }}
<NuxtUiTable :loading="status === 'pending'" :rows="data?.data?.data" :columns="[ <NuxtUiTable :loading="status === 'pending'" :rows="data?.data?.data" :columns="[
{ key: 'actions', label: 'Actions' }, { key: 'actions', label: 'Actions' },
{ key: 'category_name', label: 'Category' }, { key: 'category_name', label: 'Category' },

View File

@ -52,7 +52,7 @@
<div class="flex justify-between"> <div class="flex justify-between">
<span class="inline-block pe-3 w-fit">Sub Total:</span> <span class="inline-block pe-3 w-fit">Sub Total:</span>
<span class="inline-block text-green-500 font-semibold"> <span class="inline-block text-green-500 font-semibold">
{{ numeral(item.amount + item.price).format('0,0') }} {{ numeral(calculateSubtotal(item)).format('0,0') }}
</span> </span>
</div> </div>
</div> </div>
@ -129,7 +129,7 @@
<p class="dark:text-white"> <p class="dark:text-white">
Total: <span class="text-green-500 font-semibold">{{ Total: <span class="text-green-500 font-semibold">{{
numeral(storeCart.totalPrice).format('0,0') numeral(storeCart.totalPrice).format('0,0')
}}</span> }}</span>
</p> </p>
<p class="text-sm text-gray-500">Items: {{ storeCart.totalItem }}</p> <p class="text-sm text-gray-500">Items: {{ storeCart.totalItem }}</p>
</div> </div>
@ -201,6 +201,10 @@ function decrementQty(item: { amount: number }) {
} }
} }
function calculateSubtotal(product: { price: number, amount: number }) {
return product.price * product.amount;
}
const productIdWithoutSellingPrice = ref(undefined) const productIdWithoutSellingPrice = ref(undefined)
const handleInputItem = (code: string) => { const handleInputItem = (code: string) => {