mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'mod/serv_defecto_admin' into 'main'
quitado el botón de servicios defecto. Se añaden automaticamente cuando se crea See merge request jjimenez/safekat!566
This commit is contained in:
@ -15,7 +15,7 @@ class Servicios {
|
||||
this.ServiciosManipulado = new ServiciosManipulado(this.csrf_token, this.csrf_hash);
|
||||
this.serviciosExtra = new ServiciosExtra(this.csrf_token, this.csrf_hash);
|
||||
|
||||
this.serviciosDefecto = $('#serv_default');
|
||||
//this.serviciosDefecto = $('#serv_default');
|
||||
}
|
||||
|
||||
init() {
|
||||
@ -28,21 +28,22 @@ class Servicios {
|
||||
this.ServiciosManipulado.init();
|
||||
this.serviciosExtra.init();
|
||||
|
||||
/*
|
||||
this.serviciosDefecto.on('click', function () {
|
||||
|
||||
$('#loader').modal('show');
|
||||
try {
|
||||
self.ServiciosEncuadernacion.getServiciosDefecto().then(function (response) {
|
||||
self.ServiciosManipulado.getServiciosDefecto().then(function (response) {
|
||||
//self.ServiciosManipulado.getServiciosDefecto().then(function (response) {
|
||||
$('#loader').modal('hide');
|
||||
});
|
||||
//});
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
$('#loader').modal('hide');
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
$('.nav-servicios button').on('shown.bs.tab', function () {
|
||||
$("#tableOfServiciosAcabado").DataTable().columns.adjust();
|
||||
@ -73,7 +74,7 @@ class Servicios {
|
||||
|
||||
$(document).on('update-servicios', async function(){
|
||||
await self.updateServicios()
|
||||
|
||||
|
||||
$(document).trigger('update-servicios-completed');
|
||||
});
|
||||
}
|
||||
@ -382,7 +383,7 @@ class ServiciosAcabado {
|
||||
{
|
||||
data: 'precio_total', render: function (data, type, row) {
|
||||
let total = 0;
|
||||
if(data !==undefined)
|
||||
if(data !==undefined)
|
||||
total = parseFloat(data).toLocaleString('es-ES', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
||||
return `
|
||||
<input class="update-totales-servicios form-control" id="precio_acabado_${row.tarifa_id}" value="${total}"></input>`;
|
||||
@ -453,7 +454,7 @@ class ServiciosAcabado {
|
||||
update_resumen: true,
|
||||
update_tiradas_alternativas: true
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -531,7 +532,7 @@ class ServiciosAcabado {
|
||||
uso = 'faja';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
this.getPresupuestoAcabado(tarifa_id, uso, null);
|
||||
}
|
||||
@ -722,7 +723,7 @@ class ServiciosPreimpresion {
|
||||
data: 'precio', render: function (data, type, row) {
|
||||
|
||||
let total = 0;
|
||||
if(data !==undefined)
|
||||
if(data !==undefined)
|
||||
total = parseFloat(data).toLocaleString('es-ES', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
||||
return `
|
||||
<input class="update-totales-servicios totales-preimpresion form-control" id="precio_preimpresion_${row.tarifa_id}" value="${total}"></input>`;
|
||||
@ -757,15 +758,15 @@ class ServiciosPreimpresion {
|
||||
$('#tableOfServiciosPreimpresion tbody').on('change', '.totales-preimpresion', function () {
|
||||
|
||||
let input = $(this);
|
||||
let tarifa_id = input.attr('id').replace('precio_preimpresion_', '');
|
||||
let newValue = parseFloat(input.val().replace(/\./g, '').replace(',', '.')) || 0;
|
||||
|
||||
let tarifa_id = input.attr('id').replace('precio_preimpresion_', '');
|
||||
let newValue = parseFloat(input.val().replace(/\./g, '').replace(',', '.')) || 0;
|
||||
|
||||
let table = $('#tableOfServiciosPreimpresion').DataTable();
|
||||
let row = table.rows().data().toArray().find(r => r.tarifa_id == tarifa_id);
|
||||
|
||||
|
||||
if (row) {
|
||||
row.precio = newValue;
|
||||
table.row($(this).closest('tr')).data(row).draw(false);
|
||||
row.precio = newValue;
|
||||
table.row($(this).closest('tr')).data(row).draw(false);
|
||||
self.check_serv_preimpresion_error();
|
||||
}
|
||||
});
|
||||
@ -862,7 +863,7 @@ class ServiciosPreimpresion {
|
||||
}
|
||||
|
||||
async guardarServiciosPreimpresion() {
|
||||
|
||||
|
||||
let datos = [];
|
||||
this.table.rows().every(function () {
|
||||
datos.push(this.data());
|
||||
@ -956,7 +957,7 @@ class ServiciosEncuadernacion {
|
||||
{
|
||||
data: 'precio_total', render: function (data, type, row) {
|
||||
let total = 0;
|
||||
if(data !==undefined)
|
||||
if(data !==undefined)
|
||||
total = parseFloat(data).toLocaleString('es-ES', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
||||
return `
|
||||
<input class="update-totales-servicios form-control" id="precio_enc_${row.tarifa_id}" value="${total}"></input>`;
|
||||
@ -1246,7 +1247,7 @@ class ServiciosEncuadernacion {
|
||||
}
|
||||
|
||||
async guardarServiciosEncuadernacion() {
|
||||
|
||||
|
||||
let datos = [];
|
||||
this.table.rows().every(function () {
|
||||
datos.push(this.data());
|
||||
@ -1385,7 +1386,7 @@ class ServiciosManipulado {
|
||||
{
|
||||
data: 'precio_total', render: function (data, type, row) {
|
||||
let total = 0;
|
||||
if(data !==undefined)
|
||||
if(data !==undefined)
|
||||
total = parseFloat(data).toLocaleString('es-ES', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
||||
else
|
||||
data = 0;
|
||||
@ -1418,15 +1419,15 @@ class ServiciosManipulado {
|
||||
|
||||
$('#tableOfServiciosManipulado tbody').on('change', '.totales-manipulado', function () {
|
||||
let input = $(this);
|
||||
let tarifa_id = input.attr('id').replace('precio_manipulado_', '');
|
||||
let newValue = parseFloat(input.val().replace(/\./g, '').replace(',', '.')) || 0;
|
||||
|
||||
let tarifa_id = input.attr('id').replace('precio_manipulado_', '');
|
||||
let newValue = parseFloat(input.val().replace(/\./g, '').replace(',', '.')) || 0;
|
||||
|
||||
let table = $('#tableOfServiciosManipulado').DataTable();
|
||||
let row = table.rows().data().toArray().find(r => r.tarifa_id == tarifa_id);
|
||||
|
||||
|
||||
if (row) {
|
||||
row.precio_total = newValue;
|
||||
table.row($(this).closest('tr')).data(row).draw(false);
|
||||
row.precio_total = newValue;
|
||||
table.row($(this).closest('tr')).data(row).draw(false);
|
||||
self.check_serv_manipulado_error();
|
||||
}
|
||||
});
|
||||
@ -1490,7 +1491,7 @@ class ServiciosManipulado {
|
||||
showBreadCrumbSaveButton(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
updateServicios() {
|
||||
|
||||
const self = this;
|
||||
@ -1651,7 +1652,7 @@ class ServiciosExtra {
|
||||
data: 'precio', render: function (data, type, row) {
|
||||
|
||||
let total = 0;
|
||||
if(data !==undefined)
|
||||
if(data !==undefined)
|
||||
total = parseFloat(data).toLocaleString('es-ES', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
||||
return `
|
||||
<input class="update-totales-servicios totales-extra form-control" id="precio_extra_${row.tarifa_id}" value="${total}"></input>`;
|
||||
@ -1684,19 +1685,19 @@ class ServiciosExtra {
|
||||
$('#tableOfServiciosExtra tbody').on('change', '.totales-extra', function () {
|
||||
|
||||
let input = $(this);
|
||||
let tarifa_id = input.attr('id').replace('precio_extra_', '');
|
||||
let newValue = parseFloat(input.val().replace(/\./g, '').replace(',', '.')) || 0;
|
||||
|
||||
let tarifa_id = input.attr('id').replace('precio_extra_', '');
|
||||
let newValue = parseFloat(input.val().replace(/\./g, '').replace(',', '.')) || 0;
|
||||
|
||||
let table = $('#tableOfServiciosExtra').DataTable();
|
||||
let row = table.rows().data().toArray().find(r => r.tarifa_id == tarifa_id);
|
||||
|
||||
|
||||
if (row) {
|
||||
row.precio = newValue;
|
||||
table.row($(this).closest('tr')).data(row).draw(false);
|
||||
row.precio = newValue;
|
||||
table.row($(this).closest('tr')).data(row).draw(false);
|
||||
self.check_serv_extra_error();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click', '.btn-delete-servextra', function () {
|
||||
const rowId = $(this).closest('td').parent()[0].sectionRowIndex;
|
||||
self.table.row(rowId).remove().draw();
|
||||
@ -1733,7 +1734,7 @@ class ServiciosExtra {
|
||||
}
|
||||
|
||||
async guardarServiciosExtra() {
|
||||
|
||||
|
||||
let datos = [];
|
||||
this.table.rows().every(function () {
|
||||
datos.push(this.data());
|
||||
|
||||
Reference in New Issue
Block a user