mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 05:25:40 +00:00
fixed: timezone de orders alterado para exibição utc -3
This commit is contained in:
@@ -19,8 +19,26 @@ Detalhes {{comanda.name}}
|
|||||||
}
|
}
|
||||||
.posi {
|
.posi {
|
||||||
position: absolute !important;
|
position: absolute !important;
|
||||||
top: 0.5em;
|
background-color: rgba(72, 72, 72, 0.151);
|
||||||
right: 0.5em;
|
color: rgba(255, 255, 255, 0.452);
|
||||||
|
border: 2px solid rgba(239, 239, 239, 0.107);
|
||||||
|
border-radius: 35px;
|
||||||
|
padding: 0px 15px 3px 15px ;
|
||||||
|
align-self: center;
|
||||||
|
font-size: 32px;
|
||||||
|
top: 0.1em;
|
||||||
|
right: 0.1em;
|
||||||
|
scale: 0.8;
|
||||||
|
}
|
||||||
|
.posi:hover{
|
||||||
|
background-color: rgba(183, 3, 3, 0.598);
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
}
|
||||||
|
.custom-toast-container {
|
||||||
|
z-index: 99999 !important;
|
||||||
|
}
|
||||||
|
.swal2-container {
|
||||||
|
z-index: 9999 !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,6 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.formats import date_format
|
from django.utils.formats import date_format
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
from products.models import Product
|
from products.models import Product
|
||||||
from comandas.models import Comanda, ProductComanda
|
from comandas.models import Comanda, ProductComanda
|
||||||
@@ -18,6 +19,8 @@ class Order(models.Model):
|
|||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
status = 'Em espera'
|
status = 'Em espera'
|
||||||
|
datetime = self.queue - timedelta(hours=3)
|
||||||
|
|
||||||
if self.preparing:
|
if self.preparing:
|
||||||
status = 'Preparando'
|
status = 'Preparando'
|
||||||
if self.finished:
|
if self.finished:
|
||||||
@@ -25,4 +28,4 @@ class Order(models.Model):
|
|||||||
if self.delivered:
|
if self.delivered:
|
||||||
status = 'Entregue'
|
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')}"
|
return f"{self.id_product}| {self.obs}|{status}|{self.id_comanda.name}|{self.id_comanda.mesa.name}|{date_format(datetime, 'd/m/Y H:i')}"
|
||||||
Binary file not shown.
@@ -181,8 +181,6 @@ function openFullscreen() {
|
|||||||
var feedbackMsg = Swal.fire({
|
var feedbackMsg = Swal.fire({
|
||||||
color: 'white',
|
color: 'white',
|
||||||
title: message,
|
title: message,
|
||||||
// toast: true,
|
|
||||||
// position: 'top',
|
|
||||||
text: subMessage || '',
|
text: subMessage || '',
|
||||||
icon: icon || 'info',
|
icon: icon || 'info',
|
||||||
background: 'rgb(23, 38, 54)',
|
background: 'rgb(23, 38, 54)',
|
||||||
@@ -190,4 +188,23 @@ function openFullscreen() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
function toast(){
|
||||||
|
|
||||||
|
const Toast = Swal.mixin({
|
||||||
|
toast: true,
|
||||||
|
theme:"dark",
|
||||||
|
position: "top",
|
||||||
|
showConfirmButton: false,
|
||||||
|
background: 'rgb(30, 42, 58)',
|
||||||
|
color: 'white',
|
||||||
|
showCloseButton: true,
|
||||||
|
timer: 2500,
|
||||||
|
timerProgressBar: true,
|
||||||
|
didOpen: (toast) => {
|
||||||
|
toast.onmouseenter = Swal.stopTimer;
|
||||||
|
toast.onmouseleave = Swal.resumeTimer;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return Toast;
|
||||||
|
}
|
||||||
@@ -1,26 +1,21 @@
|
|||||||
|
|
||||||
|
|
||||||
async function openModal() {
|
async function openModal() {
|
||||||
var htmlModal = document.getElementById('addProduct').innerHTML
|
var htmlModal = document.getElementById('addProduct').innerHTML
|
||||||
htmlModal = htmlModal.replace('search-product','search-product-modal')
|
htmlModal = htmlModal.replace('search-product','search-product-modal')
|
||||||
htmlModal = htmlModal.replace('product-list','product-list-modal')
|
htmlModal = htmlModal.replace('product-list','product-list-modal')
|
||||||
|
|
||||||
const { value: formValues } = await Swal.fire({
|
Swal.fire({
|
||||||
title: "Adicionar Produto",
|
title: "Adicionar Produto",
|
||||||
html: htmlModal,
|
html: htmlModal,
|
||||||
width: '100em',
|
|
||||||
position:"top",
|
position:"top",
|
||||||
theme: "dark",
|
theme: "dark",
|
||||||
didOpen: () => {
|
|
||||||
Swal.getPopup().classList.add('swal2-noautoclose');
|
|
||||||
},
|
|
||||||
showConfirmButton: false,
|
showConfirmButton: false,
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
cancelButtonText: '×',
|
cancelButtonText: '×',
|
||||||
customClass:{
|
customClass:{
|
||||||
cancelButton:'posi'
|
cancelButton:'posi'
|
||||||
},
|
},
|
||||||
focusConfirm: false,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -396,7 +391,16 @@ async function addProductComanda(productId, comandaId, cuisine) {
|
|||||||
// Trata resposta
|
// Trata resposta
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
const errorData = await response.json().catch(() => ({}));
|
const errorData = await response.json().catch(() => ({}));
|
||||||
|
Swal.update({
|
||||||
|
title: '<span style="color: red;">Falha ao adicionar!</span>',
|
||||||
|
html: `<div style="color: white; margin-top: 10px;">
|
||||||
|
${error.message || 'Erro desconhecido'}
|
||||||
|
</div>`,
|
||||||
|
icon: 'error',
|
||||||
|
|
||||||
|
});
|
||||||
throw new Error(errorData.message || `Erro HTTP: ${response.status}`);
|
throw new Error(errorData.message || `Erro HTTP: ${response.status}`);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await response.text();
|
const result = await response.text();
|
||||||
@@ -407,12 +411,12 @@ async function addProductComanda(productId, comandaId, cuisine) {
|
|||||||
listElement.innerHTML = result;
|
listElement.innerHTML = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Feedback de sucesso
|
|
||||||
Swal.update({
|
Swal.update({
|
||||||
title: '<span style="color: green;">Produto adicionado! 😁</span>',
|
title: '<span style="color: green;">✅ Produto adicionado!</span>',
|
||||||
});
|
});
|
||||||
|
|
||||||
// Reseta após 2.5 segundos
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Swal.update({
|
Swal.update({
|
||||||
title: '<span style="color: white;">Adicionar Produto</span>'
|
title: '<span style="color: white;">Adicionar Produto</span>'
|
||||||
|
|||||||
Reference in New Issue
Block a user