Filter year index view
This commit is contained in:
@@ -1 +1,35 @@
|
||||
no hay
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.2.1/dist/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
|
||||
|
||||
<title>AS Admin Pagina No Encontrada</title>
|
||||
</head>
|
||||
<body >
|
||||
<div>
|
||||
{% include 'partials/messages.html' %}
|
||||
<img class="rounded mx-auto d-block" src="https://static.doofinder.com/main-files/uploads/2019/08/110655-404-not-found-Doofinder.jpg" alt="Forbidden">
|
||||
<a href="/" class="btn btn-info btn-lg rounded mx-auto d-block mt-3">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-return-left" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd" d="M14.5 1.5a.5.5 0 0 1 .5.5v4.8a2.5 2.5 0 0 1-2.5 2.5H2.707l3.347 3.346a.5.5 0 0 1-.708.708l-4.2-4.2a.5.5 0 0 1 0-.708l4-4a.5.5 0 1 1 .708.708L2.707 8.3H12.5A1.5 1.5 0 0 0 14 6.8V2a.5.5 0 0 1 .5-.5z"/>
|
||||
</svg>
|
||||
Regresar al Inicio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Optional JavaScript -->
|
||||
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
||||
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.6/dist/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.2.1/dist/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -18,38 +18,56 @@ Timbres disponibles Comercio Digital: {{saldo}}
|
||||
</th>
|
||||
<th>Nombre</th>
|
||||
<th>
|
||||
<div class="d-flex align-items-center">
|
||||
Total x mes
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="">
|
||||
<a data-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample">
|
||||
Total x mes
|
||||
</a>
|
||||
<strong>
|
||||
<small>Filtrado: Mes:{{mes}}, Año:{{year}}, PAC:<label id="lbl_pac"></label></small>
|
||||
</strong>
|
||||
</div>
|
||||
<div style="display:none;" id="spinner_id" class="spinner-border ml-auto spinner-border-sm" role="status" aria-hidden="true"></div>
|
||||
</div>
|
||||
<select style="display:inline" id="table_select_anio" class="form-control form-control-sm">
|
||||
<!--option value="0"></option-->
|
||||
</select>
|
||||
<select id="table_select" class="form-control form-control-sm">
|
||||
<option value="01">Enero</option>
|
||||
<option value="02">Febrero</option>
|
||||
<option value="03">Marzo
|
||||
</option>
|
||||
<option value="04">Abril
|
||||
</option>
|
||||
<option value="05">Mayo
|
||||
</option>
|
||||
<option value="06">Junio
|
||||
</option>
|
||||
<option value="07">Julio
|
||||
</option>
|
||||
<option value="08">Agosto
|
||||
</option>
|
||||
<option value="09">Septiembre
|
||||
</option>
|
||||
<option value="10">Octubre
|
||||
</option>
|
||||
<option value="11">Noviembre
|
||||
</option>
|
||||
<option value="12">Diciembre
|
||||
</option>
|
||||
</select>
|
||||
|
||||
<div class="collapse" id="collapseExample">
|
||||
<div class="card card-body">
|
||||
<!--PACS-->
|
||||
<select id="table_select_PAC" class="form-control form-control-sm my_event_cls">
|
||||
<option value="00">Todos</option>
|
||||
<!--option value="01">EDICOM</option-->
|
||||
</select>
|
||||
<!--ANIOS-->
|
||||
<select style="display:inline" id="table_select_anio" class="form-control form-control-sm">
|
||||
<!--option value="0"></option-->
|
||||
</select>
|
||||
|
||||
<!--MESES-->
|
||||
<select id="table_select" class="form-control form-control-sm">
|
||||
<option value="01">Enero</option>
|
||||
<option value="02">Febrero</option>
|
||||
<option value="03">Marzo
|
||||
</option>
|
||||
<option value="04">Abril
|
||||
</option>
|
||||
<option value="05">Mayo
|
||||
</option>
|
||||
<option value="06">Junio
|
||||
</option>
|
||||
<option value="07">Julio
|
||||
</option>
|
||||
<option value="08">Agosto
|
||||
</option>
|
||||
<option value="09">Septiembre
|
||||
</option>
|
||||
<option value="10">Octubre
|
||||
</option>
|
||||
<option value="11">Noviembre
|
||||
</option>
|
||||
<option value="12">Diciembre
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>Estado</th>
|
||||
<th scope="col">
|
||||
@@ -139,7 +157,7 @@ Timbres disponibles Comercio Digital: {{saldo}}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id='id_filters' style="display: inline;">{% for i,v in filters.items %}&{{i}}={{v}}{% endfor%}</div>
|
||||
<div id='id_filters' style="display: none;">{% for i,v in filters.items %}&{{i}}={{v}}{% endfor%}</div>
|
||||
|
||||
|
||||
<!-- Modal EMAIL-->
|
||||
@@ -289,8 +307,47 @@ Timbres disponibles Comercio Digital: {{saldo}}
|
||||
let filters = document.getElementById('id_filters').textContent
|
||||
let mes ='{{mes}}'
|
||||
let year = parseInt('{{year}}')
|
||||
let anc = document.getElementById('home_id')
|
||||
let PAC = Object.values(filters.split('&'))
|
||||
PAC.filter(val=>{
|
||||
lbl_pac.innerHTML="Todos"
|
||||
if(val.length >0){
|
||||
lbl_pac.innerHTML= val.split('=')[1]=="" ? "Todos" :val.split('=')[1]
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
/*-------------------------Carga los pacs*/
|
||||
fetch("{% url 'PACS_Retrive_RFCS' %}",{
|
||||
method:'GET',
|
||||
headers:{
|
||||
'Content-Type':'application/json',
|
||||
'X-Requested-With':'XMLHttpRequest',
|
||||
},
|
||||
credentials:"same-origin"
|
||||
})
|
||||
.then(res=>{
|
||||
return res.json()
|
||||
})
|
||||
.then(data=>{
|
||||
let pacs = [...new Set(data['PACS'].map((arr)=>arr.rfcp) )]
|
||||
|
||||
pacs.forEach((val,index)=>{
|
||||
let option = document.createElement('option')
|
||||
option.value=val
|
||||
option.text=val
|
||||
table_select_PAC.add(option)
|
||||
PAC.filter(val=>val.includes('PAC'))
|
||||
.forEach((val,index)=>{
|
||||
table_select_PAC.value = val.split('=')[1]
|
||||
})
|
||||
})
|
||||
})
|
||||
.catch(error=>{
|
||||
console.log(error)
|
||||
})
|
||||
/*----------------------fin carga pacs*/
|
||||
|
||||
function aclick(event,RFC ,cuantos){
|
||||
|
||||
@@ -338,7 +395,7 @@ Timbres disponibles Comercio Digital: {{saldo}}
|
||||
document.getElementById('table_select').addEventListener('change',(event)=>{
|
||||
spinner_id.setAttribute('style','display:inline;')
|
||||
|
||||
let anc = document.getElementById('home_id')
|
||||
|
||||
anc.href=''
|
||||
|
||||
let url = `?mes=${event.target.value}&year=${year}${filters}`
|
||||
@@ -353,7 +410,7 @@ Timbres disponibles Comercio Digital: {{saldo}}
|
||||
table_select_anio.addEventListener('change',(event)=>{
|
||||
spinner_id.setAttribute('style','display:inline;')
|
||||
|
||||
let anc = document.getElementById('home_id')
|
||||
|
||||
anc.href=''
|
||||
|
||||
let url = `?mes=${mes}&year=${event.target.value}${filters}`
|
||||
@@ -364,6 +421,17 @@ Timbres disponibles Comercio Digital: {{saldo}}
|
||||
},1000)
|
||||
})
|
||||
|
||||
table_select_PAC.addEventListener('change',(event)=>{
|
||||
spinner_id.setAttribute('style','display:inline;');
|
||||
anc.href='';
|
||||
let url =`?mes=${mes}&year=${year}&PAC=${event.target.value}`
|
||||
setTimeout(()=>{
|
||||
anc.href=url
|
||||
anc.click()
|
||||
},1000)
|
||||
|
||||
})
|
||||
|
||||
enviar_btn.addEventListener('click',(e)=>{
|
||||
|
||||
if(id_form.checkValidity()){
|
||||
|
||||
Reference in New Issue
Block a user