mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
style: layout print conta
This commit is contained in:
@@ -41,14 +41,18 @@ function imprimirFichas() {
|
||||
font-size: 24px;}
|
||||
</style>`;
|
||||
const agora = new Date();
|
||||
var dateString = agora.getDay() + '/' + agora.getMonth() + '/' + agora.getFullYear() + ' - ' + agora.getHours() + ':' + agora.getMinutes()+' - Raul Rock Bar & Café';
|
||||
var dateString = agora.getDate() + '/' + (agora.getMonth()+1) + '/' + agora.getFullYear() + ' - ' + agora.getHours() + ':' + agora.getMinutes()+' - Raul Rock Bar & Café';
|
||||
|
||||
if (element) {
|
||||
var content = element.innerHTML;
|
||||
// console.log(content);
|
||||
content = content.replace(/<img[^>]*>(?:(?!<\/img>)[\s\S])*<\/img>/gi,'');
|
||||
content = content.replace( /<img[^>]*>/gi,'');
|
||||
content = content.replace(/<tfoot[^>]*>(?:(?!<\/tfoot>)[\s\S])*<\/tfoot>/gi,'');
|
||||
|
||||
content = content.replace(/<th[^>]*>(?:(?!<\/th>)[\s\S])*<\/th>/gi,'');
|
||||
content = content.replace(/<\/tr>/g,'</tr><tr><td colspan="2" style="font-size: 12px">'+dateString+'</td></tr>');
|
||||
// content = content.replace(/<\/tr>/g,'</tr><tr><td colspan="2" style="font-size: 12px">'+dateString+'</td></tr>');
|
||||
content = content.replace(/<\/tr>/g,'</tr><tr><td colspan="2" style="font-size: 12px">'+dateString+ '<BR>VÁLIDO SOMENTE POR ESSA NOITE'+'</td></tr>');
|
||||
|
||||
console.log(content);
|
||||
|
||||
var printWindow = window.open('', '_blank');
|
||||
@@ -67,26 +71,37 @@ function imprimirConta() {
|
||||
const element = document.getElementById("list-products-comanda");
|
||||
const style = `<style>
|
||||
td, th {
|
||||
|
||||
border-collapse: collapse;
|
||||
padding-top: 15px;
|
||||
margin: 15px;
|
||||
text-align: center;
|
||||
font-size: 18px;}
|
||||
text-align: justify;
|
||||
font-size: 15px;}
|
||||
</style>`;
|
||||
const agora = new Date();
|
||||
var dateString = agora.getDay() + '/' + agora.getMonth() + '/' + agora.getFullYear() + ' - ' + agora.getHours() + ':' + agora.getMinutes()+' - Raul Rock Bar & Café';
|
||||
var dateString = agora.getDate() + '/' + (agora.getMonth()+1) + '/' + agora.getFullYear() + ' - ' + agora.getHours() + ':' + agora.getMinutes();
|
||||
|
||||
if (element) {
|
||||
var content = element.innerHTML;
|
||||
// console.log(content);
|
||||
content = content.replace(/<img[^>]*>(?:(?!<\/img>)[\s\S])*<\/img>/gi,'');
|
||||
content = content.replace(/<img[^>]*>/gi,'');
|
||||
content = content.replace(/<th[^>]*>(?:(?!<\/th>)[\s\S])*<\/th>/gi,'');
|
||||
// content = content.replace(/<\/tr>/g,'</tr><tr><td colspan="2" style="font-size: 12px">'+dateString+'</td></tr>');
|
||||
console.log(content);
|
||||
// content = content.replace('icons','');
|
||||
content = '<img src="/static/midia/logo.png" style="width: 240px; height: 200px;">'
|
||||
+'<br>'
|
||||
+document.getElementById('name-comanda').innerText.replace(' | ', '')
|
||||
+'<br>'
|
||||
+document.getElementById('mesa-comanda').innerText
|
||||
+'<br>'
|
||||
+document.getElementById('open-comanda').innerText
|
||||
+'<br> Fechado em: '
|
||||
+dateString
|
||||
+content
|
||||
+'<br>'
|
||||
|
||||
|
||||
|
||||
var printWindow = window.open('', '_blank');
|
||||
printWindow.document.write('<table>'+content+'</table>'+style);
|
||||
printWindow.document.write('<table>'+content+'</table><b>Volte Sempre!😁😊</b>'+style);
|
||||
printWindow.document.close();
|
||||
printWindow.print();
|
||||
printWindow.close();
|
||||
|
||||
BIN
gestaoRaul/templates/static/midia/logo.png
Normal file
BIN
gestaoRaul/templates/static/midia/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 988 KiB |
@@ -1,4 +1,4 @@
|
||||
function openTab(evt, cityName) {
|
||||
function openTab(evt, etapa) {
|
||||
// Declarar todas as abas e conteúdos
|
||||
var i, tabcontent, tablinks;
|
||||
tabcontent = document.getElementsByClassName("tabcontent");
|
||||
@@ -10,6 +10,14 @@ function openTab(evt, cityName) {
|
||||
tablinks[i].className = tablinks[i].className.replace(" active", "");
|
||||
}
|
||||
// Mostrar o conteúdo da aba selecionada e marcar a aba como ativa
|
||||
document.getElementById(cityName).style.display = "block";
|
||||
document.getElementById(etapa).style.display = "block";
|
||||
evt.currentTarget.className += " active";
|
||||
}
|
||||
// console.log(evt.currentTarget.className += " active");
|
||||
}
|
||||
|
||||
|
||||
tabcontent = document.getElementsByClassName("tabcontent");
|
||||
for (i = 0; i < tabcontent.length; i++) {
|
||||
tabcontent[i].style.display = "none";
|
||||
}
|
||||
tabcontent[0].style.display = "block";
|
||||
Reference in New Issue
Block a user