Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
Pruebas-RTO
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit b852e72b
authored
2024-07-31 13:00:16 -0300
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Empieso a cargar datos
1 parent
06ad8910
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
5 deletions
main.py
protected_static/buscador.js
protected_static/cargarapida.js
tareas
templates/form.html
main.py
View file @
b852e72
...
...
@@ -221,6 +221,18 @@ def anomalies():
return
render_template
(
"anomalies.html"
,
anomalies
=
anom
)
@app.route
(
'/planilla'
,
methods
=
[
'POST'
])
def
DevolverDatosTemporales
():
planilla
=
{
"error"
:
True
}
#######ALMASENO DATOS DE LA PLANILLA
try
:
d
=
request
.
json
planilla
=
PlanillasCentTMP
[
d
[
"planilla"
]]
planilla
[
"error"
]
=
False
except
Exception
as
E
:
print
(
f
"Error generando datos de planilla cent {E}"
)
return
json
.
dumps
(
planilla
)
@app.route
(
'/report_static'
,
methods
=
[
'POST'
,
'GET'
])
def
ReporteEstatico
():
planilla
=
"0"
...
...
protected_static/buscador.js
View file @
b852e72
...
...
@@ -80,10 +80,30 @@ function handleButtonClick(inspeccion) {
console
.
log
(
'Botón clicado para:'
,
inspeccion
);
// Por ejemplo, podrías redirigir a una página basada en el dominio de inspección
// window.location.href = `http://ejemplo.com/dominio/${inspeccion.name}`;
fetch
(
'/report_static'
,
{
method
:
'POST'
,
headers
:
{
'Content-Type'
:
'application/json'
},
body
:
JSON
.
stringify
(
inspeccion
)
})
.
then
(
response
=>
{
if
(
!
response
.
ok
)
{
throw
new
Error
(
'Network response was not ok'
);
}
return
response
.
json
();
})
.
then
(
data
=>
{
// Asume que el servidor devuelve una URL para la página generada
window
.
location
.
href
=
data
.
url
;
})
.
catch
(
error
=>
{
console
.
error
(
'There has been a problem with your fetch operation:'
,
error
);
});
}
async
function
fetchChat
()
{
const
MensajeDiv
=
document
.
getElementById
(
'DivMensajeFijo'
);
const
MensajeCaida
=
"Se perdio contacto con el server, revise conexcion a internet"
...
...
protected_static/cargarapida.js
View file @
b852e72
...
...
@@ -21,11 +21,56 @@ window.onload = function() {
}
};
function
isStatusActive
(
status
)
{
return
status
===
'Anulado'
||
status
===
'No Inspeccionado'
;
}
// Ejemplo de una función que utiliza el valor del parámetro
function
usePlanillaCentValue
(
planillaCentValue
)
{
// Aquí puedes implementar la lógica que desees con el valor
console
.
log
(
'Usando el valor de planilla_cent:'
,
planillaCentValue
);
// Por ejemplo, podrías hacer una solicitud a un servidor, mostrar un mensaje, etc.
fetch
(
'/planilla'
,
{
method
:
'POST'
,
headers
:
{
'Content-Type'
:
'application/json'
},
body
:
JSON
.
stringify
({
planilla
:
planillaCentValue
})
})
.
then
(
response
=>
{
if
(
!
response
.
ok
)
{
throw
new
Error
(
'Network response was not ok'
);
}
return
response
.
json
();
})
.
then
(
data
=>
{
// Asume que el servidor devuelve una URL para la página generada
//window.location.href = data.url;
llendoTentativo
(
data
)
})
.
catch
(
error
=>
{
console
.
log
(
'There has been a problem with your fetch operation:'
,
error
);
});
}
function
llendoTentativo
(
data
)
{
//console.log(data)
//const patenteField = document.querySelector('input[name="patente"]');
// Establece el valor del campo de entrada con data.name
console
.
log
(
data
.
name
)
const
patenteFields
=
document
.
querySelectorAll
(
'input[name="patente"]'
);
patenteFields
.
forEach
(
field
=>
{
field
.
value
=
data
.
name
;
});
if
(
isStatusActive
(
name
.
resultado
))
{
return
None
}
document
.
getElementById
(
"report"
).
style
.
display
=
"block"
;
document
.
getElementById
(
"form"
).
style
.
display
=
"none"
;
}
tareas
View file @
b852e72
...
...
@@ -6,5 +6,5 @@ Hay dos tipos de accesos inspeccionado y no inspeccionados
* Separa funcion report para reutilizar pasando datos externos
"No Inspeccionado" "Anulado"
templates/form.html
View file @
b852e72
...
...
@@ -180,10 +180,11 @@
</div>
-->
<div
class=
"PDFButtonContainerFixed"
style=
"bottom: 40%;"
>
<
button
class=
"PeligroButton"
style=
"bottom: 40%; display: {% if bypass %} none {% else %} block {% endif %};"
onclick=
"location.reload()
"
>
<
a
href=
"/"
>
<button
class=
"PeligroButton"
style=
"bottom: 40%; display: {% if bypass %} none {% else %} block {% endif %};
"
>
Volver
</button>
</a>
</div>
</div>
...
...
@@ -194,7 +195,7 @@
<div
id=
"form"
class=
"DataCard"
style=
"height: auto; display: {% if bypass %} none {% else %} block {% endif %};"
>
<h1>
Generación de PDF
</h1>
Patente
<input
required
type=
"text"
sub=
"header"
name=
"patente"
>
Patente
<input
required
type=
"text"
sub=
"header"
ide=
"patente"
name=
"patente"
>
<br>
<h1>
Datos de Suspensión
</h1>
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment