mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
feat: abre modal de informações do status da order ao clicar sobre o nome do product na viewcomanda
This commit is contained in:
@@ -11,17 +11,16 @@
|
||||
|
||||
<tr>
|
||||
<td id="id-for-print-{{item.id}}">
|
||||
{{item.product.name}}
|
||||
<spam style="cursor: pointer;" onclick="inforOrders({{item.id}})">
|
||||
{{item.product.name}}</spam>
|
||||
{% if item.product.cuisine == True %}
|
||||
<input hidden id="{{item.id}}-obsOrder" type="order" value="{{item.id | obsOrder}}">
|
||||
<span id="tooltip-id-{{item.id}}" data-tooltip="{{item.id | obsOrder}}" data-flow="top">
|
||||
|
||||
<img
|
||||
onclick="openModalObs({{item.id}})"
|
||||
src="{% static 'midia/icons/note.svg' %}"
|
||||
style="width: 25px; height: 35px; cursor: pointer;">
|
||||
</img>
|
||||
</span>
|
||||
|
||||
<img
|
||||
onclick="printOrder({{item.id}})"
|
||||
|
||||
@@ -411,7 +411,7 @@ white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
@media screen and (max-width: 1028px) {
|
||||
.toast-add {
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
@@ -177,13 +177,15 @@ function openFullscreen() {
|
||||
}
|
||||
|
||||
|
||||
function feedback(message, status, subMessage) {
|
||||
function feedback(message, icon, subMessage) {
|
||||
console.log(subMessage)
|
||||
var feedbackMsg = Swal.fire({
|
||||
title: message,
|
||||
text: subMessage || '',
|
||||
icon: status,
|
||||
background: 'rgba(8, 9, 10, 0.75)',
|
||||
confirmButtonColor: 'linear-gradient(145deg, #1E2A3B, #2C3E50)',
|
||||
});
|
||||
color: 'white',
|
||||
title: message,
|
||||
text: subMessage || '',
|
||||
icon: icon || 'info',
|
||||
background: 'rgb(23, 38, 54)',
|
||||
confirmButtonColor: 'linear-gradient(145deg, #1E2A3B, #2C3E50)',
|
||||
});
|
||||
return feedbackMsg;
|
||||
}
|
||||
@@ -115,28 +115,20 @@ function imprimirFichas() {
|
||||
}
|
||||
}
|
||||
function printOrder(id) {
|
||||
var item = document.getElementById('id-for-print-'+id).innerText
|
||||
var cliente = document.getElementById('name-comanda').innerText
|
||||
var local = document.getElementById('mesa-comanda').innerText
|
||||
var obs = document.getElementById(id+'-obsOrder').value
|
||||
const agora = new Date();
|
||||
var dateString = agora.getDate() + '/' + (agora.getMonth()+1) + '/' + agora.getFullYear() + ' - ' + agora.getHours() + ':' + agora.getMinutes();
|
||||
console.log(item)
|
||||
console.log(cliente)
|
||||
console.log(local)
|
||||
var order = document.getElementById(id+'-obsOrder').value
|
||||
order = order.split('|');
|
||||
const body = `<style>
|
||||
td, th {
|
||||
|
||||
border-collapse: collapse;
|
||||
padding-top: 20px;
|
||||
margin: 20px;
|
||||
padding-top: 10px;
|
||||
margin: 10px;
|
||||
text-align: center;
|
||||
font-size: 20px;}
|
||||
</style>
|
||||
<tr><td>${item}</td></tr>
|
||||
<tr><td>${obs}</td></tr>
|
||||
<tr><td>${cliente}${local}</td></tr>
|
||||
<tr><td>${dateString}</td></tr>
|
||||
<tr><td>${order[0]}</td></tr>
|
||||
<tr><td>${order[1]}</td></tr>
|
||||
<tr><td>${order[3]} - ${order[4]}</td></tr>
|
||||
<tr><td>${order[5]}</td></tr>
|
||||
`;
|
||||
|
||||
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]);
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user