arreglado carga de cliente

This commit is contained in:
2024-11-04 23:58:18 +01:00
parent 83c8628645
commit 315d2a3acd
4 changed files with 20 additions and 10 deletions

View File

@ -64,7 +64,7 @@ class DatosGenerales {
// Selects
this.formatoLibro.init();
if (this.excluirRotativa.length != 0) {
if (!$(this.excluirRotativa).prop('hidden')){
this.cliente.init();
}
@ -102,7 +102,7 @@ class DatosGenerales {
message: window.translations["validation"].cliente,
callback: function (input) {
// Get the selected options
if(this.excluirRotativa.length == 0)
if (!$(this.excluirRotativa).prop('hidden'))
return true;
const options = $("#clienteId").select2('data');
const hasValidOption = options.some(option => parseInt(option.id) > 0);
@ -386,7 +386,7 @@ class DatosGenerales {
this.coleccion.val(datos.coleccion);
this.referenciaCliente.val(datos.referenciaCliente);
if (this.excluirRotativa.length != 0) {
if (!$(this.excluirRotativa).prop('hidden')){
this.cliente.setOption(datos.clienteId, datos.clienteNombre);
this.cliente.setVal(datos.clienteId);
$(this.cliente).trigger('change');
@ -441,7 +441,7 @@ class DatosGenerales {
}
getCliente(){
if (this.excluirRotativa.length == 0)
if ($(this.excluirRotativa).prop('hidden'))
return $('#clienteId').val();
return this.cliente.getVal();
}

View File

@ -599,7 +599,7 @@ class PresupuestoCliente {
this.calcularPresupuesto = false;
this.datosGenerales.cargarDatos(response.data.datosGenerales);
if (this.datosGenerales.excluirRotativa.length !== 0) {
if (!$(this.datosGenerales.excluirRotativa).prop("hidden")) {
this.direcciones.handleChangeCliente();
}
this.disenioInterior.cargarDatos(response.data.interior, response.data.datosGenerales.papelInteriorDiferente);