From 335c5e1911db34dbd9dc971948d7db9120514509 Mon Sep 17 00:00:00 2001 From: Welton Moura Date: Thu, 19 Dec 2024 11:30:08 -0300 Subject: [PATCH] =?UTF-8?q?fun=C3=A7=C3=A3o=20imprimir=20fichas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comandas/templates/viewcomanda.html | 2 +- gestaoRaul/db.sqlite3 | Bin 188416 -> 188416 bytes .../static/comandas/js/viewcomanda.js | 20 +++++++++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/gestaoRaul/comandas/templates/viewcomanda.html b/gestaoRaul/comandas/templates/viewcomanda.html index 9875a15..f01d705 100644 --- a/gestaoRaul/comandas/templates/viewcomanda.html +++ b/gestaoRaul/comandas/templates/viewcomanda.html @@ -23,7 +23,7 @@ Detalhes {{comanda.name}}
- +
diff --git a/gestaoRaul/db.sqlite3 b/gestaoRaul/db.sqlite3 index f3e23f1c00189afddd2b184c71a0291fedd04226..81dda6fe3530225b45b697c637ac5a27d00e36a2 100644 GIT binary patch delta 454 zcmX|)O=uHg5Qe{bce8ZU>^BD$Bo>=glK$8x+0DTi#(}+>jV8(Z|Ix)qAqGU zpPhko+qvYN&fL#jkx~yQt+XAFEcI|KyxzmMUC6gBbzYI}RlM4Q>n*s=oa+U3KX4l* zzgcbizL^i?MIXoI!T`%i|BCno zZtLnO;ztXL%Lu}d*oOHB=}HQUSqLKNS`Y*~lOhO*_rUphp7k)j9;P>r%faIlOLFjT zwO5h;!)*0Ywkm^c6`h*2`9T}=QR}raEtA35HYS$Kws4cLK}$5D{-{0mUTvtG>XIrd zIA5H;!_IBzvNMyppSha)%cU-Iyxhgn;CdHt?Lvyh$qT}kUd^k|YHwCICOz%fTYkM+ zX*3(UQFHS?zv|%_U+iNA={!H}qhn5RA)uPIB<=Z2eO3`&dVQsZ-gmxY=1MtwSBo( BYqkIY diff --git a/gestaoRaul/templates/static/comandas/js/viewcomanda.js b/gestaoRaul/templates/static/comandas/js/viewcomanda.js index 8f1c8de..0d17f08 100644 --- a/gestaoRaul/templates/static/comandas/js/viewcomanda.js +++ b/gestaoRaul/templates/static/comandas/js/viewcomanda.js @@ -16,7 +16,21 @@ function removeCloseModal() { document.getElementById('remove-product-comanda').style.display = 'none'; } - +function imprimirFichas() { + const element = document.getElementById("list-products-comanda"); + if (element) { + var content = element.innerHTML; + console.log(content); + content = content.replace(/]*>(?:(?!<\/button>)[\s\S])*<\/button>/gi,''); + const printWindow = window.open('', '_blank'); + printWindow.document.write(''+content+'
'); + printWindow.document.close(); + printWindow.print(); + printWindow.close(); + } else { + console.error(`Element with ID not found`); + } + } @@ -24,7 +38,7 @@ document.getElementById('openModal').addEventListener('click', openModal); document.getElementById('productForm').addEventListener('submit', function(event) { event.preventDefault(); - - }); + + \ No newline at end of file