mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
feat: alert product add comanda
This commit is contained in:
@@ -110,7 +110,7 @@ Detalhes {{comanda.name}}
|
|||||||
<div id="product-list" class="grid-list-products">
|
<div id="product-list" class="grid-list-products">
|
||||||
{% for product in products %}
|
{% for product in products %}
|
||||||
|
|
||||||
<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>
|
{{product.name}} <br>
|
||||||
R$ {{product.price}}
|
R$ {{product.price}}
|
||||||
</article >
|
</article >
|
||||||
|
|||||||
Binary file not shown.
@@ -1,3 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
function openModal() {
|
function openModal() {
|
||||||
document.getElementById('Modal-add-product').style.display = 'block';
|
document.getElementById('Modal-add-product').style.display = 'block';
|
||||||
}
|
}
|
||||||
@@ -5,6 +7,7 @@ function openModal() {
|
|||||||
|
|
||||||
function open_remove_product_comanda() {
|
function open_remove_product_comanda() {
|
||||||
document.getElementById('remove-product-comanda').style.display = 'block';
|
document.getElementById('remove-product-comanda').style.display = 'block';
|
||||||
|
// alert('Produto removido com sucesso!');
|
||||||
}
|
}
|
||||||
|
|
||||||
function modal_payment_comanda() {
|
function modal_payment_comanda() {
|
||||||
@@ -117,6 +120,20 @@ function teclado(event){
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function addProductComanda(productId) {
|
||||||
|
alert('Produto adicionado com sucesso!');
|
||||||
|
// const productName = document.getElementById('productName').value;
|
||||||
|
// const productPrice = document.getElementById('productPrice').value;
|
||||||
|
// const productDescription = document.getElementById('productDescription').value;
|
||||||
|
// const productqtd = document.getElementById('productqtd').value;
|
||||||
|
// const categorie = document.getElementById('select-categorie').value;
|
||||||
|
// const url = `/comandas/addProductComanda/${productName}/${productPrice}/${productDescription}/${productqtd}/${categorie}/`;
|
||||||
|
// window.location.href = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
document.getElementById('openModal').addEventListener('click', openModal);
|
document.getElementById('openModal').addEventListener('click', openModal);
|
||||||
|
|
||||||
document.getElementById('productForm').addEventListener('submit', function(event) {
|
document.getElementById('productForm').addEventListener('submit', function(event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user