second branch and commit

This commit is contained in:
fjrodriguez
2022-12-19 15:35:42 -06:00
parent de06b3ab8b
commit e1588c797d
2 changed files with 52 additions and 70 deletions

View File

@@ -1,34 +1,30 @@
{% extends 'base.html' %}
{% block content %}
<h1>Timbres <strong>{{RFC}}</strong> </h1>
<h2>Timbres totales: <strong></strong>{{conteo}}</strong></h2>
<span class="navbar-text mr-2">
{% if filters.datepicker%}
De fecha: <strong>"{{filters.datepicker}}"</strong>
{% endif %}
{% if filters.datepickerFin %}
A fecha: <strong>"{{filters.datepickerFin}}"</strong>
{% endif %}
</span>
<span class="justify-content-sm-end navbar-text mr-2">
{% if filters.datepicker%}
De fecha: <strong>"{{filters.datepicker}}"</strong>
{% endif %}
{% if filters.datepickerFin %}
A fecha: <strong>"{{filters.datepickerFin}}"</strong>
{% endif %}
</span>
<br><br>
<table class="table">
<thead>
<tr>
<th></th>
<th scope="col"> UUID</th>
<th scope="col"> UUID</th>
<th scope="col">
PAC
<select id="table_select_PAC" class="form-control form-control-sm my_event_cls">
<option value="00">Todos</option>
<!--option value="01">EDICOM</option>
<option value="02">Comercio Dig.</option-->
<!--option value="01">EDICOM</option-->
</select>
</th>
<th scope="col">
@@ -65,7 +61,7 @@
<td>{{obj.rfcp}}</td>
<td>{{obj.tipo}}</td>
<td>{{obj.serie}}/{{obj.folio}}</td>
<td>{{obj.created_at|date:"d M Y"}}</td>
<td>{{obj.created_at|date:"d M Y"}}</td>
</tr>
{% endfor %}
</tbody>
@@ -92,26 +88,26 @@
return res.json()
})
.then(data=>{
let arr = data['PACS']
let pacs = [...new Set(arr.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]
})
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]
})
})
})
}
</script>
<!--end functions-->
<script>
let filters = document.getElementById('id_filters').textContent
let mes = Object.values(filters.split('&'))
let mes = Object.values(filters.split('&'))
let PAC = Object.values(filters.split('&'))
let tipo = Object.values(filters.split('&'))
let lsearch = Object.values(filters.split('&'))
@@ -122,10 +118,9 @@
mes.filter(val=> val.length >0)
.filter(val=>val.includes('mes'))
.forEach((val,index)=>{
.forEach((val,index)=>{
table_select_Meses.value= val.split('=')[1]
})
tipo.filter(val=>val.includes('tipo'))
.forEach((val,index)=>{
@@ -148,7 +143,7 @@
datepickerFin.value=val.split('=')[1]
})
window.addEventListener('load',event=>{
window.addEventListener('load',event=>{
get_pacs()
})
document.querySelectorAll('.my_event_cls').forEach(item=>{
@@ -170,24 +165,21 @@
ref+=`&search=${search.value}`
ref+=`&datepicker=${datepicker.value}`
ref+=`&datepickerFin=${datepickerFin.value}`
})
})
}
})
table_select_PAC.addEventListener('change',(event)=>{
anc.href=''
anc.href=ref
anc.href=''
anc.href=ref
anc.click()
})
table_select_Meses.addEventListener('change',(event)=>{
anc.href=''
anc.href=ref
console.log(ref)
anc.click()
})
table_tipo.addEventListener('click', (event)=>{