mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajadno en guardar
This commit is contained in:
@ -118,13 +118,95 @@ class PresupuestoAdminEdit {
|
||||
|
||||
async guardarPresupuesto() {
|
||||
|
||||
await this.servicios.guardar();
|
||||
await this.envios.guardarEnvios();
|
||||
await this.lineasPresupuesto.guardarLineasPresupuesto();
|
||||
$('#loader').modal('show');
|
||||
|
||||
try {
|
||||
|
||||
let formData = $('#presupuestoForm').serialize()
|
||||
|
||||
await this.servicios.guardar();
|
||||
await this.envios.guardarEnvios();
|
||||
await this.lineasPresupuesto.guardarLineasPresupuesto();
|
||||
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
$('#loader').modal('hide');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
getFormData() {
|
||||
|
||||
let datos = {};
|
||||
|
||||
datos.id = window.location.href.split("/").pop();
|
||||
datos.cliente_id = this.datosGenerales.cliente.getVal();
|
||||
datos.tipo_impresion_id = this.tipo_impresion.val();
|
||||
|
||||
datos = {
|
||||
...datos, ...{
|
||||
inc_rei = this.datosGenerales.inc_rei.val();
|
||||
titulo: this.datosGenerales.titulo.val(),
|
||||
autor: this.datosGenerales.autor.val(),
|
||||
isbn: this.datosGenerales.isbn.val(),
|
||||
coleccion: this.datosGenerales.coleccion.val(),
|
||||
numero_edicion: this.datosGenerales.numeroEdicion.val(),
|
||||
referencia_cliente: this.datosGenerales.referenciaCliente.val(),
|
||||
updated_at: new Date().toISOString().slice(0, 19).replace('T', ' '),
|
||||
}
|
||||
}
|
||||
|
||||
datos = {
|
||||
...datos, ...{
|
||||
paginas: this.datosLibro.paginas.val(),
|
||||
tirada: this.datosLibro.tirada.val(),
|
||||
papel_formato_id: this.datosLibro.papelFormatoId.hasClass('d-none') ? 0 : this.datosLibro.papelFormatoId.val(),
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
}
|
||||
datos.selectedTirada = this.datosLibro.tirada.val();
|
||||
|
||||
datos.servicios = {
|
||||
'prototipo': this.datosLibro.prototipo.is(':checked') ? 1 : 0,
|
||||
'ferro': this.datosLibro.ferro.is(':checked') ? 1 : 0,
|
||||
'ferroDigital': this.datosLibro.ferroDigital.is(':checked') ? 1 : 0,
|
||||
'marcapaginas': this.datosLibro.marcapaginas.is(':checked') ? 1 : 0,
|
||||
'retractilado': this.datosLibro.retractilado.is(':checked') ? 1 : 0,
|
||||
'retractilado5': this.datosLibro.retractilado5.is(':checked') ? 1 : 0,
|
||||
};
|
||||
|
||||
if (this.comparador.tipo_impresion_id == 1 || this.tipo_impresion_id == 3) {
|
||||
datos.lomoRedondo = this.comparador.lomoRedondo.select2('data')[0].id;
|
||||
}
|
||||
else {
|
||||
datos.lomoRedondo = 0;
|
||||
}
|
||||
|
||||
this.datos.entrega_taller = this.envios.entrega_taller.is(':checked') ? 1 : 0;
|
||||
if (parseInt(this.cosido.val())) {
|
||||
|
||||
let paginas_por_cuadernillo = "";
|
||||
|
||||
this.servicios.ServiciosEncuadernacion.table.rows().every(function (rowIdx, tableLoop, rowLoop) {
|
||||
var rowData = this.data();
|
||||
if (rowData.paginas_por_cuadernillo != null) {
|
||||
paginas_por_cuadernillo = rowData.paginas_por_cuadernillo;
|
||||
}
|
||||
});
|
||||
|
||||
datos.paginas_por_cuadernillo = paginas_por_cuadernillo;
|
||||
}
|
||||
|
||||
datos.comentarios_cliente = $('#comentariosCliente').val();
|
||||
datos.comentarios_safekat = $('#comentariosSafekat').val();
|
||||
datos.comentarios_presupuesto = $('#comentariosPdf').val();
|
||||
datos.comentarios_produccion = $('#comentariosProduccion').val();
|
||||
|
||||
}
|
||||
|
||||
|
||||
async updatePresupuesto(event, {
|
||||
|
||||
update_lineas = true,
|
||||
update_servicios = true,
|
||||
update_envios = true,
|
||||
@ -244,7 +326,7 @@ class PresupuestoAdminEdit {
|
||||
cantidad_total += parseInt(rowData.paginas)
|
||||
})
|
||||
htmlString = ''
|
||||
|
||||
|
||||
if (cantidad_total != parseInt($('#paginas').val())) {
|
||||
htmlString = `
|
||||
<div class="alert alert-warning d-flex align-items-baseline" role="alert">
|
||||
|
||||
Reference in New Issue
Block a user