Merge branch 'dev/presu_cliente_v2' of https://git.imnavajas.es/jjimenez/safekat into dev/presu_cliente_v2

This commit is contained in:
2024-10-15 15:42:19 +02:00
7 changed files with 83 additions and 18 deletions

View File

@ -18,7 +18,11 @@ let ClassSelect = function (domItem, url, placeholder, allowClear = false, param
return this.url;
},
data: (params) => {
let d = $.trim(params.term);
let q = $.trim(params.term);
let d = {
q: q,
page: params.page || 1,
};
for (let key in this.params) {
d[key] = this.params[key];

View File

@ -9,7 +9,7 @@ class DatosGenerales {
this.wizardStep = wizardForm.querySelector('#datos-generales');
this.validatorStepper = validatorStepper;
this.formatoLibro = new ClassSelect($("#papelFormatoId"), '/papel-formato/menuitems', window.translations["formatoLibro"]);
this.formatoLibro = new ClassSelect($("#papelFormatoId"), '/papel-formato/getSelect2', window.translations["formatoLibro"]);
this.cliente = new ClassSelect($("#clienteId"), '/clientes/cliente/getSelect2', window.translations["selectCliente"]);
this.titulo = this.domItem.find("#titulo");

View File

@ -0,0 +1,46 @@
class SelectorTiradaEnvio {
constructor(container, id, tirada, precio_u) {
this.container = container;
this.card = this.#generateHTML(id, tirada, precio_u);
}
#generateHTML(id, tirada, precio_u) {
var $div = $('<div>', {
id: id,
class: 'form-check custom-option custom-option-basic custom-option-tiradasDirecciones'
}).append(
$('<label>', {
class: 'form-check-label custom-option-content',
for: 'tiradaEnvios1'
}).append(
$('<input>', {
class: 'form-check-input',
type: 'radio',
value: '',
}),
$('<span>', { class: 'custom-option-header' }).append(
$('<span>', {
class: 'h6 mb-0',
text: tirada
}),
$('<span>', {
class: 'text-muted precio-tirada-envio',
text: 'Total: ' + parseFloat(precio_u * tirada).toFixed(2) + '€'
})
),
$('<span>', { class: 'custom-option-body' }).append(
$('<small>', {
text: precio_u + '€/ud'
})
)
)
);
return $div;
}
}
export default SelectorTiradaEnvio;