mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
sobrecubierta
This commit is contained in:
@ -195,8 +195,12 @@ $('.change-tipo-impresion').on('change', function () {
|
||||
dropdown.val('').trigger('change');
|
||||
$('#gramajeInterior').val('').trigger('change');
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#tirada').on('change', function () {
|
||||
|
||||
const valInterior = $('#gramajeInterior option:selected').val();
|
||||
@ -631,19 +635,44 @@ async function calcularPresupuesto() {
|
||||
type: 'POST',
|
||||
data: datos,
|
||||
success: function (response) {
|
||||
if(response.errors.interior.length > 0)
|
||||
error = false;
|
||||
if(response.errors.interior.length > 0){
|
||||
$('#errorInterior').show();
|
||||
error = true;
|
||||
}
|
||||
else
|
||||
$('#errorInterior').hide();
|
||||
if(response.errors.cubierta.length > 0)
|
||||
if(response.errors.cubierta.length > 0){
|
||||
$('#errorCubierta').show();
|
||||
error = true;
|
||||
}
|
||||
else
|
||||
$('#errorCubierta').hide();
|
||||
|
||||
if(response.errors.servicios.length > 0 || response.errors.serviciosDefecto.length > 0){
|
||||
error = true;
|
||||
}
|
||||
|
||||
console.log(response);
|
||||
$('#loader').hide();
|
||||
if(error){
|
||||
$('#precios > tbody').empty();
|
||||
$('#precios').hide();
|
||||
}
|
||||
else{
|
||||
$('#precios > tbody').empty();
|
||||
|
||||
for (i = 0; i < response.tiradas.length; i++) {
|
||||
$('#precios > tbody').append('<tr class="table-light"><td>' + response.tiradas[i] + '</td><td>' + response.precio_u[i] + '€</td></tr>');
|
||||
}
|
||||
$('#precios').show();
|
||||
}
|
||||
|
||||
},
|
||||
error: function (error) {
|
||||
$('#loader').hide();
|
||||
$('#precios > tbody').empty();
|
||||
$('#precios').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -60,6 +60,20 @@
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
<table id="precios" class="table table-sm" style="display: none;">
|
||||
<caption>Precio/Unidad por tirada</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="bs-stepper-content">
|
||||
|
||||
Reference in New Issue
Block a user