mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en la preview
This commit is contained in:
@ -5,6 +5,7 @@ import DatosGenerales from './sections/datosGenerales.js';
|
||||
import DatosLibro from './sections/datosLibro.js';
|
||||
import Comparador from './sections/comparador.js';
|
||||
import LineasPresupuesto from './sections/lineasPresupuesto.js';
|
||||
import PreviewFormasAdmin from './sections/previewFormasAdmin.js';
|
||||
|
||||
class PresupuestoAdminEdit {
|
||||
|
||||
@ -19,7 +20,6 @@ class PresupuestoAdminEdit {
|
||||
this.lsc = $("#lomo_sobrecubierta");
|
||||
this.cosido = $("#isCosido");
|
||||
this.tipo_impresion = $("#tipo_impresion_id");
|
||||
this.cosido = $("#isCosido");
|
||||
this.POD = $("#POD");
|
||||
|
||||
this.datosGenerales = new DatosGenerales(this.domItem.find('#accordionDatosPresupuestoTip'));
|
||||
@ -34,7 +34,8 @@ class PresupuestoAdminEdit {
|
||||
{
|
||||
getDimensionLibro: this.getDimensionLibro,
|
||||
});
|
||||
|
||||
|
||||
this.previewFormasAdmin = null;
|
||||
this.calcularPresupuesto = false;
|
||||
}
|
||||
|
||||
@ -45,11 +46,43 @@ class PresupuestoAdminEdit {
|
||||
document.querySelector('.select2-search__field').focus();
|
||||
});
|
||||
|
||||
const impresion_id = $('#tipo_impresion_id').val();
|
||||
let tipoLibro = '';
|
||||
if (impresion_id == 1 || impresion_id == 2) {
|
||||
tipoLibro = 'fresado';
|
||||
} else if (impresion_id == 3 || impresion_id == 4) {
|
||||
tipoLibro ='cosido';
|
||||
} else if (impresion_id == 5 || impresion_id == 6) {
|
||||
tipoLibro ='espiral';
|
||||
} else if (impresion_id == 7 || impresion_id == 8) {
|
||||
tipoLibro = 'wireo';
|
||||
} else if (impresion_id == 21) {
|
||||
tipoLibro = 'grapado';
|
||||
}
|
||||
|
||||
|
||||
this.datosGenerales.init();
|
||||
this.datosLibro.init();
|
||||
this.comparador.init();
|
||||
this.lineasPresupuesto.init();
|
||||
|
||||
this.previewFormasAdmin = new PreviewFormasAdmin(tipoLibro, this.tipoTapa,
|
||||
{
|
||||
ancho: ()=>{return this.getDimensionLibro().ancho},
|
||||
alto: ()=>{return this.getDimensionLibro().alto},
|
||||
lomo: ()=>{$('#lc').val() === '' ? parseFloat('0.0') : parseFloat($('#lc').val())},
|
||||
solapas: ()=>{
|
||||
$('#solapas').prop('checked')?parseFloat($('#solapas_ancho').val()):0
|
||||
},
|
||||
solapas_sobrecubierta: ()=>{
|
||||
$('#solapas_sobrecubierta').prop('checked')?parseFloat($('#solapas_ancho_sobrecubierta').val()):0
|
||||
},
|
||||
lomoRedondo: ()=>{
|
||||
(self.tipo_impresion == 1 || $self.tipo_impresion == 3)?parseFloat($('#compLomoRedondo').val()):0
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
if (window.location.href.includes("edit")) {
|
||||
|
||||
setTimeout(() => {
|
||||
@ -88,7 +121,7 @@ class PresupuestoAdminEdit {
|
||||
self.datosGenerales.cargarDatos(response.data.datosGenerales);
|
||||
self.datosLibro.cargarDatos(response.data.datosLibro);
|
||||
self.comparador.cargarDatos(response.data.comparador);
|
||||
|
||||
self.lineasPresupuesto.cargarDatos(response.data.lineasPresupuesto);
|
||||
/*self.direcciones.handleChangeCliente();
|
||||
|
||||
self.direcciones.cargarDatos(response.data.direcciones, response.data.datosGenerales);
|
||||
|
||||
Reference in New Issue
Block a user