feat(unified-mobile-material-design): Complete US-113 - Batch Actions per Module contextuale
Implemented by Ralph autonomous loop. Iteration: 2 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -984,6 +984,7 @@ import DragDropOverlay from '@data-entry/components/bulk/DragDropOverlay.vue'
|
||||
import MobileTopBar from '@shared/components/mobile/MobileTopBar.vue'
|
||||
import MobileBottomNav from '@shared/components/mobile/MobileBottomNav.vue'
|
||||
import MobileSelectionFooter from '@shared/components/mobile/MobileSelectionFooter.vue'
|
||||
import { exportToExcel } from '@reports/utils/exportUtils'
|
||||
import BatchGroupHeader from '@data-entry/components/bulk/BatchGroupHeader.vue'
|
||||
import ProcessingStatusCell from '@data-entry/components/bulk/ProcessingStatusCell.vue'
|
||||
import Paginator from 'primevue/paginator'
|
||||
@@ -1147,13 +1148,20 @@ const handleBottomNavClick = (item) => {
|
||||
}
|
||||
}
|
||||
|
||||
// US-103: Selection footer actions for MobileSelectionFooter component
|
||||
// US-103/US-113: Selection footer actions for MobileSelectionFooter component
|
||||
// Bonuri batch actions: Delete + Export
|
||||
const mobileSelectionActions = computed(() => [
|
||||
{
|
||||
label: 'Șterge',
|
||||
icon: 'pi pi-trash',
|
||||
severity: 'danger',
|
||||
handler: () => confirmBulkDelete()
|
||||
},
|
||||
{
|
||||
label: 'Export',
|
||||
icon: 'pi pi-download',
|
||||
severity: 'secondary',
|
||||
handler: () => exportSelectedReceipts()
|
||||
}
|
||||
])
|
||||
|
||||
@@ -2329,6 +2337,61 @@ const approveSelected = async () => {
|
||||
await store.fetchStats()
|
||||
}
|
||||
|
||||
/**
|
||||
* US-113: Export selected receipts to Excel.
|
||||
* Exports receipt data including store name, date, amount, VAT, status etc.
|
||||
*/
|
||||
const exportSelectedReceipts = () => {
|
||||
const receipts = selectedReceipts.value
|
||||
if (receipts.length === 0) {
|
||||
toast.add({
|
||||
severity: 'warn',
|
||||
summary: 'Atenție',
|
||||
detail: 'Nu există bonuri selectate pentru export',
|
||||
life: 3000,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// Map receipt data to export format
|
||||
const exportData = receipts.map(r => ({
|
||||
'Magazin': r.store_name || r.partner_name || '-',
|
||||
'CUI': r.cui || '-',
|
||||
'Data': r.receipt_date ? formatDate(r.receipt_date) : '-',
|
||||
'Nr. Bon': r.receipt_number || '-',
|
||||
'Tip Document': r.receipt_type === 'receipt' ? 'Bon' : r.receipt_type === 'invoice' ? 'Factură' : r.receipt_type || '-',
|
||||
'Direcție': r.direction === 'expense' ? 'Cheltuială' : r.direction === 'income' ? 'Venit' : r.direction || '-',
|
||||
'Suma': r.amount || 0,
|
||||
'TVA': r.tva_total || 0,
|
||||
'Metodă Plată': getPaymentMethodLabel(r) || '-',
|
||||
'Status': getStatusLabel(r.status) || '-',
|
||||
'Creat de': r.created_by || '-',
|
||||
'Creat la': r.created_at ? formatDate(r.created_at) : '-',
|
||||
}))
|
||||
|
||||
const result = exportToExcel(
|
||||
exportData,
|
||||
`bonuri_selectate_${receipts.length}`,
|
||||
'Bonuri'
|
||||
)
|
||||
|
||||
if (result.success) {
|
||||
toast.add({
|
||||
severity: 'success',
|
||||
summary: 'Export reușit',
|
||||
detail: `${receipts.length} bonuri exportate cu succes`,
|
||||
life: 3000,
|
||||
})
|
||||
} else {
|
||||
toast.add({
|
||||
severity: 'error',
|
||||
summary: 'Eroare',
|
||||
detail: 'Nu s-a putut exporta lista de bonuri',
|
||||
life: 5000,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* US-026: Confirmation dialog for bulk delete.
|
||||
* Uses PrimeVue ConfirmDialog to ask user before deleting multiple receipts.
|
||||
|
||||
Reference in New Issue
Block a user