mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
añadido orden y boton de usar tirada
This commit is contained in:
@ -1047,7 +1047,12 @@ $('.insertarLinea').on("click", function (e) {
|
||||
}
|
||||
servicioGuardas(true)
|
||||
}
|
||||
|
||||
|
||||
|
||||
update_servicios().then(function(){
|
||||
update_tiradas_alternativas()
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ const lastColNr_tiradasAlt = $('#tableTiradas').find("tr:first th").length - 1;
|
||||
// Función para generar los botones de acción de la tabla de tiradas
|
||||
const actionBtns_tiradasAlt = function (data) {
|
||||
return `
|
||||
<a href="javascript:void(0);"><i class="ti ti-check ti-sm comfirm-tirada-alt mx-2" data-id="${data.row_id}"></i></a>
|
||||
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-tirada mx-2" data-id="${data.row_id}"></i></a>
|
||||
`;
|
||||
};
|
||||
@ -157,7 +158,7 @@ function add_tirada_alternativa(tirada_alt) {
|
||||
}
|
||||
else {
|
||||
var htmlString = '';
|
||||
if(!typeIsOk){
|
||||
if(typeIsOk){
|
||||
htmlString = `
|
||||
<div class="alert alert-warning d-flex align-items-baseline" role="alert">
|
||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||
@ -180,7 +181,11 @@ function add_tirada_alternativa(tirada_alt) {
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
$('#alert-tiradas_alt').html(htmlString);
|
||||
$('#alert-tiradas_alt').hide().empty().html(htmlString).fadeIn("slow", function(){
|
||||
setTimeout(function(){
|
||||
$('#alert-tiradas_alt').fadeOut("slow");
|
||||
}, 5000);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -212,7 +217,7 @@ function initTableTiradas() {
|
||||
"paging": false,
|
||||
"info": false,
|
||||
"searching": false,
|
||||
"ordering": false,
|
||||
"ordering": true,
|
||||
"autoWidth": false,
|
||||
"responsive": true,
|
||||
"columnDefs": [
|
||||
@ -238,6 +243,7 @@ function initTableTiradas() {
|
||||
className: 'row-edit dt-center'
|
||||
}
|
||||
],
|
||||
order: [[0, 'asc']]
|
||||
});
|
||||
}
|
||||
|
||||
@ -251,6 +257,16 @@ $(document).on('click', '.btn-delete-tirada', function (e) {
|
||||
})
|
||||
|
||||
|
||||
// Función para usar la tirada alternativa como tirada principal
|
||||
$(document).on('click', '.comfirm-tirada-alt', function (e) {
|
||||
|
||||
const row = $(this).closest('tr');
|
||||
const data = tableTiradas.row(row).data();
|
||||
$('#tirada').val(data.tirada);
|
||||
$('#tirada').trigger('change');
|
||||
})
|
||||
|
||||
|
||||
// Función para generar el JSON de las lineas de presupuesto para calcular las tiradas
|
||||
function generate_json_tiradas() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user