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 daa8f0c1
authored
10 months ago
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Base nueba version
1 parent
bbc6973c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
137 additions
and
17 deletions
configuracion.py
data/reportes.json
main.py
reportes.py
static/src/carbone.js
templates/form.html
test.txt
configuracion.py
View file @
daa8f0c
...
...
@@ -8,4 +8,7 @@ delataPositivoNegativo = "-"
ManualLogin
=
False
# PAra hacer pruebas sin tener que loguear
port
=
13000
codigo_cent
=
"50"
reporte_defecto
=
"repo.doc"
reporte_defecto
=
{
"2"
:
"repo_2j2s.doc"
,
"3"
:
"repo_3j2s.doc"
}
This diff is collapsed.
Click to expand it.
data/reportes.json
View file @
daa8f0c
{
"1"
:{
"N1"
:{
"2"
:
"
reporte_prueba
.doc"
,
"2"
:
"
ReportePruebaN1L1
.doc"
,
"3"
:
""
},
"M1"
:{
...
...
This diff is collapsed.
Click to expand it.
main.py
View file @
daa8f0c
...
...
@@ -216,6 +216,7 @@ def anomalies():
anom
[
'header'
][
'patente'
]
=
plate
anom
[
'header'
][
'fecha'
]
=
datetime
.
datetime
.
now
()
.
strftime
(
"
%
d/
%
m/
%
Y"
)
anom
[
'header'
][
"hora"
]
=
str
(
fingfd
)
return
render_template
(
"anomalies.html"
,
anomalies
=
anom
)
@app.route
(
'/report'
,
methods
=
[
'POST'
])
...
...
@@ -244,6 +245,7 @@ def report():
answer
[
'header'
][
'CodigoTaller'
]
=
configuracion
.
codigo_cent
print
(
answer
)
answer
[
'header'
][
"ingeniero"
]
=
ing
.
LeerDatosUsuario
(
request
.
cookies
[
"login"
])[
'nombreyapellido'
]
#answer['header']["hora"] = apollo.estaticos.Hora()
#print(2,answer)
...
...
@@ -329,6 +331,8 @@ def gotolinea(driver_abs,answer):
categoria
=
driver_abs
.
find
(
SI
.
By
.
ID
,
"categoriaVehiculoId"
)
time
.
sleep
(
1
)
cat
=
"N1"
conv
=
"Nafta"
#Este esta ffallando
try
:
print
(
categoria
.
text
)
except
Exception
as
E
:
...
...
@@ -339,8 +343,12 @@ def gotolinea(driver_abs,answer):
cat
=
CatVeh
except
Exception
as
E
:
print
(
E
)
element_1
=
driver
.
find_element_by_xpath
(
'//*[@id="ui-id-1"]'
)
element_1
.
click
()
answer
[
"header"
][
"linea_numero"
]
=
linea
answer
[
"header"
][
"vehiculo_tipo"
]
=
cat
answer
[
'header'
][
"ReporteInspeccion"
]
=
Repo
.
BuscarReporteDefecto
(
linea
,
cat
)
...
...
This diff is collapsed.
Click to expand it.
reportes.py
View file @
daa8f0c
...
...
@@ -11,5 +11,7 @@ def BuscarReporteDefecto(linea,tipo,cantidadEjes=2):
except
:
print
(
f
"reporte defecto linea: {linea}, tipo: {tipo}, ejes {cantidadEjes}"
)
rta
=
configuracion
.
reporte_defecto
if
rta
in
[
""
,
False
]:
rta
=
configuracion
.
reporte_defecto
[
cantidadEjes
]
print
(
rta
)
return
rta
This diff is collapsed.
Click to expand it.
static/src/carbone.js
0 → 100644
View file @
daa8f0c
// script.js
function
agregarCampoAObjeto
(
nombreCampo
,
reportCampo
,
objeto
)
{
var
valor
=
document
.
getElementsByName
(
nombreCampo
)[
0
].
value
;
if
(
valor
!==
''
)
{
objeto
[
reportCampo
]
=
String
(
valor
);
}
else
{
var
valor
=
document
.
getElementById
(
"defectovalor"
).
value
;
objeto
[
reportCampo
]
=
valor
;
}
}
function
agregarCampoAObjetoID
(
nombreCampo
,
reportCampo
,
objeto
)
{
var
valor
=
document
.
getElementById
(
nombreCampo
);
if
(
valor
)
{
objeto
[
reportCampo
]
=
String
(
valor
.
value
);
}
else
{
var
valor
=
document
.
getElementById
(
"defectovalor"
).
value
;
objeto
[
reportCampo
]
=
valor
;
}
}
function
Reportar
(){
///ACA hay que determinar el template
generarReporteTemplate
(
"algo.doc"
)
}
function
generarReporteTemplate
(
template
)
{
//REPORTE VIA CARBONE
var
solicitud
=
{
prueba
:
"prueba"
};
/////////////////////////ADAPTO_DATOS////////////////////////////
agregarCampoAObjeto
(
'patente'
,
'dom'
,
solicitud
);
agregarCampoAObjeto
(
'fecha'
,
'fec'
,
solicitud
);
agregarCampoAObjeto
(
'hora'
,
'ora'
,
solicitud
);
agregarCampoAObjeto
(
'cantidad_ejes'
,
'ejes'
,
solicitud
);
agregarCampoAObjeto
(
'eje_delantero'
,
'ed'
,
solicitud
);
agregarCampoAObjeto
(
'eje_trazero'
,
'et'
,
solicitud
);
//Suspencion
//eje Delantera
agregarCampoAObjeto
(
'rendimiento_izquierdo_1'
,
'DiE'
,
solicitud
);
agregarCampoAObjeto
(
'rendimiento_derecho_1'
,
'DdE'
,
solicitud
);
agregarCampoAObjeto
(
'peso_estatico_1'
,
'DP'
,
solicitud
);
//Falta Valores absolutos
//eje Trazeros
agregarCampoAObjeto
(
'rendimiento_izquierdo_2'
,
'TiD'
,
solicitud
);
agregarCampoAObjeto
(
'rendimiento_derecho_2'
,
'TdE'
,
solicitud
);
agregarCampoAObjeto
(
'peso_estatico_2'
,
'TP'
,
solicitud
);
//Falta Valores absolutos
//Frenometro
//Eje Delantero
agregarCampoAObjeto
(
'fuerza_izquierda_1'
,
'fs3'
,
solicitud
);
agregarCampoAObjeto
(
'fuerza_derecha_1'
,
'fs4'
,
solicitud
);
agregarCampoAObjeto
(
'diferencia_freno_1'
,
'fs6'
,
solicitud
);
agregarCampoAObjeto
(
'eficacia_freno_1'
,
'fs9'
,
solicitud
);
agregarCampoAObjetoID
(
'peso_freno_estatico_1'
,
'fs0'
,
solicitud
);
agregarCampoAObjetoID
(
'resistencia_derecha_1'
,
'fs2'
,
solicitud
);
agregarCampoAObjetoID
(
'resistencia_izquierda_1'
,
'fs1'
,
solicitud
);
//Fr. Estacionam.
//Eje Trasero
agregarCampoAObjeto
(
'fuerza_izquierda_2'
,
'g'
,
solicitud
);
agregarCampoAObjeto
(
'fuerza_derecha_2'
,
'j'
,
solicitud
);
agregarCampoAObjeto
(
'ovalidad_izquierda_2'
,
'n'
,
solicitud
);
agregarCampoAObjeto
(
'ovalidad_derecha_2'
,
's'
,
solicitud
);
agregarCampoAObjetoID
(
'peso_freno_estatico_1'
,
'p_e'
,
solicitud
);
//Estacionamiento
//let listaNumeros = [10, 5, 20, 15, 30];
//let numeroMaximo = Math.max(...listaNumeros);
//agregarCampoAObjetoID('eficacia_freno_mano', 'sf3',solicitud);
//agregarCampoAObjetoID('diferencia_freno_mano', 'sf1',solicitud);
//agregarCampoAObjetoID('diferencia_freno_mano', 'sf2',solicitud);
//Resultados Finales
//freno servicio
agregarCampoAObjetoID
(
'rf_servicio_fuerza_max'
,
'sf1'
,
solicitud
);
agregarCampoAObjetoID
(
'rf_servicio_fuerza_diferencia'
,
'sf2'
,
solicitud
);
agregarCampoAObjetoID
(
'rf_servicio_eficacia_estatica'
,
'sf3'
,
solicitud
);
//freno estacionamiento
agregarCampoAObjetoID
(
'rf_estacionamiento_fuerza_max'
,
'ef1'
,
solicitud
);
agregarCampoAObjetoID
(
'rf_estacionamiento_fuerza_diferencia'
,
'ef2'
,
solicitud
);
agregarCampoAObjetoID
(
'rf_estacionamiento_eficacia_estatica'
,
'ef3'
,
solicitud
);
/////////////////////////SOLICITO REPORTE Y ABRO PDF/////////////
var
datos
=
{
solicitud
:
solicitud
,
template
:
template
,
salida
:
'_REPORT_HIST.pdf'
,
'convert_pdf'
:
true
};
console
.
log
(
datos
)
//fetch('https://reporte.hgt.com.ar/consulta/carbone', {
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json'
// },
// body: JSON.stringify(datos)
//})
//.then(response => response.json())
//.then(data => {
// var pdfUrl = data.full_url;
// window.open(pdfUrl);
//})
//.catch(error => {
// console.error('Error:', error);
//});
}
This diff is collapsed.
Click to expand it.
templates/form.html
View file @
daa8f0c
...
...
@@ -7,9 +7,7 @@
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.min.js"
></script>
<script
src=
"{{ url_for('static', filename = 'src/ajax.js') }}"
></script>
<script
src=
"{{ url_for('static', filename = 'src/div.js') }}"
></script>
<script
src=
"{{ url_for('static', filename = 'src/pdf1.js') }}"
></script>
<script
src=
"{{ url_for('static', filename = 'src/pdf2.js') }}"
></script>
<script
src=
"{{ url_for('static', filename = 'src/pdf3.js') }}"
></script>
<script
src=
"{{ url_for('static', filename = 'src/carbone.js') }}"
></script>
<script
src=
"{{ url_for('static', filename = 'src/forms.js') }}"
></script>
<link
rel=
"stylesheet"
href=
"{{ url_for('static', filename = 'styles/general.css') }}"
>
<!--INCLUIMOS LA FUENTE
...
...
@@ -40,6 +38,8 @@
<br>
CodigoTaller
<input
sub=
"header"
type=
"text"
name=
"CodigoTaller"
readonly=
"1"
>
<br>
Reporte
<input
sub=
"header"
type=
"text"
name=
"ReporteInspeccion"
readonly=
"1"
>
<br>
Cantidad Ejes
<select
type=
"text"
sub=
"alineador"
id=
"cantidad_ejes"
name=
"cantidad_ejes"
>
<option
value=
"2"
selected
>
2
</option>
<option
value=
"3"
>
3
</option>
...
...
@@ -152,17 +152,7 @@
</div>
<div
class=
"PDFButtonContainerFixed"
>
<button
class=
"PDFButton"
onclick=
"window.open(
compile(
(new PDF2()).pdf( collectToConvert() ),
new jsPDF('portrait', 'pt', 'a4')
)
.output('bloburl')
)"
;
>
Pdf Informe
</button>
<button
class=
"PDFButton"
onclick=
"Reportar()"
>
Pdf Informe
</button>
<img
id=
"maha"
src=
"{{ url_for('static', filename = 'assets/maha.png') }}"
style=
"display: none;"
>
</div>
...
...
This diff is collapsed.
Click to expand it.
test.txt
View file @
daa8f0c
...
...
@@ -21,4 +21,7 @@ Clave:hm621
//*[@id="tabs"]/ul/li[6]/a[2]/span
//*[@id="nuevoVehiculo"]/form/div[2]/fieldset/div[4]/span[2]/label/strong
\ No newline at end of file
//*[@id="nuevoVehiculo"]/form/div[2]/fieldset/div[4]/span[2]/label/strong
VIHICULO desde Fotovalidacion
//*[@id="ui-id-1"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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