gallabs commited on
Commit
b8a6467
·
verified ·
1 Parent(s): 1d9bfef

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +874 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Tom System Pedido Compra
3
- emoji: 🦀
4
- colorFrom: blue
5
- colorTo: yellow
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: tom-system-pedido-compra
3
+ emoji: 🐳
4
+ colorFrom: green
5
+ colorTo: green
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,874 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="pt-BR" class="dark">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Pedidos de Compra</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
10
+ <style>
11
+ .status-em-elaboracao {
12
+ background-color: rgba(59, 130, 246, 0.2);
13
+ color: rgb(59, 130, 246);
14
+ }
15
+ .status-aguardando-aprovacao {
16
+ background-color: rgba(234, 179, 8, 0.2);
17
+ color: rgb(234, 179, 8);
18
+ }
19
+ .status-aprovado {
20
+ background-color: rgba(34, 197, 94, 0.2);
21
+ color: rgb(34, 197, 94);
22
+ }
23
+ .status-enviado {
24
+ background-color: rgba(168, 85, 247, 0.2);
25
+ color: rgb(168, 85, 247);
26
+ }
27
+ .status-recebido-parcial {
28
+ background-color: rgba(249, 115, 22, 0.2);
29
+ color: rgb(249, 115, 22);
30
+ }
31
+ .status-recebido-total {
32
+ background-color: rgba(16, 185, 129, 0.2);
33
+ color: rgb(16, 185, 129);
34
+ }
35
+ .status-cancelado {
36
+ background-color: rgba(239, 68, 68, 0.2);
37
+ color: rgb(239, 68, 68);
38
+ }
39
+
40
+ .item-status-pendente {
41
+ background-color: rgba(239, 68, 68, 0.2);
42
+ color: rgb(239, 68, 68);
43
+ }
44
+ .item-status-recebido {
45
+ background-color: rgba(16, 185, 129, 0.2);
46
+ color: rgb(16, 185, 129);
47
+ }
48
+ .item-status-parcial {
49
+ background-color: rgba(249, 115, 22, 0.2);
50
+ color: rgb(249, 115, 22);
51
+ }
52
+
53
+ .dark .modal-content {
54
+ background-color: #1f2937;
55
+ }
56
+
57
+ .modal-overlay {
58
+ position: fixed;
59
+ top: 0;
60
+ left: 0;
61
+ right: 0;
62
+ bottom: 0;
63
+ background-color: rgba(0, 0, 0, 0.7);
64
+ display: flex;
65
+ justify-content: center;
66
+ align-items: center;
67
+ z-index: 1000;
68
+ }
69
+
70
+ .modal-content {
71
+ background-color: white;
72
+ border-radius: 0.5rem;
73
+ width: 90%;
74
+ max-width: 1200px;
75
+ max-height: 90vh;
76
+ overflow-y: auto;
77
+ padding: 1.5rem;
78
+ }
79
+
80
+ @media (max-width: 768px) {
81
+ .responsive-table {
82
+ display: block;
83
+ overflow-x: auto;
84
+ white-space: nowrap;
85
+ }
86
+ }
87
+ </style>
88
+ </head>
89
+ <body class="dark:bg-gray-900 dark:text-gray-100 min-h-screen transition-colors duration-300">
90
+ <div class="container mx-auto px-4 py-8">
91
+ <!-- Header -->
92
+ <div class="flex flex-col md:flex-row justify-between items-start md:items-center mb-8 gap-4">
93
+ <div>
94
+ <h1 class="text-3xl font-bold">Pedidos de Compra</h1>
95
+ <p class="text-gray-500 dark:text-gray-400">Gerencie todos os pedidos de compra da sua empresa</p>
96
+ </div>
97
+ <div class="flex items-center gap-4">
98
+ <button id="theme-toggle" class="p-2 rounded-full bg-gray-200 dark:bg-gray-700">
99
+ <i class="fas fa-moon dark:hidden"></i>
100
+ <i class="fas fa-sun hidden dark:inline"></i>
101
+ </button>
102
+ <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">
103
+ <i class="fas fa-plus"></i> Novo Pedido de Compra
104
+ </button>
105
+ </div>
106
+ </div>
107
+
108
+ <!-- Filters -->
109
+ <div class="bg-gray-100 dark:bg-gray-800 p-4 rounded-lg mb-6">
110
+ <h2 class="text-lg font-semibold mb-4">Filtros</h2>
111
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
112
+ <div>
113
+ <label for="supplier-filter" class="block text-sm font-medium mb-1">Fornecedor</label>
114
+ <select id="supplier-filter" class="w-full p-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600">
115
+ <option value="">Todos</option>
116
+ <option value="1">Fornecedor A</option>
117
+ <option value="2">Fornecedor B</option>
118
+ <option value="3">Fornecedor C</option>
119
+ </select>
120
+ </div>
121
+ <div>
122
+ <label for="status-filter" class="block text-sm font-medium mb-1">Status</label>
123
+ <select id="status-filter" class="w-full p-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600">
124
+ <option value="">Todos</option>
125
+ <option value="Em Elaboração">Em Elaboração</option>
126
+ <option value="Aguardando Aprovação">Aguardando Aprovação</option>
127
+ <option value="Aprovado">Aprovado</option>
128
+ <option value="Enviado">Enviado</option>
129
+ <option value="Recebido Parcial">Recebido Parcial</option>
130
+ <option value="Recebido Total">Recebido Total</option>
131
+ <option value="Cancelado">Cancelado</option>
132
+ </select>
133
+ </div>
134
+ <div>
135
+ <label for="responsible-filter" class="block text-sm font-medium mb-1">Responsável</label>
136
+ <select id="responsible-filter" class="w-full p-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600">
137
+ <option value="">Todos</option>
138
+ <option value="1">João Silva</option>
139
+ <option value="2">Maria Souza</option>
140
+ <option value="3">Carlos Oliveira</option>
141
+ </select>
142
+ </div>
143
+ <div>
144
+ <label for="date-filter" class="block text-sm font-medium mb-1">Período</label>
145
+ <input type="date" id="date-filter" class="w-full p-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600">
146
+ </div>
147
+ </div>
148
+ <div class="flex justify-end mt-4">
149
+ <button id="apply-filters" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg mr-2">
150
+ Aplicar Filtros
151
+ </button>
152
+ <button id="clear-filters" 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">
153
+ Limpar
154
+ </button>
155
+ </div>
156
+ </div>
157
+
158
+ <!-- Orders Table -->
159
+ <div class="bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden">
160
+ <div class="responsive-table">
161
+ <table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
162
+ <thead class="bg-gray-50 dark:bg-gray-700">
163
+ <tr>
164
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Número</th>
165
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Fornecedor</th>
166
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Responsável</th>
167
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Emissão</th>
168
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Previsão Entrega</th>
169
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Status</th>
170
+ <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>
171
+ <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>
172
+ </tr>
173
+ </thead>
174
+ <tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">
175
+ <!-- Sample Data -->
176
+ <tr>
177
+ <td class="px-6 py-4 whitespace-nowrap">PC-2023-001</td>
178
+ <td class="px-6 py-4 whitespace-nowrap">Fornecedor A</td>
179
+ <td class="px-6 py-4 whitespace-nowrap">João Silva</td>
180
+ <td class="px-6 py-4 whitespace-nowrap">10/05/2023</td>
181
+ <td class="px-6 py-4 whitespace-nowrap">25/05/2023</td>
182
+ <td class="px-6 py-4 whitespace-nowrap">
183
+ <span class="px-2 py-1 rounded-full text-xs font-semibold status-em-elaboracao">Em Elaboração</span>
184
+ </td>
185
+ <td class="px-6 py-4 whitespace-nowrap">R$ 1.250,00</td>
186
+ <td class="px-6 py-4 whitespace-nowrap">
187
+ <button class="view-btn text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 mr-2" data-id="1">
188
+ <i class="fas fa-eye"></i>
189
+ </button>
190
+ <button class="edit-btn text-yellow-600 hover:text-yellow-800 dark:text-yellow-400 dark:hover:text-yellow-300 mr-2" data-id="1">
191
+ <i class="fas fa-edit"></i>
192
+ </button>
193
+ <button class="cancel-btn text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300 mr-2" data-id="1">
194
+ <i class="fas fa-times-circle"></i>
195
+ </button>
196
+ <button class="print-btn text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-300" data-id="1">
197
+ <i class="fas fa-print"></i>
198
+ </button>
199
+ </td>
200
+ </tr>
201
+ <tr>
202
+ <td class="px-6 py-4 whitespace-nowrap">PC-2023-002</td>
203
+ <td class="px-6 py-4 whitespace-nowrap">Fornecedor B</td>
204
+ <td class="px-6 py-4 whitespace-nowrap">Maria Souza</td>
205
+ <td class="px-6 py-4 whitespace-nowrap">12/05/2023</td>
206
+ <td class="px-6 py-4 whitespace-nowrap">30/05/2023</td>
207
+ <td class="px-6 py-4 whitespace-nowrap">
208
+ <span class="px-2 py-1 rounded-full text-xs font-semibold status-aguardando-aprovacao">Aguardando Aprovação</span>
209
+ </td>
210
+ <td class="px-6 py-4 whitespace-nowrap">R$ 3.420,00</td>
211
+ <td class="px-6 py-4 whitespace-nowrap">
212
+ <button class="view-btn text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 mr-2" data-id="2">
213
+ <i class="fas fa-eye"></i>
214
+ </button>
215
+ <button class="edit-btn text-yellow-600 hover:text-yellow-800 dark:text-yellow-400 dark:hover:text-yellow-300 mr-2" data-id="2">
216
+ <i class="fas fa-edit"></i>
217
+ </button>
218
+ <button class="cancel-btn text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300 mr-2" data-id="2">
219
+ <i class="fas fa-times-circle"></i>
220
+ </button>
221
+ <button class="print-btn text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-300" data-id="2">
222
+ <i class="fas fa-print"></i>
223
+ </button>
224
+ </td>
225
+ </tr>
226
+ <tr>
227
+ <td class="px-6 py-4 whitespace-nowrap">PC-2023-003</td>
228
+ <td class="px-6 py-4 whitespace-nowrap">Fornecedor C</td>
229
+ <td class="px-6 py-4 whitespace-nowrap">Carlos Oliveira</td>
230
+ <td class="px-6 py-4 whitespace-nowrap">15/05/2023</td>
231
+ <td class="px-6 py-4 whitespace-nowrap">05/06/2023</td>
232
+ <td class="px-6 py-4 whitespace-nowrap">
233
+ <span class="px-2 py-1 rounded-full text-xs font-semibold status-aprovado">Aprovado</span>
234
+ </td>
235
+ <td class="px-6 py-4 whitespace-nowrap">R$ 2.150,00</td>
236
+ <td class="px-6 py-4 whitespace-nowrap">
237
+ <button class="view-btn text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 mr-2" data-id="3">
238
+ <i class="fas fa-eye"></i>
239
+ </button>
240
+ <button class="edit-btn text-yellow-600 hover:text-yellow-800 dark:text-yellow-400 dark:hover:text-yellow-300 mr-2" data-id="3">
241
+ <i class="fas fa-edit"></i>
242
+ </button>
243
+ <button class="cancel-btn text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300 mr-2" data-id="3">
244
+ <i class="fas fa-times-circle"></i>
245
+ </button>
246
+ <button class="print-btn text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-300" data-id="3">
247
+ <i class="fas fa-print"></i>
248
+ </button>
249
+ </td>
250
+ </tr>
251
+ <tr>
252
+ <td class="px-6 py-4 whitespace-nowrap">PC-2023-004</td>
253
+ <td class="px-6 py-4 whitespace-nowrap">Fornecedor A</td>
254
+ <td class="px-6 py-4 whitespace-nowrap">João Silva</td>
255
+ <td class="px-6 py-4 whitespace-nowrap">18/05/2023</td>
256
+ <td class="px-6 py-4 whitespace-nowrap">10/06/2023</td>
257
+ <td class="px-6 py-4 whitespace-nowrap">
258
+ <span class="px-2 py-1 rounded-full text-xs font-semibold status-enviado">Enviado</span>
259
+ </td>
260
+ <td class="px-6 py-4 whitespace-nowrap">R$ 4.750,00</td>
261
+ <td class="px-6 py-4 whitespace-nowrap">
262
+ <button class="view-btn text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 mr-2" data-id="4">
263
+ <i class="fas fa-eye"></i>
264
+ </button>
265
+ <button class="edit-btn text-yellow-600 hover:text-yellow-800 dark:text-yellow-400 dark:hover:text-yellow-300 mr-2" data-id="4">
266
+ <i class="fas fa-edit"></i>
267
+ </button>
268
+ <button class="cancel-btn text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300 mr-2" data-id="4">
269
+ <i class="fas fa-times-circle"></i>
270
+ </button>
271
+ <button class="print-btn text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-300" data-id="4">
272
+ <i class="fas fa-print"></i>
273
+ </button>
274
+ </td>
275
+ </tr>
276
+ <tr>
277
+ <td class="px-6 py-4 whitespace-nowrap">PC-2023-005</td>
278
+ <td class="px-6 py-4 whitespace-nowrap">Fornecedor B</td>
279
+ <td class="px-6 py-4 whitespace-nowrap">Maria Souza</td>
280
+ <td class="px-6 py-4 whitespace-nowrap">20/05/2023</td>
281
+ <td class="px-6 py-4 whitespace-nowrap">15/06/2023</td>
282
+ <td class="px-6 py-4 whitespace-nowrap">
283
+ <span class="px-2 py-1 rounded-full text-xs font-semibold status-recebido-parcial">Recebido Parcial</span>
284
+ </td>
285
+ <td class="px-6 py-4 whitespace-nowrap">R$ 5.300,00</td>
286
+ <td class="px-6 py-4 whitespace-nowrap">
287
+ <button class="view-btn text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 mr-2" data-id="5">
288
+ <i class="fas fa-eye"></i>
289
+ </button>
290
+ <button class="edit-btn text-yellow-600 hover:text-yellow-800 dark:text-yellow-400 dark:hover:text-yellow-300 mr-2" data-id="5">
291
+ <i class="fas fa-edit"></i>
292
+ </button>
293
+ <button class="cancel-btn text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300 mr-2" data-id="5">
294
+ <i class="fas fa-times-circle"></i>
295
+ </button>
296
+ <button class="print-btn text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-300" data-id="5">
297
+ <i class="fas fa-print"></i>
298
+ </button>
299
+ </td>
300
+ </tr>
301
+ </tbody>
302
+ </table>
303
+ </div>
304
+ </div>
305
+
306
+ <!-- Pagination -->
307
+ <div class="flex justify-between items-center mt-6">
308
+ <div class="text-sm text-gray-500 dark:text-gray-400">
309
+ Mostrando 1 a 5 de 15 registros
310
+ </div>
311
+ <div class="flex gap-1">
312
+ <button class="px-3 py-1 rounded-lg bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300">
313
+ <i class="fas fa-angle-left"></i>
314
+ </button>
315
+ <button class="px-3 py-1 rounded-lg bg-blue-600 text-white">1</button>
316
+ <button class="px-3 py-1 rounded-lg bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-600">2</button>
317
+ <button class="px-3 py-1 rounded-lg bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-600">3</button>
318
+ <button class="px-3 py-1 rounded-lg bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300">
319
+ <i class="fas fa-angle-right"></i>
320
+ </button>
321
+ </div>
322
+ </div>
323
+ </div>
324
+
325
+ <!-- Order Detail Modal -->
326
+ <div id="order-detail-modal" class="modal-overlay hidden">
327
+ <div class="modal-content">
328
+ <div class="flex justify-between items-center mb-6">
329
+ <h2 class="text-2xl font-bold">Detalhes do Pedido de Compra</h2>
330
+ <button id="close-modal" class="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200">
331
+ <i class="fas fa-times text-2xl"></i>
332
+ </button>
333
+ </div>
334
+
335
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
336
+ <div class="bg-gray-100 dark:bg-gray-700 p-4 rounded-lg">
337
+ <h3 class="text-lg font-semibold mb-4">Dados do Pedido</h3>
338
+ <div class="space-y-3">
339
+ <div>
340
+ <p class="text-sm text-gray-500 dark:text-gray-400">Número do Pedido</p>
341
+ <p class="font-medium" id="order-number">PC-2023-001</p>
342
+ </div>
343
+ <div>
344
+ <p class="text-sm text-gray-500 dark:text-gray-400">Status</p>
345
+ <p class="font-medium"><span class="px-2 py-1 rounded-full text-xs font-semibold status-em-elaboracao" id="order-status">Em Elaboração</span></p>
346
+ </div>
347
+ <div>
348
+ <p class="text-sm text-gray-500 dark:text-gray-400">Data de Emissão</p>
349
+ <p class="font-medium" id="order-date">10/05/2023</p>
350
+ </div>
351
+ <div>
352
+ <p class="text-sm text-gray-500 dark:text-gray-400">Previsão de Entrega</p>
353
+ <p class="font-medium" id="order-delivery-date">25/05/2023</p>
354
+ </div>
355
+ </div>
356
+ </div>
357
+
358
+ <div class="bg-gray-100 dark:bg-gray-700 p-4 rounded-lg">
359
+ <h3 class="text-lg font-semibold mb-4">Dados do Fornecedor</h3>
360
+ <div class="space-y-3">
361
+ <div>
362
+ <p class="text-sm text-gray-500 dark:text-gray-400">Fornecedor</p>
363
+ <p class="font-medium" id="supplier-name">Fornecedor A</p>
364
+ </div>
365
+ <div>
366
+ <p class="text-sm text-gray-500 dark:text-gray-400">CNPJ</p>
367
+ <p class="font-medium" id="supplier-cnpj">12.345.678/0001-90</p>
368
+ </div>
369
+ <div>
370
+ <p class="text-sm text-gray-500 dark:text-gray-400">Contato</p>
371
+ <p class="font-medium" id="supplier-contact">[email protected]</p>
372
+ </div>
373
+ </div>
374
+ </div>
375
+
376
+ <div class="bg-gray-100 dark:bg-gray-700 p-4 rounded-lg">
377
+ <h3 class="text-lg font-semibold mb-4">Dados da Compra</h3>
378
+ <div class="space-y-3">
379
+ <div>
380
+ <p class="text-sm text-gray-500 dark:text-gray-400">Responsável</p>
381
+ <p class="font-medium" id="responsible-name">João Silva</p>
382
+ </div>
383
+ <div>
384
+ <p class="text-sm text-gray-500 dark:text-gray-400">Condição de Pagamento</p>
385
+ <p class="font-medium" id="payment-terms">30/60/90 dias</p>
386
+ </div>
387
+ <div>
388
+ <p class="text-sm text-gray-500 dark:text-gray-400">Valor Total</p>
389
+ <p class="font-medium" id="order-total">R$ 1.250,00</p>
390
+ </div>
391
+ </div>
392
+ </div>
393
+
394
+ <div class="bg-gray-100 dark:bg-gray-700 p-4 rounded-lg">
395
+ <h3 class="text-lg font-semibold mb-4">Observações</h3>
396
+ <p class="text-sm" id="order-notes">Pedido com prioridade máxima. Favor confirmar disponibilidade antes do envio.</p>
397
+ </div>
398
+ </div>
399
+
400
+ <!-- Items Table -->
401
+ <div class="mb-8">
402
+ <div class="flex justify-between items-center mb-4">
403
+ <h3 class="text-lg font-semibold">Itens do Pedido</h3>
404
+ <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">
405
+ <i class="fas fa-plus"></i> Adicionar Item
406
+ </button>
407
+ </div>
408
+
409
+ <div class="responsive-table">
410
+ <table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
411
+ <thead class="bg-gray-50 dark:bg-gray-700">
412
+ <tr>
413
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Produto</th>
414
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Categoria</th>
415
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Quantidade</th>
416
+ <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>
417
+ <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>
418
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Recebido</th>
419
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Status</th>
420
+ <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>
421
+ </tr>
422
+ </thead>
423
+ <tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">
424
+ <tr>
425
+ <td class="px-6 py-4 whitespace-nowrap">Produto X</td>
426
+ <td class="px-6 py-4 whitespace-nowrap">Eletrônicos</td>
427
+ <td class="px-6 py-4 whitespace-nowrap">5</td>
428
+ <td class="px-6 py-4 whitespace-nowrap">R$ 150,00</td>
429
+ <td class="px-6 py-4 whitespace-nowrap">R$ 750,00</td>
430
+ <td class="px-6 py-4 whitespace-nowrap">0</td>
431
+ <td class="px-6 py-4 whitespace-nowrap">
432
+ <span class="px-2 py-1 rounded-full text-xs font-semibold item-status-pendente">Pendente</span>
433
+ </td>
434
+ <td class="px-6 py-4 whitespace-nowrap">
435
+ <button class="edit-item-btn text-yellow-600 hover:text-yellow-800 dark:text-yellow-400 dark:hover:text-yellow-300 mr-2">
436
+ <i class="fas fa-edit"></i>
437
+ </button>
438
+ <button class="receive-item-btn text-green-600 hover:text-green-800 dark:text-green-400 dark:hover:text-green-300 mr-2">
439
+ <i class="fas fa-check-circle"></i>
440
+ </button>
441
+ <button class="remove-item-btn text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300">
442
+ <i class="fas fa-trash"></i>
443
+ </button>
444
+ </td>
445
+ </tr>
446
+ <tr>
447
+ <td class="px-6 py-4 whitespace-nowrap">Produto Y</td>
448
+ <td class="px-6 py-4 whitespace-nowrap">Móveis</td>
449
+ <td class="px-6 py-4 whitespace-nowrap">2</td>
450
+ <td class="px-6 py-4 whitespace-nowrap">R$ 250,00</td>
451
+ <td class="px-6 py-4 whitespace-nowrap">R$ 500,00</td>
452
+ <td class="px-6 py-4 whitespace-nowrap">0</td>
453
+ <td class="px-6 py-4 whitespace-nowrap">
454
+ <span class="px-2 py-1 rounded-full text-xs font-semibold item-status-pendente">Pendente</span>
455
+ </td>
456
+ <td class="px-6 py-4 whitespace-nowrap">
457
+ <button class="edit-item-btn text-yellow-600 hover:text-yellow-800 dark:text-yellow-400 dark:hover:text-yellow-300 mr-2">
458
+ <i class="fas fa-edit"></i>
459
+ </button>
460
+ <button class="receive-item-btn text-green-600 hover:text-green-800 dark:text-green-400 dark:hover:text-green-300 mr-2">
461
+ <i class="fas fa-check-circle"></i>
462
+ </button>
463
+ <button class="remove-item-btn text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300">
464
+ <i class="fas fa-trash"></i>
465
+ </button>
466
+ </td>
467
+ </tr>
468
+ </tbody>
469
+ </table>
470
+ </div>
471
+ </div>
472
+
473
+ <!-- Order Actions -->
474
+ <div class="flex flex-wrap gap-3 mb-8">
475
+ <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">
476
+ <i class="fas fa-paper-plane"></i> Enviar para Aprovação
477
+ </button>
478
+ <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">
479
+ <i class="fas fa-check-double"></i> Registrar Recebimento
480
+ </button>
481
+ <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">
482
+ <i class="fas fa-times"></i> Cancelar Pedido
483
+ </button>
484
+ <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">
485
+ <i class="fas fa-print"></i> Imprimir Pedido
486
+ </button>
487
+ </div>
488
+
489
+ <!-- History -->
490
+ <div>
491
+ <h3 class="text-lg font-semibold mb-4">Histórico do Pedido</h3>
492
+ <div class="space-y-4">
493
+ <div class="border-l-4 border-blue-500 pl-4 py-2">
494
+ <div class="flex justify-between">
495
+ <p class="font-medium">Pedido criado</p>
496
+ <p class="text-sm text-gray-500 dark:text-gray-400">10/05/2023 09:15</p>
497
+ </div>
498
+ <p class="text-sm">Por: João Silva</p>
499
+ </div>
500
+ <div class="border-l-4 border-blue-500 pl-4 py-2">
501
+ <div class="flex justify-between">
502
+ <p class="font-medium">Item adicionado</p>
503
+ <p class="text-sm text-gray-500 dark:text-gray-400">10/05/2023 09:20</p>
504
+ </div>
505
+ <p class="text-sm">Produto X - Quantidade: 5 - Valor: R$ 750,00</p>
506
+ <p class="text-sm">Por: João Silva</p>
507
+ </div>
508
+ <div class="border-l-4 border-blue-500 pl-4 py-2">
509
+ <div class="flex justify-between">
510
+ <p class="font-medium">Item adicionado</p>
511
+ <p class="text-sm text-gray-500 dark:text-gray-400">10/05/2023 09:25</p>
512
+ </div>
513
+ <p class="text-sm">Produto Y - Quantidade: 2 - Valor: R$ 500,00</p>
514
+ <p class="text-sm">Por: João Silva</p>
515
+ </div>
516
+ </div>
517
+ </div>
518
+ </div>
519
+ </div>
520
+
521
+ <!-- Add Item Modal -->
522
+ <div id="add-item-modal" class="modal-overlay hidden">
523
+ <div class="modal-content max-w-md">
524
+ <div class="flex justify-between items-center mb-6">
525
+ <h2 class="text-2xl font-bold">Adicionar Item</h2>
526
+ <button id="close-add-item-modal" class="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200">
527
+ <i class="fas fa-times text-2xl"></i>
528
+ </button>
529
+ </div>
530
+
531
+ <form id="add-item-form" class="space-y-4">
532
+ <div>
533
+ <label for="product-select" class="block text-sm font-medium mb-1">Produto</label>
534
+ <select id="product-select" class="w-full p-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600" required>
535
+ <option value="">Selecione um produto</option>
536
+ <option value="1">Produto X</option>
537
+ <option value="2">Produto Y</option>
538
+ <option value="3">Produto Z</option>
539
+ </select>
540
+ </div>
541
+
542
+ <div>
543
+ <label for="item-quantity" class="block text-sm font-medium mb-1">Quantidade</label>
544
+ <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>
545
+ </div>
546
+
547
+ <div>
548
+ <label for="item-unit-price" class="block text-sm font-medium mb-1">Valor Unitário</label>
549
+ <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>
550
+ </div>
551
+
552
+ <div class="flex justify-end gap-3 pt-4">
553
+ <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">
554
+ Cancelar
555
+ </button>
556
+ <button type="submit" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg">
557
+ Adicionar Item
558
+ </button>
559
+ </div>
560
+ </form>
561
+ </div>
562
+ </div>
563
+
564
+ <!-- Receive Item Modal -->
565
+ <div id="receive-item-modal" class="modal-overlay hidden">
566
+ <div class="modal-content max-w-md">
567
+ <div class="flex justify-between items-center mb-6">
568
+ <h2 class="text-2xl font-bold">Registrar Recebimento</h2>
569
+ <button id="close-receive-item-modal" class="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200">
570
+ <i class="fas fa-times text-2xl"></i>
571
+ </button>
572
+ </div>
573
+
574
+ <form id="receive-item-form" class="space-y-4">
575
+ <div>
576
+ <p class="text-sm font-medium mb-1">Produto</p>
577
+ <p class="font-medium" id="receive-product-name">Produto X</p>
578
+ </div>
579
+
580
+ <div class="grid grid-cols-2 gap-4">
581
+ <div>
582
+ <p class="text-sm font-medium mb-1">Quantidade Solicitada</p>
583
+ <p class="font-medium" id="receive-requested-quantity">5</p>
584
+ </div>
585
+ <div>
586
+ <p class="text-sm font-medium mb-1">Quantidade Pendente</p>
587
+ <p class="font-medium" id="receive-pending-quantity">5</p>
588
+ </div>
589
+ </div>
590
+
591
+ <div>
592
+ <label for="received-quantity" class="block text-sm font-medium mb-1">Quantidade Recebida</label>
593
+ <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>
594
+ </div>
595
+
596
+ <div>
597
+ <label for="receipt-date" class="block text-sm font-medium mb-1">Data do Recebimento</label>
598
+ <input type="date" id="receipt-date" class="w-full p-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600" required>
599
+ </div>
600
+
601
+ <div>
602
+ <label for="receipt-notes" class="block text-sm font-medium mb-1">Observações</label>
603
+ <textarea id="receipt-notes" rows="3" class="w-full p-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600"></textarea>
604
+ </div>
605
+
606
+ <div class="flex justify-end gap-3 pt-4">
607
+ <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">
608
+ Cancelar
609
+ </button>
610
+ <button type="submit" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg">
611
+ Registrar Recebimento
612
+ </button>
613
+ </div>
614
+ </form>
615
+ </div>
616
+ </div>
617
+
618
+ <script>
619
+ // Theme Toggle
620
+ document.getElementById('theme-toggle').addEventListener('click', function() {
621
+ document.documentElement.classList.toggle('dark');
622
+ localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light');
623
+ });
624
+
625
+ // Check for saved theme preference
626
+ if (localStorage.getItem('theme') === 'light') {
627
+ document.documentElement.classList.remove('dark');
628
+ }
629
+
630
+ // Order Detail Modal
631
+ const viewButtons = document.querySelectorAll('.view-btn');
632
+ const orderDetailModal = document.getElementById('order-detail-modal');
633
+ const closeModal = document.getElementById('close-modal');
634
+
635
+ viewButtons.forEach(button => {
636
+ button.addEventListener('click', function() {
637
+ const orderId = this.getAttribute('data-id');
638
+ // In a real app, we would fetch order details based on orderId
639
+ orderDetailModal.classList.remove('hidden');
640
+ document.body.style.overflow = 'hidden';
641
+ });
642
+ });
643
+
644
+ closeModal.addEventListener('click', function() {
645
+ orderDetailModal.classList.add('hidden');
646
+ document.body.style.overflow = 'auto';
647
+ });
648
+
649
+ // Add Item Modal
650
+ const addItemBtn = document.getElementById('add-item-btn');
651
+ const addItemModal = document.getElementById('add-item-modal');
652
+ const closeAddItemModal = document.getElementById('close-add-item-modal');
653
+ const cancelAddItem = document.getElementById('cancel-add-item');
654
+
655
+ addItemBtn.addEventListener('click', function() {
656
+ addItemModal.classList.remove('hidden');
657
+ document.body.style.overflow = 'hidden';
658
+ });
659
+
660
+ closeAddItemModal.addEventListener('click', function() {
661
+ addItemModal.classList.add('hidden');
662
+ document.body.style.overflow = 'auto';
663
+ });
664
+
665
+ cancelAddItem.addEventListener('click', function() {
666
+ addItemModal.classList.add('hidden');
667
+ document.body.style.overflow = 'auto';
668
+ });
669
+
670
+ // Receive Item Modal
671
+ const receiveItemBtns = document.querySelectorAll('.receive-item-btn');
672
+ const receiveItemModal = document.getElementById('receive-item-modal');
673
+ const closeReceiveItemModal = document.getElementById('close-receive-item-modal');
674
+ const cancelReceiveItem = document.getElementById('cancel-receive-item');
675
+
676
+ receiveItemBtns.forEach(button => {
677
+ button.addEventListener('click', function() {
678
+ receiveItemModal.classList.remove('hidden');
679
+ document.body.style.overflow = 'hidden';
680
+ });
681
+ });
682
+
683
+ closeReceiveItemModal.addEventListener('click', function() {
684
+ receiveItemModal.classList.add('hidden');
685
+ document.body.style.overflow = 'auto';
686
+ });
687
+
688
+ cancelReceiveItem.addEventListener('click', function() {
689
+ receiveItemModal.classList.add('hidden');
690
+ document.body.style.overflow = 'auto';
691
+ });
692
+
693
+ // Cancel Order Confirmation
694
+ const cancelOrderBtn = document.getElementById('cancel-order-btn');
695
+ const cancelButtons = document.querySelectorAll('.cancel-btn');
696
+
697
+ function showCancelConfirmation() {
698
+ Swal.fire({
699
+ title: 'Cancelar Pedido',
700
+ text: 'Tem certeza que deseja cancelar este pedido? Esta ação não pode ser desfeita.',
701
+ icon: 'warning',
702
+ showCancelButton: true,
703
+ confirmButtonColor: '#d33',
704
+ cancelButtonColor: '#3085d6',
705
+ confirmButtonText: 'Sim, cancelar!',
706
+ cancelButtonText: 'Não, manter'
707
+ }).then((result) => {
708
+ if (result.isConfirmed) {
709
+ Swal.fire(
710
+ 'Cancelado!',
711
+ 'O pedido foi cancelado com sucesso.',
712
+ 'success'
713
+ );
714
+ // In a real app, we would update the order status to "Cancelado"
715
+ }
716
+ });
717
+ }
718
+
719
+ cancelOrderBtn.addEventListener('click', showCancelConfirmation);
720
+
721
+ cancelButtons.forEach(button => {
722
+ button.addEventListener('click', showCancelConfirmation);
723
+ });
724
+
725
+ // Send for Approval
726
+ const sendApprovalBtn = document.getElementById('send-approval-btn');
727
+
728
+ sendApprovalBtn.addEventListener('click', function() {
729
+ Swal.fire({
730
+ title: 'Enviar para Aprovação',
731
+ text: 'Deseja enviar este pedido para aprovação?',
732
+ icon: 'question',
733
+ showCancelButton: true,
734
+ confirmButtonColor: '#3085d6',
735
+ cancelButtonColor: '#d33',
736
+ confirmButtonText: 'Sim, enviar!',
737
+ cancelButtonText: 'Cancelar'
738
+ }).then((result) => {
739
+ if (result.isConfirmed) {
740
+ Swal.fire(
741
+ 'Enviado!',
742
+ 'O pedido foi enviado para aprovação com sucesso.',
743
+ 'success'
744
+ );
745
+ // In a real app, we would update the order status to "Aguardando Aprovação"
746
+ }
747
+ });
748
+ });
749
+
750
+ // Register Receipt
751
+ const registerReceiptBtn = document.getElementById('register-receipt-btn');
752
+
753
+ registerReceiptBtn.addEventListener('click', function() {
754
+ Swal.fire({
755
+ title: 'Registrar Recebimento',
756
+ text: 'Deseja registrar o recebimento deste pedido?',
757
+ icon: 'question',
758
+ showCancelButton: true,
759
+ confirmButtonColor: '#3085d6',
760
+ cancelButtonColor: '#d33',
761
+ confirmButtonText: 'Sim, registrar!',
762
+ cancelButtonText: 'Cancelar'
763
+ }).then((result) => {
764
+ if (result.isConfirmed) {
765
+ Swal.fire(
766
+ 'Registrado!',
767
+ 'O recebimento do pedido foi registrado com sucesso.',
768
+ 'success'
769
+ );
770
+ // In a real app, we would update the order status to "Recebido Parcial" or "Recebido Total"
771
+ }
772
+ });
773
+ });
774
+
775
+ // Print Order
776
+ const printOrderBtn = document.getElementById('print-order-btn');
777
+ const printButtons = document.querySelectorAll('.print-btn');
778
+
779
+ function showPrintConfirmation() {
780
+ Swal.fire({
781
+ title: 'Imprimir Pedido',
782
+ text: 'Preparando o pedido para impressão...',
783
+ icon: 'info',
784
+ timer: 1500,
785
+ showConfirmButton: false
786
+ });
787
+ }
788
+
789
+ printOrderBtn.addEventListener('click', showPrintConfirmation);
790
+
791
+ printButtons.forEach(button => {
792
+ button.addEventListener('click', showPrintConfirmation);
793
+ });
794
+
795
+ // Remove Item Confirmation
796
+ const removeItemBtns = document.querySelectorAll('.remove-item-btn');
797
+
798
+ removeItemBtns.forEach(button => {
799
+ button.addEventListener('click', function() {
800
+ Swal.fire({
801
+ title: 'Remover Item',
802
+ text: 'Tem certeza que deseja remover este item do pedido?',
803
+ icon: 'warning',
804
+ showCancelButton: true,
805
+ confirmButtonColor: '#d33',
806
+ cancelButtonColor: '#3085d6',
807
+ confirmButtonText: 'Sim, remover!',
808
+ cancelButtonText: 'Cancelar'
809
+ }).then((result) => {
810
+ if (result.isConfirmed) {
811
+ Swal.fire(
812
+ 'Removido!',
813
+ 'O item foi removido do pedido com sucesso.',
814
+ 'success'
815
+ );
816
+ // In a real app, we would remove the item from the order
817
+ }
818
+ });
819
+ });
820
+ });
821
+
822
+ // Apply Filters
823
+ document.getElementById('apply-filters').addEventListener('click', function() {
824
+ // In a real app, we would filter the orders based on the selected filters
825
+ Swal.fire({
826
+ title: 'Filtros Aplicados',
827
+ text: 'Os filtros foram aplicados com sucesso.',
828
+ icon: 'success',
829
+ timer: 1500,
830
+ showConfirmButton: false
831
+ });
832
+ });
833
+
834
+ // Clear Filters
835
+ document.getElementById('clear-filters').addEventListener('click', function() {
836
+ document.getElementById('supplier-filter').value = '';
837
+ document.getElementById('status-filter').value = '';
838
+ document.getElementById('responsible-filter').value = '';
839
+ document.getElementById('date-filter').value = '';
840
+
841
+ Swal.fire({
842
+ title: 'Filtros Limpos',
843
+ text: 'Todos os filtros foram resetados.',
844
+ icon: 'info',
845
+ timer: 1500,
846
+ showConfirmButton: false
847
+ });
848
+ });
849
+
850
+ // New Order Button
851
+ document.getElementById('new-order-btn').addEventListener('click', function() {
852
+ Swal.fire({
853
+ title: 'Novo Pedido de Compra',
854
+ text: 'Redirecionando para a criação de novo pedido...',
855
+ icon: 'info',
856
+ timer: 1500,
857
+ showConfirmButton: false
858
+ });
859
+ // In a real app, we would redirect to a new order form
860
+ });
861
+
862
+ // Money format input
863
+ document.querySelectorAll('.money').forEach(input => {
864
+ input.addEventListener('input', function() {
865
+ let value = this.value.replace(/\D/g, '');
866
+ value = (value / 100).toFixed(2) + '';
867
+ value = value.replace(".", ",");
868
+ value = value.replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1.');
869
+ this.value = 'R$ ' + value;
870
+ });
871
+ });
872
+ </script>
873
+ <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>
874
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
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".