mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
feat: botão imprimir pedido cozinha
This commit is contained in:
@@ -110,6 +110,38 @@ function imprimirFichas() {
|
||||
console.error(`Element with ID not found`);
|
||||
}
|
||||
}
|
||||
function printOrder(id) {
|
||||
var item = document.getElementById('id-for-print-'+id).innerText
|
||||
var cliente = document.getElementById('name-comanda').innerText
|
||||
var local = document.getElementById('mesa-comanda').innerText
|
||||
const agora = new Date();
|
||||
var dateString = agora.getDate() + '/' + (agora.getMonth()+1) + '/' + agora.getFullYear() + ' - ' + agora.getHours() + ':' + agora.getMinutes();
|
||||
console.log(item)
|
||||
console.log(cliente)
|
||||
console.log(local)
|
||||
const body = `<style>
|
||||
td, th {
|
||||
|
||||
border-collapse: collapse;
|
||||
padding-top: 35px;
|
||||
margin: 20px;
|
||||
text-align: center;
|
||||
font-size: 20px;}
|
||||
</style>
|
||||
<tr><td>${item}</td></tr>
|
||||
<tr><td>${cliente}</td></tr>
|
||||
<tr><td>${local}</td></tr>
|
||||
<tr><td>${dateString}</td></tr>
|
||||
`;
|
||||
|
||||
var printWindow = window.open('', '_blank');
|
||||
// printWindow.body.appendChild(body);
|
||||
printWindow.document.write('<table>'+body+'</table>');
|
||||
printWindow.document.close();
|
||||
printWindow.print();
|
||||
printWindow.close();
|
||||
|
||||
}
|
||||
|
||||
|
||||
function imprimirConta() {
|
||||
|
||||
7
gestaoRaul/templates/static/midia/icons/print.svg
Normal file
7
gestaoRaul/templates/static/midia/icons/print.svg
Normal file
@@ -0,0 +1,7 @@
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
|
||||
<svg width="233px" height="233px" viewBox="0 0 24.00 24.00" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#ffa500" stroke-width="0.8399999999999999">
|
||||
|
||||
<g id="SVGRepo_bgCarrier" stroke-width="0"/>
|
||||
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
Reference in New Issue
Block a user