trabajando en el comparador

This commit is contained in:
2024-12-17 12:55:44 +01:00
parent 7aa75cdd59
commit 4e7f53ba6c
9 changed files with 217 additions and 174 deletions

View File

@ -0,0 +1,44 @@
import ClassSelect from '../../../components/select2.js';
import { getToken } from '../../../common/common.js';
class Comparador {
constructor(domItem) {
this.domItem = domItem;
this.csrf_token = getToken();
this.csrf_hash = $('#mainContainer').find('input[name="' + this.csrf_token + '"]').val();
this.comparador_json = this.domItem.find("#comparador_json_data");
this.tipo_impresion = $("#tipoImpresion");
this.paginasNegro = $('#compPaginasNegro');
this.papelNegro = new ClassSelect($('#compPapelNegro'),
'/papelesgenericos/getpapelcliente', 'Seleccione papel', false,
{
[this.csrf_token]: this.csrf_hash,
tirada: $('#tirada').val(),
tipo: 'negro',
cubierta: 0,
});
this.gramajeNegro = $('#compGramajeNegro');
}
init() {
this.papelNegro.init();
}
cargarDatos(datos) {
this.tipo_impresion.val(datos.tipo_impresion);
this.comparador_json.val(JSON.stringify(datos.json_data));
//if (datos.json_data.bn)
}
}
export default Comparador;