trabajando en comparador

This commit is contained in:
2024-12-17 14:38:02 +01:00
parent 4e7f53ba6c
commit 643f84684a
11 changed files with 267 additions and 492 deletions

View File

@ -79,6 +79,7 @@ class PresupuestoAdminEdit {
self.datosGenerales.cargarDatos(response.data.datosGenerales);
self.datosLibro.cargarDatos(response.data.datosLibro);
self.comparador.cargarDatos(response.data.comparador);
/*self.direcciones.handleChangeCliente();

View File

@ -15,20 +15,29 @@ class Comparador {
this.paginasNegro = $('#compPaginasNegro');
this.papelNegro = new ClassSelect($('#compPapelNegro'),
'/papelesgenericos/getpapelcliente', 'Seleccione papel', false,
'/presupuestoadmin/papelgenerico', 'Seleccione papel', false,
{
[this.csrf_token]: this.csrf_hash,
tipo_impresion: this.tipo_impresion.val(),
tirada: $('#tirada').val(),
tipo: 'negro',
cubierta: 0,
});
this.gramajeNegro = $('#compGramajeNegro');
this.gramajeNegro = new ClassSelect($('#compGramajeNegro'),
'/presupuestoadmin/papelgramaje', 'Seleccione gramaje', false,
{
[this.csrf_token]: this.csrf_hash,
papel_generico: this.papelNegro.getVal(),
tipo_impresion: this.tipo_impresion.val(),
tirada: $('#tirada').val(),
tipo: 'negro',
});
}
init() {
this.papelNegro.init();
this.gramajeNegro.init();
}
cargarDatos(datos) {
@ -36,7 +45,11 @@ class Comparador {
this.tipo_impresion.val(datos.tipo_impresion);
this.comparador_json.val(JSON.stringify(datos.json_data));
//if (datos.json_data.bn)
if (datos.json_data.bn){
this.paginasNegro.val(datos.json_data.bn.paginas);
this.papelNegro.setOption(datos.json_data.bn.papel_id, datos.json_data.bn.papel_nombre);
this.gramajeNegro.setOption(datos.json_data.bn.gramaje, datos.json_data.bn.gramaje);
}
}
}