feat: mostrar detalle y nombre en ventanas de sincronización Tryton

- Fallidos muestran ID + Nombre/Código + Detalle (causa del fallo)
- Actualizados muestran columna Detalle con los cambios aplicados
- Creados/Sin cambios/Verificados muestran ID + Nombre; ventas ID + Código
- Formateadores toleran backend anterior (IDs sueltos)
This commit is contained in:
2026-08-15 16:05:22 -05:00
parent 2b00b2556a
commit 87c01b11a7
4 changed files with 99 additions and 38 deletions

View File

@@ -51,9 +51,13 @@
<v-card-title class="bg-error text-white">❌ Fallidos ({{ result.failed?.length || 0 }})</v-card-title>
<v-card-text>
<v-data-table
:items="formatItems(result.failed)"
:items="formatSalesResults(result.failed)"
density="compact"
:headers="[{ title: 'ID', key: 'id' }]"
:headers="[
{ title: 'ID', key: 'id' },
{ title: 'Código', key: 'code' },
{ title: 'Detalle', key: 'detail' }
]"
></v-data-table>
</v-card-text>
</v-card>
@@ -64,9 +68,12 @@
<v-card-title class="bg-success text-white">✅ Exitosos ({{ result.successful?.length || 0 }})</v-card-title>
<v-card-text>
<v-data-table
:items="formatItems(result.successful)"
:items="formatSalesResults(result.successful)"
density="compact"
:headers="[{ title: 'ID', key: 'id' }]"
:headers="[
{ title: 'ID', key: 'id' },
{ title: 'Código', key: 'code' }
]"
></v-data-table>
</v-card-text>
</v-card>
@@ -99,9 +106,13 @@
}
},
methods: {
formatItems(ids) {
if (!ids || ids.length === 0) return [];
return ids.map(id => ({ id }));
formatSalesResults(items) {
if (!items || items.length === 0) return [];
return items.map(item =>
typeof item === 'object'
? { id: item.id, code: item.code ?? '', detail: item.error ?? '' }
: { id: item, code: '', detail: '' }
);
},
startSync() {
this.loading = true;