mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
no borrar papeles cuando se cambia tipo libro
This commit is contained in:
@ -74,6 +74,8 @@ class DatosGenerales {
|
||||
this.rl_retractilado = $("#rl_retractilado");
|
||||
this.rl_retractilado5 = $("#rl_retractilado5");
|
||||
|
||||
this.cargando = false;
|
||||
|
||||
this.initValidation();
|
||||
}
|
||||
|
||||
@ -534,6 +536,8 @@ class DatosGenerales {
|
||||
|
||||
cargarDatos(datos) {
|
||||
|
||||
this.cargando = true;
|
||||
|
||||
this.titulo.val(datos.titulo);
|
||||
this.autor.val(datos.autor);
|
||||
this.isbn.val(datos.isbn);
|
||||
@ -600,6 +604,8 @@ class DatosGenerales {
|
||||
this.retractilado5.prop('checked', datos.retractilado5);
|
||||
|
||||
this.ivaReducido.val(datos.ivaReducido ? 1 : 0).trigger('change');
|
||||
|
||||
this.cargando = false;
|
||||
}
|
||||
|
||||
getCliente() {
|
||||
@ -736,8 +742,6 @@ class DatosGenerales {
|
||||
this.checkPaginasMultiplo4();
|
||||
|
||||
// Para recalcular el presupuesto
|
||||
$('#divGramajeInterior').empty();
|
||||
$('#divGramajeInteriorColor').empty();
|
||||
element.trigger('change');
|
||||
}
|
||||
|
||||
@ -782,6 +786,7 @@ class DatosGenerales {
|
||||
this.formValidation.revalidateField('paginas');
|
||||
|
||||
// Se configura dependiento si hay color o no
|
||||
const lastLayoutColor = $('#negroEstandar').hasClass('d-none');
|
||||
if (paginasColor == 0) {
|
||||
|
||||
this.#handleInteriorLayout('negro');
|
||||
@ -789,6 +794,13 @@ class DatosGenerales {
|
||||
this.divPosPaginasColor.addClass('d-none');
|
||||
this.posPaginasColor.val("");
|
||||
this.pagColorConsecutivas.prop('checked', false);
|
||||
|
||||
if(lastLayoutColor && !this.cargando){
|
||||
|
||||
$('#divPapelInterior').empty();
|
||||
$('#divGramajeInterior').empty();
|
||||
$('#negroEstandar').trigger('click');
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (this.papelDiferente.is(":checked"))
|
||||
@ -797,6 +809,13 @@ class DatosGenerales {
|
||||
this.#handleInteriorLayout('color');
|
||||
this.divPaginasColorConsecutivas.removeClass('d-none');
|
||||
this.divPosPaginasColor.removeClass('d-none');
|
||||
|
||||
if(!lastLayoutColor && !this.cargando){
|
||||
|
||||
$('#divPapelInterior').empty();
|
||||
$('#divGramajeInterior').empty();
|
||||
$('#colorEstandar').trigger('click');
|
||||
}
|
||||
}
|
||||
|
||||
$('.calcular-lomo').trigger('change');
|
||||
|
||||
Reference in New Issue
Block a user