Arreglados bugs de warning numero de paginas

This commit is contained in:
imnavajas
2024-01-08 09:17:54 +01:00
parent a05c717c9f
commit f85dfc1cfc
2 changed files with 24 additions and 21 deletions

View File

@ -364,7 +364,7 @@ const actionBtns_lp = function(data) {
`;
};
window.tableLineasPresupuesto = new DataTable('#tableLineasPresupuesto',{
var tableLineasPresupuesto = new DataTable('#tableLineasPresupuesto',{
scrollX: true,
searching: false,
paging: false,
@ -3285,27 +3285,29 @@ async function fill_bbdd_from_lp(presupuesto_id){
data.push(linea_data)
} );
await $.ajax({
type: 'post',
url: '<?= route_to("updateDataOfCosidotapablanda") ?>',
if(data.lengh > 0){
data: {
tipo: 'lineasPresupuesto',
datos: data,
presupuesto_id: presupuesto_id,
<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v
},
dataType: 'json',
success:function(response){
await $.ajax({
type: 'post',
url: '<?= route_to("updateDataOfCosidotapablanda") ?>',
token=response.<?= csrf_token() ?>;
yeniden(token);
}
}).fail(function (jqXHR, textStatus, error) {
// Handle error here
console.log(jqXHR)
});
data: {
tipo: 'lineasPresupuesto',
datos: data,
presupuesto_id: presupuesto_id,
<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v
},
dataType: 'json',
success:function(response){
token=response.<?= csrf_token() ?>;
yeniden(token);
}
}).fail(function (jqXHR, textStatus, error) {
// Handle error here
console.log(jqXHR)
});
}
}
function updateLineasPresupuesto(){
@ -3344,6 +3346,7 @@ function checkPaginasPresupuesto(){
tableLineasPresupuesto.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
var rowData = this.data();
if((rowData.row_id != 'lp_cubierta') && (rowData.row_id != 'lp_sobrecubierta'))
cantidad_total += rowData.paginas
})

View File

@ -463,7 +463,7 @@ function getObjetoLP(lpName) {
function getVisibleTabs() {
window.tableLineasPresupuesto.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
$('#tableLineasPresupuesto').DataTable().rows().every( function ( rowIdx, tableLoop, rowLoop ) {
var rowData = this.data();
console.log(rowData.row_id);
$("#tab-pv-bn").show();