mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
modificaciones
This commit is contained in:
@ -243,6 +243,7 @@ class Comparador {
|
||||
this.papelSobrecubierta.onChange(() => this.gramajeSobrecubierta.setVal(0))
|
||||
this.sobrecubierta.on('change', () => {
|
||||
if (this.sobrecubierta.val() == 1) {
|
||||
$('#solapas_sobrecubierta').prop('checked', true);
|
||||
$('#compPapelSobrecubierta').prop('disabled', false);
|
||||
$('#compGramajeSobrecubierta').prop('disabled', false);
|
||||
}
|
||||
|
||||
@ -85,6 +85,17 @@ class DatosLibro {
|
||||
|
||||
this.paginas.on('change', this.changePaginas.bind(this));
|
||||
this.tirada.on('change', this.changeTirada.bind(this));
|
||||
|
||||
$('.formato-libro').on('change', function () {
|
||||
$(document).trigger('update-lineas-presupuesto');
|
||||
/* TO-DO
|
||||
updatePresupuesto({
|
||||
update_servicios: true,
|
||||
update_envios: true,
|
||||
update_resumen: true,
|
||||
update_tiradas_alternativas: true
|
||||
})*/
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -161,9 +172,12 @@ class DatosLibro {
|
||||
|
||||
this.checkPaginasPresupuesto();
|
||||
|
||||
$('.tamanio-personalizado').addClass('d-none');
|
||||
|
||||
$(document).trigger('update-lineas-presupuesto');
|
||||
|
||||
// TO-DO
|
||||
/*updatePresupuesto({
|
||||
update_lineas: true,
|
||||
update_servicios: true,
|
||||
update_envios: true,
|
||||
update_resumen: true,
|
||||
@ -190,6 +204,7 @@ class DatosLibro {
|
||||
$("#label_papelFormatoId").text(
|
||||
window.language.Presupuestos.papelFormatoId + '*');
|
||||
}
|
||||
$(document).trigger('update-lineas-presupuesto');
|
||||
}
|
||||
|
||||
|
||||
@ -367,20 +382,31 @@ class DatosLibro {
|
||||
|
||||
if ($('#tipo_impresion_id').val() == 1 || $('#tipo_impresion_id').val() == 3 ||
|
||||
$('#tipo_impresion_id').val() == 5 || $('#tipo_impresion_id').val() == 7) {
|
||||
$(".impresion-con-solapas").addClass('d-none');
|
||||
$(".solapas-cubierta-div").addClass('d-none');
|
||||
}
|
||||
else {
|
||||
else{
|
||||
if (datos.solapasCubierta) {
|
||||
this.solapasCubierta.prop('checked', true);
|
||||
this.anchoSolapasCubierta.val(datos.solapasCubiertaAncho);
|
||||
$('#div_solapas_ancho').removeClass('d-none');
|
||||
}
|
||||
if (datos.solapasSobrecubierta) {
|
||||
this.solapasSobrecubierta.prop('checked', true);
|
||||
this.anchoSolapasSobrecubierta.val(datos.solapasSobrecubiertaAncho);
|
||||
$('#div_solapas_ancho_sobrecubierta').removeClass('d-none');
|
||||
else{
|
||||
this.solapasCubierta.prop('checked', false);
|
||||
this.anchoSolapasCubierta.val(0);
|
||||
$('#div_solapas_ancho').addClass('d-none');
|
||||
}
|
||||
}
|
||||
if (datos.solapasSobrecubierta) {
|
||||
this.solapasSobrecubierta.prop('checked', true);
|
||||
this.anchoSolapasSobrecubierta.val(datos.solapasSobrecubiertaAncho);
|
||||
$('#div_solapas_ancho_sobrecubierta').removeClass('d-none');
|
||||
}
|
||||
else{
|
||||
this.solapasSobrecubierta.prop('checked', false);
|
||||
this.anchoSolapasSobrecubierta.val(0);
|
||||
$('#div_solapas_ancho_sobrecubierta').addClass('d-none');
|
||||
}
|
||||
|
||||
|
||||
this.acabadoCubierta.setOption(datos.acabadoCubierta.id, datos.acabadoCubierta.text);
|
||||
|
||||
|
||||
@ -37,7 +37,6 @@ class LineasPresupuesto {
|
||||
|
||||
// TO-DO
|
||||
/*updatePresupuesto({
|
||||
update_lineas: false,
|
||||
update_servicios: true,
|
||||
update_envios: true,
|
||||
update_resumen: true,
|
||||
@ -1464,6 +1463,10 @@ class LineasPresupuesto {
|
||||
cliente_id: $('#clienteId').find(":selected").val(),
|
||||
};
|
||||
|
||||
if(datos.ancho==0 || datos.alto==0){
|
||||
return;
|
||||
}
|
||||
|
||||
if (linea.includes('rot')) {
|
||||
if (fromComparador) {
|
||||
datos.paginas_negro = parseInt($('#compPaginasNegro').val())
|
||||
@ -1514,27 +1517,39 @@ class LineasPresupuesto {
|
||||
(response) => {
|
||||
if (response.lineas.length > 0) {
|
||||
|
||||
$.each(response.lineas, function (key, value) {
|
||||
let borrar_linea = true;
|
||||
// Si viene del comparador
|
||||
if (Object.keys(input_data).length == 0) {
|
||||
borrar_linea = false;
|
||||
}
|
||||
|
||||
for(let $i=0; $i<response.lineas.length; $i++){
|
||||
|
||||
// Se cogen los valores de la linea con los datos correspondientes
|
||||
if (value.fields.maquina_id === input_data.maquina_id &&
|
||||
value.fields.papel_generico_id === input_data.papel_generico_id &&
|
||||
value.fields.papel_impresion_id === input_data.papel_impresion_id) {
|
||||
if (response.lineas[$i].fields.maquina_id === input_data.maquina_id &&
|
||||
response.lineas[$i].fields.papel_generico_id === input_data.papel_generico_id &&
|
||||
response.lineas[$i].fields.papel_impresion_id === input_data.papel_impresion_id) {
|
||||
|
||||
borrar_linea = false;
|
||||
|
||||
// Si viene del comparador
|
||||
if (Object.keys(input_data).length == 0) {
|
||||
value.fields.check_papel_total = $('#' + linea + '_checkPapel').is(":checked") ? 1 : 0
|
||||
value.fields.check_impresion_total = $('#' + linea + '_checkClicks').is(":checked") ? 1 : 0
|
||||
response.lineas[$i].fields.check_papel_total = $('#' + linea + '_checkPapel').is(":checked") ? 1 : 0
|
||||
response.lineas[$i].fields.check_impresion_total = $('#' + linea + '_checkClicks').is(":checked") ? 1 : 0
|
||||
|
||||
}
|
||||
else {
|
||||
value.fields.check_papel_total = 1
|
||||
value.fields.check_impresion_total = 1
|
||||
response.lineas[$i].fields.check_papel_total = 1;
|
||||
response.lineas[$i].fields.check_impresion_total = 1;
|
||||
}
|
||||
self.rellenarDatosLinea(linea, value.fields);
|
||||
self.rellenarDatosLinea(linea, response.lineas[$i].fields);
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
if(borrar_linea){
|
||||
self.table.row('#' + linea).remove().draw();
|
||||
}
|
||||
}
|
||||
else {
|
||||
let pags = $("#" + linea + "_paginas").val()
|
||||
|
||||
Reference in New Issue
Block a user