Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
formularioConformidad
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Fernando José Palomino Aquino
formularioConformidad
Commits
273b20c0
Commit
273b20c0
authored
Jan 17, 2025
by
Fernando José Palomino Aquino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[EDIT] AGREGAR NUEVOS CAMBPOS Y REGISTRO DE NUEVAS EVIDENCIAS
parent
b14a3610
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
136 additions
and
109 deletions
+136
-109
conformidad.componente.html
src/app/pages/conformidad/conformidad.componente.html
+67
-14
conformidad.componente.ts
src/app/pages/conformidad/conformidad.componente.ts
+63
-17
conformidad.helper.ts
src/app/pages/conformidad/helper/conformidad.helper.ts
+0
-5
conformidad.service.ts
src/app/service/conformidad_service/conformidad.service.ts
+3
-67
env.prod.ts
src/environment/env.prod.ts
+2
-2
env.ts
src/environment/env.ts
+1
-4
No files found.
src/app/pages/conformidad/conformidad.componente.html
View file @
273b20c0
...
@@ -48,19 +48,20 @@
...
@@ -48,19 +48,20 @@
<div
class=
"basis-2/4"
>
<div
class=
"basis-2/4"
>
<div
class=
"flex flex-row gap-x-2"
>
<div
class=
"flex flex-row gap-x-2"
>
<
!--<
mat-form-field class="w-full" appearance="outline" floatLabel="always">
<mat-form-field
class=
"w-full"
appearance=
"outline"
floatLabel=
"always"
>
<mat-label>
Sede designad
a</mat-label>
<mat-label>
Zon
a
</mat-label>
<mat-select formControlName="
sedePersonal" placeholder="[Seleccionar sede
]" required>
<mat-select
formControlName=
"
zonaPersonal"
placeholder=
"[Seleccionar zona
]"
required
>
<mat-option *ngFor="let option of this.
sede_list" [value]="option?.idlocal
">
<mat-option
*
ngFor=
"let option of this.
zona_list"
[
value
]="
option
.
value
"
>
{{option
?.deslocal
}}
{{option
.viewValue
}}
</mat-option>
</mat-option>
</mat-select>
</mat-select>
</mat-form-field> -->
</mat-form-field>
<mat-form-field
class=
"w-full"
appearance=
"outline"
floatLabel=
"always"
>
<mat-form-field
class=
"w-full"
appearance=
"outline"
floatLabel=
"always"
>
<mat-label>
Sede designada
</mat-label>
<mat-label>
Sede designada
</mat-label>
<mat-select
formControlName=
"sedePersonal"
placeholder=
"[Seleccionar sede]"
required
>
<mat-select
formControlName=
"sedePersonal"
placeholder=
"[Seleccionar sede]"
required
>
<mat-option
*
ngFor=
"let option of this.
sede_list"
[
value
]="
opcionEnvironmnet =
==
1
?
option
.
idlocal
:
option
.
id_local
"
>
<mat-option
*
ngFor=
"let option of this.
listSedesAtencion"
[
value
]="
option
.
value
"
>
{{option.
deslocal
}}
{{option.
viewValue
}}
</mat-option>
</mat-option>
</mat-select>
</mat-select>
</mat-form-field>
</mat-form-field>
...
@@ -272,15 +273,15 @@
...
@@ -272,15 +273,15 @@
<mat-label>
SUBIR EVIDENCIA DEL PROBLEMA
</mat-label>
<mat-label>
SUBIR EVIDENCIA DEL PROBLEMA
</mat-label>
<mat-icon>
file_open
</mat-icon>
<mat-icon>
file_open
</mat-icon>
</button>
</button>
<input
type=
"file"
#
file1
(
change
)="
onEventoSubirArchivo
($
event
)"
class=
"hidden"
multiple
accept=
"image/png"
>
<input
type=
"file"
#
file1
(
change
)="
onEventoSubirArchivo
($
event
)"
class=
"hidden"
multiple
accept=
"image/png
, image/jpeg
"
>
<br>
<br>
<div
*
ngFor=
"let archivo of archivosEvidencia; let i = index"
class=
"flex mt-2"
>
<div
*
ngFor=
"let archivo of archivosEvidencia; let i = index"
class=
"flex mt-2"
>
<div
*
ngIf=
"archivo.tipoEvidencia === 1"
class=
"flex w-full"
>
<div
*
ngIf=
"archivo.tipoEvidencia === 1"
class=
"flex w-full"
>
<p
class=
"w-2/4"
>
{{ (archivo.file.name + ' (' + (archivo.file.size / 1000) + ' KB)') | truncate:30:true }}
</p>
<p
class=
"w-2/4"
>
{{ (archivo.file.name + ' (' + (archivo.file.size / 1000) + ' KB)') | truncate:30:true }}
</p>
<div
class=
"w-2/4 grid grid-cols-3 gap-4"
>
<div
class=
"w-2/4 grid grid-cols-3 gap-4"
>
<button
(
click
)="
gestionArchivos
(
i
,
1
,
archivo
.
file
)"
><mat-icon>
info
</mat-icon></button>
<button
(
click
)="
gestionArchivos
(
i
,
1
,
archivo
.
file
)"
><mat-icon>
info
</mat-icon></button>
<button
(
click
)="
seleccionarInput
(
i
,
1
)"
><mat-icon>
edit
</mat-icon></button>
<button
(
click
)="
seleccionarInput
(
archivo
,
1
)"
><mat-icon>
edit
</mat-icon></button>
<input
type=
"file"
#
fileEditar1
(
change
)="
gestionArchivos
(
i
,
2
,$
event
)"
class=
"hidden"
multiple
accept=
"image/png"
>
<input
type=
"file"
#
fileEditar1
(
change
)="
gestionArchivos
(
i
,
2
,$
event
)"
class=
"hidden"
multiple
accept=
"image/png
, image/jpeg
"
>
<button
(
click
)="
gestionArchivos
(
i
,
3
)"
><mat-icon>
delete
</mat-icon></button>
<button
(
click
)="
gestionArchivos
(
i
,
3
)"
><mat-icon>
delete
</mat-icon></button>
</div>
</div>
</div>
</div>
...
@@ -293,15 +294,15 @@
...
@@ -293,15 +294,15 @@
<mat-label>
SUBIR EVIDENCIA DE LA SOLUCIÓN
</mat-label>
<mat-label>
SUBIR EVIDENCIA DE LA SOLUCIÓN
</mat-label>
<mat-icon>
file_open
</mat-icon>
<mat-icon>
file_open
</mat-icon>
</button>
</button>
<input
type=
"file"
#
file2
(
change
)="
onEventoSubirArchivo
($
event
,
2
)"
class=
"hidden"
multiple
accept=
"image/png"
>
<input
type=
"file"
#
file2
(
change
)="
onEventoSubirArchivo
($
event
,
2
)"
class=
"hidden"
multiple
accept=
"image/png
, image/jpeg
"
>
<br>
<br>
<div
*
ngFor=
"let archivo of archivosEvidencia; let i = index"
class=
"flex mt-2"
>
<div
*
ngFor=
"let archivo of archivosEvidencia; let i = index"
class=
"flex mt-2"
>
<div
*
ngIf=
"archivo.tipoEvidencia === 2"
class=
"flex w-full"
>
<div
*
ngIf=
"archivo.tipoEvidencia === 2"
class=
"flex w-full"
>
<p
class=
"w-2/4"
>
{{ (archivo.file.name + ' (' + (archivo.file.size / 1000) + ' KB)') | truncate:30:true }}
</p>
<p
class=
"w-2/4"
>
{{ (archivo.file.name + ' (' + (archivo.file.size / 1000) + ' KB)') | truncate:30:true }}
</p>
<div
class=
"w-2/4 grid grid-cols-3 gap-4"
>
<div
class=
"w-2/4 grid grid-cols-3 gap-4"
>
<button
(
click
)="
gestionArchivos
(
i
,
1
,
archivo
.
file
,
2
)"
><mat-icon>
info
</mat-icon></button>
<button
(
click
)="
gestionArchivos
(
i
,
1
,
archivo
.
file
,
2
)"
><mat-icon>
info
</mat-icon></button>
<button
(
click
)="
seleccionarInput
(
i
,
2
)"
><mat-icon>
edit
</mat-icon></button>
<button
(
click
)="
seleccionarInput
(
archivo
,
2
)"
><mat-icon>
edit
</mat-icon></button>
<input
type=
"file"
#
fileEditar2
(
change
)="
gestionArchivos
(
i
,
2
,$
event
,
2
)"
class=
"hidden"
multiple
accept=
"image/png"
>
<input
type=
"file"
#
fileEditar2
(
change
)="
gestionArchivos
(
i
,
2
,$
event
,
2
)"
class=
"hidden"
multiple
accept=
"image/png
, image/jpeg
"
>
<button
(
click
)="
gestionArchivos
(
i
,
3
,
2
)"
><mat-icon>
delete
</mat-icon></button>
<button
(
click
)="
gestionArchivos
(
i
,
3
,
2
)"
><mat-icon>
delete
</mat-icon></button>
</div>
</div>
</div>
</div>
...
@@ -361,6 +362,58 @@
...
@@ -361,6 +362,58 @@
</ng-container>
</ng-container>
</mat-card>
</mat-card>
<mat-card
appearance=
"outlined"
class=
"mt-4 flex flex-col gap-2.5 text-[#222] !shadow-xl w-[90vw] sm:w-[85vw] md:w-[75vw]"
[
formGroup
]="
existeMaterialS
"
>
<mat-card-header
class=
"flex flex-col items-start w-full"
>
<mat-label
class=
"flex items-center text-[1.1em] font-bold"
>
ADICIONALES
</mat-label>
</mat-card-header>
<mat-card-content
class=
"w-full my-2.5"
>
<div
class=
"div-serviocisPrestados divisionGeneral"
>
<div
class=
"grid grid-flow-col md:grid-cols-2 gap-5"
>
<div>
<div><b
class=
"md:text-[1rem] text-[1em] text-black/60"
>
EVIDENCIA DE ATC: *
</b></div>
<button
mat-fab
class=
"!w-full"
[
color
]="'
blue
'"
(
click
)="
fotoATC
.
click
()"
>
<mat-label>
SUBIR FOTO DE LA ATC
</mat-label>
<mat-icon>
file_open
</mat-icon>
</button>
<input
type=
"file"
#
fotoATC
(
change
)="
onEventoSubirArchivo
($
event
,
3
)"
class=
"hidden"
accept=
"image/png, image/jpeg"
>
<br>
<div
*
ngFor=
"let archivo of archivosEvidencia; let i = index"
class=
"flex mt-2"
>
<div
*
ngIf=
"archivo.tipoEvidencia === 3"
class=
"flex w-full"
>
<p
class=
"w-2/4"
>
{{ (archivo.file.name + ' (' + (archivo.file.size / 1000) + ' KB)') | truncate:30:true }}
</p>
<div
class=
"w-2/4 grid grid-cols-3 gap-4"
>
<button
(
click
)="
gestionArchivos
(
i
,
1
,
archivo
.
file
)"
><mat-icon>
info
</mat-icon></button>
<button
(
click
)="
gestionArchivos
(
i
,
3
)"
><mat-icon>
delete
</mat-icon></button>
</div>
</div>
</div>
</div>
<div>
<div><b
class=
"md:text-[1rem] text-[1em] text-black/60"
>
FIRMA DEL ENCARGADO: *
</b></div>
<button
mat-fab
class=
"!w-full"
[
color
]="'
blue
'"
(
click
)="
fotoFirma
.
click
()"
>
<mat-label>
SUBIR EVIDENCIA DE LA FIRMA
</mat-label>
<mat-icon>
file_open
</mat-icon>
</button>
<input
type=
"file"
#
fotoFirma
(
change
)="
onEventoSubirArchivo
($
event
,
4
)"
class=
"hidden"
accept=
"image/png, image/jpeg"
>
<br>
<div
*
ngFor=
"let archivo of archivosEvidencia; let i = index"
class=
"flex mt-2"
>
<div
*
ngIf=
"archivo.tipoEvidencia === 4"
class=
"flex w-full"
>
<p
class=
"w-2/4"
>
{{ (archivo.file.name + ' (' + (archivo.file.size / 1000) + ' KB)') | truncate:30:true }}
</p>
<div
class=
"w-2/4 grid grid-cols-3 gap-4"
>
<button
(
click
)="
gestionArchivos
(
i
,
1
,
archivo
.
file
)"
><mat-icon>
info
</mat-icon></button>
<button
(
click
)="
gestionArchivos
(
i
,
3
,
2
)"
><mat-icon>
delete
</mat-icon></button>
</div>
</div>
</div>
</div>
</div>
</div>
</mat-card-content>
</mat-card>
<div
class=
"mt-4 flex flex-col"
>
<div
class=
"mt-4 flex flex-col"
>
<button
mat-fab
extended
(
click
)="
gestionConformidad
()"
>
<button
mat-fab
extended
(
click
)="
gestionConformidad
()"
>
<mat-icon>
app_registration
</mat-icon>
<mat-icon>
app_registration
</mat-icon>
...
...
src/app/pages/conformidad/conformidad.componente.ts
View file @
273b20c0
...
@@ -152,10 +152,12 @@ export class ConformidadComponent implements AfterViewInit {
...
@@ -152,10 +152,12 @@ export class ConformidadComponent implements AfterViewInit {
opcionEnvironmnet
:
number
=
environment
.
opcion
;
opcionEnvironmnet
:
number
=
environment
.
opcion
;
personal_list
:
any
=
[];
personal_list
:
any
=
[];
sede_list
:
any
=
[];
sede_list
:
any
=
[];
zona_list
:
any
=
[];
requerimientosFiltrados
:
any
[]
=
[];
requerimientosFiltrados
:
any
[]
=
[];
listSedesAtencion
:
lugaresTrabajo
[]
=
[];
listRequerimientos
:
interRequerimientos
[]
=
[];
listRequerimientos
:
interRequerimientos
[]
=
[];
listTipoTrabajo
:
tiposTrabajo
[]
=
[];
listTipoTrabajo
:
tiposTrabajo
[]
=
[];
listadoSedesTrabajo
:
lugaresTrabajo
[]
=
[];
//listadoSedesTrabajo : lugaresTrabajo[] = []; // SEDE DE TRABAJO PARA PASAJES
listPersonal
:
interPersonal
[]
=
[{
index
:
0
,
id
:
0
,
nombre
:
''
}];
listPersonal
:
interPersonal
[]
=
[{
index
:
0
,
id
:
0
,
nombre
:
''
}];
idBotones
:
number
=
0
;
idBotones
:
number
=
0
;
//indexPasaje : number = 0 ;
//indexPasaje : number = 0 ;
...
@@ -177,14 +179,18 @@ export class ConformidadComponent implements AfterViewInit {
...
@@ -177,14 +179,18 @@ export class ConformidadComponent implements AfterViewInit {
maxFechaLimite
:
Date
|
null
=
new
Date
();
maxFechaLimite
:
Date
|
null
=
new
Date
();
archivosEvidencia
:
interFile
[]
=
[];
archivosEvidencia
:
interFile
[]
=
[];
archivosProblema
:
interFile
[]
=
[];
archivosSolucion
:
interFile
[]
=
[];
archivosATC
:
interFile
[]
=
[];
archivosFirma
:
interFile
[]
=
[];
//INICIALIZACION DE VARIABLES UTILIZABLES
//INICIALIZACION DE VARIABLES UTILIZABLES
// GR
O
UPO DE FORMULARIO
// GRUPO DE FORMULARIO
datos_personal
=
new
FormGroup
({
datos_personal
=
new
FormGroup
({
tecnicoPersonal0
:
new
FormControl
(
null
,
Validators
.
required
),
tecnicoPersonal0
:
new
FormControl
(
null
,
Validators
.
required
),
areaPersonal0
:
new
FormControl
<
string
>
(
''
,
Validators
.
required
),
areaPersonal0
:
new
FormControl
<
string
>
(
''
,
Validators
.
required
),
zonaPersonal
:
new
FormControl
(
null
,
Validators
.
required
),
sedePersonal
:
new
FormControl
(
null
,
Validators
.
required
),
sedePersonal
:
new
FormControl
(
null
,
Validators
.
required
),
minFechaTrabajo
:
new
FormControl
<
Date
>
(
new
Date
(),
Validators
.
required
),
minFechaTrabajo
:
new
FormControl
<
Date
>
(
new
Date
(),
Validators
.
required
),
maxFechaTrabajo
:
new
FormControl
<
Date
>
(
new
Date
(),
Validators
.
required
),
maxFechaTrabajo
:
new
FormControl
<
Date
>
(
new
Date
(),
Validators
.
required
),
...
@@ -202,8 +208,7 @@ export class ConformidadComponent implements AfterViewInit {
...
@@ -202,8 +208,7 @@ export class ConformidadComponent implements AfterViewInit {
descripcionTrabajo
:
new
FormControl
<
string
>
(
''
,
Validators
.
required
),
descripcionTrabajo
:
new
FormControl
<
string
>
(
''
,
Validators
.
required
),
});
});
/*datos_pasajeAcumulado = new FormGroup<any>({
/*datos_pasajeAcumulado = new FormGroup<any>({});
});
datos_lugarOrigen : FormGroup = new FormGroup<any>({}) ;
datos_lugarOrigen : FormGroup = new FormGroup<any>({}) ;
...
@@ -213,8 +218,6 @@ export class ConformidadComponent implements AfterViewInit {
...
@@ -213,8 +218,6 @@ export class ConformidadComponent implements AfterViewInit {
existeMaterial
:
new
FormControl
(
null
,
Validators
.
required
),
existeMaterial
:
new
FormControl
(
null
,
Validators
.
required
),
});
});
//formulario: FormGroup | undefined;
// GROUPO DE FORMULARIO
// GROUPO DE FORMULARIO
constructor
(
constructor
(
...
@@ -273,7 +276,8 @@ export class ConformidadComponent implements AfterViewInit {
...
@@ -273,7 +276,8 @@ export class ConformidadComponent implements AfterViewInit {
this
.
personal_list
=
personal
;
this
.
personal_list
=
personal
;
this
.
sede_list
=
sede
;
this
.
sede_list
=
sede
;
//this.dataSource = [];
this
.
zona_list
=
[{
value
:
1
,
viewValue
:
'NORTE'
},{
value
:
2
,
viewValue
:
'SUR'
},{
value
:
3
,
viewValue
:
'ESTE'
},{
value
:
4
,
viewValue
:
'CENTRO'
}];
//this.dataSource = []; // Inicializa la tabla de pasajes
this
.
activarPasajes
=
false
;
this
.
activarPasajes
=
false
;
const
jsonTipoTrabajo
=
JSON
.
parse
(
tipoTrabajo
);
const
jsonTipoTrabajo
=
JSON
.
parse
(
tipoTrabajo
);
...
@@ -300,6 +304,11 @@ export class ConformidadComponent implements AfterViewInit {
...
@@ -300,6 +304,11 @@ export class ConformidadComponent implements AfterViewInit {
}*/
}*/
});
});
this
.
obtenerFormControl
(
this
.
datos_personal
,
'zonaPersonal'
)?.
valueChanges
.
subscribe
((
value
:
any
)
=>
{
console
.
log
(
'VALOR SELECCIONAD0 : '
+
value
);
this
.
listSedesAtencion
=
this
.
sede_list
.
filter
((
item
:
any
)
=>
item
.
zona
===
value
).
map
((
item
:
any
)
=>
({
value
:
item
.
id_local
,
viewValue
:
item
.
deslocal
}));
});
// Sincronizar el valor de 'sedePersonal' con los selects la tabla de pasaje
// Sincronizar el valor de 'sedePersonal' con los selects la tabla de pasaje
/*this.obtenerFormControl(this.datos_personal,'sedePersonal')?.valueChanges.subscribe((value : any) => {
/*this.obtenerFormControl(this.datos_personal,'sedePersonal')?.valueChanges.subscribe((value : any) => {
this.lugarDestinoPasaje = this.listadoSedesTrabajo.find((item: any) => item.value === value)?.viewValue || '';
this.lugarDestinoPasaje = this.listadoSedesTrabajo.find((item: any) => item.value === value)?.viewValue || '';
...
@@ -689,20 +698,46 @@ export class ConformidadComponent implements AfterViewInit {
...
@@ -689,20 +698,46 @@ export class ConformidadComponent implements AfterViewInit {
onEventoSubirArchivo
(
event
:
any
,
tipo
:
number
=
1
)
{
onEventoSubirArchivo
(
event
:
any
,
tipo
:
number
=
1
)
{
const
archivosSeleccionados
:
FileList
=
event
.
target
.
files
;
const
archivosSeleccionados
:
FileList
=
event
.
target
.
files
;
const
nuevosArchivos
=
Array
.
from
(
archivosSeleccionados
).
filter
(
file
=>
file
.
type
===
'image/png'
);
const
nuevosArchivos
=
Array
.
from
(
archivosSeleccionados
).
filter
(
file
=>
file
.
type
===
'image/png'
||
file
.
type
===
'image/jpeg'
);
nuevosArchivos
.
forEach
(
async
(
file
)
=>
{
nuevosArchivos
.
forEach
(
async
(
file
)
=>
{
if
(
!
this
.
archivosEvidencia
.
find
((
item
)
=>
item
.
file
.
name
===
file
.
name
)){
this
.
archivosEvidencia
.
push
({
tipoEvidencia
:
tipo
,
file
:
file
});
if
(
tipo
===
3
||
tipo
===
4
){
const
Encontrado
=
this
.
archivosEvidencia
.
find
((
item
)
=>
item
.
tipoEvidencia
===
tipo
);
if
(
Encontrado
)
{
this
.
archivosEvidencia
=
this
.
archivosEvidencia
.
filter
((
item
)
=>
item
.
tipoEvidencia
!==
tipo
);
this
.
archivosEvidencia
.
push
({
tipoEvidencia
:
tipo
,
file
:
file
});
}
else
{
this
.
archivosEvidencia
.
push
({
tipoEvidencia
:
tipo
,
file
:
file
});
}
}
else
{
if
(
!
this
.
archivosEvidencia
.
find
((
item
)
=>
item
.
file
.
name
===
file
.
name
))
{
this
.
archivosEvidencia
.
push
({
tipoEvidencia
:
tipo
,
file
:
file
});
}
}
}
});
});
this
.
archivosProblema
=
this
.
archivosEvidencia
.
filter
((
item
)
=>
item
.
tipoEvidencia
===
1
);
this
.
archivosSolucion
=
this
.
archivosEvidencia
.
filter
((
item
)
=>
item
.
tipoEvidencia
===
2
);
}
}
seleccionarInput
(
index
:
number
,
tipo
:
number
){
seleccionarInput
(
archivo
:
any
,
tipo
:
number
){
if
(
tipo
===
1
){
if
(
tipo
===
1
){
const
index
=
this
.
archivosProblema
.
findIndex
((
item
)
=>
item
.
file
.
name
===
archivo
.
file
.
name
);
const
input
=
this
.
fileInputs1
.
toArray
()[
index
];
const
input
=
this
.
fileInputs1
.
toArray
()[
index
];
input
.
nativeElement
.
click
();
// Simula el clic en el input file correspondiente
input
.
nativeElement
.
click
();
// Simula el clic en el input file correspondiente
}
else
{
}
else
if
(
tipo
===
2
){
const
index
=
this
.
archivosSolucion
.
findIndex
((
item
)
=>
item
.
file
.
name
===
archivo
.
file
.
name
);
const
input
=
this
.
fileInputs2
.
toArray
()[
index
];
const
input
=
this
.
fileInputs2
.
toArray
()[
index
];
input
.
nativeElement
.
click
();
// Simula el clic en el input file correspondiente
input
.
nativeElement
.
click
();
// Simula el clic en el input file correspondiente
}
}
...
@@ -728,7 +763,7 @@ export class ConformidadComponent implements AfterViewInit {
...
@@ -728,7 +763,7 @@ export class ConformidadComponent implements AfterViewInit {
//OBTENER EL ARCHIVO FILE Y UBICARLO EN EL ARRAY DE archivosEP EN EL MISMO INDEX
//OBTENER EL ARCHIVO FILE Y UBICARLO EN EL ARRAY DE archivosEP EN EL MISMO INDEX
if
(
archivoSeleccionado
)
{
if
(
archivoSeleccionado
)
{
//COMPRAR EL NOMBRE DEL ARCHIVOS CON TODA LA LISTA EXISTENTE PARA EVITAR REPETICIONES
//COMPRAR EL NOMBRE DEL ARCHIVOS CON TODA LA LISTA EXISTENTE PARA EVITAR REPETICIONES
if
(
!
this
.
archivosEvidencia
.
find
((
item
)
=>
item
.
file
.
name
===
archivoSeleccionado
.
name
)){
if
(
!
this
.
archivosEvidencia
.
find
((
item
)
=>
item
.
file
.
name
===
archivoSeleccionado
.
name
&&
item
.
tipoEvidencia
===
tipo
)){
this
.
archivosEvidencia
[
index
].
file
=
archivoSeleccionado
;
this
.
archivosEvidencia
[
index
].
file
=
archivoSeleccionado
;
}
else
{
}
else
{
this
.
barraAlerta
.
open
(
'ARCHIVO YA SE ENCUENTRA EN LA LISTA'
,
''
,
{
this
.
barraAlerta
.
open
(
'ARCHIVO YA SE ENCUENTRA EN LA LISTA'
,
''
,
{
...
@@ -750,7 +785,7 @@ export class ConformidadComponent implements AfterViewInit {
...
@@ -750,7 +785,7 @@ export class ConformidadComponent implements AfterViewInit {
//Obtener todos los datos del form Group datos_personal
//Obtener todos los datos del form Group datos_personal
const
datosPersonal
=
this
.
datos_personal
.
getRawValue
();
const
datosPersonal
=
this
.
datos_personal
.
getRawValue
();
const
personal
=
this
.
listPersonal
;
const
personal
=
this
.
listPersonal
;
//const datosPasajes = this.dataSource;
//const datosPasajes = this.dataSource;
// Obtener todos los datos de la tabla de pasajes
const
datosServicio
=
this
.
datos_servicio
.
getRawValue
();
const
datosServicio
=
this
.
datos_servicio
.
getRawValue
();
const
requerimientoRelacionados
=
this
.
listRequerimientos
;
const
requerimientoRelacionados
=
this
.
listRequerimientos
;
const
datosTrabajo
=
this
.
datos_trabajo
.
getRawValue
();
const
datosTrabajo
=
this
.
datos_trabajo
.
getRawValue
();
...
@@ -759,6 +794,9 @@ export class ConformidadComponent implements AfterViewInit {
...
@@ -759,6 +794,9 @@ export class ConformidadComponent implements AfterViewInit {
const
archivosEvidencias
=
this
.
archivosEvidencia
;
const
archivosEvidencias
=
this
.
archivosEvidencia
;
let
contadorEP
=
1
;
let
contadorEP
=
1
;
let
contadorES
=
1
;
let
contadorES
=
1
;
let
constadorATC
=
1
;
let
contadorFirma
=
1
;
let
contadorExtras
=
1
;
const
datosMaterialSobrante
=
this
.
ordenSalidaComponent
?.
datos_materialSobrante
?.
get
(
'descMaterial'
)?.
value
?
this
.
ordenSalidaComponent
?.
datos_materialSobrante
?.
get
(
'descMaterial'
)?.
value
:
''
;
const
datosMaterialSobrante
=
this
.
ordenSalidaComponent
?.
datos_materialSobrante
?.
get
(
'descMaterial'
)?.
value
?
this
.
ordenSalidaComponent
?.
datos_materialSobrante
?.
get
(
'descMaterial'
)?.
value
:
''
;
Notiflix
.
Loading
.
pulse
();
// Muestra un loading
Notiflix
.
Loading
.
pulse
();
// Muestra un loading
...
@@ -869,14 +907,22 @@ export class ConformidadComponent implements AfterViewInit {
...
@@ -869,14 +907,22 @@ export class ConformidadComponent implements AfterViewInit {
archivo
:
item
.
file
,
archivo
:
item
.
file
,
idCarpeta
:
registroCarpeta
.
idCarpeta
,
idCarpeta
:
registroCarpeta
.
idCarpeta
,
tipoEvidencia
:
item
.
tipoEvidencia
,
tipoEvidencia
:
item
.
tipoEvidencia
,
nombreArchivo
:
(
item
.
tipoEvidencia
===
1
)
?
'EVIDENCIA_PROBLEMA_'
+
codigoConformidad
+
"_"
+
(
contadorEP
++
)
:
'EVIDENCIA_SOLUCION_'
+
codigoConformidad
+
"_"
+
(
contadorES
++
)
nombreArchivo
:
(
item
.
tipoEvidencia
===
1
)
?
'EVIDENCIA_PROBLEMA_'
+
codigoConformidad
+
"_"
+
(
contadorEP
++
)
:
(
item
.
tipoEvidencia
===
2
)
?
'EVIDENCIA_SOLUCION_'
+
codigoConformidad
+
"_"
+
(
contadorES
++
)
:
(
item
.
tipoEvidencia
===
3
)
?
'EVINDENCIA_ATC'
+
codigoConformidad
+
"_"
+
(
constadorATC
++
)
:
(
item
.
tipoEvidencia
===
4
)
?
'FIRMA'
+
codigoConformidad
+
"_"
+
(
contadorFirma
++
)
:
'DATO_EXTRA'
+
codigoConformidad
+
"_"
+
(
contadorExtras
++
)
};
};
});
});
const
filtroEvidenciasProblemas
=
registroArchivos
.
filter
((
item
)
=>
item
.
tipoEvidencia
===
1
);
const
filtroEvidenciasProblemas
=
registroArchivos
.
filter
((
item
)
=>
item
.
tipoEvidencia
===
1
);
const
filtroEvidenciasSoluciones
=
registroArchivos
.
filter
((
item
)
=>
item
.
tipoEvidencia
===
2
);
const
filtroEvidenciasSoluciones
=
registroArchivos
.
filter
((
item
)
=>
item
.
tipoEvidencia
===
2
);
const
filtroEvidenciasExtras
=
registroArchivos
.
filter
((
item
)
=>
item
.
tipoEvidencia
===
3
||
item
.
tipoEvidencia
===
4
);
const
registroEvidencia
=
await
Promise
.
all
([
this
.
conformidadHelper
.
subidaEvidencia2
(
filtroEvidenciasProblemas
),
this
.
conformidadHelper
.
subidaEvidencia2
(
filtroEvidenciasSoluciones
)]);
const
registroEvidencia
=
await
Promise
.
all
([
this
.
conformidadHelper
.
subidaEvidencia2
(
filtroEvidenciasProblemas
),
this
.
conformidadHelper
.
subidaEvidencia2
(
filtroEvidenciasSoluciones
),
this
.
conformidadHelper
.
subidaEvidencia2
(
filtroEvidenciasExtras
)]);
//console.log(registroEvidencia);
//console.log(registroEvidencia);
if
(
!
(
registroEvidencia
[
0
].
status
&&
registroEvidencia
[
1
].
status
))
{
if
(
!
(
registroEvidencia
[
0
].
status
&&
registroEvidencia
[
1
].
status
))
{
...
...
src/app/pages/conformidad/helper/conformidad.helper.ts
View file @
273b20c0
...
@@ -44,11 +44,6 @@ export class ConformidadHelper {
...
@@ -44,11 +44,6 @@ export class ConformidadHelper {
}
}
}
}
async
subidaEvidencia
(
json
:
any
){
const
respuesta
=
await
this
.
ConformidadService
.
subidaEvidencia
(
json
);
return
respuesta
}
async
subidaEvidencia2
(
json
:
any
){
async
subidaEvidencia2
(
json
:
any
){
const
respuesta
=
await
this
.
ConformidadService
.
subidaEvidencia2
(
json
);
const
respuesta
=
await
this
.
ConformidadService
.
subidaEvidencia2
(
json
);
return
respuesta
return
respuesta
...
...
src/app/service/conformidad_service/conformidad.service.ts
View file @
273b20c0
...
@@ -121,71 +121,6 @@ export class ConformidadService {
...
@@ -121,71 +121,6 @@ export class ConformidadService {
return
respuesta
;
return
respuesta
;
}
}
async
subidaEvidencia
(
json
:
any
){
const
url
=
`
${
this
.
t_redireccionamiento
}
/google/drive`
;
let
respuesta
:
any
;
const
formData
=
new
FormData
();
formData
.
append
(
'archivo_nombre'
,
json
.
nombreArchivo
);
formData
.
append
(
'archivo_binario'
,
json
.
archivo
);
formData
.
append
(
'archivo_id_actual'
,
''
);
formData
.
append
(
'carpeta_id'
,
this
.
value_idDrive
);
formData
.
append
(
'correo'
,
this
.
value_correoDrive
);
formData
.
append
(
'app_nombre'
,
'EVIDENCIA_CONFORMIDAD'
);
formData
.
append
(
'carpeta_nombre'
,
'CONFORMIDAD_'
+
json
.
codconformidad
);
formData
.
append
(
'subcarpeta_nombre'
,
json
.
tipoEvidencia
===
1
?
'EVIDENCIAS_PROBLEMAS'
:
'EVIDENCIAS_SOLUCIONES'
);
const
controller
=
new
AbortController
();
const
timeout
=
setTimeout
(()
=>
controller
.
abort
(),
30000
);
// 30 segundos
try
{
const
response
=
await
fetch
(
url
,
{
method
:
'POST'
,
body
:
formData
,
signal
:
controller
.
signal
,
// 30 segundos de timeout
});
const
statusCode
=
response
.
status
;
const
responseBody
=
await
response
.
json
();
clearTimeout
(
timeout
);
// Limpiar, REVISA SI ESTO ESTA BIEN O QUITARLO
//let respuesta: any;
if
(
statusCode
===
200
)
{
const
registroEvidencia
=
await
this
.
registroDocumento
({
codconformidad
:
json
.
codconformidad
||
0
,
tipoEvidencia
:
json
.
tipoEvidencia
||
0
,
idDrive
:
responseBody
.
data
.
archivo_id
||
''
,
enlaceDrive
:
responseBody
.
data
.
archivo_url_vista
||
''
,
enlaceDescarga
:
responseBody
.
data
.
archivo_url
||
''
,
nombreDocumento
:
json
.
nombreArchivo
||
''
});
if
(
registroEvidencia
?.
status
)
{
respuesta
=
{
status
:
true
,
message
:
"Imagenes subidas"
};
}
else
{
respuesta
=
{
status
:
false
,
message
:
"Fallo en subir imagenes"
};
}
}
else
{
respuesta
=
{
status
:
false
,
message
:
"Imagenes subidas"
};
}
//return respuesta;
}
catch
(
error
)
{
console
.
error
(
'Error al registrar el archivo:'
,
error
);
//throw error;
respuesta
=
{
status
:
false
,
message
:
error
};
}
return
respuesta
;
}
async
subidaEvidencia2
(
json
:
any
){
async
subidaEvidencia2
(
json
:
any
){
const
url
=
`
${
this
.
t_redireccionamiento
}
/google/drive`
;
const
url
=
`
${
this
.
t_redireccionamiento
}
/google/drive`
;
let
respuesta
:
any
;
let
respuesta
:
any
;
...
@@ -200,8 +135,9 @@ export class ConformidadService {
...
@@ -200,8 +135,9 @@ export class ConformidadService {
formData
.
append
(
'archivo_id_actual'
,
''
);
formData
.
append
(
'archivo_id_actual'
,
''
);
formData
.
append
(
'carpeta_id'
,
datos
.
idCarpeta
||
this
.
value_idDrive
);
formData
.
append
(
'carpeta_id'
,
datos
.
idCarpeta
||
this
.
value_idDrive
);
formData
.
append
(
'correo'
,
this
.
value_correoDrive
);
formData
.
append
(
'correo'
,
this
.
value_correoDrive
);
formData
.
append
(
'app_nombre'
,
'ORDEN_COMPRA'
);
// USANDO ESTE NOMBRE DE APP YA QUE NO CUENTA CON LA CONFIGURACION DE SUBCARPETAS
formData
.
append
(
'app_nombre'
,
'ORDEN_COMPRA'
);
// USANDO ESTE NOMBRE DE APP(ORDEN_COMPRA) YA QUE NO CUENTA CON LA CONFIGURACION DE SUBCARPETAS
formData
.
append
(
'carpeta_nombre'
,
datos
.
tipoEvidencia
===
1
?
'EVIDENCIAS_PROBLEMAS'
:
'EVIDENCIAS_SOLUCIONES'
);
formData
.
append
(
'carpeta_nombre'
,
datos
.
tipoEvidencia
===
1
?
'EVIDENCIAS_PROBLEMAS'
:
datos
.
tipoEvidencia
===
2
?
'EVIDENCIAS_SOLUCIONES'
:
'EVIDENCIAS_EXTRAS'
);
const
controller
=
new
AbortController
();
const
controller
=
new
AbortController
();
const
timeout
=
setTimeout
(()
=>
controller
.
abort
(),
30000
);
// 30 segundos
const
timeout
=
setTimeout
(()
=>
controller
.
abort
(),
30000
);
// 30 segundos
try
{
try
{
...
...
src/environment/env.prod.ts
View file @
273b20c0
...
@@ -3,9 +3,9 @@ export const environment = {
...
@@ -3,9 +3,9 @@ export const environment = {
//trismegisto_services_link: 'https://tp-services.sacooliveros.edu.pe',
//trismegisto_services_link: 'https://tp-services.sacooliveros.edu.pe',
t_asistencia_rest_link
:
'https://tp-rest.sacooliveros.edu.pe'
,
t_asistencia_rest_link
:
'https://tp-rest.sacooliveros.edu.pe'
,
redireccionamiento
:
'https://fichaonline.sacooliveros.edu.pe:8000/trismegisto-apis/api/v1'
,
redireccionamiento
:
'https://fichaonline.sacooliveros.edu.pe:8000/trismegisto-apis/api/v1'
,
//
facturacion_electronica_link: 'https://fichaonline.sacooliveros.edu.pe:8080/FacturacionElectronicaSIIAA',
facturacion_electronica_link
:
'https://fichaonline.sacooliveros.edu.pe:8080/FacturacionElectronicaSIIAA'
,
//facturacion_electronica_link: 'http://pruebaintranet.sacooliveros.pe:8080/FacturacionElectronicaSIIAA',
//facturacion_electronica_link: 'http://pruebaintranet.sacooliveros.pe:8080/FacturacionElectronicaSIIAA',
facturacion_electronica_link
:
'https://prueba-intranet.sacooliveros.edu.pe:8443/FacturacionElectronicaSIIAA'
,
//
facturacion_electronica_link: 'https://prueba-intranet.sacooliveros.edu.pe:8443/FacturacionElectronicaSIIAA',
horizon_services_link
:
'https://api-horizon.sacooliveros.edu.pe'
,
horizon_services_link
:
'https://api-horizon.sacooliveros.edu.pe'
,
//horizon_services_link: 'http://prueba-intranet.sacooliveros.edu.pe:8080/trismegisto-api-horizons',
//horizon_services_link: 'http://prueba-intranet.sacooliveros.edu.pe:8080/trismegisto-api-horizons',
ID_CARPETA_DRIVE_LOGISTICA
:
'13mGZo3AnFqgkNRyiVAgJoW9mUoQdABdC'
,
ID_CARPETA_DRIVE_LOGISTICA
:
'13mGZo3AnFqgkNRyiVAgJoW9mUoQdABdC'
,
...
...
src/environment/env.ts
View file @
273b20c0
...
@@ -5,10 +5,7 @@ export const environment = {
...
@@ -5,10 +5,7 @@ export const environment = {
redireccionamiento
:
'https://fichaonline.sacooliveros.edu.pe:8000/trismegisto-apis/api/v1'
,
redireccionamiento
:
'https://fichaonline.sacooliveros.edu.pe:8000/trismegisto-apis/api/v1'
,
facturacion_electronica_link
:
'http://localhost:8080/FacturacionElectronicaSIIAA'
,
facturacion_electronica_link
:
'http://localhost:8080/FacturacionElectronicaSIIAA'
,
horizon_services_link
:
'http://localhost:8080/trismegisto-api-horizons'
,
horizon_services_link
:
'http://localhost:8080/trismegisto-api-horizons'
,
ID_CARPETA_DRIVE_LOGISTICA
:
'1
3mGZo3AnFqgkNRyiVAgJoW9mUoQdABdC
'
,
ID_CARPETA_DRIVE_LOGISTICA
:
'1
zYWsmpIAKR6nBmO5dnnBSAHJr81img0s
'
,
CORREO_DRIVE_LOGISTICA
:
'trismegisto.logistica@sacooliveros.edu.pe'
,
CORREO_DRIVE_LOGISTICA
:
'trismegisto.logistica@sacooliveros.edu.pe'
,
opcion
:
1
opcion
:
1
};
};
// /api/v1/Conformidad/listadoGeneral
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment