Ventas
This commit is contained in:
@ -117,7 +117,11 @@
|
||||
this.data.venta_ids = data.ventas
|
||||
const promises = []
|
||||
data.ventas.forEach(venta_id => {
|
||||
promises.push(this.get().venta(venta_id))
|
||||
const promise = this.get().venta(venta_id)
|
||||
/*promise.then(() => {
|
||||
this.draw().ventas(true)
|
||||
})*/
|
||||
promises.push(promise)
|
||||
})
|
||||
Promise.all(promises).then(() => {
|
||||
this.draw().ventas()
|
||||
@ -181,7 +185,7 @@
|
||||
parent.show()
|
||||
parent.find('.item.proyecto').click(this.actions().get)
|
||||
},
|
||||
ventas: () => {
|
||||
ventas: (loading = false) => {
|
||||
const title = $(this.ids.title)
|
||||
const parent = $(this.ids.proyectos)
|
||||
const table = $(this.ids.table)
|
||||
@ -195,6 +199,11 @@
|
||||
}
|
||||
|
||||
title.html('Ventas de ' + this.data.proyecto + ' [' + this.data.ventas.length + ']')
|
||||
if (loading) {
|
||||
title.append(
|
||||
$('<span></span>').addClass('ui active inline loader')
|
||||
)
|
||||
}
|
||||
|
||||
const tbody = $('<tbody></tbody>')
|
||||
this.data.ventas.forEach(venta => {
|
||||
|
Reference in New Issue
Block a user