diff --git a/src/pages/Dashboard/Index.vue b/src/pages/Dashboard/Index.vue index 97441dc..c145046 100644 --- a/src/pages/Dashboard/Index.vue +++ b/src/pages/Dashboard/Index.vue @@ -6,11 +6,12 @@ import reportService from '@Services/reportService'; import useCashRegister from '@Stores/cashRegister'; import GoogleIcon from '@Shared/GoogleIcon.vue'; import OpenModal from '@/pages/POS/CashRegister/OpenModal.vue'; +import Table from '@Holos/Table.vue'; // State const router = useRouter(); const topProduct = ref(null); -const stagnantProducts = ref([]); +const stagnantProducts = ref({ data: [], total: 0 }); const loadingTopProduct = ref(true); const loadingStagnantProducts = ref(true); const today = new Date(); @@ -43,7 +44,7 @@ const fetchTopProduct = async () => { } }; -const fetchStagnantProducts = async () => { +const fetchStagnantProducts = async (page = 1) => { if (!filters.value.from_date || !filters.value.to_date) { window.Notify.warning('Por favor selecciona ambas fechas para consultar el reporte.'); return; @@ -54,11 +55,13 @@ const fetchStagnantProducts = async () => { const data = await reportService.getProductsWithoutMovement( filters.value.from_date, filters.value.to_date, - true + true, + page ); - stagnantProducts.value = data.products; + stagnantProducts.value = data.products || { data: [], total: 0 }; } catch (error) { window.Notify.error('Error al cargar productos sin movimiento.'); + stagnantProducts.value = { data: [], total: 0 }; } finally { loadingStagnantProducts.value = false; } @@ -191,43 +194,43 @@ onMounted(() => {
Cargando inventario...
- -Todos los productos se han vendido en el período reciente.
-| Producto | -Stock | -Valor Inventario | -
|---|---|---|
|
- {{ product.name }} -{{ product.sku }} - |
- - - {{ product.stock }} - - | -- - {{ formatCurrency(product.inventory_value) }} - - | -
| Producto | +Stock | + + +
|---|---|
|
+ {{ product.name }} +{{ product.sku }} + |
+ + + {{ product.stock }} + + | +
+
+
+ ¡Excelente rotación!+Todos los productos se han vendido en el período reciente. + |
+
+
Valor Total del Inventario
++ {{ formatCurrency(totalInventoryValue) }} +
+Total de Productos
+{{ models.total || 0 }}
+| SKU / CÓDIGO | -PRODUCTO | -CATEGORÍA | -PRECIO | +SKU / CÓDIGO | +PRODUCTO | +CATEGORÍA | +PRECIO | STOCK | +TOTAL | ACCIONES | @@ -191,21 +268,20 @@ onMounted(() => { :key="model.id" class="hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors" > -+ | {{ model.sku }} | -+ |
{{ model.name }} -{{ model.description }} |
- + | {{ model.category?.name || '-' }} | -+ |
{{ formatCurrency(model.price?.retail_price) }} @@ -217,15 +293,22 @@ onMounted(() => { |
- {{ model.stock }} - - | + {{ model.stock }} + + +
+
+
+ + {{ formatCurrency(model.inventory_value) }} + + |
|
|---|