mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into feat/sk-20
This commit is contained in:
@ -115,7 +115,7 @@ class previewFormas {
|
||||
//console.log(pvObj);
|
||||
|
||||
// Printing shape definition
|
||||
this.pvObj.anchoForma = (_isCosido) ? 2 * this.pvObj.anchoLibro : this.pvObj.anchoLibro;
|
||||
this.pvObj.anchoForma = parseInt(_isCosido) ? 2 * this.pvObj.anchoLibro : this.pvObj.anchoLibro;
|
||||
this.pvObj.altoForma = this.pvObj.altoLibro;
|
||||
|
||||
|
||||
@ -207,7 +207,7 @@ class previewFormas {
|
||||
case 'rot_bn':
|
||||
case 'rot_color':
|
||||
// Conditional assignements depending on rotation of the printing shape
|
||||
if (this.pvObj.orientacionFormas == 'v') {
|
||||
if (this.pvObj.orientacionFormas != 'h') {
|
||||
let auxReg = this.pvObj.altoForma;
|
||||
this.pvObj.altoForma = this.pvObj.anchoForma;
|
||||
this.pvObj.anchoForma = auxReg;
|
||||
@ -223,7 +223,7 @@ class previewFormas {
|
||||
case 'color':
|
||||
case 'colorhq':
|
||||
// Conditional assignements depending on rotation of the printing shape
|
||||
if (this.pvObj.orientacionFormas == 'v') {
|
||||
if (this.pvObj.orientacionFormas != 'h') {
|
||||
let auxReg = this.pvObj.altoForma;
|
||||
this.pvObj.altoForma = this.pvObj.anchoForma;
|
||||
this.pvObj.anchoForma = auxReg;
|
||||
|
||||
@ -33,8 +33,12 @@ class PresupuestoAdminEdit {
|
||||
this.datosLibro = new DatosLibro(this.domItem.find('#accordionDatosLibroTip'),
|
||||
{
|
||||
checkPaginasPresupuesto: this.checkPaginasPresupuesto,
|
||||
getDimensionLibro: this.getDimensionLibro,
|
||||
});
|
||||
this.comparador = new Comparador(this.domItem.find('#accordionDatosPresupuestoClienteTip'),
|
||||
{
|
||||
getDimensionLibro: this.getDimensionLibro,
|
||||
});
|
||||
this.comparador = new Comparador(this.domItem.find('#accordionDatosPresupuestoClienteTip'));
|
||||
this.lineasPresupuesto = new LineasPresupuesto(this.domItem.find('#accordionLineasPresupuestoTip'),
|
||||
{
|
||||
getDimensionLibro: this.getDimensionLibro,
|
||||
|
||||
@ -4,10 +4,12 @@ import Ajax from '../../../components/ajax.js';
|
||||
|
||||
class Comparador {
|
||||
|
||||
constructor(domItem) {
|
||||
constructor(domItem, functions = {}) {
|
||||
|
||||
this.domItem = domItem;
|
||||
|
||||
this.getDimensionLibro = functions.getDimensionLibro;
|
||||
|
||||
this.tipo_impresion_id = parseInt($('#tipo_impresion_id').val());
|
||||
|
||||
this.csrf_token = getToken();
|
||||
@ -23,6 +25,10 @@ class Comparador {
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tipo_impresion: this.tipo_impresion_id,
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: 0,
|
||||
lomo: 0,
|
||||
tipo: 'negro',
|
||||
});
|
||||
|
||||
@ -33,6 +39,10 @@ class Comparador {
|
||||
papel_generico: () => this.papelNegro.getVal(),
|
||||
tipo_impresion: this.tipo_impresion_id,
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: 0,
|
||||
lomo: 0,
|
||||
tipo: 'negro',
|
||||
});
|
||||
this.paginasColor = $('#compPaginasColor');
|
||||
@ -42,6 +52,10 @@ class Comparador {
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tipo_impresion: this.tipo_impresion_id,
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: 0,
|
||||
lomo: 0,
|
||||
tipo: 'color',
|
||||
});
|
||||
|
||||
@ -52,6 +66,10 @@ class Comparador {
|
||||
papel_generico: () => this.papelColor.getVal(),
|
||||
tipo_impresion: this.tipo_impresion_id,
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: 0,
|
||||
lomo: 0,
|
||||
tipo: 'color',
|
||||
});
|
||||
|
||||
@ -62,6 +80,10 @@ class Comparador {
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tipo_impresion: this.tipo_impresion_id,
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: 0,
|
||||
lomo: 0,
|
||||
tipo: 'negrohq',
|
||||
});
|
||||
|
||||
@ -72,6 +94,10 @@ class Comparador {
|
||||
papel_generico: () => this.papelNegrohq.getVal(),
|
||||
tipo_impresion: this.tipo_impresion_id,
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: 0,
|
||||
lomo: 0,
|
||||
tipo: 'negrohq',
|
||||
});
|
||||
|
||||
@ -82,6 +108,10 @@ class Comparador {
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tipo_impresion: this.tipo_impresion_id,
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: 0,
|
||||
lomo: 0,
|
||||
tipo: 'colorhq',
|
||||
});
|
||||
|
||||
@ -92,6 +122,10 @@ class Comparador {
|
||||
papel_generico: () => this.papelColorhq.getVal(),
|
||||
tipo_impresion: this.tipo_impresion_id,
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: 0,
|
||||
lomo: 0,
|
||||
tipo: 'colorhq',
|
||||
});
|
||||
|
||||
@ -102,6 +136,10 @@ class Comparador {
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tipo_impresion: this.tipo_impresion_id,
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: () => $('#solapas').prop('checked') ? $('#solapas_ancho').val() : 0,
|
||||
lomo: () => $('#lomo_cubierta').val(),
|
||||
tipo: 'colorhq',
|
||||
uso: 'cubierta',
|
||||
});
|
||||
@ -112,6 +150,10 @@ class Comparador {
|
||||
papel_generico: () => this.papelCubierta.getVal(),
|
||||
tipo_impresion: this.tipo_impresion_id,
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: () => $('#solapas').prop('checked') ? $('#solapas_ancho').val() : 0,
|
||||
lomo: () => $('#lomo_cubierta').val(),
|
||||
tipo: 'colorhq',
|
||||
uso: 'cubierta',
|
||||
});
|
||||
@ -123,6 +165,10 @@ class Comparador {
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tipo_impresion: this.tipo_impresion_id,
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: () => $('#solapas').prop('checked') ? $('#solapas_ancho').val() : 0,
|
||||
lomo: () => $('#lomo_sobrecubierta').val(),
|
||||
tipo: 'colorhq',
|
||||
uso: 'sobrecubierta',
|
||||
});
|
||||
@ -133,6 +179,10 @@ class Comparador {
|
||||
papel_generico: () => this.papelSobrecubierta.getVal(),
|
||||
tipo_impresion: this.tipo_impresion_id,
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: () => $('#solapas').prop('checked') ? $('#solapas_ancho').val() : 0,
|
||||
lomo: () => $('#lomo_sobrecubierta').val(),
|
||||
tipo: 'colorhq',
|
||||
uso: 'sobrecubierta',
|
||||
});
|
||||
@ -145,6 +195,10 @@ class Comparador {
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tipo_impresion: this.tipo_impresion_id,
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: 0,
|
||||
lomo: 0,
|
||||
tipo: 'colorhq',
|
||||
uso: 'guardas',
|
||||
});
|
||||
@ -155,6 +209,10 @@ class Comparador {
|
||||
papel_generico: () => this.papelCubierta.getVal(),
|
||||
tipo_impresion: this.tipo_impresion_id,
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: 0,
|
||||
lomo: 0,
|
||||
tipo: 'colorhq',
|
||||
uso: 'guardas',
|
||||
});
|
||||
@ -245,7 +303,7 @@ class Comparador {
|
||||
this.papelSobrecubierta.onChange(() => self.gramajeSobrecubierta.empty());
|
||||
this.sobrecubierta.on('change', () => {
|
||||
if (this.sobrecubierta.select2('data')[0].id == 1) {
|
||||
if($('#solapas_sobrecubierta').prop('checked') == false){
|
||||
if ($('#solapas_sobrecubierta').prop('checked') == false) {
|
||||
this.sobrecubierta.val(0);
|
||||
popErrorAlert(window.language.Presupuestos.errores.error_sobrecubierta_sin_solapas, 'divAlarmasComparador')
|
||||
}
|
||||
@ -1492,7 +1550,7 @@ class Comparador {
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
|
||||
|
||||
}
|
||||
$.extend(data, bn_obj);
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ class DatosLibro {
|
||||
this.domItem = domItem;
|
||||
|
||||
this.checkPaginasPresupuesto = functions.checkPaginasPresupuesto;
|
||||
this.getDimensionLibro = functions.getDimensionLibro;
|
||||
|
||||
this.csrf_token = getToken();
|
||||
this.csrf_hash = $('#mainContainer').find('input[name="' + this.csrf_token + '"]').val();
|
||||
|
||||
@ -1503,7 +1503,7 @@ class LineasPresupuesto {
|
||||
|
||||
// Si es inkjet, existe este check
|
||||
if ($('#' + linea + '_aFavorFibra').length) {
|
||||
datos.a_favor_fibra = $('#' + linea + '_aFavorFibra').prop('checked')
|
||||
datos.a_favor_fibra = $('#' + linea + '_aFavorFibra').prop('checked') ? 1: 0;
|
||||
}
|
||||
|
||||
if (updatedTipologias && $('#' + linea + '_gotaNegro').length) {
|
||||
|
||||
@ -49,7 +49,7 @@ class PreviewFormasAdmin{
|
||||
$('#tab-pv-rot-color').on( "click", function() {
|
||||
|
||||
self.preview.setData(self.data);
|
||||
self.preview.previewRotativa('rot_color', self.isCosido, self.tipoTapa.constains("dura")?1:0);
|
||||
self.preview.previewRotativa('rot_color', self.isCosido, self.tipoTapa.includes("dura")?1:0);
|
||||
|
||||
} );
|
||||
|
||||
|
||||
@ -33,6 +33,12 @@ class DisenioCubierta {
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tipo: 'colorhq',
|
||||
cubierta: 1,
|
||||
ancho: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho},
|
||||
alto: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().alto},
|
||||
solapas: () => {return $('#solapas_cubierta').hasClass("d-none") ? 0 : $('#solapas_cubierta').val()},
|
||||
lomo: () => {return $('#lc').val()},
|
||||
tapa_dura: () => {return this.tapaBlanda.hasClass("selected") ? 0 : 1},
|
||||
tirada: this.presupuestoCliente.datosGenerales.getTiradas()[0],
|
||||
}
|
||||
);
|
||||
|
||||
@ -63,7 +69,6 @@ class DisenioCubierta {
|
||||
this.divGramajeCubierta = this.domItem.find("#divGramajeCubierta");
|
||||
|
||||
this.acabadoCubierta = this.domItem.find("#acabadoCubierta");
|
||||
this.cubiertaRetractilado = this.domItem.find("#retractilado");
|
||||
|
||||
this.configuracionSobrecubierta = this.domItem.find(".config-sobrecubierta");
|
||||
this.sobrecubierta = this.domItem.find("#addSobrecubierta");
|
||||
@ -222,12 +227,6 @@ class DisenioCubierta {
|
||||
|
||||
this.acabadoCubierta.setOption(datosCubierta.acabado.id, datosCubierta.acabado.text);
|
||||
|
||||
if (datosCubierta.retractilado) {
|
||||
setTimeout(() => {
|
||||
this.cubiertaRetractilado.trigger('click');
|
||||
}, 0);
|
||||
}
|
||||
|
||||
if (datosSobrecubierta && datosSobrecubierta.papel) {
|
||||
this.sobrecubierta.trigger('click');
|
||||
this.papelSobrecubierta.val(datosSobrecubierta.papel.code + "_" + datosSobrecubierta.gramaje).trigger('change');
|
||||
@ -765,7 +764,12 @@ class DisenioCubierta {
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tipo: 'colorhq',
|
||||
cubierta: 1,
|
||||
tapa_dura: tapa_dura
|
||||
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
|
||||
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
|
||||
solapas: $('#solapas_cubierta').hasClass("d-none") ? 0 : $('#solapas_cubierta').val(),
|
||||
lomo: $('#lc').val(),
|
||||
tapa_dura: tapa_dura,
|
||||
tirada: this.presupuestoCliente.datosGenerales.getTiradas()[0],
|
||||
},
|
||||
{},
|
||||
(response) => { this.fillPapeles(response); },
|
||||
@ -787,7 +791,12 @@ class DisenioCubierta {
|
||||
papel: this.papelCubierta,
|
||||
tipo: 'colorhq',
|
||||
cubierta: 1,
|
||||
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
|
||||
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
|
||||
solapas: $('#solapas_cubierta').hasClass("d-none") ? 0 : $('#solapas_cubierta').val(),
|
||||
lomo: $('#lc').val(),
|
||||
tapa_dura: tapa_dura,
|
||||
tirada: this.presupuestoCliente.datosGenerales.getTiradas()[0],
|
||||
},
|
||||
{},
|
||||
this.fillGramajes.bind(context),
|
||||
@ -914,7 +923,12 @@ class DisenioCubierta {
|
||||
papel: papel,
|
||||
tipo: 'colorhq',
|
||||
cubierta: 1,
|
||||
tapa_dura: tapa_dura
|
||||
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
|
||||
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
|
||||
solapas: $('#solapas_cubierta').hasClass("d-none") ? 0 : $('#solapas_cubierta').val(),
|
||||
lomo: $('#lc').val(),
|
||||
tapa_dura: tapa_dura,
|
||||
tirada: this.presupuestoCliente.datosGenerales.getTiradas()[0],
|
||||
},
|
||||
{},
|
||||
this.fillGramajes.bind(context),
|
||||
|
||||
@ -57,6 +57,11 @@ class DisenioInterior {
|
||||
{
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tipo: this.getTipoImpresion(),
|
||||
tirada: () => {return $('#tirada').val()},
|
||||
ancho: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho},
|
||||
alto: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().alto},
|
||||
solapas: 0,
|
||||
lomo: 0,
|
||||
cubierta: 0,
|
||||
}
|
||||
);
|
||||
@ -67,6 +72,11 @@ class DisenioInterior {
|
||||
{
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tipo: this.getTipoImpresionColor(),
|
||||
tirada: () => {return $('#tirada').val()},
|
||||
ancho: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho},
|
||||
alto: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().alto},
|
||||
solapas: 0,
|
||||
lomo: 0,
|
||||
cubierta: 0,
|
||||
}
|
||||
);
|
||||
@ -116,6 +126,10 @@ class DisenioInterior {
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tirada: $('#tirada').val(),
|
||||
tipo: this.getTipoImpresion(),
|
||||
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
|
||||
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
|
||||
solapas: 0,
|
||||
lomo: 0,
|
||||
cubierta: 0,
|
||||
},
|
||||
{},
|
||||
@ -131,6 +145,10 @@ class DisenioInterior {
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tirada: $('#tirada').val(),
|
||||
tipo: this.getTipoImpresion(),
|
||||
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
|
||||
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
|
||||
solapas: 0,
|
||||
lomo: 0,
|
||||
cubierta: 0,
|
||||
},
|
||||
{},
|
||||
@ -888,6 +906,10 @@ class DisenioInterior {
|
||||
tirada: $('#tirada').val(),
|
||||
papel: papel,
|
||||
tipo: tipo,
|
||||
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
|
||||
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
|
||||
solapas: 0,
|
||||
lomo: 0,
|
||||
cubierta: 0,
|
||||
},
|
||||
{},
|
||||
@ -916,6 +938,10 @@ class DisenioInterior {
|
||||
tirada: $('#tirada').val(),
|
||||
papel: this.papelInterior,
|
||||
tipo: tipo,
|
||||
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
|
||||
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
|
||||
solapas: 0,
|
||||
lomo: 0,
|
||||
cubierta: 0,
|
||||
},
|
||||
{},
|
||||
@ -962,6 +988,10 @@ class DisenioInterior {
|
||||
tirada: $('#tirada').val(),
|
||||
papel: papel,
|
||||
tipo: tipo,
|
||||
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
|
||||
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
|
||||
solapas: 0,
|
||||
lomo: 0,
|
||||
cubierta: 0,
|
||||
},
|
||||
{},
|
||||
@ -986,6 +1016,10 @@ class DisenioInterior {
|
||||
tirada: $('#tirada').val(),
|
||||
papel: this.papelInterior,
|
||||
tipo: tipo,
|
||||
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
|
||||
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
|
||||
solapas: 0,
|
||||
lomo: 0,
|
||||
cubierta: 0,
|
||||
},
|
||||
{},
|
||||
|
||||
Reference in New Issue
Block a user