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 ed9a5698
authored
2024-08-07 11:23:58 -0300
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
SeReporte para separar linea, combustible, tipo
1 parent
fc0f9a3a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
175 additions
and
6 deletions
data/reportes.json → data/reportes_gas_oil.json
data/reportes_nafta.json
reportes.py
static/src/carbone.js
data/reportes.json
→
data/reportes
_gas_oil
.json
View file @
ed9a569
File moved
data/reportes_nafta.json
0 → 100644
View file @
ed9a569
{
"1"
:{
"N1"
:{
"2"
:
"ReportePruebaN1L1.doc"
,
"3"
:
""
},
"M1"
:{
"2"
:
""
,
"3"
:
""
},
"N2"
:{
"2"
:
""
,
"3"
:
""
},
"M2"
:{
"2"
:
""
,
"3"
:
""
},
"N3"
:{
"2"
:
""
,
"3"
:
""
},
"M3"
:{
"2"
:
""
,
"3"
:
""
},
"O1"
:{
"2"
:
""
,
"3"
:
""
,
"4"
:
""
},
"O2"
:{
"2"
:
""
,
"3"
:
""
,
"4"
:
""
},
"O3"
:{
"2"
:
""
,
"3"
:
""
,
"4"
:
""
},
"O4"
:{
"2"
:
""
,
"3"
:
""
,
"4"
:
""
},
"UP"
:{
"2"
:
""
,
"3"
:
""
,
"4"
:
""
}
},
"2"
:{
"N1"
:{
"2"
:
""
,
"3"
:
""
},
"M1"
:{
"2"
:
""
,
"3"
:
""
},
"N2"
:{
"2"
:
""
,
"3"
:
""
},
"M2"
:{
"2"
:
""
,
"3"
:
""
},
"N3"
:{
"2"
:
""
,
"3"
:
""
},
"M3"
:{
"2"
:
""
,
"3"
:
""
},
"O1"
:{
"2"
:
""
,
"3"
:
""
,
"4"
:
""
},
"O2"
:{
"2"
:
""
,
"3"
:
""
,
"4"
:
""
},
"O3"
:{
"2"
:
""
,
"3"
:
""
,
"4"
:
""
},
"O4"
:{
"2"
:
""
,
"3"
:
""
,
"4"
:
""
},
"UP"
:{
"2"
:
""
,
"3"
:
""
,
"4"
:
""
}},
"3"
:{
"N1"
:{
"2"
:
""
,
"3"
:
""
},
"M1"
:{
"2"
:
""
,
"3"
:
""
},
"N2"
:{
"2"
:
""
,
"3"
:
""
},
"M2"
:{
"2"
:
""
,
"3"
:
""
},
"N3"
:{
"2"
:
""
,
"3"
:
""
},
"M3"
:{
"2"
:
""
,
"3"
:
""
},
"O1"
:{
"2"
:
""
,
"3"
:
""
,
"4"
:
""
},
"O2"
:{
"2"
:
""
,
"3"
:
""
,
"4"
:
""
},
"O3"
:{
"2"
:
""
,
"3"
:
""
,
"4"
:
""
},
"O4"
:{
"2"
:
""
,
"3"
:
""
,
"4"
:
""
},
"UP"
:{
"2"
:
""
,
"3"
:
""
,
"4"
:
""
}
}
}
reportes.py
View file @
ed9a569
import
json
,
configuracion
def
BuscarReporteDefecto
(
linea
,
tipo
,
cantidadEjes
=
2
):
def
BuscarReporteDefecto
(
linea
,
tipo
,
cantidadEjes
=
2
,
conbustible
=
"Nafta"
):
"""Convustible Nafta , Gas Oil"""
conbustible
=
conbustible
.
upper
()
.
replace
(
" "
,
"_"
)
archivos_json
=
{
"GAS_OIL"
:
"data/reportes_gas_oil.json"
,
"NAFTA"
:
"data/reportes_nafta.json"
}
if
conbustible
in
archivos_json
.
keys
():
reporte
=
archivos_json
[
conbustible
]
else
:
reporte
=
archivos_json
[
"GAS_OIL"
]
linea
=
str
(
linea
)
cantidadEjes
=
str
(
cantidadEjes
)
tipo
=
str
(
tipo
)
.
upper
()
with
open
(
"data/reportes.json"
,
'r'
)
as
f
:
with
open
(
reporte
,
'r'
)
as
f
:
data
=
json
.
load
(
f
)
try
:
rta
=
data
[
linea
][
tipo
][
cantidadEjes
]
except
:
print
(
f
"reporte defecto linea: {linea}, tipo: {tipo}, ejes {cantidadEjes}"
)
rta
=
configuracion
.
reporte_defecto
[
cantidadEjes
]
if
rta
in
[
""
,
False
]:
rta
=
configuracion
.
reporte_defecto
[
cantidadEjes
]
rta
=
f
"Error, reporte no encontrado {linea}, tipo: {tipo}, ejes {cantidadEjes}"
# rta = configuracion.reporte_defecto[cantidadEjes]
print
(
rta
=
""
)
#if rta in ["",False]:
# rta = configuracion.reporte_defecto[cantidadEjes]
#print(rta)
return
rta
...
...
static/src/carbone.js
View file @
ed9a569
...
...
@@ -21,7 +21,11 @@ function agregarCampoAObjetoID(nombreCampo,reportCampo, objeto) {
function
Reportar
(){
///ACA hay que determinar el template
const
template
=
document
.
getElementById
(
'ReporteInspeccion'
);
if
(
template
.
value
!==
""
)
{
generarReporteTemplate
(
template
.
value
)
}
else
{
message
(
"Error en la carga de reporte anote el numero de planilla y consulte a soporte"
)
}
}
function
generarReporteTemplate
(
template
)
{
...
...
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