mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
ordem add produtos na comanda
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
|
||||
|
||||
{% for product in products %}
|
||||
{{co}}
|
||||
|
||||
<article style="background-color: #293552;" hx-get="{% url 'addProduct' product.id comanda_id %} " hx-trigger="click" hx-target="#list-products-comanda">
|
||||
<article onclick="addProductComanda({{product.id}})" style="background-color: #293552;" hx-get="{% url 'addProduct' product.id comanda_id %} " hx-trigger="click" hx-target="#list-products-comanda">
|
||||
{{product.name}} <br>
|
||||
R$ {{product.price}}
|
||||
</article>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
function openModal() {
|
||||
document.getElementById('Modal-add-product').style.display = 'block';
|
||||
// document.getElementById('Modal-add-product').setAttribute();
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +45,7 @@ function imprimirFichas() {
|
||||
if (element) {
|
||||
var content = element.innerHTML;
|
||||
// console.log(content);
|
||||
content = content.replace(/<button[^>]*>(?:(?!<\/button>)[\s\S])*<\/button>/gi,'');
|
||||
content = content.replace(/<img[^>]*>(?:(?!<\/img>)[\s\S])*<\/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);
|
||||
@@ -78,7 +79,7 @@ function imprimirConta() {
|
||||
if (element) {
|
||||
var content = element.innerHTML;
|
||||
// console.log(content);
|
||||
content = content.replace(/<button[^>]*>(?:(?!<\/button>)[\s\S])*<\/button>/gi,'');
|
||||
content = content.replace(/<img[^>]*>(?:(?!<\/img>)[\s\S])*<\/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);
|
||||
@@ -106,19 +107,17 @@ function backPage() {
|
||||
}
|
||||
|
||||
|
||||
document.onkeydown = teclado
|
||||
// document.onkeydown = teclado
|
||||
|
||||
function teclado(event){
|
||||
if (event.keyCode == 65){
|
||||
openModal()
|
||||
}
|
||||
else if (event.keyCode == 73){
|
||||
imprimirFichas()
|
||||
}
|
||||
// else if (event.keyCode == 70){
|
||||
// imprimirConta()
|
||||
// }
|
||||
}
|
||||
// function teclado(event){
|
||||
// if (event.keyCode == 65){
|
||||
// openModal()
|
||||
// }
|
||||
// else if (event.keyCode == 73){
|
||||
// imprimirFichas()
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
function addProductComanda(productId) {
|
||||
@@ -134,11 +133,11 @@ function addProductComanda(productId) {
|
||||
|
||||
|
||||
|
||||
document.getElementById('openModal').addEventListener('click', openModal);
|
||||
// document.getElementById('openModal').addEventListener('click', openModal);
|
||||
|
||||
document.getElementById('productForm').addEventListener('submit', function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
// document.getElementById('productForm').addEventListener('submit', function(event) {
|
||||
// event.preventDefault();
|
||||
// });
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user