feat: consulta pública de pedidos por código
This commit is contained in:
@@ -103,6 +103,21 @@
|
||||
:items-per-page-options="[10, 25, 50, 100]"
|
||||
show-expand
|
||||
>
|
||||
<!-- Código -->
|
||||
<template #item.code="{ item }">
|
||||
<span v-if="item.code" class="d-flex align-center">
|
||||
<code class="mr-1">{{ item.code }}</code>
|
||||
<v-btn
|
||||
icon="mdi-content-copy"
|
||||
size="x-small"
|
||||
variant="text"
|
||||
:title="`Copiar código ${item.code}`"
|
||||
@click="copyCode(item.code)"
|
||||
></v-btn>
|
||||
</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
|
||||
<!-- Fecha formateada -->
|
||||
<template #item.date="{ item }">
|
||||
{{ formatDate(item.date) }}
|
||||
@@ -267,6 +282,21 @@
|
||||
:items-per-page-options="[10, 25, 50, 100]"
|
||||
show-expand
|
||||
>
|
||||
<!-- Código -->
|
||||
<template #item.code="{ item }">
|
||||
<span v-if="item.code" class="d-flex align-center">
|
||||
<code class="mr-1">{{ item.code }}</code>
|
||||
<v-btn
|
||||
icon="mdi-content-copy"
|
||||
size="x-small"
|
||||
variant="text"
|
||||
:title="`Copiar código ${item.code}`"
|
||||
@click="copyCode(item.code)"
|
||||
></v-btn>
|
||||
</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
|
||||
<!-- Fecha formateada -->
|
||||
<template #item.date="{ item }">
|
||||
{{ formatDate(item.date) }}
|
||||
@@ -406,6 +436,7 @@ const activeTab = ref('pending'); // Tab activo por defecto
|
||||
// Headers para tabla de ventas sin sincronizar
|
||||
const pendingHeaders = [
|
||||
{ title: 'ID', key: 'id', sortable: true },
|
||||
{ title: 'Código', key: 'code', sortable: true },
|
||||
{ title: 'Fecha', key: 'date', sortable: true },
|
||||
{ title: 'Cliente', key: 'customer_name', sortable: true },
|
||||
{ title: 'Total', key: 'total', sortable: true },
|
||||
@@ -416,6 +447,7 @@ const pendingHeaders = [
|
||||
// Headers para tabla de ventas sincronizadas
|
||||
const syncedHeaders = [
|
||||
{ title: 'ID', key: 'id', sortable: true },
|
||||
{ title: 'Código', key: 'code', sortable: true },
|
||||
{ title: 'Fecha', key: 'date', sortable: true },
|
||||
{ title: 'Cliente', key: 'customer_name', sortable: true },
|
||||
{ title: 'Total', key: 'total', sortable: true },
|
||||
@@ -509,6 +541,17 @@ function clearFilters() {
|
||||
dateTo.value = '';
|
||||
}
|
||||
|
||||
async function copyCode(code) {
|
||||
try {
|
||||
if (navigator.clipboard?.writeText) {
|
||||
await navigator.clipboard.writeText(code)
|
||||
}
|
||||
snackbar.value = { show: true, message: 'Código copiado', color: 'success' }
|
||||
} catch {
|
||||
snackbar.value = { show: true, message: 'No se pudo copiar el código', color: 'error' }
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadCatalogSales();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user