feat: add expiry warnings dashboard (#69) #73

Merged
makiolaj merged 2 commits from feature/issue-69-expiry-dashboard into develop 2026-02-25 01:27:42 +00:00
Showing only changes of commit bf4d365357 - Show all commits

View File

@@ -83,6 +83,14 @@
@updated="handleItemUpdated" @updated="handleItemUpdated"
/> />
<!-- Expiry Dashboard -->
<div class="mb-6">
<InventoryExpiryDashboard
:items="inventoryItems"
@view-item="editingItem = $event"
/>
</div>
<!-- Inventory List --> <!-- Inventory List -->
<InventoryList <InventoryList
ref="inventoryListRef" ref="inventoryListRef"
@@ -111,9 +119,21 @@ const inventoryListRef = ref()
const prefilledData = ref<any>(null) const prefilledData = ref<any>(null)
const selectedTagFilters = ref<string[]>([]) const selectedTagFilters = ref<string[]>([])
const searchQuery = ref('') const searchQuery = ref('')
const inventoryItems = ref<any[]>([])
// Load inventory for dashboard
const { getInventory } = useInventory()
const loadInventoryData = async () => {
const { data } = await getInventory()
inventoryItems.value = data || []
}
// Handle scan-to-add flow (Issue #25) // Handle scan-to-add flow (Issue #25)
onMounted(() => { onMounted(async () => {
// Load inventory for dashboard
await loadInventoryData()
if (route.query.action === 'add') { if (route.query.action === 'add') {
// Pre-fill data from query params (from scan) // Pre-fill data from query params (from scan)
prefilledData.value = { prefilledData.value = {
@@ -136,15 +156,17 @@ const handleCloseAddForm = () => {
prefilledData.value = null prefilledData.value = null
} }
const handleItemAdded = (item: any) => { const handleItemAdded = async (item: any) => {
showAddForm.value = false showAddForm.value = false
prefilledData.value = null prefilledData.value = null
// Reload the inventory list // Reload the inventory list and dashboard
inventoryListRef.value?.reload() inventoryListRef.value?.reload()
await loadInventoryData()
} }
const handleItemUpdated = (item: any) => { const handleItemUpdated = async (item: any) => {
editingItem.value = null editingItem.value = null
inventoryListRef.value?.reload() inventoryListRef.value?.reload()
await loadInventoryData()
} }
</script> </script>