mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
fix: focus input addProduct & feedback addObsOrder & openComanda default 'Sem Mesa'
This commit is contained in:
Binary file not shown.
@@ -55,7 +55,7 @@ Comandas
|
|||||||
<h2>Abrir Comanda</h2>
|
<h2>Abrir Comanda</h2>
|
||||||
<input type="text" id="name-comanda" name="name-comanda" required placeholder="Nome"><br>
|
<input type="text" id="name-comanda" name="name-comanda" required placeholder="Nome"><br>
|
||||||
<select name="select-mesa" required>
|
<select name="select-mesa" required>
|
||||||
<option value="">Selecione um local</option>
|
<option value="1">Sem Mesa</option>
|
||||||
|
|
||||||
{% for mesa in mesas %}
|
{% for mesa in mesas %}
|
||||||
<option value="{{mesa.id}}">{{mesa.name}}</option>
|
<option value="{{mesa.id}}">{{mesa.name}}</option>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -14,7 +14,7 @@
|
|||||||
{{item.product.name}}
|
{{item.product.name}}
|
||||||
{% if item.product.cuisine == True %}
|
{% if item.product.cuisine == True %}
|
||||||
<input hidden id="{{item.id}}-obsOrder" type="order" value="{{item.id | obsOrder}}">
|
<input hidden id="{{item.id}}-obsOrder" type="order" value="{{item.id | obsOrder}}">
|
||||||
<span data-tooltip="{{item.id | obsOrder}}" data-flow="top">
|
<span id="tooltip-id-{{item.id}}" data-tooltip="{{item.id | obsOrder}}" data-flow="top">
|
||||||
|
|
||||||
<img
|
<img
|
||||||
onclick="openModalObs({{item.id}})"
|
onclick="openModalObs({{item.id}})"
|
||||||
|
|||||||
@@ -3,8 +3,12 @@
|
|||||||
|
|
||||||
function openModal() {
|
function openModal() {
|
||||||
textField = document.getElementById('search-product')
|
textField = document.getElementById('search-product')
|
||||||
|
if (textField) {
|
||||||
|
setTimeout(() => {
|
||||||
|
textField.focus();
|
||||||
|
}, 100); // 50ms de delay (ajuste conforme necessário)
|
||||||
|
}
|
||||||
textField.value = '';
|
textField.value = '';
|
||||||
textField.focus()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -251,7 +255,9 @@ function troco(){
|
|||||||
|
|
||||||
function addOrder(){
|
function addOrder(){
|
||||||
obs = document.getElementById('obs')
|
obs = document.getElementById('obs')
|
||||||
|
|
||||||
id = document.getElementById('id-temp').value
|
id = document.getElementById('id-temp').value
|
||||||
|
var obsPrint = document.getElementById(id+'-obsOrder')
|
||||||
tooltipObs = document.getElementById('tooltip-id-'+id)
|
tooltipObs = document.getElementById('tooltip-id-'+id)
|
||||||
|
|
||||||
fetch(`/comandas/editOrders/${id}/${obs.value}`, {
|
fetch(`/comandas/editOrders/${id}/${obs.value}`, {
|
||||||
@@ -266,11 +272,13 @@ function addOrder(){
|
|||||||
showToast('✅Pedido atualizado com sucesso!😁','success')
|
showToast('✅Pedido atualizado com sucesso!😁','success')
|
||||||
tooltipObs.dataset.tooltip = data.obs
|
tooltipObs.dataset.tooltip = data.obs
|
||||||
obs.value = ''
|
obs.value = ''
|
||||||
|
obsPrint.value = data.obs
|
||||||
document.getElementById('modal-obs').style.display = 'none';
|
document.getElementById('modal-obs').style.display = 'none';
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
console.log(error)
|
||||||
showToast('❌Ocorreu um erro!😢','error')
|
showToast('❌Ocorreu um erro!😢','error')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user