130
| <![CDATA[<script lang="text/javascript">
$(document).ready( function () {
$('#table-transparencia').DataTable( {
dom: "<'row'<'col-sm-6'>>" +
"<'row'<'col-sm-6'B><'col-sm-3'l><'col-sm-3'f>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
autoFill: true,
responsive: true,
buttons: [
{
extend: 'copy',
text: 'Ctrl+C'
},
'csv',
{
extend: 'excel',
text: 'Planilha'
},
'pdf',
{
extend: 'print',
text: 'Imprimir'
}
],
"language": {
"url": "//cdn.datatables.net/plug-ins/1.10.16/i18n/Portuguese-Brasil.json"
}
});
$('#table-arquivos').DataTable( {
dom:"<'row'<'col-sm-12'f>>"+
"<'row'<'col-sm-12'tr>>",
"language": {
"url": "//cdn.datatables.net/plug-ins/1.10.16/i18n/Portuguese-Brasil.json"
},
autoFill: true,
responsive: true
});
$('#table-relacao-servidores').DataTable( {
autoFill: true,
responsive: true,
"language": {
"url": "//cdn.datatables.net/plug-ins/1.10.16/i18n/Portuguese-Brasil.json"
},
"order": [[ 1, "asc" ]],
"ajax": {
'url': 'relacaoservidores/view',
'type': 'POST',
'data': function(d) {
d.entidade = $('#inEntidade option:selected').val();
d.stacao = 'listaServidores';
}
},
aoColumns: [
{ mData: "matricula" },
{ mData: "nom_cgm" }
],
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Todos"]]
});
$('#table-indicacao-cargo-funcao').DataTable( {
autoFill: true,
responsive: true,
"language": {
"url": "//cdn.datatables.net/plug-ins/1.10.16/i18n/Portuguese-Brasil.json"
},
"order": [[ 1, "asc" ]],
"ajax": {
'url': 'indicacaocargofuncao/view',
'type': 'POST',
'data': function(d) {
d.entidade = $('#inEntidade option:selected').val();
d.stacao = 'listaIndicacaoCargoFuncao';
}
},
aoColumns: [
{ mData: "matricula" },
{ mData: "nom_cgm" },
{ mData: "descricao_cargo" },
{ mData: "descricao_padrao" }
],
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Todos"]]
});
$('#table-padrao-remuneracao-cargos-funcoes').DataTable( {
autoFill: true,
responsive: true,
"language": {
"url": "//cdn.datatables.net/plug-ins/1.10.16/i18n/Portuguese-Brasil.json"
},
"order": [[ 1, "asc" ]],
"ajax": {
'url': 'padraoremcargosfuncoes/view',
'type': 'POST',
'data': function(d) {
d.entidade = $('#inEntidade option:selected').val();
d.stacao = 'listaPadraoRemuneracaoCargoFuncao';
}
},
aoColumns: [
{ mData: "cod_cargo" },
{ mData: "descricao_cargo" },
{ mData: "codigo_cbo" },
{ mData: "cod_padrao" },
{ mData: "descricao_padrao" },
{ mData: "horas_mensais" },
{ mData: "horas_semanais" },
{ mData: "valor_padrao",
render: $.fn.dataTable.render.number( '.', ',', 2 ) },
{ mData: "vigencia" },
],
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Todos"]]
});
$('#table-remuneracao-nominal-servidor').DataTable( {
autoFill: true,
responsive: true,
"processing": true,
"language": {
"url": "//cdn.datatables.net/plug-ins/1.10.16/i18n/Portuguese-Brasil.json",
},
"order": [[ 0, "asc" ]],
"ajax": {
'url': 'remuneracaonominalservidor/view',
'type': 'POST',
'data': function(d) {
d.entidade = $('#inEntidade option:selected').val();
d.stacao = 'listaRemuneracaoNominalServidor';
d.cod_periodo = $('#mesRemuneracaoNominalServidor option:selected').data("cod_periodo");
}
},
aoColumns: [
{ mData: "nom_cgm" },
{ mData: "descricao_cargo" },
{ mData: "salario",
render: $.fn.dataTable.render.number( '.', ',', 2 ) },
{ mData: "provento",
render: $.fn.dataTable.render.number( '.', ',', 2 ) },
{ mData: "desconto",
render: $.fn.dataTable.render.number( '.', ',', 2 ) },
{ mData: "liquido",
render: $.fn.dataTable.render.number( '.', ',', 2 ) }
],
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Todos"]]
});
if ( $( "#exercicioRemuneracaoNominalServidor" ).length ) {
$.ajax({
type: "POST",
url: "remuneracaonominalservidor/exercicio",
data: {
stacao: 'listaExercicioServidor',
entidade: $('#inEntidade option:selected').val() },
success: function (obj) {
if (obj != null) {
obj = obj.substring(0,(obj.length - 1));
obj = obj.substring(8, obj.length);
var selectbox = $('#exercicioRemuneracaoNominalServidor');
selectbox.find('option').remove();
$('<option>').val('').text('Exercicio').appendTo(selectbox);
$.each($.parseJSON(obj), function (i, d) {
$('<option>').val(d.exercicio).text(d.exercicio).appendTo(selectbox);
});
selectbox.prop("selectedIndex", 1);
selectbox.change();
}
}
});
}
$('#exercicioRemuneracaoNominalServidor').on('change', function(){
if (this.value != '') {
$.ajax({
type: "POST",
url: "remuneracaonominalservidor/mes",
data: {
stacao: 'listaMesServidor',
entidade: $('#inEntidade option:selected').val(),
exercicio: $('#exercicioRemuneracaoNominalServidor option:selected').val() },
success: function (obj) {
if (obj != null) {
obj = obj.substring(0,(obj.length - 1));
obj = obj.substring(8, obj.length);
var selectbox = $('#mesRemuneracaoNominalServidor');
selectbox.find('option').remove();
$('<option>').val('').text('Mês').data("cod_periodo", "").appendTo(selectbox);
var mesAtual = new Date();
$.each($.parseJSON(obj), function (i, d) {
if ($('#exercicioRemuneracaoNominalServidor option:selected').val() >= mesAtual.getFullYear()) {
if (parseInt(d.mes.substring(0,2)) < (mesAtual.getMonth() + 1)) {
$('<option>').val(d.mes).text(d.mes).data("cod_periodo", d.cod_periodo).appendTo(selectbox);
}
} else {
$('<option>').val(d.mes).text(d.mes).data("cod_periodo", d.cod_periodo).appendTo(selectbox);
}
});
var selectbox = $('#mesRemuneracaoNominalServidor option:last');
selectbox.prop('selected', true);
$('#mesRemuneracaoNominalServidor').change();
}
}
});
} else {
$('#mesRemuneracaoNominalServidor').find('option').remove();
$('<option>').val('').text('Mês').data("cod_periodo", "").appendTo($('#mesRemuneracaoNominalServidor'));
}
$('#table-remuneracao-nominal-servidor').DataTable().clear().draw();
});
$('#mesRemuneracaoNominalServidor').on('change', function(){
$('#table-remuneracao-nominal-servidor').DataTable().ajax.reload();
});
} );
function downloadRH(caminho, id) {
if (caminho == '') return;
window.open(caminho, '_blank');
$('#'+id).prop('selectedIndex', 0);
}
</script>]]>
|