Atualição de interface area consolidação e Relatório em PDF
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user