mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
funcionando crear editar y todo lo demas
This commit is contained in:
@ -88,6 +88,7 @@
|
|||||||
href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.min.css') ?>">
|
href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.min.css') ?>">
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/presupuestoCliente.css') ?>">
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
<?= $this->section('additionalExternalJs') ?>
|
<?= $this->section('additionalExternalJs') ?>
|
||||||
|
|||||||
@ -295,8 +295,14 @@ class PlantillasTarifasClienteForm {
|
|||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
self.rows[index] = data;
|
self.rows[index] = data;
|
||||||
}
|
}
|
||||||
if (self.rowsEdited.indexOf(row.id) == -1)
|
|
||||||
self.rowsEdited.push(row.id);
|
|
||||||
|
if (self.rowsEdited.some(row => row.id === data.id)) {
|
||||||
|
const index = self.rowsEdited.findIndex(row => row.id === data.id);
|
||||||
|
self.rowsEdited[index] = data;
|
||||||
|
} else {
|
||||||
|
self.rowsEdited.push(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -364,13 +370,13 @@ class PlantillasTarifasClienteForm {
|
|||||||
|
|
||||||
if (this.rowsEdited.length != 0) {
|
if (this.rowsEdited.length != 0) {
|
||||||
|
|
||||||
let rowIds = this.rowsEdited.map(row => '#' + this.tablePlantilla.table.row(row).data().id);
|
let rowIds = this.rowsEdited.map(row => '#' + row.id);
|
||||||
let updatedFields = {};
|
let updatedFields = {};
|
||||||
|
|
||||||
// Iterar sobre las filas editadas y construir el objeto actualizado
|
// Iterar sobre las filas editadas y construir el objeto actualizado
|
||||||
this.rowsEdited.forEach(row2Edit => {
|
this.rowsEdited.forEach(row2Edit => {
|
||||||
|
|
||||||
const row = this.tablePlantilla.table.row(row2Edit).data();
|
const row = this.tablePlantilla.table.row('#' + row2Edit.id).data();
|
||||||
|
|
||||||
updatedFields['tipo'] = updatedFields['tipo'] || {};
|
updatedFields['tipo'] = updatedFields['tipo'] || {};
|
||||||
updatedFields['tipo'][row.id] = row.tipo;
|
updatedFields['tipo'][row.id] = row.tipo;
|
||||||
|
|||||||
Reference in New Issue
Block a user