mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
nem sei o que fiz
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
function openModal() {
|
||||
document.getElementById('Modal-add-product').style.display = 'block';
|
||||
}
|
||||
// function openModal() {
|
||||
// document.getElementById('Modal-add-product').style.display = 'block';
|
||||
// }
|
||||
|
||||
|
||||
function open_remove_product_comanda() {
|
||||
document.getElementById('remove-product-comanda').style.display = 'block';
|
||||
}
|
||||
// function open_remove_product_comanda() {
|
||||
// document.getElementById('remove-product-comanda').style.display = 'block';
|
||||
// }
|
||||
|
||||
function modal_payment_comanda() {
|
||||
document.getElementById('payment-comanda').style.display = 'block';
|
||||
@@ -15,14 +15,11 @@ function close_modal_payment_comanda() {
|
||||
document.getElementById('payment-comanda').style.display = 'none';
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
document.getElementById('Modal-add-product').style.display = 'none';
|
||||
}
|
||||
// function closeModal() {
|
||||
// document.getElementById('Modal-add-product').style.display = 'none';
|
||||
// }
|
||||
|
||||
|
||||
function removeCloseModal() {
|
||||
document.getElementById('remove-product-comanda').style.display = 'none';
|
||||
}
|
||||
|
||||
function imprimirFichas() {
|
||||
const element = document.getElementById("list-products-comanda");
|
||||
@@ -105,43 +102,62 @@ function backPage() {
|
||||
document.onkeydown = teclado
|
||||
|
||||
function teclado(event){
|
||||
if (event.keyCode == 50){
|
||||
document.getElementById('qtd-product').innerHTML = '2'
|
||||
if (event.keyCode == 13){
|
||||
// const productId = document.getElementById('0').value;
|
||||
// const comandaId = document.getElementById('comanda0').value;
|
||||
addProductBalcao()
|
||||
reloadPage()
|
||||
}
|
||||
// else if (event.keyCode == 73){
|
||||
// imprimirFichas()
|
||||
// }
|
||||
// else if (event.keyCode == 51){
|
||||
// document.getElementById('qtd-product').innerHTML = '3'
|
||||
// }
|
||||
// else if (event.keyCode == 52){
|
||||
// document.getElementById('qtd-product').innerHTML = '4'
|
||||
// }
|
||||
// else if (event.keyCode == 53){
|
||||
// document.getElementById('qtd-product').innerHTML = '5'
|
||||
// }
|
||||
// else if (event.keyCode == 54){
|
||||
// document.getElementById('qtd-product').innerHTML = '6'
|
||||
// }
|
||||
// else if (event.keyCode == 55){
|
||||
// document.getElementById('qtd-product').innerHTML = '7'
|
||||
// }
|
||||
// else if (event.keyCode == 56){
|
||||
// document.getElementById('qtd-product').innerHTML = '8'
|
||||
// }
|
||||
// else if (event.keyCode == 57){
|
||||
// document.getElementById('qtd-product').innerHTML = '9'
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
document.getElementById('openModal').addEventListener('click', openModal);
|
||||
|
||||
|
||||
function addProductBalcao() {
|
||||
var productId = document.getElementById('0').innerText;
|
||||
var comandaId = document.getElementById('comanda0').innerText;
|
||||
var qtd = document.getElementById('qtd-product').value;
|
||||
console.log(productId, comandaId)
|
||||
const url = `/balcao/addProductBalcaoTeclado${productId}/${comandaId}/${qtd}/`;
|
||||
const listProductsBalcao = document.getElementById('list-products-balcao');
|
||||
fetch(url, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// document.getElementById('openModal').addEventListener('click', openModal);
|
||||
|
||||
|
||||
|
||||
document.getElementById('productForm').addEventListener('submit', function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function salvarValor() {
|
||||
const elemento = document.getElementById('qtd-product');
|
||||
const chave = 'qtd';
|
||||
const valor = elemento.value;
|
||||
localStorage.setItem(chave, valor);
|
||||
setCookie(chave, valor);
|
||||
console.log(chave, valor);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user