Separar datos inicio
This commit is contained in:
@ -1,24 +1,59 @@
|
||||
<h4 class="ui dividing header">Cierres Vigentes</h4>
|
||||
<div class="ui divided list">
|
||||
@foreach($cierres_vigentes as $proyecto => $estados)
|
||||
<div class="item">
|
||||
<div class="ui feed">
|
||||
<div class="date">
|
||||
<strong>{{$proyecto}}</strong> [{{$estados['total']}}]
|
||||
</div>
|
||||
<div class="event">
|
||||
<div class="content">Promesados</div>
|
||||
<div class="meta">{{$estados['promesados']}}</div>
|
||||
</div>
|
||||
<div class="event">
|
||||
<div class="content">Pendientes</div>
|
||||
<div class="meta">{{$estados['pendientes']}}</div>
|
||||
</div>
|
||||
<div class="event">
|
||||
<div class="content">Rechazados</div>
|
||||
<div class="meta">{{$estados['rechazados']}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="ui divided list" id="cierres_vigentes"></div>
|
||||
|
||||
@push('page_scripts')
|
||||
<script type="text/javascript">
|
||||
const cierres_vigentes = {
|
||||
get: function() {
|
||||
const list = $('#cierres_vigentes')
|
||||
list.html('')
|
||||
list.append(
|
||||
$('<div><div>').addClass('ui inline active loader')
|
||||
)
|
||||
fetch('{{$urls->api}}/ventas/cierres/vigentes').then(response => {
|
||||
list.html('')
|
||||
if (response.ok) {
|
||||
return response.json()
|
||||
}
|
||||
}).then(data => {
|
||||
this.draw(data.cierres)
|
||||
})
|
||||
},
|
||||
draw: function(cierres) {
|
||||
const list = $('#cierres_vigentes')
|
||||
Object.entries(cierres).forEach(([proyecto, estados]) => {
|
||||
const item = $('<div></div>').addClass('item')
|
||||
const feed = $('<div></div>').addClass('ui feed')
|
||||
feed.append(
|
||||
$('<div></div>').addClass('date').append(
|
||||
$('<strong></strong>').html(proyecto).append('[' + estados['total'] + ']')
|
||||
)
|
||||
).append(
|
||||
$('<div></div>').addClass('event').append(
|
||||
$('<div></div>').addClass('content').html('Promesados')
|
||||
).append(
|
||||
$('<div></div>').addClass('meta').html(estados['promesados'])
|
||||
)
|
||||
).append(
|
||||
$('<div></div>').addClass('event').append(
|
||||
$('<div></div>').addClass('content').html('Pendientes')
|
||||
).append(
|
||||
$('<div></div>').addClass('meta').html(estados['pendientes'])
|
||||
)
|
||||
).append(
|
||||
$('<div></div>').addClass('event').append(
|
||||
$('<div></div>').addClass('content').html('Rechazados')
|
||||
).append(
|
||||
$('<div></div>').addClass('meta').html(estados['rechazados'])
|
||||
)
|
||||
)
|
||||
item.append(feed)
|
||||
list.append(item)
|
||||
})
|
||||
}
|
||||
}
|
||||
$(document).ready(() => {
|
||||
cierres_vigentes.get()
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
@ -1,22 +1,52 @@
|
||||
<h4 class="ui dividing header">Cuotas Por Vencer</h4>
|
||||
<div class="ui divided list">
|
||||
@foreach ($cuotas_por_vencer as $date => $proyectos)
|
||||
<div class="item">
|
||||
<div class="ui feed">
|
||||
<div class="date">
|
||||
<strong>{{$format->localDate($date, "EEE. dd 'de' MMMM 'de' yyyy", true)}}</strong>
|
||||
</div>
|
||||
@foreach ($proyectos as $proyecto => $cuotas)
|
||||
<div class="event">
|
||||
<div class="content">
|
||||
<span class="ui small text">
|
||||
{{$proyecto}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="meta">{{$cuotas}}</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="ui divided list" id="cuotas_por_vencer"></div>
|
||||
|
||||
@push('page_scripts')
|
||||
<script type="text/javascript">
|
||||
const cuotas_por_vencer = {
|
||||
get: function() {
|
||||
const list = $('#cuotas_por_vencer')
|
||||
list.html('')
|
||||
list.append(
|
||||
$('<div><div>').addClass('ui inline active loader')
|
||||
)
|
||||
return fetch('{{$urls->api}}/ventas/cuotas/vencer').then(response => {
|
||||
list.html('')
|
||||
if (response.ok) {
|
||||
return response.json()
|
||||
}
|
||||
}).then(data => {
|
||||
this.draw(data.cuotas)
|
||||
})
|
||||
},
|
||||
draw: function(cuotas) {
|
||||
const list = $('#cuotas_por_vencer')
|
||||
Object.entries(cuotas).forEach(([fecha, proyectos]) => {
|
||||
const item = $('<div></div>').addClass('item')
|
||||
const feed = $('<div></div>').addClass('ui feed')
|
||||
feed.append(
|
||||
$('<div></div>').addClass('date').append(
|
||||
$('<strong></strong>').html(fecha)
|
||||
)
|
||||
)
|
||||
Object.entries(proyectos).forEach(([proyecto, cuotas]) => {
|
||||
const event = $('<div></div>').addClass('event')
|
||||
event.append(
|
||||
$('<div></div>').addClass('content').append(
|
||||
$('<span></span>').addClass('ui small text').html(proyecto)
|
||||
)
|
||||
).append(
|
||||
$('<div></div>').addClass('meta').html(cuotas)
|
||||
)
|
||||
feed.append(event)
|
||||
})
|
||||
item.append(feed)
|
||||
list.append(item)
|
||||
})
|
||||
}
|
||||
}
|
||||
$(document).ready(() => {
|
||||
cuotas_por_vencer.get()
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
Reference in New Issue
Block a user