[EDIT] SUBIDA DE DATOS

parent 9ae61fde
......@@ -51,8 +51,8 @@
<mat-form-field class="w-full" appearance="outline" floatLabel="always">
<mat-label>Sede designada</mat-label>
<mat-select formControlName="sedePersonal" placeholder="[Seleccionar sede]" required>
<mat-option *ngFor="let option of this.sede_list" [value]="option?.value">
{{option?.viewValue}}
<mat-option *ngFor="let option of this.sede_list" [value]="option?.idlocal">
{{option?.deslocal}}
</mat-option>
</mat-select>
</mat-form-field>
......@@ -217,11 +217,13 @@
<mat-label class="font-bold text-blue-600 text-lg" [ngClass]="{'fade-out': isFading}" [innerText]="labelText"></mat-label>
</div>
<div class="grid grid-cols-2 md:grid-cols-5 gap-4 w-full md:w-4/5">
<div class="contenedorRequerimiento" *ngFor="let card of listRequerimientos">
<!-- <div class="grid grid-cols-2 md:grid-cols-5 gap-4 w-full md:w-4/5">-->
<div class="grid grid-cols-5 gap-4 basis-4/5">
<div class="contenedorRequerimiento" *ngFor="let card of listRequerimientos" style="display: flex">
<mat-card>
<mat-card-content>
<mat-card-subtitle class="text-base font-bold">{{ card.titulo }}</mat-card-subtitle>
<!-- <mat-card-subtitle class="text-base font-bold">{{ card.titulo }}</mat-card-subtitle> -->
<mat-card-subtitle style="font-size: 1rem;font-weight: bold;align-content: center">{{ card.titulo }}</mat-card-subtitle>
<div class="w-fit py-2 px-3 flex space-x-4">
<button mat-fab aria-label="Eliminar" matTooltip="Eliminar" matTooltipPosition="above" (click)="deleteRequerimiento(card.id)">
<mat-icon class="mat-icon-small">delete</mat-icon>
......@@ -315,7 +317,7 @@
<mat-label>Seleccionar tipo de trabajo</mat-label>
<mat-select formControlName="tipoTrabajo">
@for (tipoT of listTipoTrabajo; track tipoT) {
<mat-option [value]="tipoT.value">{{ tipoT.viewValue }}</mat-option>
<mat-option [value]="tipoT.codtipo">{{ tipoT.desctipo }}</mat-option>
}
</mat-select>
</mat-form-field>
......
......@@ -42,8 +42,8 @@ import Notiflix from 'notiflix';
import { DecimalPipe } from '@angular/common';
interface tiposTrabajo {
value: string;
viewValue: string;
codtipo: string;
desctipo: string;
}
interface lugaresTrabajo {
......@@ -143,212 +143,8 @@ export class ConformidadComponent implements AfterViewInit {
// INICIALIZACION DE SEDES
listadoSedesTrabajo : lugaresTrabajo[] = [
{
"value": '1',
"viewValue": "6 DE AGOSTO"
},
{
"value": '2',
"viewValue": "ADMINISTRACION - SAN ISIDRO"
},
{
"value": '3',
"viewValue": "ANIVERSARIO"
},
{
"value": '4',
"viewValue": "ARENALES"
},
{
"value": '5',
"viewValue": "AREQUIPA"
},
{
"value": '6',
"viewValue": "BARRANCO"
},
{
"value": '7',
"viewValue": "BELISARIO"
},
{
"value": '8',
"viewValue": "BELLAVISTA"
},
{
"value": '9',
"viewValue": "BELLIDO"
},
{
"value": '10',
"viewValue": "CALCA"
},
{
"value": '11',
"viewValue": "CANTA CALLAO"
},
{
"value": '12',
"viewValue": "CARABAYLLO"
},
{
"value": '13',
"viewValue": "CASONA"
},
{
"value": '14',
"viewValue": "CHACLACAYO"
},
{
"value": '15',
"viewValue": "CHORRILLOS"
},
{
"value": '16',
"viewValue": "CIPRESES"
},
{
"value": '17',
"viewValue": "CIPRESES ELIO"
},
{
"value": '18',
"viewValue": "OBRA"
},
{
"value": '19',
"viewValue": "CUBA"
},
{
"value": '20',
"viewValue": "EL AGUSTINO"
},
{
"value": '21',
"viewValue": "ATE - GRAFICA"
},
{
"value": '22',
"viewValue": "HUANCAYO"
},
{
"value": '23',
"viewValue": "HUARAL"
},
{
"value": '24',
"viewValue": "ICA"
},
{
"value": '25',
"viewValue": "INDEPENDENCIA - ACADEMIA"
},
{
"value": '26',
"viewValue": "INGENIEROS"
},
{
"value": '27',
"viewValue": "LA VICTORIA"
},
{
"value": '28',
"viewValue": "LINCE"
},
{
"value": '29',
"viewValue": "ATE - LOGISTICA"
},
{
"value": '30',
"viewValue": "TALLER"
},
{
"value": '31',
"viewValue": "COCALENOS"
},
{
"value": '32',
"viewValue": "MIGUEL IGLESIAS"
},
{
"value": '33',
"viewValue": "MONTERRICO"
},
{
"value": '34',
"viewValue": "MONTESSORI"
},
{
"value": '35',
"viewValue": "NARANJAL"
},
{
"value": '36',
"viewValue": "PUEBLO LIBRE"
},
{
"value": '37',
"viewValue": "QUILCA"
},
{
"value": '38',
"viewValue": "SALAMANCA"
},
{
"value": '39',
"viewValue": "SAN CARLOS"
},
{
"value": '40',
"viewValue": "SAN JUAN - ACADEMIA"
},
{
"value": '41',
"viewValue": "SAN LUIS GERONA"
},
{
"value": '42',
"viewValue": "SAN LUIS BADAJOZ"
},
{
"value": '43',
"viewValue": "SAN MIGUEL"
},
{
"value": '44',
"viewValue": "SANTA ANITA"
},
{
"value": '45',
"viewValue": "SANTA ANITA - ACADEMIA"
},
{
"value": '46',
"viewValue": "SORIA"
},
{
"value": '47',
"viewValue": "VILLA EL SALVADOR"
},
{
"value": '48',
"viewValue": "VILLA SOL"
}
];
//INICIALIZACION DE LISTADO DE TIPOS DE TRABAJO
listTipoTrabajo: tiposTrabajo[] = [
{value: '1', viewValue: 'Instalación-Revisión'},
{value: '2', viewValue: 'Instalación-Ampliación'},
{value: '3', viewValue: 'Mantenimiento-Reparación'},
{value: '4', viewValue: 'Mantenimiento-Remodelación'},
{value: '5', viewValue: 'Reposición'},
{value: '6', viewValue: 'Reinstalación'},
];
//INICIALIZACION DE LISTADO DE TIPOS DE TRABAJO
//INICIALIZACION DE VARIABLES UTILIZABLES
......@@ -356,9 +152,11 @@ export class ConformidadComponent implements AfterViewInit {
sede_list: any = [];
requerimientosFiltrados: any[] = [];
listRequerimientos: interRequerimientos[] = [];
listTipoTrabajo: tiposTrabajo[] = [];
listadoSedesTrabajo : lugaresTrabajo[] = [];
listPersonal : interPersonal[] = [{ index: 0 , id: 0 , nombre: '' }];
idBotones: number = 0;
indexPasaje : number = 0 ;
//indexPasaje : number = 0 ;
labelText: string = ''; // Texto que se muestra inicialmente
isFading: boolean = false; // Controla si la animación de desvanecimiento debe activarse
personalText : string = '';
......@@ -463,11 +261,12 @@ export class ConformidadComponent implements AfterViewInit {
const [
personal,
sede
sede,
tipoTrabajo
] = await Promise.all([
this.conformidadHelper.cargarPersonal(),
//this.conformidadHelper.listadoGeneralHorizon({accion: 1}),
this.listadoSedesTrabajo
this.conformidadHelper.cargarSedes(),
this.conformidadHelper.gestionConformidad({opcion: 9})
]);
this.personal_list = personal;
......@@ -475,6 +274,9 @@ export class ConformidadComponent implements AfterViewInit {
//this.dataSource = [];
this.activarPasajes = false;
const jsonTipoTrabajo = JSON.parse(tipoTrabajo);
this.listTipoTrabajo = jsonTipoTrabajo.data;
//this.habilitarSeccionPersonal(true);
// Detecta cambios en el formulario de Datos Personal exceptuando 'lugarDestinoPasaje' para desbloquear el boton de 'Agregar Pasaje'
......@@ -677,11 +479,6 @@ export class ConformidadComponent implements AfterViewInit {
}
//tecnicoPersonal
}
//REALIZAR UNA BUSQUEDA DE REQUERIMIENTO
......@@ -996,10 +793,12 @@ export class ConformidadComponent implements AfterViewInit {
return;
}
console.log(datosPersonal);
const registroConformidad = await this.conformidadHelper.gestionConformidad({
opcion: 1,
//codper: datosPersonal.tecnicoPersonal,
codlocal: datosPersonal.sedePersonal,
codlocal: datosPersonal.sedePersonal + '',
fechainicio: this.formatoFechaRegistro(datosPersonal.minFechaTrabajo || new Date() ) ,
fechafin: this.formatoFechaRegistro(datosPersonal.maxFechaTrabajo || new Date() ) ,
descproblema: datosServicio.descripcionServicio,
......@@ -1010,6 +809,7 @@ export class ConformidadComponent implements AfterViewInit {
const respuestaConformidad : any = JSON.parse(registroConformidad);
let codigoConformidad = 0 ;
if(respuestaConformidad.status){ // DATOS DE CONFORMIDAD VALIDADOS Y REGISTRADOS
......@@ -1100,7 +900,7 @@ export class ConformidadComponent implements AfterViewInit {
const registroOrdenSalida = await this.conformidadHelper.gestionOrdenSalida({
accion: 1,
//codper: datosPersonal.tecnicoPersonal,
codlocal: datosPersonal.sedePersonal,
codlocal: datosPersonal.sedePersonal + '',
fechaRegistro: this.formatoFechaRegistro(new Date()),
descripcion: datosMaterialSobrante
});
......@@ -1163,6 +963,10 @@ export class ConformidadComponent implements AfterViewInit {
Notiflix.Loading.remove();
Notiflix.Notify.success('REGISTRO COMPLETADO');
setTimeout(() => {
window.location.reload();
}, 3000);
} else {
this.mostrarAlerta('ERROR AL REGISTRAR ORDEN DE SALIDA');
}
......
......@@ -17,6 +17,15 @@ export class ConformidadHelper {
}
}
async cargarSedes(){
const respuesta = await this.ConformidadService.listadoGeneral(2);
if(respuesta?.status){
return respuesta.data;
}else{
return [];
}
}
async listadoGeneralHorizon(json: any){
const respuesta = await this.ConformidadService.listadoGeneralHorizon(json);
if (respuesta?.status) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment