mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
carga de checks de misma direccion FP implementados en presupuesto cliente
This commit is contained in:
@ -105,7 +105,7 @@ class Direcciones {
|
||||
|
||||
|
||||
|
||||
cargarDatos(datos, datosGenerales, direccionesFP = []) {
|
||||
cargarDatos(datos, datosGenerales, direccionesFP = [], direccionesFPChecks = {}) {
|
||||
|
||||
self = this;
|
||||
|
||||
@ -130,7 +130,6 @@ class Direcciones {
|
||||
});
|
||||
}, 0);
|
||||
|
||||
|
||||
$('#tiradaEnvios-' + datosGenerales.selectedTirada).trigger('click');
|
||||
|
||||
if (datos.entrega_taller == 1) {
|
||||
@ -198,6 +197,17 @@ class Direcciones {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
if(direccionesFPChecks.addFP1isAddMain && direccionesFPChecks.addFP1isAddMain === "true") {
|
||||
this.sameAddPrincipalFP1.prop('checked', true);
|
||||
}
|
||||
|
||||
if (direccionesFPChecks.addFP2isFP1 && direccionesFPChecks.addFP2isFP1 === "true") {
|
||||
this.sameAddFP1.prop('checked', true);
|
||||
}
|
||||
else if( direccionesFPChecks.addFP2isAddMain && direccionesFPChecks.addFP2isAddMain === "true") {
|
||||
this.sameAddPrincipalFP2.prop('checked', true);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
$('#loader').modal('hide');
|
||||
@ -684,6 +694,14 @@ class Direcciones {
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
getDireccionesFPChecks() {
|
||||
return {
|
||||
addFP1isAddMain: this.sameAddPrincipalFP1.is(':checked'),
|
||||
addFP2isAddMain: this.sameAddPrincipalFP2.is(':checked'),
|
||||
addFP2isFP1: this.sameAddFP1.is(':checked')
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -801,7 +801,6 @@ class PresupuestoCliente {
|
||||
}
|
||||
|
||||
if( this.direcciones.direccionesFP1.length > 0) {
|
||||
|
||||
this.datos.direccionesFP1 = this.direcciones.direccionesFP1[0].getFormData();
|
||||
}
|
||||
|
||||
@ -809,6 +808,8 @@ class PresupuestoCliente {
|
||||
this.datos.direccionesFP2 = this.direcciones.direccionesFP2[0].getFormData();
|
||||
}
|
||||
|
||||
this.datos.direcciones_fp_checks = this.direcciones.getDireccionesFPChecks();
|
||||
|
||||
if (save) {
|
||||
this.datos.datosCabecera = {
|
||||
titulo: this.datosGenerales.titulo.val(),
|
||||
@ -848,8 +849,9 @@ class PresupuestoCliente {
|
||||
self.direcciones.handleChangeCliente();
|
||||
|
||||
self.direcciones.cargarDatos(response.data.direcciones, response.data.datosGenerales,
|
||||
response.data.direccionesFerroPrototipo && response.data.direccionesFerroPrototipo.length > 0 ?
|
||||
response.data.direccionesFerroPrototipo : []
|
||||
(response.data.direccionesFerroPrototipo && response.data.direccionesFerroPrototipo.length > 0) ?
|
||||
response.data.direccionesFerroPrototipo : [] ,
|
||||
response.data.direccionesFPChecks ? JSON.parse(response.data.direccionesFPChecks) : {}
|
||||
);
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user