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() {
|
||||
|
||||
Reference in New Issue
Block a user