From c8c3653bf8998c7048eeaa9be49b512229c5e346 Mon Sep 17 00:00:00 2001 From: Welton Moura Date: Fri, 27 Jun 2025 17:14:08 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20abre=20modal=20de=20informa=C3=A7=C3=B5?= =?UTF-8?q?es=20do=20status=20da=20order=20ao=20clicar=20sobre=20o=20nome?= =?UTF-8?q?=20do=20product=20na=20viewcomanda?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comandas/templates/viewcomanda.html | 29 ++++++------ .../custom_filter_tag.cpython-312.pyc | Bin 3737 -> 3707 bytes .../templatetags/custom_filter_tag.py | 2 +- gestaoRaul/db.sqlite3 | Bin 348160 -> 348160 bytes .../orders/__pycache__/models.cpython-312.pyc | Bin 1697 -> 2142 bytes gestaoRaul/orders/models.py | 13 +++++- gestaoRaul/orders/templates/orders.html | 2 +- .../htmx_list_products_in_comanda.html | 5 +-- gestaoRaul/templates/static/base.css | 2 +- gestaoRaul/templates/static/base.js | 16 ++++--- .../static/comandas/js/viewcomanda.js | 42 +++++++++--------- .../templates/static/orders/css/orders.css | 11 +++++ 12 files changed, 72 insertions(+), 50 deletions(-) diff --git a/gestaoRaul/comandas/templates/viewcomanda.html b/gestaoRaul/comandas/templates/viewcomanda.html index ad3e629..c1a1961 100644 --- a/gestaoRaul/comandas/templates/viewcomanda.html +++ b/gestaoRaul/comandas/templates/viewcomanda.html @@ -94,23 +94,24 @@ Detalhes {{comanda.name}} - {{item.product.name}} + + {{item.product.name}} {% if item.product.cuisine == True %} - + - - + onclick="openModalObs({{item.id}})" + src="{% static 'midia/icons/note.svg' %}" + style="width: 25px; height: 35px; cursor: pointer;"> + + - - + + {% endif %} @@ -129,7 +130,7 @@ Detalhes {{comanda.name}} {% endif %} - + {% endfor %} {% if config.taxa %} @@ -155,7 +156,7 @@ Detalhes {{comanda.name}} - + {% if config.taxa %} Total R$ {{valores.totalComTaxa}} diff --git a/gestaoRaul/comandas/templatetags/__pycache__/custom_filter_tag.cpython-312.pyc b/gestaoRaul/comandas/templatetags/__pycache__/custom_filter_tag.cpython-312.pyc index 0fdae451f8dfdbda45feba1746471f61e26692b6..ae3a7a4e9026da1ee5b1e0b819a625a58c534067 100644 GIT binary patch delta 103 zcmbO!`&)+hG%qg~0}w=QkIQ(pk#`0+=->JpW?BX>EQYCfr*h-=qA75uVNmcT$3ZCBMZYp7A8lI$y&U77~Lm7=iLMVc{dvm delta 134 zcmew@GgFrLG%qg~0}yOc{+j-5Bkv4u##NJ-ad(Pjaezco!DM|NJt@{AcA#jH7>E!D z5v)Ms7IS`5@#G>NJ4WBh8+q&%`zt#uFK|fw_`t--Ds+=y@K-SpP*sy7w<90JK|Ur& Qp~*bFdl)??pXA*H00@5|M*si- diff --git a/gestaoRaul/comandas/templatetags/custom_filter_tag.py b/gestaoRaul/comandas/templatetags/custom_filter_tag.py index 2f29302..82eccfb 100644 --- a/gestaoRaul/comandas/templatetags/custom_filter_tag.py +++ b/gestaoRaul/comandas/templatetags/custom_filter_tag.py @@ -62,7 +62,7 @@ def obsOrder(id): try: productComanda_obj = ProductComanda.objects.get(pk=id) order = Order.objects.get(productComanda=productComanda_obj) - return order.obs + return order except: return '' diff --git a/gestaoRaul/db.sqlite3 b/gestaoRaul/db.sqlite3 index 70969da9cdf62a8ebe11ca28a1bcbabb7fe7caab..f91d0895857d8540f497a09f8813516b22fde216 100644 GIT binary patch delta 3220 zcmai03v3j}8J?ZpxyP>W&OjWSnA*k$5(9Va`xTM)jBSjc7&~?$O>Cciw$Jw6nKS2C zm7LEehSVg5xXB{55~iw9iqxvTwcvWvOx=&HZ5_`2>HCv)=OMCO~rlF3Btvt(1 zepdGLN*O2WET{8wKoBHJVteD$k=S6*SUi*nm&M}IaF)vXd9{q=bwSZxg51^<>r3=x zZbev`E%k=eZTJ@@)`WD}wB!dOy@jfbV!v^LHUt0R4hfl*Bx z2!}>xO_*v}{KpTQ*K)%=7f%k2a_q!#JR}SZP4)IB`N4_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?hEDjo%0g@B^`l+u!XD+tdyKQ}QiCDBSjljRmuX38zDOpTQI0+5pA z5+ElfJ{h9m7E4}YZYt2DEXAogX~iH4 oD*%ZP%#4hTcNt`!GAQ3?F#f{E!GPEV#0HxH0DF&{jQ{`u diff --git a/gestaoRaul/orders/models.py b/gestaoRaul/orders/models.py index 46c008b..6744de9 100644 --- a/gestaoRaul/orders/models.py +++ b/gestaoRaul/orders/models.py @@ -1,5 +1,6 @@ from django.db import models - +from django.utils.formats import date_format + from products.models import Product from comandas.models import Comanda, ProductComanda @@ -16,4 +17,12 @@ class Order(models.Model): canceled = models.DateTimeField(null=True, blank=True) def __str__(self): - return f"Pedido {self.id} - Produto: {self.id_product} - Comanda: {self.id_comanda.name}" \ No newline at end of file + status = 'Em espera' + if self.preparing: + status = 'Preparando' + if self.finished: + status = 'Pronto' + if self.delivered: + status = 'Entregue' + + return f"{self.id_product}| {self.obs}|{status}|{self.id_comanda.name}|{self.id_comanda.mesa.name}|{date_format(self.queue, 'd/m/Y H:i')}" \ No newline at end of file diff --git a/gestaoRaul/orders/templates/orders.html b/gestaoRaul/orders/templates/orders.html index 379c914..775d088 100644 --- a/gestaoRaul/orders/templates/orders.html +++ b/gestaoRaul/orders/templates/orders.html @@ -23,7 +23,7 @@ {% block 'body' %}
-

Pedidos cozinha

+

Pedidos cozinha

{% csrf_token %}
diff --git a/gestaoRaul/templates/htmx_components/comandas/htmx_list_products_in_comanda.html b/gestaoRaul/templates/htmx_components/comandas/htmx_list_products_in_comanda.html index 1415b62..4ed56e1 100644 --- a/gestaoRaul/templates/htmx_components/comandas/htmx_list_products_in_comanda.html +++ b/gestaoRaul/templates/htmx_components/comandas/htmx_list_products_in_comanda.html @@ -11,17 +11,16 @@ - {{item.product.name}} + + {{item.product.name}} {% if item.product.cuisine == True %} - - td, th { - border-collapse: collapse; - padding-top: 20px; - margin: 20px; + padding-top: 10px; + margin: 10px; text-align: center; font-size: 20px;} - ${item} - ${obs} - ${cliente}${local} - ${dateString} + ${order[0]} + ${order[1]} + ${order[3]} - ${order[4]} + ${order[5]} `; var printWindow = window.open('', '_blank'); @@ -254,11 +246,11 @@ function troco(){ function addOrder(){ - obs = document.getElementById('obs') - + var obs = document.getElementById('obs') id = document.getElementById('id-temp').value var obsPrint = document.getElementById(id+'-obsOrder') - tooltipObs = document.getElementById('tooltip-id-'+id) + var order = obsPrint.value.split('|'); + var newOrder = ''; fetch(`/comandas/editOrders/${id}/${obs.value}`, { method: 'POST', @@ -270,9 +262,12 @@ function addOrder(){ .then(data => { if(data.status == 'ok'){ showToast('✅Pedido atualizado com sucesso!😁','success') - tooltipObs.dataset.tooltip = data.obs obs.value = '' - obsPrint.value = data.obs + order[1] = data.obs; + for(var i = 0; i < order.length; i++){ + newOrder += order[i] + '|'; + } + obsPrint.value = newOrder; document.getElementById('modal-obs').style.display = 'none'; } @@ -338,3 +333,8 @@ function taxa(){ } +function inforOrders(id){ + var order = document.getElementById(id+'-obsOrder').value.split('|'); + + feedback(order[2], "", order[1]+' - '+order[5]); +} \ No newline at end of file diff --git a/gestaoRaul/templates/static/orders/css/orders.css b/gestaoRaul/templates/static/orders/css/orders.css index 38497bf..2243797 100644 --- a/gestaoRaul/templates/static/orders/css/orders.css +++ b/gestaoRaul/templates/static/orders/css/orders.css @@ -4,7 +4,14 @@ color: black; } +h2 { + font-size: 18px; + justify-self: center; + margin-bottom: 0px; +} + .container { + margin-top: -50px; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); padding: 0px; @@ -91,4 +98,8 @@ } + #title { + display:none; + } + } \ No newline at end of file