feature/correccion-de-atajos-tranportes
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
import { driversApi, type Driver } from '$lib/api/dashboard/a76/drivers';
|
||||
import { transportersApi, type Transporter } from '$lib/api/dashboard/a76/transporters';
|
||||
import { companyStore } from '$lib/stores/company.svelte';
|
||||
import { onMount, onDestroy } from 'svelte';
|
||||
|
||||
let {
|
||||
open = $bindable(false),
|
||||
@@ -85,6 +86,7 @@
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
if (loading) return;
|
||||
error = null;
|
||||
loading = true;
|
||||
|
||||
@@ -162,6 +164,17 @@
|
||||
open = false;
|
||||
error = null;
|
||||
}
|
||||
|
||||
function onSaveFormEvent() {
|
||||
void handleSubmit();
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
document.addEventListener('save-form', onSaveFormEvent);
|
||||
});
|
||||
onDestroy(() => {
|
||||
document.removeEventListener('save-form', onSaveFormEvent);
|
||||
});
|
||||
</script>
|
||||
|
||||
<Dialog.Root bind:open>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import { Label } from '$lib/components/ui/label';
|
||||
import { trailersApi, type Trailer } from '$lib/api/dashboard/a76/trailers';
|
||||
import { companyStore } from '$lib/stores/company.svelte';
|
||||
import { onMount, onDestroy } from 'svelte';
|
||||
|
||||
let {
|
||||
open = $bindable(false),
|
||||
@@ -53,6 +54,7 @@
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
if (loading) return;
|
||||
error = null;
|
||||
loading = true;
|
||||
|
||||
@@ -92,6 +94,17 @@
|
||||
open = false;
|
||||
error = null;
|
||||
}
|
||||
|
||||
function onSaveFormEvent() {
|
||||
void handleSubmit();
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
document.addEventListener('save-form', onSaveFormEvent);
|
||||
});
|
||||
onDestroy(() => {
|
||||
document.removeEventListener('save-form', onSaveFormEvent);
|
||||
});
|
||||
</script>
|
||||
|
||||
<Dialog.Root bind:open>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import { Label } from '$lib/components/ui/label';
|
||||
import { transportersApi, type Transporter } from '$lib/api/dashboard/a76/transporters';
|
||||
import { companyStore } from '$lib/stores/company.svelte';
|
||||
import { onMount, onDestroy } from 'svelte';
|
||||
|
||||
let {
|
||||
open = $bindable(false),
|
||||
@@ -76,6 +77,7 @@
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
if (loading) return;
|
||||
error = null;
|
||||
loading = true;
|
||||
|
||||
@@ -117,6 +119,17 @@
|
||||
open = false;
|
||||
error = null;
|
||||
}
|
||||
|
||||
function onSaveFormEvent() {
|
||||
void handleSubmit();
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
document.addEventListener('save-form', onSaveFormEvent);
|
||||
});
|
||||
onDestroy(() => {
|
||||
document.removeEventListener('save-form', onSaveFormEvent);
|
||||
});
|
||||
</script>
|
||||
|
||||
<Dialog.Root bind:open>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import { Label } from '$lib/components/ui/label';
|
||||
import { vehiclesApi, type Vehicle } from '$lib/api/dashboard/a76/vehicles';
|
||||
import { companyStore } from '$lib/stores/company.svelte';
|
||||
import { onMount, onDestroy } from 'svelte';
|
||||
|
||||
let {
|
||||
open = $bindable(false),
|
||||
@@ -90,6 +91,7 @@
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
if (loading) return;
|
||||
error = null;
|
||||
loading = true;
|
||||
|
||||
@@ -131,6 +133,17 @@
|
||||
open = false;
|
||||
error = null;
|
||||
}
|
||||
|
||||
function onSaveFormEvent() {
|
||||
void handleSubmit();
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
document.addEventListener('save-form', onSaveFormEvent);
|
||||
});
|
||||
onDestroy(() => {
|
||||
document.removeEventListener('save-form', onSaveFormEvent);
|
||||
});
|
||||
</script>
|
||||
|
||||
<Dialog.Root bind:open>
|
||||
|
||||
@@ -19,7 +19,7 @@ export const obtenerAtajosPrincipalesEdicionPedimento = (acciones: {
|
||||
action: () => acciones.cambiarPestana('cuentas-compensacion')
|
||||
},
|
||||
{ key: 'Alt+X', description: 'Tab Otros', action: () => acciones.cambiarPestana('otros-datos') },
|
||||
{ key: 'Alt+J', description: 'Tab Digital', action: () => acciones.cambiarPestana('digitalizacion') },
|
||||
{ key: 'Alt+W', description: 'Tab Digital', action: () => acciones.cambiarPestana('digitalizacion') },
|
||||
{ key: 'Ctrl+S', description: 'Guardar cambios', action: acciones.manejarGuardar },
|
||||
{ key: 'Escape', description: 'Regresar / Cancelar', action: acciones.manejarRegresar }
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user