diff --git a/frontend/src/lib/config/shortcuts.ts b/frontend/src/lib/config/shortcuts.ts index 16249465..13ad46de 100644 --- a/frontend/src/lib/config/shortcuts.ts +++ b/frontend/src/lib/config/shortcuts.ts @@ -19,6 +19,9 @@ export const GLOBAL_NAV = { 'e': '/dashboard/reference_data/customs_sections#', 'd': '/dashboard/reference_data/customs_sections', + // Customs & Brokers + 'a': '/dashboard/customs_brokers', + // Invoices 'i': '/dashboard/invoices', diff --git a/frontend/src/lib/config/shortcuts/customs-broker-edit-shortcuts.ts b/frontend/src/lib/config/shortcuts/customs-broker-edit-shortcuts.ts new file mode 100644 index 00000000..dc716087 --- /dev/null +++ b/frontend/src/lib/config/shortcuts/customs-broker-edit-shortcuts.ts @@ -0,0 +1,35 @@ +import type { ShortcutDef } from '$lib/stores/shortcut-store'; + +export const obtenerAtajosEdicionAgente = (acciones: { + irGeneral: () => void; + irContacto: () => void; + irDireccion: () => void; + guardar: () => void; + cancelar: () => void; +}): ShortcutDef[] => [ + { + key: 'Alt+Digit1', + description: 'Tab General', + action: acciones.irGeneral + }, + { + key: 'Alt+Digit2', + description: 'Tab Contacto', + action: acciones.irContacto + }, + { + key: 'Alt+Digit3', + description: 'Tab Dirección', + action: acciones.irDireccion + }, + { + key: 'Ctrl+S', + description: 'Guardar', + action: acciones.guardar + }, + { + key: 'Escape', + description: 'Cancelar / Volver', + action: acciones.cancelar + } + ]; diff --git a/frontend/src/lib/config/shortcuts/customs-brokers-list-shortcuts.ts b/frontend/src/lib/config/shortcuts/customs-brokers-list-shortcuts.ts new file mode 100644 index 00000000..88d2a8d2 --- /dev/null +++ b/frontend/src/lib/config/shortcuts/customs-brokers-list-shortcuts.ts @@ -0,0 +1,31 @@ +import type { ShortcutDef } from '$lib/stores/shortcut-store'; + +export const obtenerAtajosListaAgentes = (acciones: { + irAgentes: () => void; + irAduanas: () => void; + crear: () => void; + recargar: () => void; +}): ShortcutDef[] => [ + { + key: 'Alt+Digit1', + description: 'Ir a Agentes', + action: acciones.irAgentes, + context: 'Customs Brokers Navigation' + }, + { + key: 'Alt+Digit2', + description: 'Ir a Aduanas', + action: acciones.irAduanas, + context: 'Customs Brokers Navigation' + }, + { + key: 'Alt+Shift+N', + description: 'Nuevo Registro', + action: acciones.crear + }, + { + key: 'Alt+Shift+R', + description: 'Actualizar Lista', + action: acciones.recargar + } + ]; diff --git a/frontend/src/routes/dashboard/customs_brokers/+page.svelte b/frontend/src/routes/dashboard/customs_brokers/+page.svelte index a1a68f0b..f4af9ee9 100644 --- a/frontend/src/routes/dashboard/customs_brokers/+page.svelte +++ b/frontend/src/routes/dashboard/customs_brokers/+page.svelte @@ -1,333 +1,479 @@
- -
-

AGENTES ADUANALES

-

- Catálogo de agentes aduanales y apoderados legales -

-
+ +
+
+

GESTIÓN ADUANAL

+

Administración de Agentes y Secciones Aduanales

+
+
-
- -
- -
-
-
-

Filtros

- Busque por nombre o patente -
-
-
- - -
-
- - -
-
- -
-
-
-
+ + + + Agentes Aduanales + + + Secciones Aduanales + + - -
-
-

Listado

-
- - {filteredItems.length} registros - - -
-
+ + +
+ +
+
+
+

Filtros

+ Busque por nombre o patente +
+
+
+ + +
+
+ + +
+
+ +
+
+
+
-
- - - - - - - - - - - {#if isLoading} - - {:else if paginatedItems.length === 0} - - {:else} - {#each paginatedItems as item (item.broker_key)} - selectItem(item)} - > - - - - - - {/each} - {/if} - -
PatenteNombreLicenciaCiudad
Cargando...
No se encontraron registros
{item.broker_key}{item.name || '-'}{item.license || '-'}{item.city || '-'}
-
- - {#if totalItems > pageSize} -
- - - Página {currentPage} de {Math.ceil(totalItems / pageSize)} - - -
- {/if} -
-
+ +
+
+

Listado

+
+ + {filteredItems.length} registros + + +
+
- -
-
-

Detalles del Agente

-

- {selectedItem?.name || '---'} -

-
- Patente: {selectedItem?.broker_key || ''} -
-
+
+ + + + + + + + + + + {#if isLoading} + + {:else if paginatedItems.length === 0} + + {:else} + {#each paginatedItems as item (item.broker_key)} + selectItem(item)} + > + + + + + + {/each} + {/if} + +
PatenteNombreLicenciaCiudad
Cargando...
No se encontraron registros
{item.broker_key}{item.name || '-'}{item.license || '-'}{item.city || '-'}
+
+ + {#if totalItems > pageSize} +
+ + + Página {currentPage} de {Math.ceil(totalItems / pageSize)} + + +
+ {/if} +
+
-
- {#if selectedItem} -
-
- -

{selectedItem.license || '-'}

-
+ +
+
+

+ Detalles del Agente +

+

+ {selectedItem?.name || '---'} +

+
+ Patente: {selectedItem?.broker_key || ''} +
+
- {#if selectedItem.tax_id} -
- -

{selectedItem.tax_id}

-
- {/if} - -
- -
-

{selectedItem.address || ''}

-

- {[selectedItem.city, selectedItem.state].filter(Boolean).join(', ')} -

-

- {[selectedItem.postal_code, selectedItem.country].filter(Boolean).join(', ')} -

-
-
- -
- - {#if selectedItem.email} -
- - {selectedItem.email} -
- {/if} - {#if selectedItem.phone} -
- - {selectedItem.phone} -
- {/if} - {#if selectedItem.contact} -
- Contacto: {selectedItem.contact} -
- {/if} -
-
- {:else} -
- -

Selecciona un agente

-
- {/if} -
-
-
+
+ {#if selectedItem} +
+
+ +

{selectedItem.license || '-'}

+
+ + {#if selectedItem.tax_id} +
+ +

{selectedItem.tax_id}

+
+ {/if} + +
+ +
+

{selectedItem.address || ''}

+

+ {[selectedItem.city, selectedItem.state].filter(Boolean).join(', ')} +

+

+ {[selectedItem.postal_code, selectedItem.country].filter(Boolean).join(', ')} +

+
+
+ +
+ + {#if selectedItem.email} +
+ + {selectedItem.email} +
+ {/if} + {#if selectedItem.phone} +
+ + {selectedItem.phone} +
+ {/if} + {#if selectedItem.contact} +
+ Contacto: + {selectedItem.contact} +
+ {/if} +
+
+ {:else} +
+ +

Selecciona un agente

+
+ {/if} +
+
+ + + + + + + + + + + +
+
+
+
+ {#if activeTab === 'brokers'} + + + + {:else} + + {/if} +
+
- - -
-
-
- - - -
-
-
\ No newline at end of file diff --git a/frontend/src/routes/dashboard/customs_brokers/edit/[[id]]/+page.svelte b/frontend/src/routes/dashboard/customs_brokers/edit/[[id]]/+page.svelte index 3da1d7cf..07e962b2 100644 --- a/frontend/src/routes/dashboard/customs_brokers/edit/[[id]]/+page.svelte +++ b/frontend/src/routes/dashboard/customs_brokers/edit/[[id]]/+page.svelte @@ -1,327 +1,397 @@
- -
-
-
- -

- {isEdit ? `Agente ${formData.broker_key}` : 'Nuevo Agente Aduanal'} -

- - {isEdit ? 'Edición' : 'Nuevo'} - -
-

- {isEdit ? 'Modifica la información del agente aduanal' : 'Registra un nuevo agente aduanal en el sistema'} -

-
-
+ +
+
+
+ +

+ {isEdit ? `Agente ${formData.broker_key}` : 'Nuevo Agente Aduanal'} +

+ + {isEdit ? 'Edición' : 'Nuevo'} + +
+

+ {isEdit + ? 'Modifica la información del agente aduanal' + : 'Registra un nuevo agente aduanal en el sistema'} +

+
+
- + - -
-
{ e.preventDefault(); handleSave(); }}> - - - - - - - Información General - Identificación oficial del agente y patente. - - -
-
- - -

Clave interna o número de patente único.

-
-
- - -
-
- - - -
- - -
- -
-
- - -
-
- - -
-
-
-
-
+ +
+ { + e.preventDefault(); + handleSave(); + }} + > + + + + + + Información General + Identificación oficial del agente y patente. + + +
+
+ + +

+ Clave interna o número de patente único. +

+
+
+ + +
+
- - - - - Información de Contacto - Datos para comunicación con el agente. - - -
-
- - -
-
- - -
-
- - + -
-
- - -
-
- - -
-
- - -
-
-
-
-
+
+ + +
- - - - - Domicilio Fiscal - Ubicación registrada del agente aduanal. - - -
- - -
-
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
-
-
-
+
+
+ + +
+
+ + +
+
+
+
+
-
- -
+ + + + + Información de Contacto + Datos para comunicación con el agente. + + +
+
+ + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ + + + + + Domicilio Fiscal + Ubicación registrada del agente aduanal. + + +
+ + +
+
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+
+
+
+
+ +
-
-
- - -
- - - General - - - Contacto - - - Dirección - - -
-
+
+
+ + +
+ + + General + + + Contacto + + + Dirección + + +
+
- -
- - -
-
-
\ No newline at end of file + +
+ + +
+
+