Parametros generales agregados
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
'act', 'valid', 'mostr', 'usar', 'utiliz', 'restring', 'bloqueo',
|
||||
'omiti', 'oculta', 'resaltar', 'cal', 'mues', 'mens', 'cont', 'firm',
|
||||
'esc', 'adv', 'val', 'tom', 'nom', 'rev', 'imp', 'temp', 'costo',
|
||||
'des', 'asig', 'calc', 'param', 'fracc', 'valor', 'cove', 'loc', 'inter', 'inclu', 'actvalor', 'trans'
|
||||
'des', 'asig', 'calc', 'param', 'fracc', 'valor', 'cove', 'loc', 'inter', 'inclu', 'actvalor', 'trans', 'cambiar', 'reasigna'
|
||||
];
|
||||
// Be more lenient: if it has the prefix and is 0, 1, or null, it's likely a toggle
|
||||
return (v === 0 || v === 1 || v === null || v === undefined) &&
|
||||
@@ -54,6 +54,15 @@
|
||||
console.log("Browse failed:", err);
|
||||
}
|
||||
}
|
||||
let selectValue = $state(String(value));
|
||||
$effect(() => {
|
||||
selectValue = String(value);
|
||||
});
|
||||
|
||||
function handleSelectChange(v: string) {
|
||||
selectValue = v;
|
||||
onChange(v);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col gap-2.5 p-4 rounded-xl bg-white/5 border border-white/5 hover:border-primary/30 transition-all group">
|
||||
@@ -65,12 +74,14 @@
|
||||
{#if mode === 'select' && options}
|
||||
<Select.Root
|
||||
type="single"
|
||||
value={String(value)}
|
||||
onValueChange={onChange}
|
||||
bind:value={selectValue}
|
||||
onValueChange={handleSelectChange}
|
||||
disabled={disabled}
|
||||
>
|
||||
<Select.Trigger class="w-full bg-[#0f0f0f] border-white/10 text-white rounded-xl focus:ring-primary/40 h-11 px-4">
|
||||
<Select.Value placeholder="Seleccionar..." />
|
||||
<Select.Trigger class="w-full bg-[#0f0f0f] border-white/10 text-white rounded-xl focus:ring-primary/40 h-11 px-4 flex items-center justify-between group">
|
||||
<span class="truncate">
|
||||
{options.find(opt => String(opt.value) === selectValue)?.label || "Seleccionar..."}
|
||||
</span>
|
||||
</Select.Trigger>
|
||||
<Select.Content class="bg-[#0f0f0f] border-white/10 text-white min-w-[200px]">
|
||||
{#each options as opt}
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
import { fade } from 'svelte/transition';
|
||||
import * as Tabs from '$lib/components/ui/tabs';
|
||||
import SettingFormField from './SettingFormField.svelte';
|
||||
import { Button } from '$lib/components/ui/button';
|
||||
import {
|
||||
AlertTriangle,
|
||||
CreditCard,
|
||||
FileEdit,
|
||||
RefreshCw,
|
||||
Layers
|
||||
} from 'lucide-svelte';
|
||||
|
||||
interface Props {
|
||||
currentData: any;
|
||||
@@ -10,17 +18,22 @@
|
||||
|
||||
let { currentData = {}, onUpdate }: Props = $props();
|
||||
|
||||
let formData: any = $state({ ...currentData });
|
||||
// Initialize local/loc fields with defaults and keep in sync with currentData prop
|
||||
let formData: any = $state({
|
||||
DownloadFTP: 'No',
|
||||
DescargarFTPoLocal: 'FTP',
|
||||
MinsDownLFTP: 0,
|
||||
UsarFechaEmisionFactura: 'false',
|
||||
Campo18Valsaaim3: 0,
|
||||
...currentData
|
||||
});
|
||||
|
||||
// Initialize local/loc fields if they don't exist
|
||||
$effect(() => {
|
||||
const defaults = {
|
||||
DownloadFTP: formData.DownloadFTP || 'No',
|
||||
DescargarFTPoLocal: formData.DescargarFTPoLocal || 'FTP',
|
||||
MinsDownLFTP: formData.MinsDownLFTP || 0,
|
||||
};
|
||||
// Object.assign(formData, { ...defaults, ...currentData });
|
||||
formData = { ...defaults, ...currentData };
|
||||
// Update state when currentData prop changes from outside
|
||||
const newData = { ...currentData };
|
||||
for (const key in newData) {
|
||||
formData[key] = newData[key];
|
||||
}
|
||||
});
|
||||
|
||||
function handleFieldChange(key: string, value: any) {
|
||||
@@ -114,7 +127,44 @@
|
||||
PathLocalParaDescDe: "Ruta Local",
|
||||
AgregarRemplazarAutomatico: "Agregar/Remplazar Aut",
|
||||
ActivarProcesoVEquipment: "Activar/Desactivar proceso para JD Edwards",
|
||||
ActivarProcesoDesperdicioJDEdwards: "Activar proceso de desperdicio para JD Edwards"
|
||||
ActivarProcesoDesperdicioJDEdwards: "Activar proceso de desperdicio para JD Edwards",
|
||||
utilizarnombregenericomainx30: "Utilizar Nombre Genérico Mainx 30",
|
||||
utilizartcrespectoatipoped: "Utilizar TC Respecto Al Tipo de Pedimento",
|
||||
tomardecimalescompletos: "Tomar Decimales Completos en las Impresiones de Facturas de Importación y Exportación",
|
||||
incluirremesaeninterfazaawinsaai: "Incluir Remesa en Interfaz AA (WINSAAI)",
|
||||
cambiarpesosporcostounitario: "Cambiar Pesos Por Costo Unitario en Exportaciones Mexicanas y Bilingües",
|
||||
utilizarsolopartesnaftaenco: "Utilizar Solo Partes Nafta En CO",
|
||||
bloqueodeediciondefacturas: "Bloqueo De Edición De Facturas",
|
||||
reasignafraccionclase: "Reasigna Fracción en Reporte de Descargos",
|
||||
calcularcostounitarioenbaseavalortotal: "Calcula Costo Unitario en Base a Valor Total Capturado",
|
||||
parametroauxiliar: "Seleccionar versión de B.O.M a Descargar",
|
||||
usarcontroldefechasdeversion: "Control de Versiones de Bom por Fechas",
|
||||
desactivaciondemodulos: "Activar/Desactivar Módulos",
|
||||
restringepaisimpo: "Restringir país de Korea para operaciones de Importación.",
|
||||
restringpaisexpo: "Restringir país de Korea para operaciones de Exportación.",
|
||||
bloqueoaldesactivarnumerodeparte: "Bloqueo para Desactivación y Activación de Número De Parte",
|
||||
geninformeanexo31: "Inventario Inicial en Base al Sistema",
|
||||
UsarFechaEmisionFactura: "Usar Fecha de Emision Factura en Manifestacion al Valor",
|
||||
utilizarfechapagopeddeundiaanterior: "Utilizar Tipo de Cambio de la Fecha de Pago de Pedimento De Un Dia Anterior",
|
||||
utilizartitulosalternativosimpresionfactura: "Utilizar Títulos Alternativos en la Impresión de las Facturas",
|
||||
utilizarequivalenciasdeumpornumerodeparte: "Utilizar factor de conversión en número de parte para Importación y exportación.",
|
||||
usarfactorconversionpornumerodeparte: "Usar Factor de Conversión Por Número De Parte",
|
||||
usartcdelafechapagopedimpoendescarga: "Usar Tipo de Cambio de la Fecha de Pago Pedimento de Importación en Descarga",
|
||||
usarvude128o256: "Utilizar Ventanilla Unica con Encriptacion de 256",
|
||||
agregarnumeroembarque: "Agregar Número Embarque",
|
||||
utilizarumdeexistenciaentransmisionvu: "Utilizar UM de Existencia En Transmision VU",
|
||||
utilizarcodigodebrokerdeclienteenmainx30: "Utilizar Codigo De Broker De Cliente En Main X 30",
|
||||
hojacalculosepararincrementablesanexo3: "En la Hoja de Calculo Separar Incrementables en el Anexo 3",
|
||||
hojacalculodesglosefacturaanexo3: "En la Hoja de Calculo Desglosar Facturas en el Anexo 3",
|
||||
usarvaloragregadoenfacturaamericana: "Usar Valor Agregado En Factura Americana",
|
||||
ocultarinformacionfraccion: "Ocultar Información Fracción",
|
||||
resaltarsaldostempconcolor: "Resaltar Saldos Temporales con Color",
|
||||
validarsectorprosecr8: "Validar Sector Prosec R8",
|
||||
agregarsubtotalinterfazaa: "Agregar Sub Total al archivo TXT para la Interfaz del Agente Aduanal",
|
||||
imprimirfacturaalterna: "Imprimir factura alterna en manifestación al valor y hoja de calculo",
|
||||
informacionamericanasubtotal: "Mostrar Información Extra En Factura Americana SubTotal",
|
||||
activarexpedienteelectronico: "Activar Expediente Electrónico",
|
||||
Campo18Valsaaim3: "Mostrar Campo 18 en 551 Valsaaim3"
|
||||
};
|
||||
|
||||
// Grouped sections for the "General" tab
|
||||
@@ -276,6 +326,74 @@
|
||||
}
|
||||
];
|
||||
|
||||
// Sections for redefined "Cont 5" tab
|
||||
const CONT5_SECTIONS = [
|
||||
{
|
||||
id: 'restricciones',
|
||||
title: 'Restricciones y Bloqueos Iniciales',
|
||||
fields: ['restringepaisimpo', 'restringpaisexpo', 'bloqueoaldesactivarnumerodeparte']
|
||||
},
|
||||
{
|
||||
id: 'inv_inicial',
|
||||
title: 'Inventario Inicial (Agrupación)',
|
||||
fields: ['geninformeanexo31']
|
||||
},
|
||||
{
|
||||
id: 'config_adicionales',
|
||||
title: 'Configuraciones Adicionales',
|
||||
fields: [
|
||||
'UsarFechaEmisionFactura',
|
||||
'utilizarfechapagopeddeundiaanterior',
|
||||
'utilizartitulosalternativosimpresionfactura',
|
||||
'utilizarequivalenciasdeumpornumerodeparte',
|
||||
'usarfactorconversionpornumerodeparte',
|
||||
'usartcdelafechapagopedimpoendescarga',
|
||||
'usarvude128o256',
|
||||
'agregarnumeroembarque',
|
||||
'utilizarumdeexistenciaentransmisionvu',
|
||||
'utilizarcodigodebrokerdeclienteenmainx30',
|
||||
'hojacalculosepararincrementablesanexo3',
|
||||
'hojacalculodesglosefacturaanexo3'
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
// Sections for redefined "Cont 6" tab
|
||||
const CONT6_SECTIONS = [
|
||||
{
|
||||
id: 'configuracion',
|
||||
title: 'Opciones de Configuración',
|
||||
fields: [
|
||||
'usarvaloragregadoenfacturaamericana',
|
||||
'ocultarinformacionfraccion',
|
||||
'resaltarsaldostempconcolor',
|
||||
'validarsectorprosecr8',
|
||||
'agregarsubtotalinterfazaa',
|
||||
'utilizarnombregenericomainx30',
|
||||
'utilizartcrespectoatipoped',
|
||||
'tomardecimalescompletos',
|
||||
'cambiarpesosporcostounitario',
|
||||
'utilizarsolopartesnaftaenco',
|
||||
'bloqueodeediciondefacturas',
|
||||
'reasignafraccionclase',
|
||||
'calcularcostounitarioenbaseavalortotal',
|
||||
'parametroauxiliar',
|
||||
'usarcontroldefechasdeversion',
|
||||
'imprimirfacturaalterna',
|
||||
'informacionamericanasubtotal'
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'acciones_modulos',
|
||||
title: 'Acciones y Módulos',
|
||||
fields: [
|
||||
'desactivaciondemodulos',
|
||||
'activarexpedienteelectronico',
|
||||
'Campo18Valsaaim3'
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
// Grouped sections for "Cont 7" tab
|
||||
const CONT7_SECTIONS = [
|
||||
{
|
||||
@@ -296,9 +414,8 @@
|
||||
{ id: 'cont2', label: 'Cont 2' },
|
||||
{ id: 'cont3', label: 'Cont 3' },
|
||||
{ id: 'cont4', label: 'Cont 4' },
|
||||
{ id: 'otros_parms', label: 'Otros Parámetros', fields: ["consecutivo", "dta", "dtaexpo", "subempresa", "fechades", "validasifra", "restringepaisimpo", "restringpaisexpo", "bloqueoaldesactivarnumerodeparte", "asignafracameparte", "validadecencant", "usartranspamedocame", "mostraradvertenciaro", "calcdutypacking", "parammultiples", "fraccnivelpais", "pathtransexpo", "pathrespuesta", "covefechaemision", "interfaceaaconsolidada", "interfaceaatcfpff", "incluirobscoveobsimpo", "agregarincreimpo", "componentebom", "limitesubensamble", "actpdfreportes", "patharchpdfimpo", "patharchpdfexpo", "noimprimircons", "mostraradvertenciarovalor", "partesypedimentosporcliente", "mensajesvurfc", "mostrarpackinglistingles", "omitirempaqueencodigobarras", "geninformeanexo31", "utilizarfechapagopeddeundiaanterior", "utilizarequivalenciasdeumpornumerodeparte", "utilizartitulosalternativosimpresionfactura"] },
|
||||
{ id: 'cont5', label: 'cont 5', fields: ["utilizarnombregenericomainx30", "utilizartcrespectoatipoped", "tomardecimalescompletos", "incluirremesaeninterfazaawinsaai", "cambiarpesosporcostounitario", "utilizarsolopartesnaftaenco", "bloqueodeediciondefacturas"] },
|
||||
{ id: 'cont6', label: 'cont 6', fields: ["reasignafraccionclase", "calcularcostounitarioenbaseavalortotal", "parametroauxiliar", "usarcontroldefechasdeversion", "desactivaciondemodulos"] },
|
||||
{ id: 'cont5', label: 'Cont 5' },
|
||||
{ id: 'cont6', label: 'Cont 6' },
|
||||
{ id: 'cont7', label: 'cont 7' }
|
||||
];
|
||||
|
||||
@@ -325,6 +442,13 @@
|
||||
{ value: 'FTP', label: 'FTP' },
|
||||
{ value: 'Ruta Local', label: 'Ruta Local' }
|
||||
];
|
||||
|
||||
// Options for Inventario Inicial in Cont 5
|
||||
const INICIAL_INV_OPTIONS = [
|
||||
{ value: 'AMBOS', label: 'AMBOS' },
|
||||
{ value: 'SCAII', label: 'SCAII' },
|
||||
{ value: 'SCAF', label: 'SCAF' }
|
||||
];
|
||||
</script>
|
||||
|
||||
<div class="h-full flex flex-col bg-[#080808] rounded-2xl border border-white/5 overflow-hidden shadow-2xl">
|
||||
@@ -333,7 +457,7 @@
|
||||
{#each TABS as tab}
|
||||
<Tabs.Trigger
|
||||
value={tab.id}
|
||||
class="px-5 py-2.5 text-xs font-bold uppercase tracking-wider transition-all data-[state=active]:bg-primary data-[state=active]:text-white rounded-lg opacity-40 data-[state=active]:opacity-100 hover:opacity-70"
|
||||
class="px-5 py-2.5 text-xs font-bold uppercase tracking-wider data-[state=active]:bg-primary data-[state=active]:text-white rounded-lg opacity-40 data-[state=active]:opacity-100 hover:opacity-70"
|
||||
>
|
||||
{tab.label}
|
||||
</Tabs.Trigger>
|
||||
@@ -480,8 +604,7 @@
|
||||
<Tabs.Content value="cont4" class="flex-1 overflow-hidden p-0 m-0 bg-transparent">
|
||||
<div class="h-full w-full overflow-y-scroll custom-scrollbar p-6 space-y-8 min-h-[600px]">
|
||||
<div class="max-w-4xl mx-auto space-y-12">
|
||||
<!-- Master Activation (Blue Box Container) -->
|
||||
<div class="space-y-6 p-8 rounded-3xl border-2 border-primary/20 bg-primary/[0.02] shadow-2xl transition-all {formData.DownloadFTP !== 'Si' ? 'grayscale opacity-60' : ''}">
|
||||
<div class="space-y-6 p-6 rounded-2xl border border-white/5 bg-white/[0.01]">
|
||||
|
||||
{#each CONT4_SECTIONS.filter(s => s.id !== 'additional_options') as section}
|
||||
<div class="space-y-6">
|
||||
@@ -499,7 +622,7 @@
|
||||
label={FIELD_LABELS[field] || field}
|
||||
value={formData[field]}
|
||||
onChange={(val) => handleFieldChange(field, val)}
|
||||
disabled={section.id !== 'ftp_master' && formData.DownloadFTP !== 'Si'}
|
||||
disabled={formData.DownloadFTP !== 'Si' && field !== 'DownloadFTP'}
|
||||
type={
|
||||
field === 'DownloadFTP' || field === 'DescargarFTPoLocal' ? 'radio' :
|
||||
field === 'MinsDownLFTP' ? 'number' :
|
||||
@@ -549,6 +672,127 @@
|
||||
</div>
|
||||
</Tabs.Content>
|
||||
|
||||
<Tabs.Content value="cont5" class="flex-1 overflow-hidden p-0 m-0 bg-transparent">
|
||||
<div class="h-full w-full overflow-y-scroll custom-scrollbar p-6 space-y-12 min-h-[600px]">
|
||||
<div class="max-w-4xl mx-auto space-y-12">
|
||||
{#each CONT5_SECTIONS as section}
|
||||
<div class="space-y-6 p-6 rounded-2xl border border-white/5 bg-white/[0.01]">
|
||||
<div class="flex items-center gap-4">
|
||||
<h3 class="text-xs font-bold uppercase tracking-[0.2em] text-primary/80 whitespace-nowrap">
|
||||
{section.title}
|
||||
</h3>
|
||||
<div class="h-[1px] w-full bg-gradient-to-r from-primary/20 to-transparent"></div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 {section.id === 'inv_inicial' ? '' : 'md:grid-cols-2 lg:grid-cols-3'} gap-6">
|
||||
{#each section.fields as field}
|
||||
<SettingFormField
|
||||
key={field}
|
||||
label={FIELD_LABELS[field] || field}
|
||||
value={formData[field]}
|
||||
onChange={(val) => handleFieldChange(field, val)}
|
||||
type={
|
||||
field === 'geninformeanexo31' ? 'radio' :
|
||||
(['UsarFechaEmisionFactura', 'agregarnumeroembarque', 'hojacalculosepararincrementablesanexo3', 'hojacalculodesglosefacturaanexo3'].includes(field) ? 'switch' : undefined)
|
||||
}
|
||||
options={field === 'geninformeanexo31' ? INICIAL_INV_OPTIONS : undefined}
|
||||
/>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
</Tabs.Content>
|
||||
|
||||
<Tabs.Content value="cont6" class="flex-1 overflow-hidden p-0 m-0 bg-transparent">
|
||||
<div class="h-full w-full overflow-y-scroll custom-scrollbar p-6 min-h-[600px]">
|
||||
<div class="max-w-5xl mx-auto grid grid-cols-1 lg:grid-cols-2 gap-12">
|
||||
<!-- Columna Izquierda: Opciones de Configuración -->
|
||||
<div class="space-y-8">
|
||||
<div class="flex items-center gap-4">
|
||||
<h3 class="text-xs font-bold uppercase tracking-[0.2em] text-primary/80 whitespace-nowrap">
|
||||
Opciones de Configuración
|
||||
</h3>
|
||||
<div class="h-[1px] w-full bg-gradient-to-r from-primary/20 to-transparent"></div>
|
||||
</div>
|
||||
|
||||
<div class="space-y-4">
|
||||
{#each CONT6_SECTIONS.find(s => s.id === 'configuracion')?.fields || [] as field}
|
||||
<div class="{field === 'usarcontroldefechasdeversion' ? 'ml-8 opacity-60' : ''} transition-opacity">
|
||||
<SettingFormField
|
||||
key={field}
|
||||
label={FIELD_LABELS[field] || field}
|
||||
value={formData[field]}
|
||||
onChange={(val) => handleFieldChange(field, val)}
|
||||
disabled={field === 'usarcontroldefechasdeversion' && !formData.parametroauxiliar}
|
||||
type="switch"
|
||||
/>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Columna Derecha: Acciones y Módulos -->
|
||||
<div class="space-y-12">
|
||||
<!-- Módulos -->
|
||||
<div class="space-y-8">
|
||||
<div class="flex items-center gap-4">
|
||||
<h3 class="text-xs font-bold uppercase tracking-[0.2em] text-primary/80 whitespace-nowrap">
|
||||
Módulos del Sistema
|
||||
</h3>
|
||||
<div class="h-[1px] w-full bg-gradient-to-r from-primary/20 to-transparent"></div>
|
||||
</div>
|
||||
|
||||
<div class="space-y-4">
|
||||
{#each CONT6_SECTIONS.find(s => s.id === 'acciones_modulos')?.fields || [] as field}
|
||||
<SettingFormField
|
||||
key={field}
|
||||
label={FIELD_LABELS[field] || field}
|
||||
value={formData[field]}
|
||||
onChange={(val) => handleFieldChange(field, val)}
|
||||
type={field === 'Campo18Valsaaim3' ? 'switch' : undefined}
|
||||
/>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Acciones -->
|
||||
<div class="space-y-8">
|
||||
<div class="flex items-center gap-4">
|
||||
<h3 class="text-xs font-bold uppercase tracking-[0.2em] text-white/40 whitespace-nowrap">
|
||||
Acciones de Gestión
|
||||
</h3>
|
||||
<div class="h-[1px] w-full bg-gradient-to-r from-white/10 to-transparent"></div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 gap-4">
|
||||
<Button variant="outline" class="w-full flex items-center justify-start gap-4 h-12 rounded-xl border-white/5 bg-white/[0.02] hover:bg-white/[0.05] text-white/80 group">
|
||||
<AlertTriangle class="w-5 h-5 text-red-500 group-hover:scale-110 transition-transform" />
|
||||
Eliminar Accesos Abiertos
|
||||
</Button>
|
||||
|
||||
<Button variant="outline" class="w-full flex items-center justify-start gap-4 h-12 rounded-xl border-white/5 bg-white/[0.02] hover:bg-white/[0.05] text-white/80 group">
|
||||
<CreditCard class="w-5 h-5 text-primary group-hover:scale-110 transition-transform" />
|
||||
Asignar Formas de Pago Para Anexo 31
|
||||
</Button>
|
||||
|
||||
<Button variant="outline" class="w-full flex items-center justify-start gap-4 h-12 rounded-xl border-white/5 bg-white/[0.02] hover:bg-white/[0.05] text-white/80 group">
|
||||
<FileEdit class="w-5 h-5 text-primary group-hover:scale-110 transition-transform" />
|
||||
Corrección de partidas expo
|
||||
</Button>
|
||||
|
||||
<Button variant="outline" class="w-full flex items-center justify-start gap-4 h-12 rounded-xl border-white/5 bg-white/[0.02] hover:bg-white/[0.05] text-white/80 group">
|
||||
<RefreshCw class="w-5 h-5 text-primary group-hover:scale-110 transition-transform" />
|
||||
Actualizar Tarifa
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Tabs.Content>
|
||||
|
||||
<Tabs.Content value="cont7" class="flex-1 overflow-hidden p-0 m-0 bg-transparent">
|
||||
<div class="h-full w-full overflow-y-scroll custom-scrollbar p-6 space-y-8 min-h-[600px]">
|
||||
{#each CONT7_SECTIONS as section}
|
||||
@@ -596,22 +840,6 @@
|
||||
</div>
|
||||
</Tabs.Content>
|
||||
|
||||
{#each TABS.filter(t => !['general', 'archivos', 'continuacion', 'cont2', 'cont3', 'cont4', 'cont7'].includes(t.id)) as tab}
|
||||
<Tabs.Content value={tab.id} class="flex-1 overflow-hidden p-0 m-0">
|
||||
<div class="h-full w-full overflow-y-scroll custom-scrollbar min-h-[600px]">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 p-8">
|
||||
{#each tab.fields || [] as field}
|
||||
<SettingFormField
|
||||
key={field}
|
||||
label={FIELD_LABELS[field] || field}
|
||||
value={formData[field]}
|
||||
onChange={(val) => handleFieldChange(field, val)}
|
||||
/>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
</Tabs.Content>
|
||||
{/each}
|
||||
</Tabs.Root>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
let activeCategory = $state('ssisgen');
|
||||
|
||||
let resolvedSettings = $state<any>(null);
|
||||
let loading = $state(false);
|
||||
let loading = $state(true); // Start as true to show loading initially
|
||||
let saving = $state(false);
|
||||
|
||||
// Form internal state tracking
|
||||
@@ -37,8 +37,15 @@
|
||||
|
||||
// Load when company changes or on mount
|
||||
$effect(() => {
|
||||
if (companyIdVal) {
|
||||
const companyId = companyIdVal; // Track dependency
|
||||
const tenantId = tenantIdVal; // Track dependency
|
||||
|
||||
if (companyId && tenantId) {
|
||||
handleResolve();
|
||||
} else {
|
||||
// If no company selected, still show loading state until we have context
|
||||
loading = true;
|
||||
resolvedSettings = null;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -102,33 +109,21 @@
|
||||
<Settings2 class="w-6 h-6 text-primary" />
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<h1 class="text-xl font-bold tracking-tight flex items-center gap-2">
|
||||
<h1 class="text-xl font-bold tracking-tight">
|
||||
Configuraciones Generales
|
||||
<span class="text-[10px] font-medium bg-white/5 px-2 py-0.5 rounded-full border border-white/10 text-white/40">SsisGen</span>
|
||||
</h1>
|
||||
<div class="flex items-center gap-2 mt-0.5">
|
||||
<div class="flex items-center gap-1.5 text-xs text-white/30">
|
||||
<Database class="w-3 h-3" />
|
||||
<span>Tenant: {tenantIdVal}</span>
|
||||
</div>
|
||||
<div class="w-1 h-1 rounded-full bg-white/10"></div>
|
||||
<div class="flex items-center gap-1.5 text-xs text-white/30">
|
||||
<Layers class="w-3 h-3" />
|
||||
<span>Empresa: {companyIdVal}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
{#if loading}
|
||||
<div in:fade class="flex items-center gap-2 text-xs text-white/40 bg-white/5 px-3 py-1.5 rounded-lg border border-white/5">
|
||||
<div class="flex items-center gap-2 text-xs text-white/40 bg-white/5 px-3 py-1.5 rounded-lg border border-white/5">
|
||||
<RefreshCw class="w-3 h-3 animate-spin" />
|
||||
Cargando...
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<Button variant="default" onclick={handleSave} disabled={saving || loading} class="h-11 px-6 bg-primary hover:bg-primary/90 text-white shadow-xl shadow-primary/20 font-bold transition-all hover:scale-[1.02] active:scale-[0.98]">
|
||||
<Button variant="default" onclick={handleSave} disabled={saving || loading} class="h-11 px-6 bg-primary hover:bg-primary/90 text-white shadow-xl shadow-primary/20 font-bold">
|
||||
{#if saving}
|
||||
<RefreshCw class="w-4 h-4 mr-2 animate-spin" />
|
||||
Guardando...
|
||||
@@ -155,7 +150,7 @@
|
||||
<p class="text-xs font-bold uppercase tracking-[0.2em] text-white/20">Inicializando Parámetros</p>
|
||||
</div>
|
||||
{:else}
|
||||
<div in:fade={{ duration: 400 }} class="flex-1 h-full shadow-2xl">
|
||||
<div class="flex-1 h-full shadow-2xl">
|
||||
<SsisGenTabsForm
|
||||
currentData={currentFormData}
|
||||
onUpdate={handleFormUpdate}
|
||||
|
||||
Reference in New Issue
Block a user