fiz um monte de coisa e criei um bug

This commit is contained in:
2025-01-15 11:04:27 -03:00
parent a2fd5d12e3
commit 43d9cd9c5b
20 changed files with 83 additions and 19 deletions

View File

@@ -2,7 +2,8 @@
{% for product in products %}
{% if forloop.counter0 == 0 %}
{% if forloop.counter0 == 0 %}
<input hidden type="text" id="idComanda0" value="{{comanda_id}}">
<article
name="productBox"
@@ -11,7 +12,7 @@
onclick="addProductClick({{product.id}} , {{comanda_id}})"
>
<p hidden id="{{forloop.counter0}}" >{{product.id}}</p>
<p hidden id="comanda{{forloop.counter0}}" >{{comanda_id}}</p>
<p hidden id="comanda{{forloop.counter0}}" >{{comanda.id}}</p>
{{product.name}} <br> <p id="{{product.id}}"></p>
R$ {{product.price}}
</article >
@@ -22,7 +23,7 @@
name="productBox"
id="productId-{{ product.id }}"
style="background-color: #293552;"
onclick="addProductClick({{product.id}} , {{comanda_id}})"
onclick="addProductClick({{product.id}} , {{comanda.id}})"
>
{{product.name}} <br>
R$ {{product.price}}

View File

@@ -21,6 +21,7 @@
<h4>{{order.id_product.name}}</h4>
<h4>{{order.obs}} </h4>
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
<button
hx-get="{% url 'preparing' order.id %} " hx-trigger="click" hx-target="#list-orders"
@@ -45,6 +46,7 @@
<h4>{{order.id_product.name}}</h4>
<h4>{{order.obs}} </h4>
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
<button
hx-get="{% url 'finished' order.id %} " hx-trigger="click" hx-target="#list-orders"
@@ -68,6 +70,7 @@
<h4>{{order.id_product.name}}</h4>
<h4>{{order.obs}} </h4>
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
<button
hx-get="{% url 'delivered' order.id %} " hx-trigger="click" hx-target="#list-orders"
@@ -91,6 +94,7 @@
<h4>{{order.id_product.name}}</h4>
<h4>{{order.obs}} </h4>
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
<!-- <button>Preparar</button> -->
</div>

View File

@@ -150,8 +150,9 @@ function searchProduct() {
function time(){
var search_product = document.getElementById('search-product').value.trim()
var productListElement = document.getElementById("product-list");
var comanda_id = document.getElementById("idComanda0").value;
if(search_product.length == 0 ){search_product ='*';}
fetch(`/balcao/listProductBalcao/13/${search_product}`, {
fetch(`/balcao/listProductBalcao/${comanda_id}/${search_product}`, {
method: 'GET',}
).then(function(response) {
return response.text();