mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
solucionado problema con los checks de retractilado
This commit is contained in:
@ -242,6 +242,8 @@ class DatosLibro {
|
||||
$(document).trigger('remove-servicio-lineas', 'retractilado5');
|
||||
$(document).trigger('add-servicio-lineas', 'retractilado');
|
||||
}
|
||||
else
|
||||
$(document).trigger('remove-servicio-lineas', 'retractilado');
|
||||
break;
|
||||
case 'retractilado5':
|
||||
if ($('#' + event.currentTarget.id).prop('checked')) {
|
||||
@ -249,6 +251,8 @@ class DatosLibro {
|
||||
$(document).trigger('remove-servicio-lineas', 'retractilado');
|
||||
$(document).trigger('add-servicio-lineas', 'retractilado5');
|
||||
}
|
||||
else
|
||||
$(document).trigger('remove-servicio-lineas', 'retractilado5');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@ -127,12 +127,12 @@ class Servicios {
|
||||
else if (servicio == 'retractilado') {
|
||||
const id = $('#retractilado').attr('service-id');
|
||||
if (!this.checkServiceInTable(this.serviciosAcabado.table, id))
|
||||
this.serviciosAcabado.getPresupuestoAcabado(id);
|
||||
this.serviciosAcabado.getPresupuestoAcabado(id, null, null, true);
|
||||
}
|
||||
else if (servicio == 'retractilado5') {
|
||||
const id = $('#retractilado5').attr('service-id');
|
||||
if (!this.checkServiceInTable(this.serviciosAcabado.table, id))
|
||||
this.serviciosAcabado.getPresupuestoAcabado(id);
|
||||
this.serviciosAcabado.getPresupuestoAcabado(id, null, null,true);
|
||||
}
|
||||
else if (servicio == 'plegado_guardas') {
|
||||
const id = $('#plegado_guardas').attr('service-id');
|
||||
@ -194,9 +194,10 @@ class Servicios {
|
||||
let data = this.data();
|
||||
if (data.tarifa_id == id) {
|
||||
this.remove();
|
||||
this.serviciosExtra.table.draw();
|
||||
return;
|
||||
}
|
||||
});
|
||||
this.serviciosExtra.table.draw();
|
||||
}
|
||||
else if (servicio == 'prototipo') {
|
||||
const id = $('#prototipo').attr('service-id');
|
||||
@ -204,29 +205,32 @@ class Servicios {
|
||||
var data = this.data();
|
||||
if (data.tarifa_id == id) {
|
||||
this.remove();
|
||||
this.serviciosExtra.table.draw();
|
||||
return;
|
||||
}
|
||||
});
|
||||
this.serviciosExtra.table.draw();
|
||||
}
|
||||
else if (servicio == 'retractilado') {
|
||||
const id = $('#retractilado').attr('service-id');
|
||||
this.serviciosAcabado.table.rows().every(function () {
|
||||
let data = this.data();
|
||||
if (data.tarifa_id == id) {
|
||||
this.remove();
|
||||
for(let i = this.serviciosAcabado.table.rows().count(); i >= 0; i--) {
|
||||
let data = this.serviciosAcabado.table.row(i).data();
|
||||
if (data && data.tarifa_id == id) {
|
||||
this.serviciosAcabado.table.row(i).remove();
|
||||
this.serviciosAcabado.table.draw();
|
||||
return;
|
||||
}
|
||||
});
|
||||
this.serviciosAcabado.table.draw();
|
||||
}
|
||||
}
|
||||
else if (servicio == 'retractilado5') {
|
||||
const id = $('#retractilado5').attr('service-id');
|
||||
this.serviciosAcabado.table.rows().every(function () {
|
||||
let data = this.data();
|
||||
if (data.tarifa_id == id) {
|
||||
this.remove().draw();
|
||||
for(let i = this.serviciosAcabado.table.rows().count(); i >= 0; i--) {
|
||||
let data = this.serviciosAcabado.table.row(i).data();
|
||||
if (data && data.tarifa_id == id) {
|
||||
this.serviciosAcabado.table.row(i).remove();
|
||||
this.serviciosAcabado.table.draw();
|
||||
return;
|
||||
}
|
||||
});
|
||||
this.serviciosAcabado.table.draw();
|
||||
}
|
||||
}
|
||||
else if (servicio == 'plegado_guardas') {
|
||||
const id = $('#plegado_guardas').attr('service-id');
|
||||
@ -234,9 +238,10 @@ class Servicios {
|
||||
var data = this.data();
|
||||
if (data && data.tarifa_id == id) {
|
||||
this.remove();
|
||||
this.ServiciosManipulado.table.draw();
|
||||
return;
|
||||
}
|
||||
});
|
||||
this.ServiciosManipulado.table.draw();
|
||||
}
|
||||
else if (servicio == 'solapas_cubierta') {
|
||||
const id = $('#serv_solapas_cubierta').attr('service-id');
|
||||
@ -244,9 +249,10 @@ class Servicios {
|
||||
let data = this.data();
|
||||
if (data && parseInt(data.tarifa_id) == id) {
|
||||
this.remove();
|
||||
this.ServiciosManipulado.table.draw();
|
||||
return;
|
||||
}
|
||||
});
|
||||
this.ServiciosManipulado.table.draw();
|
||||
}
|
||||
else if (servicio == 'solapas_sobrecubierta') {
|
||||
const id = $('#serv_solapas_sobrecubierta').attr('service-id');
|
||||
@ -254,9 +260,10 @@ class Servicios {
|
||||
let data = this.data();
|
||||
if (data && data.tarifa_id == id) {
|
||||
this.remove();
|
||||
this.ServiciosManipulado.table.draw();
|
||||
return;
|
||||
}
|
||||
});
|
||||
this.ServiciosManipulado.table.draw();
|
||||
}
|
||||
else if (servicio == 'solapas_faja') {
|
||||
const id = $('#solapas_faja').attr('service-id');
|
||||
@ -264,9 +271,10 @@ class Servicios {
|
||||
let data = this.data();
|
||||
if (data && data.tarifa_id == id) {
|
||||
this.remove().draw();
|
||||
this.ServiciosManipulado.table.draw();
|
||||
return;
|
||||
}
|
||||
});
|
||||
this.ServiciosManipulado.table.draw();
|
||||
}
|
||||
else if (servicio == 'solapas_grandes_cubierta') {
|
||||
const id = $('#solapas_grandes_cubierta').attr('service-id');
|
||||
@ -274,9 +282,10 @@ class Servicios {
|
||||
let data = this.data();
|
||||
if (data && data.tarifa_id == id) {
|
||||
this.remove();
|
||||
this.ServiciosManipulado.table.draw();
|
||||
return;
|
||||
}
|
||||
});
|
||||
this.ServiciosManipulado.table.draw();
|
||||
}
|
||||
else if (servicio == 'solapas_grandes_sobrecubierta') {
|
||||
const id = $('#solapas_grandes_sobrecubierta').attr('service-id');
|
||||
@ -284,9 +293,10 @@ class Servicios {
|
||||
var data = this.data();
|
||||
if (data && data.tarifa_id == id) {
|
||||
this.remove();
|
||||
this.ServiciosManipulado.table.draw();
|
||||
return;
|
||||
}
|
||||
});
|
||||
this.ServiciosManipulado.table.draw();
|
||||
}
|
||||
else if (servicio == 'solapas_grandes_faja') {
|
||||
const id = $('#solapas_grandes_faja').attr('service-id');
|
||||
@ -294,9 +304,10 @@ class Servicios {
|
||||
var data = this.data();
|
||||
if (data && data.tarifa_id == id) {
|
||||
this.remove();
|
||||
this.ServiciosManipulado.table.draw();
|
||||
return;
|
||||
}
|
||||
});
|
||||
this.ServiciosManipulado.table.draw();
|
||||
}
|
||||
else if (servicio == 'acabadoCubierta') {
|
||||
for (let i = 0; i < this.serviciosAcabado.table.rows().count(); i++) {
|
||||
@ -563,7 +574,7 @@ class ServiciosAcabado {
|
||||
this.getPresupuestoAcabado(tarifa_id, uso, null);
|
||||
}
|
||||
|
||||
getPresupuestoAcabado(tarifa_id = -1, uso = null, updateSelect = null) {
|
||||
getPresupuestoAcabado(tarifa_id = -1, uso = null, updateSelect = null, isTarifa = false) {
|
||||
|
||||
const self = this;
|
||||
|
||||
@ -573,6 +584,7 @@ class ServiciosAcabado {
|
||||
}
|
||||
let datos = {
|
||||
tirada: tirada,
|
||||
isTarifa: isTarifa ? 1 : 0
|
||||
};
|
||||
|
||||
if (updateSelect != null) {
|
||||
|
||||
Reference in New Issue
Block a user