mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-13 00:48:49 +00:00
voy a empezar con los acabados de cubierta
This commit is contained in:
@ -8,7 +8,7 @@ public class ImagenPresupuesto {
|
|||||||
private String imagen;
|
private String imagen;
|
||||||
private String alt;
|
private String alt;
|
||||||
private String texto;
|
private String texto;
|
||||||
private boolean selected;
|
private boolean selected = false;
|
||||||
private Map<String, String> extra_data;
|
private Map<String, String> extra_data;
|
||||||
|
|
||||||
// Constructores
|
// Constructores
|
||||||
|
|||||||
@ -52,20 +52,7 @@ public class PresupuestoController {
|
|||||||
|
|
||||||
// opciones color
|
// opciones color
|
||||||
Map<String, Object> resultado = presupuestoService.obtenerOpcionesColor(presupuesto, locale);
|
Map<String, Object> resultado = presupuestoService.obtenerOpcionesColor(presupuesto, locale);
|
||||||
List<ImagenPresupuesto> opcionesColor = (List<ImagenPresupuesto>) resultado.get("opciones_color");
|
|
||||||
if (opcionesColor != null && !opcionesColor.isEmpty()) {
|
|
||||||
Presupuesto.TipoImpresion colorActual = presupuesto.getTipoImpresion();
|
|
||||||
if (!opcionesColor.stream().anyMatch(opcion -> opcion.getId().equals(colorActual.name()))) {
|
|
||||||
String idSeleccionado = opcionesColor.get(0).getId();
|
|
||||||
try {
|
|
||||||
Presupuesto.TipoImpresion tipo = Presupuesto.TipoImpresion.valueOf(idSeleccionado);
|
|
||||||
presupuesto.setTipoImpresion(tipo);
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
System.err.println("Tipo de impresión no válido: " + idSeleccionado);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// opciones papel interior
|
// opciones papel interior
|
||||||
resultado.putAll(presupuestoService.obtenerOpcionesPapelInterior(presupuesto, locale));
|
resultado.putAll(presupuestoService.obtenerOpcionesPapelInterior(presupuesto, locale));
|
||||||
|
|
||||||
|
|||||||
@ -124,7 +124,7 @@ public class Presupuesto {
|
|||||||
private Integer gramajeGuardas;
|
private Integer gramajeGuardas;
|
||||||
|
|
||||||
@Column(name = "guardas_impresas")
|
@Column(name = "guardas_impresas")
|
||||||
private Boolean guardasImpresas;
|
private Integer guardasImpresas;
|
||||||
|
|
||||||
@Column(name = "cabezada")
|
@Column(name = "cabezada")
|
||||||
private String cabezada;
|
private String cabezada;
|
||||||
@ -343,11 +343,11 @@ public class Presupuesto {
|
|||||||
this.gramajeGuardas = gramajeGuardas;
|
this.gramajeGuardas = gramajeGuardas;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getGuardasImpresas() {
|
public Integer getGuardasImpresas() {
|
||||||
return guardasImpresas;
|
return guardasImpresas;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGuardasImpresas(Boolean guardasImpresas) {
|
public void setGuardasImpresas(Integer guardasImpresas) {
|
||||||
this.guardasImpresas = guardasImpresas;
|
this.guardasImpresas = guardasImpresas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -52,37 +52,32 @@ public class PresupuestoService {
|
|||||||
|
|
||||||
List<ImagenPresupuesto> opciones = new ArrayList<>();
|
List<ImagenPresupuesto> opciones = new ArrayList<>();
|
||||||
|
|
||||||
ImagenPresupuesto opcion;
|
|
||||||
|
|
||||||
if (presupuesto.getPaginasColor() > 0) {
|
if (presupuesto.getPaginasColor() > 0) {
|
||||||
if (!this.isPOD(presupuesto)) {
|
if (!this.isPOD(presupuesto)) {
|
||||||
// POD solo color foto
|
// POD solo color foto
|
||||||
opcion = this.presupuestadorItems.getImpresionColor(locale);
|
ImagenPresupuesto opcionColor = this.presupuestadorItems.getImpresionColor(locale);
|
||||||
opcion.setSelected(presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.color);
|
opcionColor.setSelected(Presupuesto.TipoImpresion.color.equals(presupuesto.getTipoImpresion()));
|
||||||
opciones.add(opcion);
|
opciones.add(opcionColor);
|
||||||
}
|
}
|
||||||
opcion = this.presupuestadorItems.getImpresionColorPremium(locale);
|
ImagenPresupuesto opcionColorHq = this.presupuestadorItems.getImpresionColorPremium(locale);
|
||||||
opcion.setSelected(presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.colorhq);
|
if(Presupuesto.TipoImpresion.colorhq.equals(presupuesto.getTipoImpresion()))
|
||||||
opciones.add(opcion);
|
opcionColorHq.setSelected(true);
|
||||||
|
opciones.add(opcionColorHq);
|
||||||
} else {
|
} else {
|
||||||
opcion = this.presupuestadorItems.getImpresionNegro(locale);
|
ImagenPresupuesto opcionNegro = this.presupuestadorItems.getImpresionNegro(locale);
|
||||||
opcion.setSelected(presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.negro);
|
if(Presupuesto.TipoImpresion.negro.equals(presupuesto.getTipoImpresion()))
|
||||||
opciones.add(opcion);
|
opcionNegro.setSelected(true);
|
||||||
opcion = this.presupuestadorItems.getImpresionNegroPremium(locale);
|
opciones.add(opcionNegro);
|
||||||
opcion.setSelected(presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.negrohq);
|
ImagenPresupuesto opcionNegroHq = this.presupuestadorItems.getImpresionNegroPremium(locale);
|
||||||
opciones.add(opcion);
|
if(Presupuesto.TipoImpresion.negrohq.equals(presupuesto.getTipoImpresion()))
|
||||||
|
opcionNegroHq.setSelected(true);
|
||||||
|
opciones.add(opcionNegroHq);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean opcionSeleccionada = opciones.stream()
|
boolean opcionSeleccionada = opciones.stream().anyMatch(ImagenPresupuesto::isSelected);
|
||||||
.findFirst()
|
|
||||||
.map(op -> {
|
|
||||||
op.setSelected(true);
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
.orElse(false);
|
|
||||||
if (!opcionSeleccionada) {
|
if (!opcionSeleccionada) {
|
||||||
opciones.get(0).setSelected(true);
|
opciones.get(0).setSelected(true);
|
||||||
presupuesto.setPapelInteriorId(Integer.parseInt(opciones.get(0).getExtra_data().get("sk-id")));
|
presupuesto.setTipoImpresion(Presupuesto.TipoImpresion.valueOf(opciones.get(0).getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> response = new HashMap<>();
|
Map<String, Object> response = new HashMap<>();
|
||||||
@ -114,16 +109,12 @@ public class PresupuestoService {
|
|||||||
String.valueOf(presupuesto.getPapelInteriorId())));
|
String.valueOf(presupuesto.getPapelInteriorId())));
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean opcionSeleccionada = opciones.stream()
|
boolean yaSeleccionado = opciones.stream().anyMatch(ImagenPresupuesto::isSelected);
|
||||||
.findFirst()
|
|
||||||
.map(opcion -> {
|
if (!yaSeleccionado && !opciones.isEmpty()) {
|
||||||
opcion.setSelected(true);
|
ImagenPresupuesto primeraOpcion = opciones.get(0);
|
||||||
return true;
|
primeraOpcion.setSelected(true);
|
||||||
})
|
presupuesto.setPapelInteriorId(Integer.parseInt(primeraOpcion.getExtra_data().get("sk-id")));
|
||||||
.orElse(false);
|
|
||||||
if (!opcionSeleccionada) {
|
|
||||||
opciones.get(0).setSelected(true);
|
|
||||||
presupuesto.setPapelInteriorId(Integer.parseInt(opciones.get(0).getExtra_data().get("sk-id")));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> response = new HashMap<>();
|
Map<String, Object> response = new HashMap<>();
|
||||||
@ -242,13 +233,12 @@ public class PresupuestoService {
|
|||||||
gramajes.add("300");
|
gramajes.add("300");
|
||||||
gramajes.add("350");
|
gramajes.add("350");
|
||||||
} else if (presupuesto.getPapelCubiertaId() != null && presupuesto.getPapelCubiertaId() == ESTUCADO_MATE_ID) {
|
} else if (presupuesto.getPapelCubiertaId() != null && presupuesto.getPapelCubiertaId() == ESTUCADO_MATE_ID) {
|
||||||
if(presupuesto.getTipoCubierta() == Presupuesto.TipoCubierta.tapaBlanda) {
|
if (presupuesto.getTipoCubierta() == Presupuesto.TipoCubierta.tapaBlanda) {
|
||||||
|
|
||||||
gramajes.add("250");
|
gramajes.add("250");
|
||||||
gramajes.add("300");
|
gramajes.add("300");
|
||||||
gramajes.add("350");
|
gramajes.add("350");
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
gramajes.add("170");
|
gramajes.add("170");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -258,7 +248,6 @@ public class PresupuestoService {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Map<String, Object> toSkApiRequest(Presupuesto presupuesto) {
|
public Map<String, Object> toSkApiRequest(Presupuesto presupuesto) {
|
||||||
|
|
||||||
final int SK_CLIENTE_ID = 1284;
|
final int SK_CLIENTE_ID = 1284;
|
||||||
|
|||||||
@ -33,8 +33,8 @@ class PresupuestoCliente {
|
|||||||
solapasCubierta: 0,
|
solapasCubierta: 0,
|
||||||
tamanioSolapasCubierta: '80',
|
tamanioSolapasCubierta: '80',
|
||||||
cubiertaCaras: 2,
|
cubiertaCaras: 2,
|
||||||
papelGuardasId: 3,
|
guardasPapelId: 3,
|
||||||
gramajeGuardas: 170,
|
guardasGramaje: 170,
|
||||||
guardasImpresas: 0,
|
guardasImpresas: 0,
|
||||||
cabezada: 'WHI',
|
cabezada: 'WHI',
|
||||||
papelCubiertaId: 3,
|
papelCubiertaId: 3,
|
||||||
@ -78,6 +78,11 @@ class PresupuestoCliente {
|
|||||||
this.divGramajeCubierta = $("#div-gramaje-cubierta");
|
this.divGramajeCubierta = $("#div-gramaje-cubierta");
|
||||||
this.btn_plantilla_cubierta = $('#btn-plantilla-cubierta');
|
this.btn_plantilla_cubierta = $('#btn-plantilla-cubierta');
|
||||||
this.btn_impresion_cubierta_help = $('#impresion-cubierta-help');
|
this.btn_impresion_cubierta_help = $('#impresion-cubierta-help');
|
||||||
|
this.carasImpresionCubierta = $('#impresion-cubierta');
|
||||||
|
this.tamanioSolapasCubierta = $('#tamanio-solapas-cubierta');
|
||||||
|
this.guardasCubierta = $('#papel-guardas');
|
||||||
|
this.guardasImpresas = $('#guardas-impresas');
|
||||||
|
this.cabezada = $('#cabezada');
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
@ -142,7 +147,7 @@ class PresupuestoCliente {
|
|||||||
|
|
||||||
// Crear label
|
// Crear label
|
||||||
const label = document.createElement('label');
|
const label = document.createElement('label');
|
||||||
label.className = 'btn btn-outline-primary material-shadow gramaje-radio gramaje-interior';
|
label.className = 'btn btn-outline-primary material-shadow gramaje-radio ' + name;
|
||||||
label.setAttribute('for', id);
|
label.setAttribute('for', id);
|
||||||
label.textContent = gramaje;
|
label.textContent = gramaje;
|
||||||
|
|
||||||
@ -192,7 +197,15 @@ class PresupuestoCliente {
|
|||||||
|
|
||||||
#nextDatosGenerales() {
|
#nextDatosGenerales() {
|
||||||
|
|
||||||
let data = this.#getPresupuestoData();
|
let data = this.#getDatosGeneralesData();
|
||||||
|
data = {
|
||||||
|
...data,
|
||||||
|
...{
|
||||||
|
papelInteriorId: this.formData.interior.papelInteriorId,
|
||||||
|
gramajeInterior: this.formData.interior.gramajeInterior,
|
||||||
|
tipoImpresion: this.formData.interior.tipoImpresion,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/presupuesto/public/validar/datos-generales',
|
url: '/presupuesto/public/validar/datos-generales',
|
||||||
@ -524,8 +537,14 @@ class PresupuestoCliente {
|
|||||||
$('.max-solapa-text').text(function (_, textoActual) {
|
$('.max-solapa-text').text(function (_, textoActual) {
|
||||||
return textoActual.replace(/\d+/, maxSolapas);
|
return textoActual.replace(/\d+/, maxSolapas);
|
||||||
});
|
});
|
||||||
$('.tapa-cubierta.selected').trigger('click');
|
this.#loadCubiertaData(data);
|
||||||
|
|
||||||
this.#changeTab('pills-cover');
|
this.#changeTab('pills-cover');
|
||||||
|
|
||||||
|
const dataInterior = this.#getInteriorData();
|
||||||
|
this.#updateInteriorData(dataInterior);
|
||||||
|
this.#cacheFormData();
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: (xhr, status, error) => {
|
error: (xhr, status, error) => {
|
||||||
@ -562,8 +581,8 @@ class PresupuestoCliente {
|
|||||||
const opcion = opciones_color[i];
|
const opcion = opciones_color[i];
|
||||||
const item = new imagen_presupuesto(opcion);
|
const item = new imagen_presupuesto(opcion);
|
||||||
item.extraClass = 'interior-data opcion-color';
|
item.extraClass = 'interior-data opcion-color';
|
||||||
if ((this.formData.interior.color === '' && i === 0) ||
|
if ((this.formData.interior.tipoImpresion === '' && i === 0) ||
|
||||||
this.formData.interior.color === opcion.id) {
|
this.formData.interior.tipoImpresion === opcion.id) {
|
||||||
item.setSelected(true);
|
item.setSelected(true);
|
||||||
}
|
}
|
||||||
this.divOpcionesColor.append(item.render());
|
this.divOpcionesColor.append(item.render());
|
||||||
@ -574,7 +593,10 @@ class PresupuestoCliente {
|
|||||||
const opcion = opciones_papel_interior[i];
|
const opcion = opciones_papel_interior[i];
|
||||||
const item = new imagen_presupuesto(opcion);
|
const item = new imagen_presupuesto(opcion);
|
||||||
item.extraClass = 'interior-data papel-interior';
|
item.extraClass = 'interior-data papel-interior';
|
||||||
|
if( this.formData.interior.papelInteriorId == '' && i === 0 ||
|
||||||
|
this.formData.interior.papelInteriorId == opcion.extra_data["sk-id"]) {
|
||||||
|
item.setSelected(true);
|
||||||
|
}
|
||||||
this.divPapelInterior.append(item.render());
|
this.divPapelInterior.append(item.render());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -668,8 +690,6 @@ class PresupuestoCliente {
|
|||||||
|
|
||||||
$(document).on('click', '.tapa-cubierta', (e) => {
|
$(document).on('click', '.tapa-cubierta', (e) => {
|
||||||
|
|
||||||
const prevTargetisTapaDura = !$('.tapa-dura-options').hasClass('d-none');
|
|
||||||
|
|
||||||
$('.tapa-dura-options').eq(0).removeClass('animate-fadeInUpBounce');
|
$('.tapa-dura-options').eq(0).removeClass('animate-fadeInUpBounce');
|
||||||
$('.tapa-blanda-options').eq(0).removeClass('animate-fadeInUpBounce');
|
$('.tapa-blanda-options').eq(0).removeClass('animate-fadeInUpBounce');
|
||||||
|
|
||||||
@ -684,10 +704,7 @@ class PresupuestoCliente {
|
|||||||
$('.tapa-dura-options').removeClass('d-none');
|
$('.tapa-dura-options').removeClass('d-none');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(e.currentTarget.id !== 'tapaBlanda' && prevTargetisTapaDura)) {
|
this.#getPapelesCubierta(e.currentTarget.id);
|
||||||
|
|
||||||
this.#getPapelesCubierta(e.currentTarget.id);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '.solapas-cubierta', (e) => {
|
$(document).on('click', '.solapas-cubierta', (e) => {
|
||||||
@ -729,6 +746,29 @@ class PresupuestoCliente {
|
|||||||
console.error("Error al obtener los gramajes de interior: ", xhr.responseText);
|
console.error("Error al obtener los gramajes de interior: ", xhr.responseText);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).on('change', '.datos-cubierta', (e) => {
|
||||||
|
|
||||||
|
const dataToStore = this.#getCubiertaData();
|
||||||
|
this.#updateCubiertaData(dataToStore);
|
||||||
|
this.#cacheFormData();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.btn-change-tab-cubierta').on('click', () => {
|
||||||
|
this.#changeTab('pills-inside');
|
||||||
|
/*const data = this.#getPresupuestoData();
|
||||||
|
$.ajax({
|
||||||
|
url: '/presupuesto/public/validar/cubierta',
|
||||||
|
type: 'POST',
|
||||||
|
data: data,
|
||||||
|
success: (data) => {
|
||||||
|
this.#changeTab('pills-inside');
|
||||||
|
},
|
||||||
|
error: (xhr, status, error) => {
|
||||||
|
console.error("Error al validar los datos de cubierta: ", xhr.responseText);
|
||||||
|
}
|
||||||
|
});*/
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#getPapelesCubierta(tapa_id) {
|
#getPapelesCubierta(tapa_id) {
|
||||||
@ -738,6 +778,7 @@ class PresupuestoCliente {
|
|||||||
this.divGramajeCubierta.empty();
|
this.divGramajeCubierta.empty();
|
||||||
setTimeout(resolve, 250);
|
setTimeout(resolve, 250);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
|
||||||
this.divPapelCubierta.removeClass('animate-fadeInUpBounce');
|
this.divPapelCubierta.removeClass('animate-fadeInUpBounce');
|
||||||
this.divGramajeCubierta.removeClass('animate-fadeInUpBounce');
|
this.divGramajeCubierta.removeClass('animate-fadeInUpBounce');
|
||||||
|
|
||||||
@ -802,11 +843,11 @@ class PresupuestoCliente {
|
|||||||
const tipoCubierta = $('.tapa-cubierta.selected').attr('id') || 'tapaBlanda';
|
const tipoCubierta = $('.tapa-cubierta.selected').attr('id') || 'tapaBlanda';
|
||||||
const solapas = $('.solapas-cubierta.selected').id == 'sin-solapas' ? 0 : 1 || 0;
|
const solapas = $('.solapas-cubierta.selected').id == 'sin-solapas' ? 0 : 1 || 0;
|
||||||
const tamanioSolapas = $('#tamanio-solapas-cubierta').val() || '80';
|
const tamanioSolapas = $('#tamanio-solapas-cubierta').val() || '80';
|
||||||
const cubiertaCaras = parseInt($('#cubierta-caras').val()) || 2;
|
const cubiertaCaras = parseInt(this.carasImpresionCubierta.val()) || 2;
|
||||||
const guardasPapel = parseInt($('#guardas-papel').val()) || 3;
|
const guardasPapelId = parseInt($('#papel-guardas option:selected').data('papel-id')) || 3;
|
||||||
const guardasGramaje = parseInt($('#guardas-gramaje').val()) || 170;
|
const guardasGramaje = parseInt($('#papel-guardas option:selected').data('gramaje')) || 170;
|
||||||
const guardasImpresas = parseInt($('#guardas-impresas').val()) || 0;
|
const guardasImpresas = parseInt(this.guardasImpresas) || 0;
|
||||||
const cabezada = $('#cabezada').val() || 'WHI';
|
const cabezada = this.cabezada.val() || 'WHI';
|
||||||
const papelCubiertaId = $('#div-papel-cubierta .image-container.selected').data('sk-id') || 3;
|
const papelCubiertaId = $('#div-papel-cubierta .image-container.selected').data('sk-id') || 3;
|
||||||
const gramajeCubierta = $('input[name="gramaje-cubierta"]:checked').data('gramaje') || 240;
|
const gramajeCubierta = $('input[name="gramaje-cubierta"]:checked').data('gramaje') || 240;
|
||||||
|
|
||||||
@ -815,7 +856,7 @@ class PresupuestoCliente {
|
|||||||
solapas: solapas,
|
solapas: solapas,
|
||||||
tamanioSolapas: tamanioSolapas,
|
tamanioSolapas: tamanioSolapas,
|
||||||
cubiertaCaras: cubiertaCaras,
|
cubiertaCaras: cubiertaCaras,
|
||||||
guardasPapel: guardasPapel,
|
guardasPapelId: guardasPapelId,
|
||||||
guardasGramaje: guardasGramaje,
|
guardasGramaje: guardasGramaje,
|
||||||
guardasImpresas: guardasImpresas,
|
guardasImpresas: guardasImpresas,
|
||||||
cabezada: cabezada,
|
cabezada: cabezada,
|
||||||
@ -830,7 +871,7 @@ class PresupuestoCliente {
|
|||||||
this.formData.cubierta.solapas = data.solapas;
|
this.formData.cubierta.solapas = data.solapas;
|
||||||
this.formData.cubierta.tamanioSolapas = data.tamanioSolapas;
|
this.formData.cubierta.tamanioSolapas = data.tamanioSolapas;
|
||||||
this.formData.cubierta.cubiertaCaras = data.cubiertaCaras;
|
this.formData.cubierta.cubiertaCaras = data.cubiertaCaras;
|
||||||
this.formData.cubierta.guardasPapel = data.guardasPapel;
|
this.formData.cubierta.guardasPapelId = data.guardasPapelId;
|
||||||
this.formData.cubierta.guardasGramaje = data.guardasGramaje;
|
this.formData.cubierta.guardasGramaje = data.guardasGramaje;
|
||||||
this.formData.cubierta.guardasImpresas = data.guardasImpresas;
|
this.formData.cubierta.guardasImpresas = data.guardasImpresas;
|
||||||
this.formData.cubierta.cabezada = data.cabezada;
|
this.formData.cubierta.cabezada = data.cabezada;
|
||||||
@ -856,6 +897,44 @@ class PresupuestoCliente {
|
|||||||
this.divGramajeCubierta.find('input[type="radio"]').first().prop('checked', true);
|
this.divGramajeCubierta.find('input[type="radio"]').first().prop('checked', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#loadCubiertaData() {
|
||||||
|
|
||||||
|
$('.tapa-cubierta').removeClass('selected');
|
||||||
|
$(`#${this.formData.cubierta.tipoCubierta}`).addClass('selected');
|
||||||
|
|
||||||
|
if (this.formData.cubierta.tipoCubierta === 'tapaBlanda') {
|
||||||
|
$('.tapa-blanda-options').removeClass('d-none');
|
||||||
|
$('.tapa-dura-options').addClass('d-none');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('.tapa-dura-options').removeClass('d-none');
|
||||||
|
$('.tapa-blanda-options').addClass('d-none');
|
||||||
|
$('#papel-guardas option[data-papel-id="' +
|
||||||
|
this.formData.cubierta.guardasPapelId + '"][data-gramaje="' +
|
||||||
|
this.formData.cubierta.guardasGramaje + '"]').prop('selected', true).trigger('change');
|
||||||
|
this.guardasImpresas.val(this.formData.cubierta.guardasImpresas);
|
||||||
|
this.cabezada.val(this.formData.cubierta.cabezada);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$(`#${this.formData.cubierta.tipoCubierta}`).trigger('click');
|
||||||
|
|
||||||
|
if (this.formData.cubierta.solapas === 0) {
|
||||||
|
$('.solapas-cubierta#sin-solapas').addClass('selected');
|
||||||
|
this.divSolapasCubierta.addClass('d-none');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('.solapas-cubierta').removeClass('selected');
|
||||||
|
$(`.solapas-cubierta#con-solapas`).addClass('selected');
|
||||||
|
this.divSolapasCubierta.removeClass('d-none');
|
||||||
|
this.carasImpresionCubierta.val(this.formData.cubierta.cubiertaCaras);
|
||||||
|
this.tamanioSolapasCubierta.val(this.formData.cubierta.tamanioSolapas);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.carasImpresionCubierta.val(this.formData.cubierta.cubiertaCaras);
|
||||||
|
|
||||||
|
}
|
||||||
/******************************
|
/******************************
|
||||||
* END CUBIERTA
|
* END CUBIERTA
|
||||||
******************************/
|
******************************/
|
||||||
|
|||||||
@ -77,7 +77,7 @@
|
|||||||
<label for="impresion-cubierta" class="form-label"
|
<label for="impresion-cubierta" class="form-label"
|
||||||
th:text="#{presupuesto.impresion-cubierta}">Impresión de cubierta</label>
|
th:text="#{presupuesto.impresion-cubierta}">Impresión de cubierta</label>
|
||||||
<div class="input-group input-group-sm">
|
<div class="input-group input-group-sm">
|
||||||
<select class="form-select select2" id="impresion-cubierta">
|
<select class="form-select select2 datos-cubierta" id="impresion-cubierta">
|
||||||
<option value="2" th:text="#{presupuesto.una-cara}">Una cara</option>
|
<option value="2" th:text="#{presupuesto.una-cara}">Una cara</option>
|
||||||
<option value="4" th:text="#{presupuesto.dos-caras}">Dos caras</option>
|
<option value="4" th:text="#{presupuesto.dos-caras}">Dos caras</option>
|
||||||
</select>
|
</select>
|
||||||
@ -93,7 +93,7 @@
|
|||||||
<div id="div-solapas-cubierta" class="d-none">
|
<div id="div-solapas-cubierta" class="d-none">
|
||||||
<label for="tamanio-solapas-cubierta" class="form-label"
|
<label for="tamanio-solapas-cubierta" class="form-label"
|
||||||
th:text="#{presupuesto.tamanio-solapa}">Tamaño solapa</label>
|
th:text="#{presupuesto.tamanio-solapa}">Tamaño solapa</label>
|
||||||
<input type="number" class="form-control form-control-sm solapas-presupuesto"
|
<input type="number" class="form-control form-control-sm solapas-presupuesto datos-cubierta"
|
||||||
id="tamanio-solapas-cubierta" min="60" max="120" value="80" step="1">
|
id="tamanio-solapas-cubierta" min="60" max="120" value="80" step="1">
|
||||||
<div class="form-text">
|
<div class="form-text">
|
||||||
<p class="mb-0">min: 60 mm</p>
|
<p class="mb-0">min: 60 mm</p>
|
||||||
@ -113,7 +113,7 @@
|
|||||||
<div class="col-auto mb-3">
|
<div class="col-auto mb-3">
|
||||||
<label for="papel-guardas" class="form-label" th:text="#{presupuesto.papel-guardas}">Papel de
|
<label for="papel-guardas" class="form-label" th:text="#{presupuesto.papel-guardas}">Papel de
|
||||||
guardas</label>
|
guardas</label>
|
||||||
<select class="form-select select2" id="papel-guardas">
|
<select class="form-select select2 datos-cubierta" id="papel-guardas">
|
||||||
<optgroup th:label="#{presupuesto.offset}">
|
<optgroup th:label="#{presupuesto.offset}">
|
||||||
<option value="1" data-papel-id="3" data-gramaje="170"
|
<option value="1" data-papel-id="3" data-gramaje="170"
|
||||||
th:text="#{presupuesto.offset-blanco} + ' 170 gr'" selected>Offset blanco 170 gr
|
th:text="#{presupuesto.offset-blanco} + ' 170 gr'" selected>Offset blanco 170 gr
|
||||||
@ -130,7 +130,7 @@
|
|||||||
<div class="col-auto mb-3">
|
<div class="col-auto mb-3">
|
||||||
<label for="guardas-impresas" class="form-label" th:text="#{presupuesto.guardas-impresas}">Guardas
|
<label for="guardas-impresas" class="form-label" th:text="#{presupuesto.guardas-impresas}">Guardas
|
||||||
impresas</label>
|
impresas</label>
|
||||||
<select class="form-select select2" id="guardas-impresas">
|
<select class="form-select select2 datos-cubierta" id="guardas-impresas">
|
||||||
<option value="0" th:text="#{presupuesto.no}" selected>No</option>
|
<option value="0" th:text="#{presupuesto.no}" selected>No</option>
|
||||||
<option value="4" th:text="#{presupuesto.una-cara}">Una cara</option>
|
<option value="4" th:text="#{presupuesto.una-cara}">Una cara</option>
|
||||||
<option value="8" th:text="#{presupuesto.dos-caras}">Dos caras</option>
|
<option value="8" th:text="#{presupuesto.dos-caras}">Dos caras</option>
|
||||||
@ -138,7 +138,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-auto mb-3">
|
<div class="col-auto mb-3">
|
||||||
<label for="cabezada" class="form-label" th:text="#{presupuesto.cabezada}">Cabezada</label>
|
<label for="cabezada" class="form-label" th:text="#{presupuesto.cabezada}">Cabezada</label>
|
||||||
<select class="form-select select2" id="guardas-impresas">
|
<select class="form-select select2 datos-cubierta" id="cabezada">
|
||||||
<option value="WHI" th:text="#{presupuesto.cabezada-blanca}" selected>Blanca</option>
|
<option value="WHI" th:text="#{presupuesto.cabezada-blanca}" selected>Blanca</option>
|
||||||
<option value="GRE" th:text="#{presupuesto.cabezada-verde}">Verde</option>
|
<option value="GRE" th:text="#{presupuesto.cabezada-verde}">Verde</option>
|
||||||
<option value="BLUE" th:text="#{presupuesto.cabezada-azul}">Azul</option>
|
<option value="BLUE" th:text="#{presupuesto.cabezada-azul}">Azul</option>
|
||||||
@ -217,11 +217,11 @@
|
|||||||
<!-- End Ribbon Shape -->
|
<!-- End Ribbon Shape -->
|
||||||
|
|
||||||
<div class="d-flex justify-content-between align-items-center mt-4 w-100">
|
<div class="d-flex justify-content-between align-items-center mt-4 w-100">
|
||||||
<button type="button" class="btn btn-light d-flex align-items-center">
|
<button id="btn-prev-cubierta" type="button" class="btn btn-light d-flex align-items-center btn-change-tab-cubierta">
|
||||||
<i class=" ri-arrow-left-circle-line label-icon align-middle fs-16 me-2"></i>
|
<i class=" ri-arrow-left-circle-line label-icon align-middle fs-16 me-2"></i>
|
||||||
<span th:text="#{presupuesto.volver-interior}">Volver a interior</span>
|
<span th:text="#{presupuesto.volver-interior}">Volver a interior</span>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-primary d-flex align-items-center">
|
<button id="btn-next-cubierta" type="button" class="btn btn-primary d-flex align-items-center btn-change-tab-cubierta">
|
||||||
<span th:text="#{presupuesto.continuar-extras-libro}">Continuar a extras del libro</span>
|
<span th:text="#{presupuesto.continuar-extras-libro}">Continuar a extras del libro</span>
|
||||||
<i class="ri-arrow-right-circle-line fs-16 ms-2"></i>
|
<i class="ri-arrow-right-circle-line fs-16 ms-2"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user