Atualição de interface area consolidação e Relatório em PDF

This commit is contained in:
2026-06-16 16:38:42 -03:00
parent 7c57b8e09d
commit 80c068c798
5 changed files with 37 additions and 7 deletions

View File

@@ -6,7 +6,7 @@ import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = [
"linha", "checkbox", "toggles", "barra", "percentual",
"linha", "checkbox", "selecionarTodos", "toggles", "barra", "percentual",
"contadorClassificadas", "contadorTotal",
"qtdNormal", "qtdRetirada", "qtdBonus", "qtdDesconto", "valorTotal"
]
@@ -64,6 +64,12 @@ export default class extends Controller {
this.atualizarResumo(resp)
}
// ── Selecionar / desmarcar todos os checkboxes ─────────────
selecionarTodos(event) {
const marcar = event.currentTarget.checked
this.checkboxTargets.forEach(c => { c.checked = marcar })
}
// ── Marcar selecionados como X ─────────────────────────────
async marcarSelecionados(event) {
const tipo = event.currentTarget.dataset.tipo
@@ -81,6 +87,7 @@ export default class extends Controller {
})
ids.forEach(id => this.setToggle(id, tipo, true))
this.checkboxTargets.forEach(c => c.checked = false)
if (this.hasSelecionarTodosTarget) this.selecionarTodosTarget.checked = false
this.atualizarResumo(resp)
}