-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdespachos.html
426 lines (381 loc) · 22.9 KB
/
despachos.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Envios</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Signika:wght@300..700&family=Titan+One&display=swap" rel="stylesheet">
<!-- Bootstrap CSS -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="styles.css">
<link rel="shortcut icon" href="./Img/caja.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css">
</head>
<script>
// Verificación de sesión
function checkLogin() {
const savedTimestamp = localStorage.getItem('loginTimestamp');
const isExpired = !savedTimestamp || (Date.now() - savedTimestamp) > 10800000; // 3 horas
if (isExpired) {
window.location.href = 'logipaq.html'; // Redirige al login si la sesión ha expirado
}
}
// Ejecutar la verificación al cargar la página
checkLogin();
</script>
<body class="envios-body"> <strong></strong>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="#">
<img src="./Img/Novogar N.png" alt="Logo" class="navbar-logo">
<span class="navbar-brand-text">L<span class="navbar-brand-text4">gi</span><span class="navbar-brand-text2">Paq</span> <img class="blackCat" src="./Img/Location.gif" alt="LogiPaq" srcset=""> </span>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ml-auto">
<li class="nav-item"><a href="./index.html" class="nav-link">Etiquetas</a></li>
<li class="nav-item"><a href="./envios.html" class="nav-link">Andesmar</a></li>
<li class="nav-item"><a href="./despachos.html" class="nav-link active">Logistica</a></li>
<li class="nav-item"><a href="./facturacionMl.html" class="nav-link">Fact.</a></li>
<li class="nav-item"><a href="./meliAr.html" class="nav-link"><img id="meli-logo" src="./Img/meli.png">MeLi</a></li>
<li class="nav-item"><a href="./controlMeli.html" class="nav-link">Colecta</a></li>
<li class="nav-item"><a href="./bna.html" class="nav-link"><img id="meli-logo" src="./Img/bna-logo.png" alt="BNA Logo" /></a></li>
</ul>
</div>
</div>
</nav>
<div class="container mt-4">
<div class="row justify-content-between align-items-center search-filter-container">
<div class="col-md-6 mb-3">
<div class="input-group">
<input type="text" class="form-control" id="searchDespachosLogistica" placeholder="Buscar por cliente o Remito...">
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</div>
<div class="col-md-6 mb-3 d-flex justify-content-end ingreso-egreso trio-de-botones">
<button class="btn btn-dark" id="btnVolverAtras" type="button" title="Volver atrás" style="display: none;">
<i class="bi bi-arrow-return-left"></i>
</button>
<button class="btn btn-primary" id="ingresoBtn" data-toggle="modal" data-target="#ingresoModal">
<i class="bi bi-box-arrow-in-down"></i>
</button>
<!-- Botón para filtrar por antigüedad -->
<button class="btn btn-danger ml-2" id="filterOldestBtn" title="Filtrar por antigüedad">
<i class="bi bi-clock"></i>
</button>
<!-- Botón de Logística Propia -->
<button class="btn btn-secondary ml-2" id="logisticaPropiaBtn" data-toggle="modal" data-target="#logisticaModal">
<i class="bi bi-truck"></i> Local
</button>
<!-- Nuevo botón BsAr-StaFe -->
<button class="btn btn-info ml-2" id="bsarStaFeBtn" data-toggle="modal" data-target="#bsarStaFeModal">
<i class="bi bi-truck"></i> Interior
</button>
<!-- Botón para abrir el modal de escanear remito y adjuntar foto -->
<button class="btn btn-success ml-2" id="scanRemitoBtn" data-toggle="modal" data-target="#scanRemitoModal">
<i class="bi bi-camera2"></i>
</button>
<button class="btn btn-secondary ml-2" id="promedioBtn" title="Promedio Despacho: Xd Yh Zm">
<i class="bi bi-calculator"></i> Calculando Promedio...
</button>
</div>
</div>
</div>
<div class="container mt-5" id="cards-container">
<div class="spinner-border" role="status" id="spinner">
<span class="sr-only">Cargando...</span>
</div>
<div id="search-despachos" class="search-despachos"></div>
<div class="text-center">
<div id="porcentajes" class="d-flex flex-column flex-md-row justify-content-center align-items-center p-2">
<span class="percentage-card text-danger mx-2 col-12 col-md-auto d-flex flex-column align-items-center text-center" id="andreaniPorcentaje">
<i class="bi bi-truck-front" style="font-size: 1.5em;"></i>
<span class="ml-1">Calculando Andreani... <span id="andreaniValue"></span></span>
</span>
<span class="percentage-card text-primary mx-2 col-12 col-md-auto d-flex flex-column align-items-center text-center" id="andesmarPorcentaje">
<i class="bi bi-truck-front" style="font-size: 1.5em;"></i>
<span class="ml-1">Calculando Andesmar... <span id="andesmarValue"></span></span>
</span>
<span class="percentage-card text-secondary mx-2 col-12 col-md-auto d-flex flex-column align-items-center text-center" id="SinDespacharPorcentaje">
<i class="bi bi-stopwatch-fill" style="font-size: 1.5em;"></i>
<span class="ml-1">Calculando Sin Despachar... <span id="SinDespacharValue"></span></span>
</span>
</div>
</div>
<div class="table-responsive">
<table id="data-table" class="table table-striped">
<thead>
<tr>
<th><i class="bi bi-calendar-check-fill"></i> Fecha</th>
<th class="estado-column"><i class="bi bi-geo-alt-fill"></i> Estado</th>
<th><i class="bi bi-person-badge-fill"></i> Cliente</th>
<th><i class="bi bi-file-earmark-text-fill"></i> Remito</th>
<th><i class="bi bi-currency-dollar"></i> Valor</th>
<th><i class="bi bi-truck-front-fill"></i> Operador</th>
<th><i class="bi bi-trash-fill"></i></th>
<th><i class="bi bi-chat-dots-fill"></i></th>
</tr>
</thead>
<tbody>
<!-- Los datos se llenarán aquí dinámicamente -->
</tbody>
</table>
</div>
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center" id="pagination"></ul>
</nav>
</div>
</div>
<div class="modal fade" id="ingresoModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Ingreso de Datos Logísticos</h5>
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form id="ingresoForm">
<div class="form-group">
<label for="remito">Número de Remito</label>
<input type="text" class="form-control" id="remito" maxlength="11" placeholder="Ingrese el número de remito" autofocus>
</div>
<div class="form-group">
<label for="cliente">Número de Cliente</label>
<input type="text" class="form-control" id="cliente" maxlength="8" placeholder="Ingrese el número de cliente">
</div>
<div class="form-group">
<label for="valorDeclarado">Valor Declarado</label>
<input type="text" class="form-control" id="valorDeclarado" placeholder="Ingrese el valor declarado">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
</div>
</div>
</div>
</div>
<div id="spinner2" class="spinner-container" style="display:none;">
<div class="spinner"></div>
</div>
<!-- Modal para escanear remito y adjuntar foto -->
<div class="modal fade" id="scanRemitoModal" tabindex="-1" aria-labelledby="scanRemitoModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header bg-info text-white">
<h5 class="modal-title" id="scanRemitoModalLabel">Escanear Remito y Adjuntar Foto</h5>
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form id="scanRemitoForm">
<div class="form-group">
<label for="remitoInput">Número de Remito</label>
<input type="text" class="form-control" id="remitoInput" maxlength="11" placeholder="Ingrese el número de remito" autofocus>
</div>
<div class="form-group">
<label for="fotoRemitoInput">Adjuntar Foto del Remito</label>
<input type="file" class="form-control" id="fotoRemitoInput" accept="image/*" capture="camera">
</div>
<div id="logisticsAlert" class="Alert35 text-center mt-2" style="display: none;"></div>
<div id="loadingSpinner" class="spinner-border text-info custom-spinner33" role="status" style="display: none; width: 3rem; height: 3rem;">
<span class="sr-only">Cargando...</span>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
<button type="button" class="btn btn-info" onclick="subirFoto()">Subir Foto</button>
</div>
</div>
</div>
</div>
<!-- FIN Modal para escanear remito y adjuntar foto -->
<!-- Modal para Logística BsAr-StaFe -->
<div class="modal fade" id="bsarStaFeModal" tabindex="-1" aria-labelledby="bsarStaFeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header bg-info text-white">
<h5 class="modal-title" id="bsarStaFeModalLabel">Logística Propia BsAr-StaFe</h5>
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="d-flex justify-content-center mb-3">
<div class="btn-group btn-group-logistica" role="group" aria-label="Basic outlined example">
<button id="logisticaSanNicolasButton" class="btn btn-outline-primary" onclick="cargarDiaPredeterminado('SanNicolas')">
<i class="bi bi-lightning-charge-fill"></i> San Nicolás
</button>
<button id="logisticaBsAsButton" class="btn btn-outline-primary" onclick="cargarDiaPredeterminado('BsAs')">
<i class="bi bi-lightning-charge-fill"></i> Buenos Aires
</button>
<button id="logisticaRafaelaButton" class="btn btn-outline-primary" onclick="cargarDiaPredeterminado('Rafaela')">
<i class="bi bi-lightning-charge-fill"></i> Rafaela
</button>
<button id="logisticaSantaFeButton" class="btn btn-outline-primary" onclick="cargarDiaPredeterminado('StaFe')">
<i class="bi bi-lightning-charge-fill"></i> Santa Fe
</button>
</div>
</div>
<div id="diaEntregaAlert" class="Alert33 text-center" style="display: none;">
<i class="bi bi-info-circle-fill"></i> <span id="diaEntregaText"></span>
</div>
<form id="logisticaBsArStaFeForm">
<div class="form-group">
<label for="remitoLogisticaBsArStaFe">Número de Remito</label>
<input type="text" class="form-control" id="remitoLogisticaBsArStaFe" maxlength="11" placeholder="Ingrese el número de remito" autofocus>
</div>
<div class="alert alert-danger text-center" role="alert">
<i class="bi bi-exclamation-triangle-fill"></i> Escaneo de remitos con reparto Buenos Aires, Santa Fe, Rafaela o San Nicolás
</div>
</form>
<hr class="my-2">
<div class="btn-mc-os-Check">
<p class="mt-2 mb-1 text-center"><strong><i class="bi bi-info-circle-fill"></i> Sale en el camión de mañana</strong></p>
<div class="form-check form-switch apple-switch">
<input class="form-check-input" type="checkbox" id="camionCheckbox" checked>
</div>
</div>
<div class="d-flex justify-content-center mt-1">
<button type="button" class="btn btn-danger mt-3" id="unknownLogisticsButton" onclick="toggleLogisticsInput()">
<i class="bi bi-question-circle-fill"></i> No conozco la logística del código postal
</button>
</div>
<div id="logisticsInputContainer" style="display: none;">
<input type="text" class="form-control mt-2" id="logisticsCpInput" maxlength="4" placeholder="Ingrese el código postal">
<div id="logisticsAlert33" class="Alert34 text-center mt-2" style="display: none;"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
<button type="button" class="btn btn-info" id="confirmLogisticaBsArStaFeBtn" onclick="confirmarLogistica()">Confirmar</button>
</div>
</div>
</div>
</div>
<!-- Fin Modal para Logística BsAr-StaFe -->
<!-- Modal para Logística Propia -->
<div class="modal fade" id="logisticaModal" tabindex="-1" aria-labelledby="logisticaModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header bg-warning text-white">
<h5 class="modal-title" id="logisticaModalLabel">Logística Propia ROSARIO - Escanear Remito</h5>
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form id="logisticaForm">
<div class="form-group">
<label for="remitoLogistica">Número de Remito</label>
<input type="text" class="form-control" id="remitoLogistica" maxlength="11" placeholder="Ingrese el número de remito" autofocus>
</div>
<div class="alert-modal-logRosario">
<i class="bi bi-exclamation-triangle-fill"></i> Escaneo de remitos con reparto Rosario o Gran Rosario
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
<button type="button" class="btn btn-warning" id="confirmLogisticaBtn">Confirmar</button>
</div>
</div>
</div>
</div>
<!-- Modal Comentario -->
<div class="modal fade" id="comentarioModal" tabindex="-1" aria-labelledby="comentarioModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="comentarioModalLabel">Actualizar Comentario</h5>
<button type="button" class="btn-close btn-danger" data-bs-dismiss="modal" aria-label="Close">
<i class="bi bi-x-lg"></i>
</button>
</div>
<div class="modal-body">
<textarea id="comentarioInput" class="form-control" placeholder="Escribe tu comentario aquí..." rows="3" style="resize: none;"></textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cerrar</button>
<button type="button" class="btn btn-primary" id="guardarComentarioBtn">Guardar Comentario</button>
</div>
</div>
</div>
</div>
<!-- Fin Modal Comentario -->
<!-- Comentarios Alert -->
<div id="statusCard" class="card">
<div class="card-body">
<h5 class="card-title text-center">Estado de los Botones</h5>
<div class="d-flex justify-content-around mb-3">
<button class="btn btn-sm btn-secondary btn-timer">
<i class="bi bi-pencil"></i> Sin Comentario
</button>
<button class="btn btn-sm btn-success btn-timer">
<i class="bi bi-pencil"></i> Con Comentario
</button>
</div>
<p class="text-muted text-center">
<small>
<strong>Gris:</strong> Sin información.<br>
<strong>Verde:</strong> Con comentarios cargados.<br>
</small>
</p>
<div id="timer">Me cerraré en <span id="countdown">20</span> segundos</div>
<div class="text-center">
<button id="closeCard" class="btn btn-danger btn-sm">Cerrar</button>
</div>
</div>
</div>
<!-- Fin Comentarios Alert -->
<!-- Botón de flecha hacia arriba -->
<a href="#" id="scrollToTop" class="btn btn-warning" style="display: none;">
<i class="fas fa-arrow-up"></i>
</a>
<footer class="text-center">
<img class="logo-foot" src="./Img/Novogar N.png" alt="Logo Novogar">
<a class="www" href="https://novogar.com.ar/" target="_blank">NOVOGAR</a>
<a href="https://novogar.com.ar/info/empresa" target="_blank">Quienes somos</a>
<a href="https://novogar.com.ar/info/Sucursales" target="_blank">Sucursales</a>
<a href="https://novogar.com.ar/info/ventaTelefonica" target="_blank">Atención al cliente</a>
</footer>
<!-- Scripts Firebase-->
<script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-database.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-storage.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<!-- Scripts Bootstrap-->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.9.3/html2pdf.bundle.min.js"></script>
<!-- SweetAlert JS -->
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<!-- Cargar dompurify -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/2.3.4/purify.min.js"></script>
<!-- Cargar html2canvas -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
<!-- Cargar jsPDF -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<script src="./js/features.js"></script>
<script src="./js/ingreso.js"></script>
</body>
</html>