-
Notifications
You must be signed in to change notification settings - Fork 0
/
tabulars.js
162 lines (161 loc) · 5.15 KB
/
tabulars.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
import {Meteor} from 'meteor/meteor';
var echarts = require('echarts/lib/echarts');
var Tab_Reports=new Tabular.Table({
name: 'Reports',
collection: Reports,
scrollX: true,
processing: true,
"language": {
"processing": '<i class="fa fa-spinner fa-spin" style=\'font-size:45px;color:#2196f3;\'></i>',
search: 'Buscar:',
info: 'Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros',
infoEmpty: 'Mostrando registros del 0 al 0 de un total de 0 registros',
lengthMenu: 'Mostrar _MENU_ registros',
emptyTable: 'Ningún dato disponible',
paginate: {
first: 'Primero',
previous: 'Anterior',
next: 'Siguiente',
last: 'Último',
}
},
buttons: [
{
extend: 'copyHtml5',
text: '<i class="large material-icons">content_copy</i>',
messageTop: 'Mis Registros',
"className": 'btn-floating waves-effect waves-light blue'
},
{
extend: 'csvHtml5',
charset:'utf-8',
bom: true,
text: '<i class="large material-icons">cloud_download</i>',
title: 'Mis Registros',
"className": 'btn-floating waves-effect waves-light red'
},
{
extend: 'pdfHtml5',
text: '<i class="large material-icons">picture_as_pdf</i>',
title:'Mis Registros',
"className": 'btn-floating waves-effect waves-light orange',
exportOptions: { modifier: { page: 'current' } }
}
],
columns:[
{ data: 'fecha', title: 'FECHA' },
{ data: 'inicioOficial', title: 'INICIO OFICIAL' },
{ data: 'primerRegistro', title: 'PRIMER REGISTRO', },
{ data: 'salidaOficial', title: 'SALIDA OFICIAL' },
{ data: 'ultimoRegistro', title: 'ÚLTIMO REGISTRO' },
{ data: 'tiempo', title: 'TIEMPO' },
{ data: 'horas', title: 'HORAS' },
{ data: 'estatus', title: 'ESTATUS' },
{data: 'sancion', title: 'SANCIÓN' },
{ data: 'excepcion', title: 'EXCEPCIÓN' },
{ data: 'antes', title: 'SALIDA ANTICIPADA',render:function(val){
var result="-";
if(val=="false"){
result="No"
}else if(val=="true"){
result="Si";
}
return result;
}
},
{
data:"estatus",
title:"Justificar",
tmpl: Meteor.isClient && Template.justificar_template
}
]
});
var Tab_Justificantes=new Tabular.Table({
name: 'Justificantes',
collection: Justificantes,
autoWidth: false,
scrollX: true,
responsive:true,
processing: true,
"language": {
"processing": '<i class="fa fa-spinner fa-spin" style=\'font-size:45px;color:#2196f3;\'></i>',
search: 'Buscar:',
info: 'Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros',
infoEmpty: 'Mostrando registros del 0 al 0 de un total de 0 registros',
lengthMenu: 'Mostrar _MENU_ registros',
emptyTable: 'Ningún dato disponible',
paginate: {
first: 'Primero',
previous: 'Anterior',
next: 'Siguiente',
last: 'Último',
}
},
dom: 'lBfrtip',
lengthMenu: [
[10, 25, 50, 100, 500,-1],
['10 Filas', '25 Filas', '50 Filas', '100 Filas', '500 Filas','Todo']
],
buttons: [
{
extend: 'copyHtml5',
text: '<i class="large material-icons">content_copy</i>',
messageTop: 'Mis Justificantes',
"className": 'btn-floating waves-effect waves-light blue'
},
{
extend: 'csvHtml5',
charset:'utf-8',
bom: true,
text: '<i class="large material-icons">cloud_download</i>',
title: 'Mis Justificantes',
"className": 'btn-floating waves-effect waves-light red'
},
{
extend: 'pdfHtml5',
text: '<i class="large material-icons">picture_as_pdf</i>',
title:'Mis Justificantes',
"className": 'btn-floating waves-effect waves-light orange',
exportOptions: { modifier: { page: 'current' } }
}
],
selector:Selector_Justificantes,
columns: [
{ data:"idEmp", title:"Id" },
{ data:"idEmpName", title:"Colaborador" },
{ data:"fecha", title:"Fecha" },
{ data: "razon_txt", title: "Razón de la Ausencia", },
{ data:"observaciones", title:"Obs. del Colaborador" },
orion.attributeColumn('fileXP', 'documento', 'Documento'),
{ data:"estatus", title:"Estatus"},
{ data:"observaciones_admin", title:"Obs. RH",render(val){if(val){return val;}else{ return "Sin Comentarios";}}},
{
data:"procede",
title:"Procede",
render(val) {
if (val) { return "<img src='/images/check.png' width='25px'>" }
else { return "<img src='/images/denied.png' width='25lpx'>" }
}
},
{
data: "createdBy",
title: "Insertó",
render: function(val){ var Data = Meteor.users.findOne({_id:val}); if (Data !== undefined) { return Data.profile.name; }else { return "Sin Asignar"; } }
},
{
data: "createdAt",
title: "Insertado",
render: function(val){ return formatADate(val); }
},
{
data: "updatedBy",
title: "Actualizó",
render: function(val){ var Data = Meteor.users.findOne({_id:val}); if (Data !== undefined) { return Data.profile.name; }else { return "Sin Asignar"; } }
},
{
data: "updatedAt",
title: "Actualizado",
render: function(val){ return formatADate(val); }
}
]
});