falta ordenar por paginas y revisar la busqueda de los selects

This commit is contained in:
2025-10-11 18:16:55 +02:00
parent a1359f37b0
commit 62dcff8869
11 changed files with 287 additions and 70 deletions

View File

@ -0,0 +1,9 @@
import PresupuestoWizard from './wizard.js';
const app = new PresupuestoWizard({
mode: 'private',
readonly: false,
canSave: true,
useSessionCache: false,
});
app.init();

View File

@ -29,8 +29,8 @@ export default class PresupuestoWizard {
ancho: 148,
alto: 218,
formatoPersonalizado: false,
paginasNegro: 0,
paginasColor: 32,
paginasNegro: 32,
paginasColor: 0,
posicionPaginasColor: '',
tipoEncuadernacion: 'fresado',
},
@ -245,7 +245,7 @@ export default class PresupuestoWizard {
});
if (this.opts.canSave) {
$('#btn-guardar').on('click', async () => {
$('.guardar-presupuesto').on('click', async () => {
const alert = $('#form-errors');
const servicios = [];
@ -263,6 +263,7 @@ export default class PresupuestoWizard {
mode: this.opts.mode,
presupuesto: this.#getPresupuestoData(),
servicios: servicios,
cliente_id: $('#cliente_id').val() || null,
};
try {
alert.addClass('d-none').find('ul').empty();
@ -274,7 +275,7 @@ export default class PresupuestoWizard {
}).then((data) => {
Swal.fire({
icon: 'success',
title: window.languageBundle?.get('common.guardado') || 'Guardado',
title: window.languageBundle?.get('presupuesto.exito.guardado') || 'Guardado',
timer: 1800,
buttonsStyling: false,
customClass: {
@ -307,7 +308,7 @@ export default class PresupuestoWizard {
} catch (e) {
Swal.fire({
icon: 'error',
title: 'Error al guardar',
title: window.languageBundle?.get('presupuesto.add.error.save.title') || 'Error',
text: e?.message || '',
buttonsStyling: false,
customClass: {

View File

@ -138,9 +138,9 @@ import { preguntarTipoPresupuesto } from './presupuesto-utils.js';
if (!res) return;
if (res.tipo === 'anonimo') {
console.log('Crear presupuesto ANÓNIMO');
window.location.href = '/presupuesto/add/public';
} else {
console.log('Crear presupuesto de CLIENTE:', res.clienteId, res.clienteText);
window.location.href = '/presupuesto/add/private/' + res.clienteId;
}
});