Vinculaciones multi-agencia

This commit is contained in:
2025-06-25 12:38:50 -06:00
parent a830e3a84a
commit c5c698dbe4
62 changed files with 5107 additions and 1454 deletions

View File

@@ -103,27 +103,27 @@
e.preventDefault(); // Prevenir envío por defecto
// Obtener todos los campos
const clave = document.getElementById('Clave').value.trim();
const nombre = document.getElementById('Nombre').value.trim();
const rfc = document.getElementById('RFC').value.trim().toUpperCase();
const ciudad = document.getElementById('Ciudad').value.trim();
const telefono = document.getElementById('Telefono').value.trim();
const pais = document.getElementById('Pais').value.trim();
const clave = document.getElementById('Clave').value.trim();
const nombre = document.getElementById('Nombre').value.trim();
const rfc = document.getElementById('RFC').value.trim().toUpperCase();
const ciudad = document.getElementById('Ciudad').value.trim();
const telefono = document.getElementById('Telefono').value.trim();
const pais = document.getElementById('Pais').value.trim();
const entidadFederativa = document.getElementById('EntidadFederativa').value.trim();
const municipio = document.getElementById('Municipio').value.trim();
const colonia = document.getElementById('Colonia').value.trim();
const codigoPostal = document.getElementById('CodigoPostal').value.trim();
const municipio = document.getElementById('Municipio').value.trim();
const colonia = document.getElementById('Colonia').value.trim();
const codigoPostal = document.getElementById('CodigoPostal').value.trim();
// Expresiones regulares
const rfcRegex = /^[A-ZÑ&]{3,4}\d{6}[A-Z0-9]{3}$/;
const telefonoRegex = /^\d{3}\s\d{7}$/;
const rfcRegex = /^[A-ZÑ&]{3,4}\d{6}[A-Z0-9]{3}$/;
const telefonoRegex = /^\d{3}\s\d{7}$/;
const codigoPostalRegex = /^\d{5}$/;
const soloLetrasRegex = /^[a-zA-ZáéíóúÁÉÍÓÚñÑ\s]+$/;
const soloLetrasRegex = /^[a-zA-ZáéíóúÁÉÍÓÚñÑ\s]+$/;
const alfanumericoRegex = /^[a-zA-Z0-9áéíóúÁÉÍÓÚñÑ\s]+$/;
// VALIDAR CAMPOS OBLIGATORIOS
if (!clave) {
Swal.fire({ icon: 'error', title: 'Clave requerida', text: 'Por favor ingresa la clave del proveedor.', confirmButtonColor: '#dc3545' });
Swal.fire({ icon: 'warning', title: 'Clave requerida', text: 'Por favor ingresa la clave del proveedor.', confirmButtonColor: '#dc3545' });
document.getElementById('Clave').focus();
return;
}
@@ -139,7 +139,7 @@
return;
}
if (!nombre) {
Swal.fire({ icon: 'error', title: 'Nombre requerido', text: 'Por favor ingresa el nombre del proveedor.', confirmButtonColor: '#dc3545' });
Swal.fire({ icon: 'warning', title: 'Nombre requerido', text: 'Por favor ingresa el nombre del proveedor.', confirmButtonColor: '#dc3545' });
document.getElementById('Nombre').focus();
return;
}
@@ -149,7 +149,7 @@
return;
}
if (!rfc) {
Swal.fire({ icon: 'error', title: 'RFC requerido', text: 'Por favor ingresa el RFC del proveedor.', confirmButtonColor: '#dc3545' });
Swal.fire({ icon: 'warning', title: 'RFC requerido', text: 'Por favor ingresa el RFC del proveedor.', confirmButtonColor: '#dc3545' });
document.getElementById('RFC').focus();
return;
}
@@ -159,7 +159,7 @@
return;
}
if (!ciudad) {
Swal.fire({ icon: 'error', title: 'Ciudad requerida', text: 'Por favor ingresa la ciudad del proveedor.', confirmButtonColor: '#dc3545' });
Swal.fire({ icon: 'warning', title: 'Ciudad requerida', text: 'Por favor ingresa la ciudad del proveedor.', confirmButtonColor: '#dc3545' });
document.getElementById('Ciudad').focus();
return;
}