diseño interior con selector de papeles

This commit is contained in:
2024-11-24 20:03:42 +01:00
parent b42b34f350
commit bcbf14c41f
22 changed files with 693 additions and 767 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 KiB

View File

@ -6,3 +6,7 @@ export function getToken()
const paramsObject = Object.fromEntries(params.entries());
return paramsObject.token;
}
export function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}

View File

@ -80,6 +80,9 @@ let ClassSelect = function (domItem, url, placeholder, allowClear = false, param
this.getText = () => {
return this.item.find(":selected").text();
};
this.onChange = function(callback) {
this.item.on('change', callback);
};
};
export default ClassSelect;

View File

@ -4,7 +4,7 @@ class tarjetaDireccion {
this.container = container;
this.id = id;
this.direccionId = direccion.id;
this.direccionId = direccion.direccionId;
this.card = this.#generateHTML(id, direccion);
this.deleteBtn = this.card.find('.direccion-eliminar');
this.editBtn = this.card.find('.direccion-editar');

View File

@ -806,14 +806,17 @@ class DatosGenerales {
$(".papel-interior").removeClass('selected');
$(".interior-color").removeClass('d-none');
this.#handleInteriorLayout('mixto');
$("#divPapelInterior").empty();
$("#divGramajeInterior").empty();
$("#divPapelInteriorColor").empty();
$("#divGramajeInteriorColor").empty();
}
else {
$(".interior-color").addClass('d-none');
$("#divGramajeInteriorColor").addClass('d-none');
$(".papel-interior").removeClass('selected');
$(".gramaje-interior").prop('checked', false);
$(".gramaje-interior-color").prop('checked', false);
$("#divPapelInterior").empty();
$("#divGramajeInterior").empty();
$("#divPapelInteriorColor").empty();
$("#divGramajeInteriorColor").empty();
this.#handlePaginas();
}
}

View File

@ -33,7 +33,7 @@ class PresupuestoCliente {
this.rl_sobrecubierta = $(".rl-sobrecubierta");
this.datosGenerales = new DatosGenerales($("#datos-generales"), this.clientePresupuestoWizard, this.validationStepper);
this.disenioInterior = new DisenioInterior($("#interior-libro"), this.clientePresupuestoWizard, this.validationStepper);
this.disenioInterior = new DisenioInterior($("#interior-libro"), this.clientePresupuestoWizard, this.validationStepper, this);
this.disenioCubierta = new DisenioCubierta($("#cubierta-libro"), this.clientePresupuestoWizard, this.validationStepper);
this.direcciones = new Direcciones($("#direcciones-libro"), this.clientePresupuestoWizard, this.validationStepper);
this.resumen = new Resumen($("#resumen-libro"), this.datosGenerales, this.disenioInterior, this.disenioCubierta, this.direcciones);
@ -108,6 +108,7 @@ class PresupuestoCliente {
this.calcularPresupuesto = true;
}
$(".calcular-presupuesto").on('change', this.checkForm.bind(this));
}
@ -701,9 +702,11 @@ class PresupuestoCliente {
this.datosGenerales.cargarDatos(response.data.datosGenerales);
this.direcciones.handleChangeCliente();
this.direcciones.cargarDatos(response.data.direcciones, response.data.datosGenerales);
this.disenioInterior.cargarDatos(response.data.interior, response.data.datosGenerales.papelInteriorDiferente);
this.disenioCubierta.cargarDatos(response.data.cubierta, response.data.guardas, response.data.sobrecubierta);
this.direcciones.cargarDatos(response.data.direcciones, response.data.datosGenerales);
setTimeout(() => {

View File

@ -1,4 +1,5 @@
import previewFormas from "../preview.js";
import { capitalizeFirstLetter } from "../../common/common.js";
class Resumen {
constructor(domItem, datosGenerales, disenioInterior, disenioCubierta) {
@ -201,7 +202,7 @@ class Resumen {
generate() {
this.titulo.text(this.datosGenerales.titulo.val());
this.tipoLibro.text(this.capitalizeFirstLetter(this.datosGenerales.tiposLibro.filter('.selected').attr('id')));
this.tipoLibro.text(capitalizeFirstLetter(this.datosGenerales.tiposLibro.filter('.selected').attr('id')));
let ancho = 0, alto = 0;
if (this.datosGenerales.checkFormatoPersonalizado.is(':checked')) {
@ -346,11 +347,6 @@ class Resumen {
}
capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
#changeDecimalFormat(number) {
let cleanedNumber = String(number).replace(/[^\d.]/g, '');

View File

@ -502,7 +502,7 @@
}
/* Asegurar el tamaño uniforme del contenedor */
.custom-selector-gramaje {
.custom-selector-gramaje, .custom-selector-gramaje-color {
width: 100px !important; /* Fija el ancho */
}