Add 2 files
Browse files- index.html +703 -510
- prompts.txt +2 -1
index.html
CHANGED
|
@@ -116,6 +116,110 @@
|
|
| 116 |
border-bottom-color: #374151;
|
| 117 |
}
|
| 118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
@media (max-width: 768px) {
|
| 120 |
.responsive-table {
|
| 121 |
display: block;
|
|
@@ -126,6 +230,11 @@
|
|
| 126 |
.offcanvas {
|
| 127 |
width: 90%;
|
| 128 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
}
|
| 130 |
</style>
|
| 131 |
</head>
|
|
@@ -142,6 +251,56 @@
|
|
| 142 |
<i class="fas fa-moon dark:hidden"></i>
|
| 143 |
<i class="fas fa-sun hidden dark:inline"></i>
|
| 144 |
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
<button id="new-order-btn" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg flex items-center gap-2">
|
| 146 |
<i class="fas fa-plus"></i> Novo Pedido de Compra
|
| 147 |
</button>
|
|
@@ -536,574 +695,608 @@
|
|
| 536 |
</div>
|
| 537 |
<div>
|
| 538 |
<p class="text-sm text-gray-500 dark:text-gray-400">Condição de Pagamento</p>
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 552 |
</div>
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
<button class="remove-item-btn text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300">
|
| 596 |
-
<i class="fas fa-trash"></i>
|
| 597 |
-
</button>
|
| 598 |
-
</td>
|
| 599 |
-
</tr>
|
| 600 |
-
<tr>
|
| 601 |
-
<td class="px-6 py-4 whitespace-nowrap">Produto Y</td>
|
| 602 |
-
<td class="px-6 py-4 whitespace-nowrap">Móveis</td>
|
| 603 |
-
<td class="px-6 py-4 whitespace-nowrap">2</td>
|
| 604 |
-
<td class="px-6 py-4 whitespace-nowrap">R$ 250,00</td>
|
| 605 |
-
<td class="px-6 py-4 whitespace-nowrap">R$ 500,00</td>
|
| 606 |
-
<td class="px-6 py-4 whitespace-nowrap">0</td>
|
| 607 |
-
<td class="px-6 py-4 whitespace-nowrap">
|
| 608 |
-
<span class="px-2 py-1 rounded-full text-xs font-semibold item-status-pendente">Pendente</span>
|
| 609 |
-
</td>
|
| 610 |
-
<td class="px-6 py-4 whitespace-nowrap">
|
| 611 |
-
<button class="edit-item-btn text-yellow-600 hover:text-yellow-800 dark:text-yellow-400 dark:hover:text-yellow-300 mr-2">
|
| 612 |
-
<i class="fas fa-edit"></i>
|
| 613 |
-
</button>
|
| 614 |
-
<button class="receive-item-btn text-green-600 hover:text-green-800 dark:text-green-400 dark:hover:text-green-300 mr-2">
|
| 615 |
-
<i class="fas fa-check-circle"></i>
|
| 616 |
-
</button>
|
| 617 |
-
<button class="remove-item-btn text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300">
|
| 618 |
-
<i class="fas fa-trash"></i>
|
| 619 |
-
</button>
|
| 620 |
-
</td>
|
| 621 |
-
</tr>
|
| 622 |
-
</tbody>
|
| 623 |
-
</table>
|
| 624 |
-
</div>
|
| 625 |
</div>
|
| 626 |
|
| 627 |
-
|
| 628 |
-
|
| 629 |
-
<
|
| 630 |
-
<i class="fas fa-paper-plane"></i> Enviar para Aprovação
|
| 631 |
-
</button>
|
| 632 |
-
<button id="register-receipt-btn" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center gap-2">
|
| 633 |
-
<i class="fas fa-check-double"></i> Registrar Recebimento
|
| 634 |
-
</button>
|
| 635 |
-
<button id="cancel-order-btn" class="bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-lg flex items-center gap-2">
|
| 636 |
-
<i class="fas fa-times"></i> Cancelar Pedido
|
| 637 |
-
</button>
|
| 638 |
-
<button id="print-order-btn" class="bg-gray-600 hover:bg-gray-700 text-white px-4 py-2 rounded-lg flex items-center gap-2">
|
| 639 |
-
<i class="fas fa-print"></i> Imprimir Pedido
|
| 640 |
-
</button>
|
| 641 |
</div>
|
| 642 |
|
| 643 |
-
<!-- History -->
|
| 644 |
<div>
|
| 645 |
-
<
|
| 646 |
-
<
|
| 647 |
-
<div class="border-l-4 border-blue-500 pl-4 py-2">
|
| 648 |
-
<div class="flex justify-between">
|
| 649 |
-
<p class="font-medium">Pedido criado</p>
|
| 650 |
-
<p class="text-sm text-gray-500 dark:text-gray-400">10/05/2023 09:15</p>
|
| 651 |
-
</div>
|
| 652 |
-
<p class="text-sm">Por: João Silva</p>
|
| 653 |
-
</div>
|
| 654 |
-
<div class="border-l-4 border-blue-500 pl-4 py-2">
|
| 655 |
-
<div class="flex justify-between">
|
| 656 |
-
<p class="font-medium">Item adicionado</p>
|
| 657 |
-
<p class="text-sm text-gray-500 dark:text-gray-400">10/05/2023 09:20</p>
|
| 658 |
-
</div>
|
| 659 |
-
<p class="text-sm">Produto X - Quantidade: 5 - Valor: R$ 750,00</p>
|
| 660 |
-
<p class="text-sm">Por: João Silva</p>
|
| 661 |
-
</div>
|
| 662 |
-
<div class="border-l-4 border-blue-500 pl-4 py-2">
|
| 663 |
-
<div class="flex justify-between">
|
| 664 |
-
<p class="font-medium">Item adicionado</p>
|
| 665 |
-
<p class="text-sm text-gray-500 dark:text-gray-400">10/05/2023 09:25</p>
|
| 666 |
-
</div>
|
| 667 |
-
<p class="text-sm">Produto Y - Quantidade: 2 - Valor: R$ 500,00</p>
|
| 668 |
-
<p class="text-sm">Por: João Silva</p>
|
| 669 |
-
</div>
|
| 670 |
-
</div>
|
| 671 |
</div>
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
|
| 679 |
-
<h2 class="text-2xl font-bold">Adicionar Item</h2>
|
| 680 |
-
<button id="close-add-item-modal" class="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200">
|
| 681 |
-
<i class="fas fa-times text-2xl"></i>
|
| 682 |
</button>
|
| 683 |
</div>
|
| 684 |
-
|
| 685 |
-
<form id="add-item-form" class="space-y-4">
|
| 686 |
-
<div>
|
| 687 |
-
<label for="product-select" class="block text-sm font-medium mb-1">Produto</label>
|
| 688 |
-
<select id="product-select" class="w-full p-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600" required>
|
| 689 |
-
<option value="">Selecione um produto</option>
|
| 690 |
-
<option value="1">Produto X</option>
|
| 691 |
-
<option value="2">Produto Y</option>
|
| 692 |
-
<option value="3">Produto Z</option>
|
| 693 |
-
</select>
|
| 694 |
-
</div>
|
| 695 |
-
|
| 696 |
-
<div>
|
| 697 |
-
<label for="item-quantity" class="block text-sm font-medium mb-1">Quantidade</label>
|
| 698 |
-
<input type="number" id="item-quantity" min="1" class="w-full p-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600" required>
|
| 699 |
-
</div>
|
| 700 |
-
|
| 701 |
-
<div>
|
| 702 |
-
<label for="item-unit-price" class="block text-sm font-medium mb-1">Valor Unitário</label>
|
| 703 |
-
<input type="text" id="item-unit-price" class="w-full p-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600 money" required>
|
| 704 |
-
</div>
|
| 705 |
-
|
| 706 |
-
<div class="flex justify-end gap-3 pt-4">
|
| 707 |
-
<button type="button" id="cancel-add-item" class="bg-gray-300 hover:bg-gray-400 dark:bg-gray-600 dark:hover:bg-gray-700 text-gray-800 dark:text-gray-200 px-4 py-2 rounded-lg">
|
| 708 |
-
Cancelar
|
| 709 |
-
</button>
|
| 710 |
-
<button type="submit" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg">
|
| 711 |
-
Adicionar Item
|
| 712 |
-
</button>
|
| 713 |
-
</div>
|
| 714 |
-
</form>
|
| 715 |
-
</div>
|
| 716 |
</div>
|
| 717 |
-
|
| 718 |
-
|
| 719 |
-
|
| 720 |
-
|
| 721 |
-
|
| 722 |
-
|
| 723 |
-
|
| 724 |
-
|
| 725 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 726 |
</div>
|
| 727 |
|
| 728 |
-
<
|
| 729 |
-
<div>
|
| 730 |
-
<p class="text-sm font-medium mb-1">Produto</p>
|
| 731 |
-
<p class="font-medium" id="receive-product-name">Produto X</p>
|
| 732 |
-
</div>
|
| 733 |
-
|
| 734 |
-
<div class="grid grid-cols-2 gap-4">
|
| 735 |
-
<div>
|
| 736 |
-
<p class="text-sm font-medium mb-1">Quantidade Solicitada</p>
|
| 737 |
-
<p class="font-medium" id="receive-requested-quantity">5</p>
|
| 738 |
-
</div>
|
| 739 |
-
<div>
|
| 740 |
-
<p class="text-sm font-medium mb-1">Quantidade Pendente</p>
|
| 741 |
-
<p class="font-medium" id="receive-pending-quantity">5</p>
|
| 742 |
-
</div>
|
| 743 |
-
</div>
|
| 744 |
-
|
| 745 |
<div>
|
| 746 |
-
<
|
| 747 |
-
<
|
| 748 |
</div>
|
| 749 |
-
|
| 750 |
<div>
|
| 751 |
-
<
|
| 752 |
-
<
|
| 753 |
</div>
|
| 754 |
-
|
| 755 |
-
|
| 756 |
-
|
| 757 |
-
|
| 758 |
-
|
| 759 |
-
|
| 760 |
-
|
| 761 |
-
|
| 762 |
-
|
| 763 |
-
|
| 764 |
-
|
| 765 |
-
|
| 766 |
-
|
| 767 |
-
</
|
| 768 |
-
|
| 769 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 770 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 771 |
|
| 772 |
-
|
| 773 |
-
|
| 774 |
-
|
| 775 |
-
|
| 776 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 777 |
});
|
|
|
|
|
|
|
| 778 |
|
| 779 |
-
|
| 780 |
-
|
| 781 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 782 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 783 |
|
| 784 |
-
|
| 785 |
-
|
| 786 |
-
|
| 787 |
-
|
| 788 |
-
|
|
|
|
|
|
|
|
|
|
| 789 |
|
| 790 |
-
|
| 791 |
-
newOrderOffcanvas.classList.add('show');
|
| 792 |
-
document.body.style.overflow = 'hidden';
|
| 793 |
-
});
|
| 794 |
|
| 795 |
-
|
| 796 |
-
|
| 797 |
-
|
| 798 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 799 |
|
| 800 |
-
|
| 801 |
-
newOrderOffcanvas.classList.remove('show');
|
| 802 |
-
document.body.style.overflow = 'auto';
|
| 803 |
-
});
|
| 804 |
|
| 805 |
-
//
|
| 806 |
-
|
| 807 |
-
|
|
|
|
| 808 |
|
| 809 |
-
|
| 810 |
-
|
| 811 |
-
|
| 812 |
-
const quantity = document.getElementById('item-quantity').value;
|
| 813 |
-
const unitPrice = document.getElementById('item-unit-price').value;
|
| 814 |
-
|
| 815 |
-
if (productSelect.value === '' || quantity === '' || unitPrice === '') {
|
| 816 |
-
Swal.fire({
|
| 817 |
-
title: 'Campos obrigatórios',
|
| 818 |
-
text: 'Por favor, preencha todos os campos do item.',
|
| 819 |
-
icon: 'warning'
|
| 820 |
-
});
|
| 821 |
-
return;
|
| 822 |
-
}
|
| 823 |
-
|
| 824 |
-
const totalValue = (parseFloat(quantity) * parseFloat(unitPrice.replace('R$ ', '').replace('.', '').replace(',', '.'))).toFixed(2);
|
| 825 |
-
|
| 826 |
-
const newRow = document.createElement('tr');
|
| 827 |
-
newRow.className = 'bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700';
|
| 828 |
-
newRow.innerHTML = `
|
| 829 |
-
<td class="px-4 py-2 whitespace-nowrap">${productName}</td>
|
| 830 |
-
<td class="px-4 py-2 whitespace-nowrap">${quantity}</td>
|
| 831 |
-
<td class="px-4 py-2 whitespace-nowrap">${unitPrice}</td>
|
| 832 |
-
<td class="px-4 py-2 whitespace-nowrap">
|
| 833 |
-
<button class="remove-item-row text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300">
|
| 834 |
-
<i class="fas fa-trash"></i>
|
| 835 |
-
</button>
|
| 836 |
-
</td>
|
| 837 |
-
`;
|
| 838 |
-
|
| 839 |
-
orderItemsList.appendChild(newRow);
|
| 840 |
-
|
| 841 |
-
// Clear form
|
| 842 |
-
productSelect.value = '';
|
| 843 |
-
document.getElementById('item-quantity').value = '1';
|
| 844 |
-
document.getElementById('item-unit-price').value = '';
|
| 845 |
-
|
| 846 |
-
// Add event listener to remove button
|
| 847 |
-
newRow.querySelector('.remove-item-row').addEventListener('click', function() {
|
| 848 |
-
newRow.remove();
|
| 849 |
-
});
|
| 850 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 851 |
|
| 852 |
-
|
| 853 |
-
document.getElementById('new-order-form').addEventListener('submit', function(e) {
|
| 854 |
-
e.preventDefault();
|
| 855 |
-
|
| 856 |
-
if (orderItemsList.children.length === 0) {
|
| 857 |
-
Swal.fire({
|
| 858 |
-
title: 'Itens obrigatórios',
|
| 859 |
-
text: 'Por favor, adicione pelo menos um item ao pedido.',
|
| 860 |
-
icon: 'warning'
|
| 861 |
-
});
|
| 862 |
-
return;
|
| 863 |
-
}
|
| 864 |
-
|
| 865 |
Swal.fire({
|
| 866 |
-
title: '
|
| 867 |
-
text: '
|
| 868 |
-
icon: '
|
| 869 |
-
});
|
| 870 |
-
|
| 871 |
-
newOrderOffcanvas.classList.remove('show');
|
| 872 |
-
document.body.style.overflow = 'auto';
|
| 873 |
-
this.reset();
|
| 874 |
-
orderItemsList.innerHTML = '';
|
| 875 |
-
});
|
| 876 |
-
|
| 877 |
-
// Order Detail Modal
|
| 878 |
-
const viewButtons = document.querySelectorAll('.view-btn');
|
| 879 |
-
const orderDetailModal = document.getElementById('order-detail-modal');
|
| 880 |
-
const closeModal = document.getElementById('close-modal');
|
| 881 |
-
|
| 882 |
-
viewButtons.forEach(button => {
|
| 883 |
-
button.addEventListener('click', function() {
|
| 884 |
-
const orderId = this.getAttribute('data-id');
|
| 885 |
-
// In a real app, we would fetch order details based on orderId
|
| 886 |
-
orderDetailModal.classList.remove('hidden');
|
| 887 |
-
document.body.style.overflow = 'hidden';
|
| 888 |
});
|
| 889 |
-
|
|
|
|
| 890 |
|
| 891 |
-
|
| 892 |
-
|
| 893 |
-
|
|
|
|
| 894 |
});
|
| 895 |
|
| 896 |
-
|
| 897 |
-
|
| 898 |
-
|
| 899 |
-
|
| 900 |
-
|
| 901 |
-
|
| 902 |
-
|
| 903 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 904 |
document.body.style.overflow = 'hidden';
|
| 905 |
});
|
| 906 |
-
|
| 907 |
-
|
| 908 |
-
|
| 909 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 910 |
});
|
| 911 |
-
|
| 912 |
-
|
| 913 |
-
|
| 914 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 915 |
});
|
| 916 |
-
|
| 917 |
-
|
| 918 |
-
|
| 919 |
-
|
| 920 |
-
|
| 921 |
-
|
| 922 |
-
|
| 923 |
-
|
| 924 |
-
|
| 925 |
-
|
| 926 |
-
|
| 927 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 928 |
});
|
| 929 |
-
|
| 930 |
-
|
| 931 |
-
|
| 932 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 933 |
});
|
| 934 |
-
|
| 935 |
-
|
| 936 |
-
|
| 937 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 938 |
});
|
| 939 |
-
|
| 940 |
-
|
| 941 |
-
|
| 942 |
-
|
| 943 |
-
|
| 944 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 945 |
Swal.fire({
|
| 946 |
-
title: '
|
| 947 |
-
text: 'Tem certeza que deseja
|
| 948 |
icon: 'warning',
|
| 949 |
showCancelButton: true,
|
| 950 |
confirmButtonColor: '#d33',
|
| 951 |
cancelButtonColor: '#3085d6',
|
| 952 |
-
confirmButtonText: 'Sim,
|
| 953 |
-
cancelButtonText: 'Não, manter'
|
| 954 |
-
}).then((result) => {
|
| 955 |
-
if (result.isConfirmed) {
|
| 956 |
-
Swal.fire(
|
| 957 |
-
'Cancelado!',
|
| 958 |
-
'O pedido foi cancelado com sucesso.',
|
| 959 |
-
'success'
|
| 960 |
-
);
|
| 961 |
-
// In a real app, we would update the order status to "Cancelado"
|
| 962 |
-
}
|
| 963 |
-
});
|
| 964 |
-
}
|
| 965 |
-
|
| 966 |
-
cancelOrderBtn.addEventListener('click', showCancelConfirmation);
|
| 967 |
-
|
| 968 |
-
cancelButtons.forEach(button => {
|
| 969 |
-
button.addEventListener('click', showCancelConfirmation);
|
| 970 |
-
});
|
| 971 |
-
|
| 972 |
-
// Send for Approval
|
| 973 |
-
const sendApprovalBtn = document.getElementById('send-approval-btn');
|
| 974 |
-
|
| 975 |
-
sendApprovalBtn.addEventListener('click', function() {
|
| 976 |
-
Swal.fire({
|
| 977 |
-
title: 'Enviar para Aprovação',
|
| 978 |
-
text: 'Deseja enviar este pedido para aprovação?',
|
| 979 |
-
icon: 'question',
|
| 980 |
-
showCancelButton: true,
|
| 981 |
-
confirmButtonColor: '#3085d6',
|
| 982 |
-
cancelButtonColor: '#d33',
|
| 983 |
-
confirmButtonText: 'Sim, enviar!',
|
| 984 |
cancelButtonText: 'Cancelar'
|
| 985 |
}).then((result) => {
|
| 986 |
if (result.isConfirmed) {
|
| 987 |
Swal.fire(
|
| 988 |
-
'
|
| 989 |
-
'O
|
| 990 |
'success'
|
| 991 |
);
|
| 992 |
-
// In a real app, we would
|
| 993 |
}
|
| 994 |
});
|
| 995 |
});
|
| 996 |
-
|
| 997 |
-
|
| 998 |
-
|
| 999 |
-
|
| 1000 |
-
|
| 1001 |
-
|
| 1002 |
-
|
| 1003 |
-
|
| 1004 |
-
|
| 1005 |
-
|
| 1006 |
-
|
| 1007 |
-
cancelButtonColor: '#d33',
|
| 1008 |
-
confirmButtonText: 'Sim, registrar!',
|
| 1009 |
-
cancelButtonText: 'Cancelar'
|
| 1010 |
-
}).then((result) => {
|
| 1011 |
-
if (result.isConfirmed) {
|
| 1012 |
-
Swal.fire(
|
| 1013 |
-
'Registrado!',
|
| 1014 |
-
'O recebimento do pedido foi registrado com sucesso.',
|
| 1015 |
-
'success'
|
| 1016 |
-
);
|
| 1017 |
-
// In a real app, we would update the order status to "Recebido Parcial" or "Recebido Total"
|
| 1018 |
-
}
|
| 1019 |
-
});
|
| 1020 |
-
});
|
| 1021 |
-
|
| 1022 |
-
// Print Order
|
| 1023 |
-
const printOrderBtn = document.getElementById('print-order-btn');
|
| 1024 |
-
const printButtons = document.querySelectorAll('.print-btn');
|
| 1025 |
-
|
| 1026 |
-
function showPrintConfirmation() {
|
| 1027 |
-
Swal.fire({
|
| 1028 |
-
title: 'Imprimir Pedido',
|
| 1029 |
-
text: 'Preparando o pedido para impressão...',
|
| 1030 |
-
icon: 'info',
|
| 1031 |
-
timer: 1500,
|
| 1032 |
-
showConfirmButton: false
|
| 1033 |
-
});
|
| 1034 |
-
}
|
| 1035 |
-
|
| 1036 |
-
printOrderBtn.addEventListener('click', showPrintConfirmation);
|
| 1037 |
-
|
| 1038 |
-
printButtons.forEach(button => {
|
| 1039 |
-
button.addEventListener('click', showPrintConfirmation);
|
| 1040 |
-
});
|
| 1041 |
-
|
| 1042 |
-
// Remove Item Confirmation
|
| 1043 |
-
const removeItemBtns = document.querySelectorAll('.remove-item-btn');
|
| 1044 |
-
|
| 1045 |
-
removeItemBtns.forEach(button => {
|
| 1046 |
-
button.addEventListener('click', function() {
|
| 1047 |
-
Swal.fire({
|
| 1048 |
-
title: 'Remover Item',
|
| 1049 |
-
text: 'Tem certeza que deseja remover este item do pedido?',
|
| 1050 |
-
icon: 'warning',
|
| 1051 |
-
showCancelButton: true,
|
| 1052 |
-
confirmButtonColor: '#d33',
|
| 1053 |
-
cancelButtonColor: '#3085d6',
|
| 1054 |
-
confirmButtonText: 'Sim, remover!',
|
| 1055 |
-
cancelButtonText: 'Cancelar'
|
| 1056 |
-
}).then((result) => {
|
| 1057 |
-
if (result.isConfirmed) {
|
| 1058 |
-
Swal.fire(
|
| 1059 |
-
'Removido!',
|
| 1060 |
-
'O item foi removido do pedido com sucesso.',
|
| 1061 |
-
'success'
|
| 1062 |
-
);
|
| 1063 |
-
// In a real app, we would remove the item from the order
|
| 1064 |
-
}
|
| 1065 |
-
});
|
| 1066 |
-
});
|
| 1067 |
-
});
|
| 1068 |
-
|
| 1069 |
-
// Apply Filters
|
| 1070 |
-
document.getElementById('apply-filters').addEventListener('click', function() {
|
| 1071 |
-
// In a real app, we would filter the orders based on the selected filters
|
| 1072 |
-
Swal.fire({
|
| 1073 |
-
title: 'Filtros Aplicados',
|
| 1074 |
-
text: 'Os filtros foram aplicados com sucesso.',
|
| 1075 |
-
icon: 'success',
|
| 1076 |
-
timer: 1500,
|
| 1077 |
-
showConfirmButton: false
|
| 1078 |
-
});
|
| 1079 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1080 |
|
| 1081 |
-
|
| 1082 |
-
|
| 1083 |
-
|
| 1084 |
-
|
| 1085 |
-
|
| 1086 |
-
|
| 1087 |
-
|
| 1088 |
-
Swal.fire({
|
| 1089 |
-
title: 'Filtros Limpos',
|
| 1090 |
-
text: 'Todos os filtros foram resetados.',
|
| 1091 |
-
icon: 'info',
|
| 1092 |
-
timer: 1500,
|
| 1093 |
-
showConfirmButton: false
|
| 1094 |
-
});
|
| 1095 |
});
|
| 1096 |
-
|
| 1097 |
-
|
| 1098 |
-
|
| 1099 |
-
|
| 1100 |
-
|
| 1101 |
-
|
| 1102 |
-
|
| 1103 |
-
|
| 1104 |
-
|
| 1105 |
-
|
| 1106 |
});
|
| 1107 |
-
|
|
|
|
| 1108 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=gallabs/tom-system-pedido-compra" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 1109 |
</html>
|
|
|
|
| 116 |
border-bottom-color: #374151;
|
| 117 |
}
|
| 118 |
|
| 119 |
+
/* Notification Dropdown Styles */
|
| 120 |
+
.notification-container {
|
| 121 |
+
position: relative;
|
| 122 |
+
display: inline-block;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
.notification-badge {
|
| 126 |
+
position: absolute;
|
| 127 |
+
top: -5px;
|
| 128 |
+
right: -5px;
|
| 129 |
+
background-color: #ef4444;
|
| 130 |
+
color: white;
|
| 131 |
+
border-radius: 50%;
|
| 132 |
+
width: 20px;
|
| 133 |
+
height: 20px;
|
| 134 |
+
display: flex;
|
| 135 |
+
align-items: center;
|
| 136 |
+
justify-content: center;
|
| 137 |
+
font-size: 12px;
|
| 138 |
+
font-weight: bold;
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
.notification-dropdown {
|
| 142 |
+
position: absolute;
|
| 143 |
+
right: 0;
|
| 144 |
+
top: 100%;
|
| 145 |
+
width: 350px;
|
| 146 |
+
max-height: 400px;
|
| 147 |
+
overflow-y: auto;
|
| 148 |
+
background-color: white;
|
| 149 |
+
border-radius: 0.5rem;
|
| 150 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
| 151 |
+
z-index: 1100;
|
| 152 |
+
display: none;
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
.dark .notification-dropdown {
|
| 156 |
+
background-color: #1f2937;
|
| 157 |
+
border: 1px solid #374151;
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
.notification-dropdown.show {
|
| 161 |
+
display: block;
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
.notification-header {
|
| 165 |
+
padding: 1rem;
|
| 166 |
+
border-bottom: 1px solid #e5e7eb;
|
| 167 |
+
display: flex;
|
| 168 |
+
justify-content: space-between;
|
| 169 |
+
align-items: center;
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
.dark .notification-header {
|
| 173 |
+
border-bottom-color: #374151;
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
.notification-item {
|
| 177 |
+
padding: 1rem;
|
| 178 |
+
border-bottom: 1px solid #e5e7eb;
|
| 179 |
+
cursor: pointer;
|
| 180 |
+
transition: background-color 0.2s;
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
.dark .notification-item {
|
| 184 |
+
border-bottom-color: #374151;
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
.notification-item:hover {
|
| 188 |
+
background-color: #f3f4f6;
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
.dark .notification-item:hover {
|
| 192 |
+
background-color: #374151;
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
.notification-item.unread {
|
| 196 |
+
background-color: #f0f9ff;
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
.dark .notification-item.unread {
|
| 200 |
+
background-color: #1e3a8a;
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
.notification-time {
|
| 204 |
+
font-size: 0.75rem;
|
| 205 |
+
color: #6b7280;
|
| 206 |
+
margin-top: 0.25rem;
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
.dark .notification-time {
|
| 210 |
+
color: #9ca3af;
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
.notification-footer {
|
| 214 |
+
padding: 0.75rem;
|
| 215 |
+
text-align: center;
|
| 216 |
+
border-top: 1px solid #e5e7eb;
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
.dark .notification-footer {
|
| 220 |
+
border-top-color: #374151;
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
@media (max-width: 768px) {
|
| 224 |
.responsive-table {
|
| 225 |
display: block;
|
|
|
|
| 230 |
.offcanvas {
|
| 231 |
width: 90%;
|
| 232 |
}
|
| 233 |
+
|
| 234 |
+
.notification-dropdown {
|
| 235 |
+
width: 280px;
|
| 236 |
+
right: -50px;
|
| 237 |
+
}
|
| 238 |
}
|
| 239 |
</style>
|
| 240 |
</head>
|
|
|
|
| 251 |
<i class="fas fa-moon dark:hidden"></i>
|
| 252 |
<i class="fas fa-sun hidden dark:inline"></i>
|
| 253 |
</button>
|
| 254 |
+
|
| 255 |
+
<!-- Notification Bell -->
|
| 256 |
+
<div class="notification-container">
|
| 257 |
+
<button id="notification-btn" class="p-2 rounded-full bg-gray-200 dark:bg-gray-700 relative">
|
| 258 |
+
<i class="fas fa-bell"></i>
|
| 259 |
+
<span class="notification-badge">6</span>
|
| 260 |
+
</button>
|
| 261 |
+
<div id="notification-dropdown" class="notification-dropdown">
|
| 262 |
+
<div class="notification-header">
|
| 263 |
+
<h3 class="font-semibold">Notificações</h3>
|
| 264 |
+
<button id="mark-all-read" class="text-blue-600 dark:text-blue-400 text-sm">Marcar todas como lidas</button>
|
| 265 |
+
</div>
|
| 266 |
+
<div class="overflow-y-auto max-h-80">
|
| 267 |
+
<div class="notification-item unread">
|
| 268 |
+
<div class="font-medium">Novo pedido aprovado</div>
|
| 269 |
+
<p class="text-sm">Pedido PC-2023-010 foi aprovado pelo gestor</p>
|
| 270 |
+
<div class="notification-time">Há 5 minutos</div>
|
| 271 |
+
</div>
|
| 272 |
+
<div class="notification-item unread">
|
| 273 |
+
<div class="font-medium">Recebimento parcial</div>
|
| 274 |
+
<p class="text-sm">3 itens do pedido PC-2023-008 foram recebidos</p>
|
| 275 |
+
<div class="notification-time">Há 1 hora</div>
|
| 276 |
+
</div>
|
| 277 |
+
<div class="notification-item unread">
|
| 278 |
+
<div class="font-medium">Pedido enviado</div>
|
| 279 |
+
<p class="text-sm">Pedido PC-2023-009 foi enviado ao fornecedor</p>
|
| 280 |
+
<div class="notification-time">Hoje, 09:30</div>
|
| 281 |
+
</div>
|
| 282 |
+
<div class="notification-item">
|
| 283 |
+
<div class="font-medium">Aprovação pendente</div>
|
| 284 |
+
<p class="text-sm">Pedido PC-2023-011 aguarda sua aprovação</p>
|
| 285 |
+
<div class="notification-time">Ontem, 16:45</div>
|
| 286 |
+
</div>
|
| 287 |
+
<div class="notification-item">
|
| 288 |
+
<div class="font-medium">Fornecedor atualizado</div>
|
| 289 |
+
<p class="text-sm">Fornecedor A atualizou seus dados cadastrais</p>
|
| 290 |
+
<div class="notification-time">Ontem, 14:20</div>
|
| 291 |
+
</div>
|
| 292 |
+
<div class="notification-item">
|
| 293 |
+
<div class="font-medium">Novo comentário</div>
|
| 294 |
+
<p class="text-sm">João Silva comentou no pedido PC-2023-007</p>
|
| 295 |
+
<div class="notification-time">Ontem, 11:10</div>
|
| 296 |
+
</div>
|
| 297 |
+
</div>
|
| 298 |
+
<div class="notification-footer">
|
| 299 |
+
<a href="#" class="text-blue-600 dark:text-blue-400 text-sm">Ver todas as notificações</a>
|
| 300 |
+
</div>
|
| 301 |
+
</div>
|
| 302 |
+
</div>
|
| 303 |
+
|
| 304 |
<button id="new-order-btn" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg flex items-center gap-2">
|
| 305 |
<i class="fas fa-plus"></i> Novo Pedido de Compra
|
| 306 |
</button>
|
|
|
|
| 695 |
</div>
|
| 696 |
<div>
|
| 697 |
<p class="text-sm text-gray-500 dark:text-gray-400">Condição de Pagamento</p>
|
| 698 |
+
<p class="font-medium" id="payment-terms">30/60/90 dias</p>
|
| 699 |
+
</div>
|
| 700 |
+
<div>
|
| 701 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">Valor Total</p>
|
| 702 |
+
<p class="font-medium" id="order-total">R$ 1.250,00</p>
|
| 703 |
+
</div>
|
| 704 |
+
</div>
|
| 705 |
+
</div>
|
| 706 |
+
|
| 707 |
+
<div class="bg-gray-100 dark:bg-gray-700 p-4 rounded-lg">
|
| 708 |
+
<h3 class="text-lg font-semibold mb-4">Observações</h3>
|
| 709 |
+
<p class="text-sm" id="order-notes">Pedido com prioridade máxima. Favor confirmar disponibilidade antes do envio.</p>
|
| 710 |
+
</div>
|
| 711 |
+
</div>
|
| 712 |
+
|
| 713 |
+
<!-- Items Table -->
|
| 714 |
+
<div class="mb-8">
|
| 715 |
+
<div class="flex justify-between items-center mb-4">
|
| 716 |
+
<h3 class="text-lg font-semibold">Itens do Pedido</h3>
|
| 717 |
+
<button id="add-item-btn" class="bg-blue-600 hover:bg-blue-700 text-white px-3 py-1 rounded-lg text-sm flex items-center gap-1">
|
| 718 |
+
<i class="fas fa-plus"></i> Adicionar Item
|
| 719 |
+
</button>
|
| 720 |
+
</div>
|
| 721 |
+
|
| 722 |
+
<div class="responsive-table">
|
| 723 |
+
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
|
| 724 |
+
<thead class="bg-gray-50 dark:bg-gray-700">
|
| 725 |
+
<tr>
|
| 726 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Produto</th>
|
| 727 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Categoria</th>
|
| 728 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Quantidade</th>
|
| 729 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Valor Unitário</th>
|
| 730 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Valor Total</th>
|
| 731 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Recebido</th>
|
| 732 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Status</th>
|
| 733 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Ações</th>
|
| 734 |
+
</tr>
|
| 735 |
+
</thead>
|
| 736 |
+
<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">
|
| 737 |
+
<tr>
|
| 738 |
+
<td class="px-6 py-4 whitespace-nowrap">Produto X</td>
|
| 739 |
+
<td class="px-6 py-4 whitespace-nowrap">Eletrônicos</td>
|
| 740 |
+
<td class="px-6 py-4 whitespace-nowrap">5</td>
|
| 741 |
+
<td class="px-6 py-4 whitespace-nowrap">R$ 150,00</td>
|
| 742 |
+
<td class="px-6 py-4 whitespace-nowrap">R$ 750,00</td>
|
| 743 |
+
<td class="px-6 py-4 whitespace-nowrap">0</td>
|
| 744 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
| 745 |
+
<span class="px-2 py-1 rounded-full text-xs font-semibold item-status-pendente">Pendente</span>
|
| 746 |
+
</td>
|
| 747 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
| 748 |
+
<button class="edit-item-btn text-yellow-600 hover:text-yellow-800 dark:text-yellow-400 dark:hover:text-yellow-300 mr-2">
|
| 749 |
+
<i class="fas fa-edit"></i>
|
| 750 |
+
</button>
|
| 751 |
+
<button class="receive-item-btn text-green-600 hover:text-green-800 dark:text-green-400 dark:hover:text-green-300 mr-2">
|
| 752 |
+
<i class="fas fa-check-circle"></i>
|
| 753 |
+
</button>
|
| 754 |
+
<button class="remove-item-btn text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300">
|
| 755 |
+
<i class="fas fa-trash"></i>
|
| 756 |
+
</button>
|
| 757 |
+
</td>
|
| 758 |
+
</tr>
|
| 759 |
+
<tr>
|
| 760 |
+
<td class="px-6 py-4 whitespace-nowrap">Produto Y</td>
|
| 761 |
+
<td class="px-6 py-4 whitespace-nowrap">Móveis</td>
|
| 762 |
+
<td class="px-6 py-4 whitespace-nowrap">2</td>
|
| 763 |
+
<td class="px-6 py-4 whitespace-nowrap">R$ 250,00</td>
|
| 764 |
+
<td class="px-6 py-4 whitespace-nowrap">R$ 500,00</td>
|
| 765 |
+
<td class="px-6 py-4 whitespace-nowrap">0</td>
|
| 766 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
| 767 |
+
<span class="px-2 py-1 rounded-full text-xs font-semibold item-status-pendente">Pendente</span>
|
| 768 |
+
</td>
|
| 769 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
| 770 |
+
<button class="edit-item-btn text-yellow-600 hover:text-yellow-800 dark:text-yellow-400 dark:hover:text-yellow-300 mr-2">
|
| 771 |
+
<i class="fas fa-edit"></i>
|
| 772 |
+
</button>
|
| 773 |
+
<button class="receive-item-btn text-green-600 hover:text-green-800 dark:text-green-400 dark:hover:text-green-300 mr-2">
|
| 774 |
+
<i class="fas fa-check-circle"></i>
|
| 775 |
+
</button>
|
| 776 |
+
<button class="remove-item-btn text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300">
|
| 777 |
+
<i class="fas fa-trash"></i>
|
| 778 |
+
</button>
|
| 779 |
+
</td>
|
| 780 |
+
</tr>
|
| 781 |
+
</tbody>
|
| 782 |
+
</table>
|
| 783 |
+
</div>
|
| 784 |
+
</div>
|
| 785 |
+
|
| 786 |
+
<!-- Order Actions -->
|
| 787 |
+
<div class="flex flex-wrap gap-3 mb-8">
|
| 788 |
+
<button id="send-approval-btn" class="bg-purple-600 hover:bg-purple-700 text-white px-4 py-2 rounded-lg flex items-center gap-2">
|
| 789 |
+
<i class="fas fa-paper-plane"></i> Enviar para Aprovação
|
| 790 |
+
</button>
|
| 791 |
+
<button id="register-receipt-btn" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center gap-2">
|
| 792 |
+
<i class="fas fa-check-double"></i> Registrar Recebimento
|
| 793 |
+
</button>
|
| 794 |
+
<button id="cancel-order-btn" class="bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-lg flex items-center gap-2">
|
| 795 |
+
<i class="fas fa-times"></i> Cancelar Pedido
|
| 796 |
+
</button>
|
| 797 |
+
<button id="print-order-btn" class="bg-gray-600 hover:bg-gray-700 text-white px-4 py-2 rounded-lg flex items-center gap-2">
|
| 798 |
+
<i class="fas fa-print"></i> Imprimir Pedido
|
| 799 |
+
</button>
|
| 800 |
+
</div>
|
| 801 |
+
|
| 802 |
+
<!-- History -->
|
| 803 |
+
<div>
|
| 804 |
+
<h3 class="text-lg font-semibold mb-4">Histórico do Pedido</h3>
|
| 805 |
+
<div class="space-y-4">
|
| 806 |
+
<div class="border-l-4 border-blue-500 pl-4 py-2">
|
| 807 |
+
<div class="flex justify-between">
|
| 808 |
+
<p class="font-medium">Pedido criado</p>
|
| 809 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">10/05/2023 09:15</p>
|
| 810 |
</div>
|
| 811 |
+
<p class="text-sm">Por: João Silva</p>
|
| 812 |
+
</div>
|
| 813 |
+
<div class="border-l-4 border-blue-500 pl-4 py-2">
|
| 814 |
+
<div class="flex justify-between">
|
| 815 |
+
<p class="font-medium">Item adicionado</p>
|
| 816 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">10/05/2023 09:20</p>
|
| 817 |
+
</div>
|
| 818 |
+
<p class="text-sm">Produto X - Quantidade: 5 - Valor: R$ 750,00</p>
|
| 819 |
+
<p class="text-sm">Por: João Silva</p>
|
| 820 |
+
</div>
|
| 821 |
+
<div class="border-l-4 border-blue-500 pl-4 py-2">
|
| 822 |
+
<div class="flex justify-between">
|
| 823 |
+
<p class="font-medium">Item adicionado</p>
|
| 824 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">10/05/2023 09:25</p>
|
| 825 |
+
</div>
|
| 826 |
+
<p class="text-sm">Produto Y - Quantidade: 2 - Valor: R$ 500,00</p>
|
| 827 |
+
<p class="text-sm">Por: João Silva</p>
|
| 828 |
+
</div>
|
| 829 |
+
</div>
|
| 830 |
+
</div>
|
| 831 |
+
</div>
|
| 832 |
+
</div>
|
| 833 |
+
|
| 834 |
+
<!-- Add Item Modal -->
|
| 835 |
+
<div id="add-item-modal" class="modal-overlay hidden">
|
| 836 |
+
<div class="modal-content max-w-md">
|
| 837 |
+
<div class="flex justify-between items-center mb-6">
|
| 838 |
+
<h2 class="text-2xl font-bold">Adicionar Item</h2>
|
| 839 |
+
<button id="close-add-item-modal" class="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200">
|
| 840 |
+
<i class="fas fa-times text-2xl"></i>
|
| 841 |
+
</button>
|
| 842 |
+
</div>
|
| 843 |
+
|
| 844 |
+
<form id="add-item-form" class="space-y-4">
|
| 845 |
+
<div>
|
| 846 |
+
<label for="product-select" class="block text-sm font-medium mb-1">Produto</label>
|
| 847 |
+
<select id="product-select" class="w-full p-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600" required>
|
| 848 |
+
<option value="">Selecione um produto</option>
|
| 849 |
+
<option value="1">Produto X</option>
|
| 850 |
+
<option value="2">Produto Y</option>
|
| 851 |
+
<option value="3">Produto Z</option>
|
| 852 |
+
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 853 |
</div>
|
| 854 |
|
| 855 |
+
<div>
|
| 856 |
+
<label for="item-quantity" class="block text-sm font-medium mb-1">Quantidade</label>
|
| 857 |
+
<input type="number" id="item-quantity" min="1" class="w-full p-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600" required>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 858 |
</div>
|
| 859 |
|
|
|
|
| 860 |
<div>
|
| 861 |
+
<label for="item-unit-price" class="block text-sm font-medium mb-1">Valor Unitário</label>
|
| 862 |
+
<input type="text" id="item-unit-price" class="w-full p-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600 money" required>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 863 |
</div>
|
| 864 |
+
|
| 865 |
+
<div class="flex justify-end gap-3 pt-4">
|
| 866 |
+
<button type="button" id="cancel-add-item" class="bg-gray-300 hover:bg-gray-400 dark:bg-gray-600 dark:hover:bg-gray-700 text-gray-800 dark:text-gray-200 px-4 py-2 rounded-lg">
|
| 867 |
+
Cancelar
|
| 868 |
+
</button>
|
| 869 |
+
<button type="submit" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg">
|
| 870 |
+
Adicionar Item
|
|
|
|
|
|
|
|
|
|
| 871 |
</button>
|
| 872 |
</div>
|
| 873 |
+
</form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 874 |
</div>
|
| 875 |
+
</div>
|
| 876 |
+
|
| 877 |
+
<!-- Receive Item Modal -->
|
| 878 |
+
<div id="receive-item-modal" class="modal-overlay hidden">
|
| 879 |
+
<div class="modal-content max-w-md">
|
| 880 |
+
<div class="flex justify-between items-center mb-6">
|
| 881 |
+
<h2 class="text-2xl font-bold">Registrar Recebimento</h2>
|
| 882 |
+
<button id="close-receive-item-modal" class="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200">
|
| 883 |
+
<i class="fas fa-times text-2xl"></i>
|
| 884 |
+
</button>
|
| 885 |
+
</div>
|
| 886 |
+
|
| 887 |
+
<form id="receive-item-form" class="space-y-4">
|
| 888 |
+
<div>
|
| 889 |
+
<p class="text-sm font-medium mb-1">Produto</p>
|
| 890 |
+
<p class="font-medium" id="receive-product-name">Produto X</p>
|
| 891 |
</div>
|
| 892 |
|
| 893 |
+
<div class="grid grid-cols-2 gap-4">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 894 |
<div>
|
| 895 |
+
<p class="text-sm font-medium mb-1">Quantidade Solicitada</p>
|
| 896 |
+
<p class="font-medium" id="receive-requested-quantity">5</p>
|
| 897 |
</div>
|
|
|
|
| 898 |
<div>
|
| 899 |
+
<p class="text-sm font-medium mb-1">Quantidade Pendente</p>
|
| 900 |
+
<p class="font-medium" id="receive-pending-quantity">5</p>
|
| 901 |
</div>
|
| 902 |
+
</div>
|
| 903 |
+
|
| 904 |
+
<div>
|
| 905 |
+
<label for="received-quantity" class="block text-sm font-medium mb-1">Quantidade Recebida</label>
|
| 906 |
+
<input type="number" id="received-quantity" min="1" max="5" class="w-full p-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600" required>
|
| 907 |
+
</div>
|
| 908 |
+
|
| 909 |
+
<div>
|
| 910 |
+
<label for="receipt-date" class="block text-sm font-medium mb-1">Data do Recebimento</label>
|
| 911 |
+
<input type="date" id="receipt-date" class="w-full p-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600" required>
|
| 912 |
+
</div>
|
| 913 |
+
|
| 914 |
+
<div>
|
| 915 |
+
<label for="receipt-notes" class="block text-sm font-medium mb-1">Observações</label>
|
| 916 |
+
<textarea id="receipt-notes" rows="3" class="w-full p-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600"></textarea>
|
| 917 |
+
</div>
|
| 918 |
+
|
| 919 |
+
<div class="flex justify-end gap-3 pt-4">
|
| 920 |
+
<button type="button" id="cancel-receive-item" class="bg-gray-300 hover:bg-gray-400 dark:bg-gray-600 dark:hover:bg-gray-700 text-gray-800 dark:text-gray-200 px-4 py-2 rounded-lg">
|
| 921 |
+
Cancelar
|
| 922 |
+
</button>
|
| 923 |
+
<button type="submit" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg">
|
| 924 |
+
Registrar Recebimento
|
| 925 |
+
</button>
|
| 926 |
+
</div>
|
| 927 |
+
</form>
|
| 928 |
</div>
|
| 929 |
+
</div>
|
| 930 |
+
|
| 931 |
+
<script>
|
| 932 |
+
// Theme Toggle
|
| 933 |
+
document.getElementById('theme-toggle').addEventListener('click', function() {
|
| 934 |
+
document.documentElement.classList.toggle('dark');
|
| 935 |
+
localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light');
|
| 936 |
+
});
|
| 937 |
+
|
| 938 |
+
// Check for saved theme preference
|
| 939 |
+
if (localStorage.getItem('theme') === 'light') {
|
| 940 |
+
document.documentElement.classList.remove('dark');
|
| 941 |
+
}
|
| 942 |
+
|
| 943 |
+
// Notification Dropdown Toggle
|
| 944 |
+
const notificationBtn = document.getElementById('notification-btn');
|
| 945 |
+
const notificationDropdown = document.getElementById('notification-dropdown');
|
| 946 |
+
const markAllReadBtn = document.getElementById('mark-all-read');
|
| 947 |
+
const notificationBadge = document.querySelector('.notification-badge');
|
| 948 |
|
| 949 |
+
notificationBtn.addEventListener('click', function(e) {
|
| 950 |
+
e.stopPropagation();
|
| 951 |
+
notificationDropdown.classList.toggle('show');
|
| 952 |
+
});
|
| 953 |
+
|
| 954 |
+
markAllReadBtn.addEventListener('click', function() {
|
| 955 |
+
const unreadItems = document.querySelectorAll('.notification-item.unread');
|
| 956 |
+
unreadItems.forEach(item => {
|
| 957 |
+
item.classList.remove('unread');
|
| 958 |
});
|
| 959 |
+
notificationBadge.textContent = '0';
|
| 960 |
+
notificationBadge.style.display = 'none';
|
| 961 |
|
| 962 |
+
Swal.fire({
|
| 963 |
+
title: 'Notificações marcadas como lidas',
|
| 964 |
+
icon: 'success',
|
| 965 |
+
timer: 1500,
|
| 966 |
+
showConfirmButton: false
|
| 967 |
+
});
|
| 968 |
+
});
|
| 969 |
+
|
| 970 |
+
// Close dropdown when clicking outside
|
| 971 |
+
document.addEventListener('click', function(e) {
|
| 972 |
+
if (!notificationDropdown.contains(e.target) && e.target !== notificationBtn) {
|
| 973 |
+
notificationDropdown.classList.remove('show');
|
| 974 |
}
|
| 975 |
+
});
|
| 976 |
+
|
| 977 |
+
// New Order Offcanvas
|
| 978 |
+
const newOrderBtn = document.getElementById('new-order-btn');
|
| 979 |
+
const newOrderOffcanvas = document.getElementById('new-order-offcanvas');
|
| 980 |
+
const closeNewOrder = document.getElementById('close-new-order');
|
| 981 |
+
const cancelNewOrder = document.getElementById('cancel-new-order');
|
| 982 |
+
|
| 983 |
+
newOrderBtn.addEventListener('click', function() {
|
| 984 |
+
newOrderOffcanvas.classList.add('show');
|
| 985 |
+
document.body.style.overflow = 'hidden';
|
| 986 |
+
});
|
| 987 |
+
|
| 988 |
+
closeNewOrder.addEventListener('click', function() {
|
| 989 |
+
newOrderOffcanvas.classList.remove('show');
|
| 990 |
+
document.body.style.overflow = 'auto';
|
| 991 |
+
});
|
| 992 |
+
|
| 993 |
+
cancelNewOrder.addEventListener('click', function() {
|
| 994 |
+
newOrderOffcanvas.classList.remove('show');
|
| 995 |
+
document.body.style.overflow = 'auto';
|
| 996 |
+
});
|
| 997 |
+
|
| 998 |
+
// Add items to new order
|
| 999 |
+
const addItemToOrderBtn = document.getElementById('add-item-to-order');
|
| 1000 |
+
const orderItemsList = document.getElementById('order-items-list');
|
| 1001 |
+
|
| 1002 |
+
addItemToOrderBtn.addEventListener('click', function() {
|
| 1003 |
+
const productSelect = document.getElementById('product-select');
|
| 1004 |
+
const productName = productSelect.options[productSelect.selectedIndex].text;
|
| 1005 |
+
const quantity = document.getElementById('item-quantity').value;
|
| 1006 |
+
const unitPrice = document.getElementById('item-unit-price').value;
|
| 1007 |
|
| 1008 |
+
if (productSelect.value === '' || quantity === '' || unitPrice === '') {
|
| 1009 |
+
Swal.fire({
|
| 1010 |
+
title: 'Campos obrigatórios',
|
| 1011 |
+
text: 'Por favor, preencha todos os campos do item.',
|
| 1012 |
+
icon: 'warning'
|
| 1013 |
+
});
|
| 1014 |
+
return;
|
| 1015 |
+
}
|
| 1016 |
|
| 1017 |
+
const totalValue = (parseFloat(quantity) * parseFloat(unitPrice.replace('R$ ', '').replace('.', '').replace(',', '.'))).toFixed(2);
|
|
|
|
|
|
|
|
|
|
| 1018 |
|
| 1019 |
+
const newRow = document.createElement('tr');
|
| 1020 |
+
newRow.className = 'bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700';
|
| 1021 |
+
newRow.innerHTML = `
|
| 1022 |
+
<td class="px-4 py-2 whitespace-nowrap">${productName}</td>
|
| 1023 |
+
<td class="px-4 py-2 whitespace-nowrap">${quantity}</td>
|
| 1024 |
+
<td class="px-4 py-2 whitespace-nowrap">${unitPrice}</td>
|
| 1025 |
+
<td class="px-4 py-2 whitespace-nowrap">
|
| 1026 |
+
<button class="remove-item-row text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300">
|
| 1027 |
+
<i class="fas fa-trash"></i>
|
| 1028 |
+
</button>
|
| 1029 |
+
</td>
|
| 1030 |
+
`;
|
| 1031 |
|
| 1032 |
+
orderItemsList.appendChild(newRow);
|
|
|
|
|
|
|
|
|
|
| 1033 |
|
| 1034 |
+
// Clear form
|
| 1035 |
+
productSelect.value = '';
|
| 1036 |
+
document.getElementById('item-quantity').value = '1';
|
| 1037 |
+
document.getElementById('item-unit-price').value = '';
|
| 1038 |
|
| 1039 |
+
// Add event listener to remove button
|
| 1040 |
+
newRow.querySelector('.remove-item-row').addEventListener('click', function() {
|
| 1041 |
+
newRow.remove();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1042 |
});
|
| 1043 |
+
});
|
| 1044 |
+
|
| 1045 |
+
// Submit new order form
|
| 1046 |
+
document.getElementById('new-order-form').addEventListener('submit', function(e) {
|
| 1047 |
+
e.preventDefault();
|
| 1048 |
|
| 1049 |
+
if (orderItemsList.children.length === 0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1050 |
Swal.fire({
|
| 1051 |
+
title: 'Itens obrigatórios',
|
| 1052 |
+
text: 'Por favor, adicione pelo menos um item ao pedido.',
|
| 1053 |
+
icon: 'warning'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1054 |
});
|
| 1055 |
+
return;
|
| 1056 |
+
}
|
| 1057 |
|
| 1058 |
+
Swal.fire({
|
| 1059 |
+
title: 'Pedido criado!',
|
| 1060 |
+
text: 'O novo pedido de compra foi criado com sucesso.',
|
| 1061 |
+
icon: 'success'
|
| 1062 |
});
|
| 1063 |
|
| 1064 |
+
newOrderOffcanvas.classList.remove('show');
|
| 1065 |
+
document.body.style.overflow = 'auto';
|
| 1066 |
+
this.reset();
|
| 1067 |
+
orderItemsList.innerHTML = '';
|
| 1068 |
+
});
|
| 1069 |
+
|
| 1070 |
+
// Order Detail Modal
|
| 1071 |
+
const viewButtons = document.querySelectorAll('.view-btn');
|
| 1072 |
+
const orderDetailModal = document.getElementById('order-detail-modal');
|
| 1073 |
+
const closeModal = document.getElementById('close-modal');
|
| 1074 |
+
|
| 1075 |
+
viewButtons.forEach(button => {
|
| 1076 |
+
button.addEventListener('click', function() {
|
| 1077 |
+
const orderId = this.getAttribute('data-id');
|
| 1078 |
+
// In a real app, we would fetch order details based on orderId
|
| 1079 |
+
orderDetailModal.classList.remove('hidden');
|
| 1080 |
document.body.style.overflow = 'hidden';
|
| 1081 |
});
|
| 1082 |
+
});
|
| 1083 |
+
|
| 1084 |
+
closeModal.addEventListener('click', function() {
|
| 1085 |
+
orderDetailModal.classList.add('hidden');
|
| 1086 |
+
document.body.style.overflow = 'auto';
|
| 1087 |
+
});
|
| 1088 |
+
|
| 1089 |
+
// Add Item Modal
|
| 1090 |
+
const addItemBtn = document.getElementById('add-item-btn');
|
| 1091 |
+
const addItemModal = document.getElementById('add-item-modal');
|
| 1092 |
+
const closeAddItemModal = document.getElementById('close-add-item-modal');
|
| 1093 |
+
const cancelAddItem = document.getElementById('cancel-add-item');
|
| 1094 |
+
|
| 1095 |
+
addItemBtn.addEventListener('click', function() {
|
| 1096 |
+
addItemModal.classList.remove('hidden');
|
| 1097 |
+
document.body.style.overflow = 'hidden';
|
| 1098 |
+
});
|
| 1099 |
+
|
| 1100 |
+
closeAddItemModal.addEventListener('click', function() {
|
| 1101 |
+
addItemModal.classList.add('hidden');
|
| 1102 |
+
document.body.style.overflow = 'auto';
|
| 1103 |
+
});
|
| 1104 |
+
|
| 1105 |
+
cancelAddItem.addEventListener('click', function() {
|
| 1106 |
+
addItemModal.classList.add('hidden');
|
| 1107 |
+
document.body.style.overflow = 'auto';
|
| 1108 |
+
});
|
| 1109 |
+
|
| 1110 |
+
// Receive Item Modal
|
| 1111 |
+
const receiveItemBtns = document.querySelectorAll('.receive-item-btn');
|
| 1112 |
+
const receiveItemModal = document.getElementById('receive-item-modal');
|
| 1113 |
+
const closeReceiveItemModal = document.getElementById('close-receive-item-modal');
|
| 1114 |
+
const cancelReceiveItem = document.getElementById('cancel-receive-item');
|
| 1115 |
+
|
| 1116 |
+
receiveItemBtns.forEach(button => {
|
| 1117 |
+
button.addEventListener('click', function() {
|
| 1118 |
+
receiveItemModal.classList.remove('hidden');
|
| 1119 |
+
document.body.style.overflow = 'hidden';
|
| 1120 |
});
|
| 1121 |
+
});
|
| 1122 |
+
|
| 1123 |
+
closeReceiveItemModal.addEventListener('click', function() {
|
| 1124 |
+
receiveItemModal.classList.add('hidden');
|
| 1125 |
+
document.body.style.overflow = 'auto';
|
| 1126 |
+
});
|
| 1127 |
+
|
| 1128 |
+
cancelReceiveItem.addEventListener('click', function() {
|
| 1129 |
+
receiveItemModal.classList.add('hidden');
|
| 1130 |
+
document.body.style.overflow = 'auto';
|
| 1131 |
+
});
|
| 1132 |
+
|
| 1133 |
+
// Cancel Order Confirmation
|
| 1134 |
+
const cancelOrderBtn = document.getElementById('cancel-order-btn');
|
| 1135 |
+
const cancelButtons = document.querySelectorAll('.cancel-btn');
|
| 1136 |
+
|
| 1137 |
+
function showCancelConfirmation() {
|
| 1138 |
+
Swal.fire({
|
| 1139 |
+
title: 'Cancelar Pedido',
|
| 1140 |
+
text: 'Tem certeza que deseja cancelar este pedido? Esta ação não pode ser desfeita.',
|
| 1141 |
+
icon: 'warning',
|
| 1142 |
+
showCancelButton: true,
|
| 1143 |
+
confirmButtonColor: '#d33',
|
| 1144 |
+
cancelButtonColor: '#3085d6',
|
| 1145 |
+
confirmButtonText: 'Sim, cancelar!',
|
| 1146 |
+
cancelButtonText: 'Não, manter'
|
| 1147 |
+
}).then((result) => {
|
| 1148 |
+
if (result.isConfirmed) {
|
| 1149 |
+
Swal.fire(
|
| 1150 |
+
'Cancelado!',
|
| 1151 |
+
'O pedido foi cancelado com sucesso.',
|
| 1152 |
+
'success'
|
| 1153 |
+
);
|
| 1154 |
+
// In a real app, we would update the order status to "Cancelado"
|
| 1155 |
+
}
|
| 1156 |
});
|
| 1157 |
+
}
|
| 1158 |
+
|
| 1159 |
+
cancelOrderBtn.addEventListener('click', showCancelConfirmation);
|
| 1160 |
+
|
| 1161 |
+
cancelButtons.forEach(button => {
|
| 1162 |
+
button.addEventListener('click', showCancelConfirmation);
|
| 1163 |
+
});
|
| 1164 |
+
|
| 1165 |
+
// Send for Approval
|
| 1166 |
+
const sendApprovalBtn = document.getElementById('send-approval-btn');
|
| 1167 |
+
|
| 1168 |
+
sendApprovalBtn.addEventListener('click', function() {
|
| 1169 |
+
Swal.fire({
|
| 1170 |
+
title: 'Enviar para Aprovação',
|
| 1171 |
+
text: 'Deseja enviar este pedido para aprovação?',
|
| 1172 |
+
icon: 'question',
|
| 1173 |
+
showCancelButton: true,
|
| 1174 |
+
confirmButtonColor: '#3085d6',
|
| 1175 |
+
cancelButtonColor: '#d33',
|
| 1176 |
+
confirmButtonText: 'Sim, enviar!',
|
| 1177 |
+
cancelButtonText: 'Cancelar'
|
| 1178 |
+
}).then((result) => {
|
| 1179 |
+
if (result.isConfirmed) {
|
| 1180 |
+
Swal.fire(
|
| 1181 |
+
'Enviado!',
|
| 1182 |
+
'O pedido foi enviado para aprovação com sucesso.',
|
| 1183 |
+
'success'
|
| 1184 |
+
);
|
| 1185 |
+
// In a real app, we would update the order status to "Aguardando Aprovação"
|
| 1186 |
+
}
|
| 1187 |
});
|
| 1188 |
+
});
|
| 1189 |
+
|
| 1190 |
+
// Register Receipt
|
| 1191 |
+
const registerReceiptBtn = document.getElementById('register-receipt-btn');
|
| 1192 |
+
|
| 1193 |
+
registerReceiptBtn.addEventListener('click', function() {
|
| 1194 |
+
Swal.fire({
|
| 1195 |
+
title: 'Registrar Recebimento',
|
| 1196 |
+
text: 'Deseja registrar o recebimento deste pedido?',
|
| 1197 |
+
icon: 'question',
|
| 1198 |
+
showCancelButton: true,
|
| 1199 |
+
confirmButtonColor: '#3085d6',
|
| 1200 |
+
cancelButtonColor: '#d33',
|
| 1201 |
+
confirmButtonText: 'Sim, registrar!',
|
| 1202 |
+
cancelButtonText: 'Cancelar'
|
| 1203 |
+
}).then((result) => {
|
| 1204 |
+
if (result.isConfirmed) {
|
| 1205 |
+
Swal.fire(
|
| 1206 |
+
'Registrado!',
|
| 1207 |
+
'O recebimento do pedido foi registrado com sucesso.',
|
| 1208 |
+
'success'
|
| 1209 |
+
);
|
| 1210 |
+
// In a real app, we would update the order status to "Recebido Parcial" or "Recebido Total"
|
| 1211 |
+
}
|
| 1212 |
});
|
| 1213 |
+
});
|
| 1214 |
+
|
| 1215 |
+
// Print Order
|
| 1216 |
+
const printOrderBtn = document.getElementById('print-order-btn');
|
| 1217 |
+
const printButtons = document.querySelectorAll('.print-btn');
|
| 1218 |
+
|
| 1219 |
+
function showPrintConfirmation() {
|
| 1220 |
+
Swal.fire({
|
| 1221 |
+
title: 'Imprimir Pedido',
|
| 1222 |
+
text: 'Preparando o pedido para impressão...',
|
| 1223 |
+
icon: 'info',
|
| 1224 |
+
timer: 1500,
|
| 1225 |
+
showConfirmButton: false
|
| 1226 |
});
|
| 1227 |
+
}
|
| 1228 |
+
|
| 1229 |
+
printOrderBtn.addEventListener('click', showPrintConfirmation);
|
| 1230 |
+
|
| 1231 |
+
printButtons.forEach(button => {
|
| 1232 |
+
button.addEventListener('click', showPrintConfirmation);
|
| 1233 |
+
});
|
| 1234 |
+
|
| 1235 |
+
// Remove Item Confirmation
|
| 1236 |
+
const removeItemBtns = document.querySelectorAll('.remove-item-btn');
|
| 1237 |
+
|
| 1238 |
+
removeItemBtns.forEach(button => {
|
| 1239 |
+
button.addEventListener('click', function() {
|
| 1240 |
Swal.fire({
|
| 1241 |
+
title: 'Remover Item',
|
| 1242 |
+
text: 'Tem certeza que deseja remover este item do pedido?',
|
| 1243 |
icon: 'warning',
|
| 1244 |
showCancelButton: true,
|
| 1245 |
confirmButtonColor: '#d33',
|
| 1246 |
cancelButtonColor: '#3085d6',
|
| 1247 |
+
confirmButtonText: 'Sim, remover!',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1248 |
cancelButtonText: 'Cancelar'
|
| 1249 |
}).then((result) => {
|
| 1250 |
if (result.isConfirmed) {
|
| 1251 |
Swal.fire(
|
| 1252 |
+
'Removido!',
|
| 1253 |
+
'O item foi removido do pedido com sucesso.',
|
| 1254 |
'success'
|
| 1255 |
);
|
| 1256 |
+
// In a real app, we would remove the item from the order
|
| 1257 |
}
|
| 1258 |
});
|
| 1259 |
});
|
| 1260 |
+
});
|
| 1261 |
+
|
| 1262 |
+
// Apply Filters
|
| 1263 |
+
document.getElementById('apply-filters').addEventListener('click', function() {
|
| 1264 |
+
// In a real app, we would filter the orders based on the selected filters
|
| 1265 |
+
Swal.fire({
|
| 1266 |
+
title: 'Filtros Aplicados',
|
| 1267 |
+
text: 'Os filtros foram aplicados com sucesso.',
|
| 1268 |
+
icon: 'success',
|
| 1269 |
+
timer: 1500,
|
| 1270 |
+
showConfirmButton: false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1271 |
});
|
| 1272 |
+
});
|
| 1273 |
+
|
| 1274 |
+
// Clear Filters
|
| 1275 |
+
document.getElementById('clear-filters').addEventListener('click', function() {
|
| 1276 |
+
document.getElementById('supplier-filter').value = '';
|
| 1277 |
+
document.getElementById('status-filter').value = '';
|
| 1278 |
+
document.getElementById('responsible-filter').value = '';
|
| 1279 |
+
document.getElementById('date-filter').value = '';
|
| 1280 |
|
| 1281 |
+
Swal.fire({
|
| 1282 |
+
title: 'Filtros Limpos',
|
| 1283 |
+
text: 'Todos os filtros foram resetados.',
|
| 1284 |
+
icon: 'info',
|
| 1285 |
+
timer: 1500,
|
| 1286 |
+
showConfirmButton: false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1287 |
});
|
| 1288 |
+
});
|
| 1289 |
+
|
| 1290 |
+
// Money format input
|
| 1291 |
+
document.querySelectorAll('.money').forEach(input => {
|
| 1292 |
+
input.addEventListener('input', function() {
|
| 1293 |
+
let value = this.value.replace(/\D/g, '');
|
| 1294 |
+
value = (value / 100).toFixed(2) + '';
|
| 1295 |
+
value = value.replace(".", ",");
|
| 1296 |
+
value = value.replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1.');
|
| 1297 |
+
this.value = 'R$ ' + value;
|
| 1298 |
});
|
| 1299 |
+
});
|
| 1300 |
+
</script>
|
| 1301 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=gallabs/tom-system-pedido-compra" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 1302 |
</html>
|
prompts.txt
CHANGED
|
@@ -1,2 +1,3 @@
|
|
| 1 |
Crie uma interface web responsiva para o gerenciamento de "Pedidos de Compra" utilizando HTML, CSS e JavaScript puro (ou Bootstrap 5, se preferir). A tela deve conter: - Título: "Pedidos de Compra" - Um botão para "Novo Pedido de Compra" - Uma tabela para listar os pedidos com as colunas: - Número do Pedido de Compra - Fornecedor - Responsável pela Compra - Data de Emissão - Data de Previsão de Entrega - Status do Pedido (Em Elaboração, Aguardando Aprovação, Aprovado, Enviado, Recebido Parcial, Recebido Total, Cancelado) - Valor Total - Ações (Visualizar, Editar, Cancelar, Imprimir) - Filtros por fornecedor, status, responsável e data. - Ao visualizar um pedido, abrir um modal ou tela de detalhe com: - Dados do Fornecedor, Responsável, Condições de Pagamento, Observações - Lista dos Itens do Pedido de Compra, colunas: - Produto (Nome) - Categoria do Produto - Quantidade Solicitada - Valor Unitário Negociado - Valor Total do Item - Quantidade Recebida - Status do Item (Pendente, Recebido, etc.) - Ações por item (Editar, Registrar Recebimento, Remover) - Botão para "Adicionar Item" - Botão para "Enviar para Aprovação" (habilitado apenas enquanto o status for "Em Elaboração") - Botão para "Registrar Recebimento" (parcial/total, conforme status) - Botão para "Cancelar Pedido" (com modal de confirmação) - Histórico de eventos/ações do pedido no final da tela - Confirmações e alertas devem usar modal estilo SweetAlert2. - Layout limpo, organizado, responsivo, com boas práticas de UX para facilitar o dia a dia de quem opera. - Utilize ícones modernos (FontAwesome ou Bootstrap Icons), cores suaves e espaçamento adequado. - Por favor, gere no modo dark (tema escuro), com um botão que alterne entre uma "meia lua, para dark" e "um sol, para modo light".
|
| 2 |
-
Por favor, no botão "+ Novo Pedido de Compra". Chame um Modal ou um OffCanvas (com 50% da página) para adicionar um novo "Pedido de Compra" direto desta página, sem precisar buscar num Orçamento. E onde está a engrenagem, mude para uma "meia lua" para o modo dark, e ao alternar para o modo light, alterne o botão para um "sol".
|
|
|
|
|
|
| 1 |
Crie uma interface web responsiva para o gerenciamento de "Pedidos de Compra" utilizando HTML, CSS e JavaScript puro (ou Bootstrap 5, se preferir). A tela deve conter: - Título: "Pedidos de Compra" - Um botão para "Novo Pedido de Compra" - Uma tabela para listar os pedidos com as colunas: - Número do Pedido de Compra - Fornecedor - Responsável pela Compra - Data de Emissão - Data de Previsão de Entrega - Status do Pedido (Em Elaboração, Aguardando Aprovação, Aprovado, Enviado, Recebido Parcial, Recebido Total, Cancelado) - Valor Total - Ações (Visualizar, Editar, Cancelar, Imprimir) - Filtros por fornecedor, status, responsável e data. - Ao visualizar um pedido, abrir um modal ou tela de detalhe com: - Dados do Fornecedor, Responsável, Condições de Pagamento, Observações - Lista dos Itens do Pedido de Compra, colunas: - Produto (Nome) - Categoria do Produto - Quantidade Solicitada - Valor Unitário Negociado - Valor Total do Item - Quantidade Recebida - Status do Item (Pendente, Recebido, etc.) - Ações por item (Editar, Registrar Recebimento, Remover) - Botão para "Adicionar Item" - Botão para "Enviar para Aprovação" (habilitado apenas enquanto o status for "Em Elaboração") - Botão para "Registrar Recebimento" (parcial/total, conforme status) - Botão para "Cancelar Pedido" (com modal de confirmação) - Histórico de eventos/ações do pedido no final da tela - Confirmações e alertas devem usar modal estilo SweetAlert2. - Layout limpo, organizado, responsivo, com boas práticas de UX para facilitar o dia a dia de quem opera. - Utilize ícones modernos (FontAwesome ou Bootstrap Icons), cores suaves e espaçamento adequado. - Por favor, gere no modo dark (tema escuro), com um botão que alterne entre uma "meia lua, para dark" e "um sol, para modo light".
|
| 2 |
+
Por favor, no botão "+ Novo Pedido de Compra". Chame um Modal ou um OffCanvas (com 50% da página) para adicionar um novo "Pedido de Compra" direto desta página, sem precisar buscar num Orçamento. E onde está a engrenagem, mude para uma "meia lua" para o modo dark, e ao alternar para o modo light, alterne o botão para um "sol".
|
| 3 |
+
Ponha um ícone (um sino) de notificação, com um badge indicando 6 notificações, e ao clicar, exiba as notificações num DropDown.
|