Vinculaciones multi-agencia
This commit is contained in:
@@ -286,20 +286,20 @@
|
||||
e.preventDefault(); // Prevenir envío por defecto
|
||||
|
||||
// Obtener todos los campos correctamente
|
||||
const aduana = document.getElementById('aduana').value;
|
||||
const patente = document.getElementById('patente').value;
|
||||
const aduana = document.getElementById('aduana').value;
|
||||
const patente = document.getElementById('patente').value;
|
||||
const agente_aduanal = document.getElementById('agente_aduanal').value.trim();
|
||||
const rfc = document.getElementById('rfc').value.trim();
|
||||
const curp = document.getElementById('curp').value.trim();
|
||||
const razon_social = document.getElementById('razon_social').value.trim();
|
||||
const rfc = document.getElementById('rfc').value.trim();
|
||||
const curp = document.getElementById('curp').value.trim();
|
||||
const razon_social = document.getElementById('razon_social').value.trim();
|
||||
|
||||
// Expresiones regulares
|
||||
const rfcRegex = /^[A-ZÑ&]{3,4}\d{6}[A-Z0-9]{3}$/;
|
||||
const curpRegex = /^[A-Z]{4}[0-9]{6}[HM](AS|BC|BS|CC|CL|CM|CS|CH|DF|DG|GT|GR|HG|JC|MC|MN|MS|NT|NL|OC|PL|QT|QR|SP|SL|SR|TC|TS|TL|VZ|YN|ZS)[A-Z]{3}[A-Z0-9]{2}$/;
|
||||
const rfcRegex = /^[A-ZÑ&]{3,4}\d{6}[A-Z0-9]{3}$/;
|
||||
const curpRegex = /^[A-Z]{4}[0-9]{6}[HM](AS|BC|BS|CC|CL|CM|CS|CH|DF|DG|GT|GR|HG|JC|MC|MN|MS|NT|NL|OC|PL|QT|QR|SP|SL|SR|TC|TS|TL|VZ|YN|ZS)[A-Z]{3}[A-Z0-9]{2}$/;
|
||||
const soloNumerosRegex = /^[0-9]+$/;
|
||||
|
||||
if (!aduana) {
|
||||
Swal.fire({ icon: 'error', title: 'Campo requerido', text: 'La aduana es obligatoria.', confirmButtonColor: '#dc3545' });
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'La aduana es obligatoria.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('aduana').focus();
|
||||
return;
|
||||
}
|
||||
@@ -309,7 +309,7 @@
|
||||
return;
|
||||
}
|
||||
if (!patente) {
|
||||
Swal.fire({ icon: 'error', title: 'Campo requerido', text: 'La patente es obligatoria.', confirmButtonColor: '#dc3545' });
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'La patente es obligatoria.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('patente').focus();
|
||||
return;
|
||||
}
|
||||
@@ -319,12 +319,12 @@
|
||||
return;
|
||||
}
|
||||
if (!agente_aduanal) {
|
||||
Swal.fire({ icon: 'error', title: 'Campo requerido', text: 'El agente aduanal es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'El agente aduanal es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('agente_aduanal').focus();
|
||||
return;
|
||||
}
|
||||
if (!rfc) {
|
||||
Swal.fire({ icon: 'error', title: 'Campo requerido', text: 'El RFC es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'El RFC es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('rfc').focus();
|
||||
return;
|
||||
}
|
||||
@@ -334,7 +334,7 @@
|
||||
return;
|
||||
}
|
||||
if (!curp) {
|
||||
Swal.fire({ icon: 'error', title: 'Campo requerido', text: 'El CURP es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'El CURP es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('curp').focus();
|
||||
return;
|
||||
}
|
||||
@@ -345,7 +345,7 @@
|
||||
return;
|
||||
}
|
||||
if (!razon_social) {
|
||||
Swal.fire({ icon: 'error', title: 'Campo requerido', text: 'La razón social es obligatoria.', confirmButtonColor: '#dc3545' });
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'La razón social es obligatoria.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('razon_social').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user