mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en guardar
This commit is contained in:
@ -35,12 +35,15 @@ class LineasPresupuesto {
|
||||
.remove()
|
||||
.draw();
|
||||
|
||||
// TO-DO
|
||||
/*updatePresupuesto({
|
||||
$(document).trigger('update-presupuesto', {
|
||||
update_lineas: false,
|
||||
update_servicios: false,
|
||||
update_envios: true,
|
||||
update_resumen: true,
|
||||
update_tiradas_alternativas: true
|
||||
})
|
||||
});
|
||||
// TO-DO
|
||||
/*
|
||||
if (data.row_id == 'lp_guardas')
|
||||
servicioGuardas(false)
|
||||
*/
|
||||
@ -52,7 +55,12 @@ class LineasPresupuesto {
|
||||
});
|
||||
|
||||
// Evento para recalcular las lineas de presupuesto
|
||||
$(document).on('update-lineas-presupuesto', this.updateLineasPresupuesto.bind(this));
|
||||
$(document).on('update-lineas-presupuesto', async function () {
|
||||
|
||||
await self.updateLineasPresupuesto();
|
||||
|
||||
$(document).trigger('update-lineas-presupuesto-completed');
|
||||
});
|
||||
|
||||
$('.insertarLinea').on("click", this.#insertarLineaComparador.bind(this));
|
||||
$('.paginas-lp').on('change', this.checkPaginasLineasPresupuesto.bind(this));
|
||||
@ -355,8 +363,8 @@ class LineasPresupuesto {
|
||||
}
|
||||
|
||||
|
||||
updateLineasPresupuesto() {
|
||||
|
||||
async updateLineasPresupuesto() {
|
||||
|
||||
$('#tableLineasPresupuesto tbody tr:visible ').each(function () {
|
||||
|
||||
$('#' + this.id + '_maquina').trigger('change');
|
||||
@ -1462,7 +1470,7 @@ class LineasPresupuesto {
|
||||
cliente_id: $('#clienteId').find(":selected").val(),
|
||||
};
|
||||
|
||||
if(datos.ancho==0 || datos.alto==0 || datos.ancho=='' || datos.alto=='' || isNaN(datos.ancho) || isNaN(datos.alto)){
|
||||
if (datos.ancho == 0 || datos.alto == 0 || datos.ancho == '' || datos.alto == '' || isNaN(datos.ancho) || isNaN(datos.alto)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1522,7 +1530,7 @@ class LineasPresupuesto {
|
||||
borrar_linea = false;
|
||||
}
|
||||
|
||||
for(let $i=0; $i<response.lineas.length; $i++){
|
||||
for (let $i = 0; $i < response.lineas.length; $i++) {
|
||||
|
||||
// Se cogen los valores de la linea con los datos correspondientes
|
||||
if (response.lineas[$i].fields.maquina_id === input_data.maquina_id &&
|
||||
@ -1546,7 +1554,7 @@ class LineasPresupuesto {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(borrar_linea){
|
||||
if (borrar_linea) {
|
||||
self.table.row('#' + linea).remove().draw();
|
||||
}
|
||||
}
|
||||
@ -1602,13 +1610,16 @@ class LineasPresupuesto {
|
||||
|
||||
/* TO-DO
|
||||
calcular_mermas()
|
||||
|
||||
updatePresupuesto({
|
||||
*/
|
||||
|
||||
$(document).trigger('update-presupuesto', {
|
||||
update_lineas : false,
|
||||
update_servicios : true,
|
||||
update_envios: true,
|
||||
update_resumen: true,
|
||||
update_tiradas_alternativas: true
|
||||
})
|
||||
*/
|
||||
});
|
||||
|
||||
|
||||
// Si existe cubierta, hay que actualizar con el valor del lomo
|
||||
if (linea != 'lp_cubierta' && linea != 'lp_sobrecubierta' && this.table.row('#lp_cubierta').length > 0) {
|
||||
@ -1886,17 +1897,15 @@ class LineasPresupuesto {
|
||||
for (const row of rows) {
|
||||
if (row.tipo == 'cubierta') {
|
||||
this.rellenarDatosLinea('lp_cubierta', row, true);
|
||||
/* TO-DO
|
||||
|
||||
if ($('#acabado_cubierta_id').val() > 0)
|
||||
insertar_acabado_exterior($('#acabado_cubierta_id').val(), window.Presupuestos.cubierta)
|
||||
*/
|
||||
$(document).trigger('add-servicio-lineas', 'acabadoCubierta');
|
||||
|
||||
}
|
||||
if (row.tipo == 'sobrecubierta') {
|
||||
this.rellenarDatosLinea('lp_sobrecubierta', row, true);
|
||||
/* TO-DO
|
||||
if ($('#acabado_sobrecubierta_id').val() > 0)
|
||||
insertar_acabado_exterior($('#acabado_sobrecubierta_id').val(), window.Presupuestos.sobrecubierta)
|
||||
*/
|
||||
$(document).trigger('add-servicio-lineas', 'acabadoSobrecubierta');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1920,15 +1929,14 @@ class LineasPresupuesto {
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* TO-DO
|
||||
updatePresupuesto({
|
||||
update_envios: false,
|
||||
$(document).trigger('update-presupuesto', {
|
||||
update_lineas : false,
|
||||
update_servicios : true,
|
||||
update_envios: true,
|
||||
update_resumen: true,
|
||||
update_tiradas_alternativas: true
|
||||
})
|
||||
*/
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user