This commit is contained in:
Juan Pablo Vial
2023-09-07 23:03:21 -03:00
parent 59825259b6
commit fa15da1ee2
40 changed files with 1787 additions and 71 deletions

View File

@ -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 => {