trabajando

This commit is contained in:
2025-04-16 18:24:48 +02:00
parent 6a4e9b611e
commit 3ada529b6e
5 changed files with 173 additions and 24 deletions

View File

@ -11,7 +11,10 @@ $(()=>{
{},
{},
function(response) {
if(response.data.createAlbaran){
if(!response.status){
popErrorAlert(response.message);
}
if(response.data && response.data.createAlbaran){
Swal.fire({
title: 'Atención!',
@ -31,11 +34,62 @@ $(()=>{
},
function(xhr, status, error) {
popErrorAlert(error.responseJSON.message);
if(status == 'error' && typeof(error)== 'string')
popErrorAlert(error);
else
popErrorAlert(error.responseJSON.message);
}
).get();
}
});
const tableEnvios = $('#tableOfEnvios').DataTable({
processing: true,
serverSide: true,
autoWidth: true,
responsive: true,
scrollX: true,
orderCellsTop: true,
lengthMenu: [5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500],
pageLength: 50,
"dom": 'lBrtip',
"ajax": {
"url": "/logistica/datatableEnvios",
},
"columns": [
{ "data": "id" },
{ "data": "pedidos" },
{ "data": "num_lineas" },
{ "data": "att" },
{ "data": "direccion" },
{ "data": "ciudad" },
{ "data": "pais" },
{ "data": "cp" },
{ "data": "email" },
{ "data": "telefono" },
{
"data": "finalizado",
"className": "text-center",
},
{ "data": "action" }
],
"language": {
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
},
"columnDefs": [
{
orderable: false,
searchable: false,
targets: [11]
},
],
"order": [[0, "desc"]],
});
$(document).on('click', '.btn-edit', function (e) {
window.location.href = '/logistica/envio/' + $(this).attr('data-id');
});
});