trabajando en servicios encuadernacion (init)

This commit is contained in:
2023-11-21 20:36:12 +01:00
parent 58af5bf90f
commit 1d0681847a
17 changed files with 174 additions and 18 deletions

View File

@ -75,6 +75,8 @@
<table id="tableOfTarifaencuadernacionlineas" class="table table-striped table-hover" style="width: 100%;">
<thead>
<tr>
<th>ID</th>
<th><?= lang('TarifaEncuadernacionLineas.dimensiones') ?></th>
<th><?= lang('TarifaEncuadernacionLineas.paginasMin') ?></th>
<th><?= lang('TarifaEncuadernacionLineas.precioMax') ?></th>
<th><?= lang('TarifaEncuadernacionLineas.paginasMax') ?></th>
@ -171,7 +173,13 @@
},
table : "#tableOfTarifaencuadernacionlineas",
idSrc: 'id',
fields: [ {
fields: [
{name: "id"},
{
name: "dimensiones_id",
"type": "select"
},
{
name: "paginas_libro_min"
}, {
name: "precio_max"
@ -194,6 +202,9 @@
]
} );
// Generación de la lista de proveedores (id, nombre) para encuadernación
const dimensionesList = <?php echo json_encode($dimensiones); ?>;
editor.field( 'dimensiones_id' ).update( dimensionesList );
editor.on( 'preSubmit', function ( e, d, type ) {
if ( type === 'create'){
@ -243,6 +254,13 @@
async: true,
}),
columns: [
{ 'data': 'id' },
{ 'data': 'dimensiones_id',
render: function(data, type, row, meta) {
var value = dimensionesList.find(element => element.value === data);
return value['label'];
},
},
{ 'data': 'paginas_libro_min' },
{ 'data': 'precio_max' },
{ 'data': 'paginas_libro_max' },
@ -401,6 +419,7 @@
// Tabla de tiradas
var theTable2 = $('#tableOfTarifaencuadernaciontiradas').DataTable( {
draw:1,
serverSide: true,
processing: true,
autoWidth: true,