Skip to content

Commit

Permalink
funcionalidad renovacion de matriculas final
Browse files Browse the repository at this point in the history
  • Loading branch information
negro89 committed Oct 18, 2023
1 parent db1a70a commit 8e63072
Show file tree
Hide file tree
Showing 10 changed files with 257 additions and 241 deletions.
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="org.andesDev.mobile" version="5.0.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="org.andes.mobile" version="5.0.6" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Andes Neuquén</name>
<description>Andes Neuquén Mobile App</description>
<author email="info@andes.gob.ar" href="http://andes.gob.ar/">ANDES ~ Aplicaciones Neuquinas De Salud</author>
Expand Down
292 changes: 146 additions & 146 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobile_app",
"version": "5.0.1",
"version": "5.0.6",
"author": "Andes Neuquén",
"description": "Andes mobile",
"homepage": "https://github.com/andes/mobile-app",
Expand Down
6 changes: 4 additions & 2 deletions scripts/remove_permissions.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const fs = require('fs/promises')
const xml2js = require('xml2js')

const REMOVE_PERMISSIONS = [
'android.permission.REQUEST_INSTALL_PACKAGES',
'android.permission.WRITE_EXTERNAL_STORAGE',
'android.permission.READ_EXTERNAL_STORAGE'
]
module.exports = async function (context) {
const root = context.opts.projectRoot
Expand All @@ -14,7 +15,8 @@ module.exports = async function (context) {
manifest.manifest['uses-permission'] = usesPermissions.filter(usesPermission => {
const attrs = usesPermission.$ || {}
const name = attrs['android:name'] // Assuming xmlns:android has been set as usual...
if (REMOVE_PERMISSIONS.includes(name)) {
const version = attrs['android:maxSdkVersion']
if (!version && REMOVE_PERMISSIONS.includes(name)) {
console.log(`Removing permission "${name}" from AndroidManifest.xml`)
return false
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export class ComprobanteProfesionalPage implements OnInit {
this.toast.danger('Ocurrió un error guardando el archivo');
});
this.cancelarEdicion();
}, (error) => {
console.log('Error Occured: ' + error);
}, () => {
this.toast.danger('El servicio momentaneamente no se encuentra disponible. Utilice la opción "Examinar"');
});
}

Expand Down
156 changes: 79 additions & 77 deletions src/app/pages/profesional/mis-matriculas/datos-profesional.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,85 +14,87 @@
</div>
<form *ngIf="validado && !inProgress">
<ion-list>
<ion-title class="titulo-datos">DATOS BÁSICOS</ion-title>
<div class="{{ editarDomReal || editarDomProfesional ? 'opacity-50' : null }}"></div>
<ion-grid>
<ion-row>
<ion-col col-6>
<ion-item lines="none">
<ion-label color="secondary" position="stacked">Apellido</ion-label>
<p>{{datos.apellido}}</p>
</ion-item>
</ion-col>
<ion-col col-6>
<ion-item lines="none">
<ion-label color="secondary" position="stacked">Nombre</ion-label>
<p>{{datos.nombre}}</p>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
<ion-grid>
<ion-row>
<ion-col col-6>
<ion-item lines="none">
<ion-label color="secondary" position="stacked">Documento</ion-label>
<p>{{datos.documento}}</p>
</ion-item>
</ion-col>
<ion-col col-6>
<ion-item lines="none">
<ion-label color="secondary" position="stacked">Sexo</ion-label>
<p>{{datos.sexo}}</p>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
<ion-title class="titulo-datos" [ngClass]="{ 'opacity-30': editarDomReal || editarDomProfesional }">DATOS
BÁSICOS</ion-title>
<div class="{{ editarDomReal || editarDomProfesional ? 'opacity-30' : null }}">
<ion-grid>
<ion-row>
<ion-col col-6>
<ion-item lines="none">
<ion-label color="secondary" position="stacked">Apellido</ion-label>
<p>{{datos.apellido}}</p>
</ion-item>
</ion-col>
<ion-col col-6>
<ion-item lines="none">
<ion-label color="secondary" position="stacked">Nombre</ion-label>
<p>{{datos.nombre}}</p>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
<ion-grid>
<ion-row>
<ion-col col-6>
<ion-item lines="none">
<ion-label color="secondary" position="stacked">Documento</ion-label>
<p>{{datos.documento}}</p>
</ion-item>
</ion-col>
<ion-col col-6>
<ion-item lines="none">
<ion-label color="secondary" position="stacked">Sexo</ion-label>
<p>{{datos.sexo}}</p>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>

<ion-title class="titulo-datos">DOMICILIO LEGAL</ion-title>
<ion-grid>
<ion-row>
<ion-col col-6>
<ion-item lines="none">
<ion-label color="secondary" position="stacked">Dirección</ion-label>
<ion-textarea readonly="true" [(ngModel)]="domicilioLegal.valor" name="direccionLegal"
id="direccionLegal">
</ion-textarea>
</ion-item>
</ion-col>
<ion-col col-6>
<ion-item lines="none">
<ion-label color="secondary" position="stacked">Provincia</ion-label>
<ion-textarea readonly="true" [(ngModel)]="domicilioLegal.ubicacion.provincia.nombre"
name="provinciaLegal" id="provinciaLegal">
</ion-textarea>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
<ion-title class="titulo-datos">DOMICILIO LEGAL</ion-title>
<ion-grid>
<ion-row>
<ion-col col-6>
<ion-item lines="none">
<ion-label color="secondary" position="stacked">Dirección</ion-label>
<ion-textarea readonly="true" [(ngModel)]="domicilioLegal.valor" name="direccionLegal"
id="direccionLegal">
</ion-textarea>
</ion-item>
</ion-col>
<ion-col col-6>
<ion-item lines="none">
<ion-label color="secondary" position="stacked">Provincia</ion-label>
<ion-textarea readonly="true" [(ngModel)]="domicilioLegal.ubicacion.provincia.nombre"
name="provinciaLegal" id="provinciaLegal">
</ion-textarea>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>

<ion-grid>
<ion-row>
<ion-col col-6>
<ion-item lines="none">
<ion-label color="secondary" position="stacked">Localidad</ion-label>
<ion-textarea readonly="true" [(ngModel)]="domicilioLegal.ubicacion.localidad.nombre"
name="localidadLegal" id="localidadLegal">
</ion-textarea>
</ion-item>
</ion-col>
<ion-col col-6>
<ion-item lines="none">
<ion-label color="secondary" position="stacked">Código Postal</ion-label>
<ion-textarea readonly="true" [(ngModel)]="domicilioLegal.codigoPostal"
name="codigoPostalLegal" id="codigoPostalLegal">
</ion-textarea>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
<ion-grid>
<ion-row>
<ion-col col-6>
<ion-item lines="none">
<ion-label color="secondary" position="stacked">Localidad</ion-label>
<ion-textarea readonly="true" [(ngModel)]="domicilioLegal.ubicacion.localidad.nombre"
name="localidadLegal" id="localidadLegal">
</ion-textarea>
</ion-item>
</ion-col>
<ion-col col-6>
<ion-item lines="none">
<ion-label color="secondary" position="stacked">Código Postal</ion-label>
<ion-textarea readonly="true" [(ngModel)]="domicilioLegal.codigoPostal"
name="codigoPostalLegal" id="codigoPostalLegal">
</ion-textarea>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
</div>

<ion-title class="titulo-datos">
<ion-title class="titulo-datos" [ngClass]="{ 'opacity-30': editarDomProfesional }">
DOMICILIO REAL
<ion-button *ngIf="!editarDomReal" class="boton-editar" color="warning"
(click)="editarDomicilio('real')" size="small">Editar
Expand Down Expand Up @@ -146,7 +148,7 @@
</ion-row>
</ion-grid>

<ion-title class="titulo-datos no-margin-top">
<ion-title class="titulo-datos no-margin-top" [ngClass]="{ 'opacity-30': editarDomReal }">
DOMICILIO PROFESIONAL
<ion-button *ngIf="!editarDomProfesional" class="boton-editar" color="warning"
(click)="editarDomicilio('profesional')" size="small">Editar</ion-button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ ion-grid {

ion-row {
height: 5rem;
}

.opacity-30 {
opacity: 30%;
}
26 changes: 16 additions & 10 deletions src/app/pages/profesional/mis-matriculas/datos-profesional.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { AfterViewInit, Component, OnInit } from '@angular/core';
import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';
import { AuthProvider } from 'src/providers/auth/auth';
import { ActivatedRoute, Router } from '@angular/router';
// providers
import { ProfesionalProvider } from 'src/providers/profesional';
import { ToastProvider } from 'src/providers/toast';
import { IonContent } from '@ionic/angular';

@Component({
selector: 'app-datos-profesional',
Expand All @@ -12,6 +13,8 @@ import { ToastProvider } from 'src/providers/toast';
})

export class DatosProfesionalPage implements OnInit, AfterViewInit {
@ViewChild(IonContent, { static: false }) content: IonContent;

inProgress = true;
datos: any;
profesional: any;
Expand Down Expand Up @@ -49,13 +52,13 @@ export class DatosProfesionalPage implements OnInit, AfterViewInit {
this.router.queryParams.subscribe(params => {
this.datos = JSON.parse(params.datos);

if (this.authProvider.user.documento !== this.datos.documento || this.authProvider.user.sexo !== this.datos.sexo.toLowerCase()) {
if (this.authProvider.user.documento !== this.datos.documento) {
this.toast.danger('El documento escaneado no se corresponde con la cuenta de usuario.');
this.inProgress = false;
this.route.navigate(['profesional/scan-profesional']);
return;
}
let profesionalId = this.authProvider.user.profesionalId;
const profesionalId = this.authProvider.user.profesionalId;

this.profesionalProvider.validarProfesional({
documento: this.datos.documento, sexo: this.datos.sexo.toLowerCase(),
Expand All @@ -70,13 +73,13 @@ export class DatosProfesionalPage implements OnInit, AfterViewInit {
dom.valor = dom.valor === null ? '' : dom.valor;
dom.codigoPostal = dom.codigoPostal === null ? '' : dom.codigoPostal;
if (data.profesional.id === profesionalId) {
this.domicilioReal = this.profesional.domicilios?.find(dom => dom.tipo === 'real');
this.domicilioLegal = this.profesional.domicilios?.find(dom => dom.tipo === 'legal');
this.domicilioProfesional = this.profesional.domicilios?.find(dom => dom.tipo === 'profesional');
this.domicilioReal = this.profesional.domicilios?.find(d => d.tipo === 'real');
this.domicilioLegal = this.profesional.domicilios?.find(d => d.tipo === 'legal');
this.domicilioProfesional = this.profesional.domicilios?.find(d => d.tipo === 'profesional');
this.inProgress = false;
this.validado = true;
}
})
});
}
}, error => {
this.route.navigate(['profesional/scan-profesional']);
Expand Down Expand Up @@ -124,7 +127,7 @@ export class DatosProfesionalPage implements OnInit, AfterViewInit {
}
} else {
this.codigoPostalReal = '';
this.codigoPostalProfesional = ''
this.codigoPostalProfesional = '';
}
}

Expand Down Expand Up @@ -158,6 +161,9 @@ export class DatosProfesionalPage implements OnInit, AfterViewInit {
this.editarDomReal = false;
this.editarDomProfesional = true;
}
setTimeout(() => {
this.content.scrollToBottom(500);
}, 200);
});
}

Expand All @@ -167,11 +173,11 @@ export class DatosProfesionalPage implements OnInit, AfterViewInit {
const provincia = this.provincias.find(item => item._id === idProvincia) || { _id: null, nombre: '' };

if (tipo === 'real') {
this.direccionReal = this.profesional.domicilios[index].valor
this.direccionReal = this.profesional.domicilios[index].valor;
this.codigoPostalReal = this.profesional.domicilios[index].codigoPostal;
this.provinciaReal = Object.assign({}, provincia);
} else { // profesional
this.direccionProfesional = this.profesional.domicilios[index].valor
this.direccionProfesional = this.profesional.domicilios[index].valor;
this.codigoPostalProfesional = this.profesional.domicilios[index].codigoPostal;
this.provinciaProfesional = Object.assign({}, provincia);
}
Expand Down
2 changes: 2 additions & 0 deletions src/app/pages/profesional/mis-matriculas/foto-profesional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export class FotoProfesionalPage implements OnInit {
this.camera.getPicture(options).then((imageData) => {
this.foto = 'data:image/jpeg;base64,' + imageData;
this.cancelarEdicion();
}, () => {
this.toast.danger('El servicio momentaneamente no se encuentra disponible. Utilice la opción "Examinar"');
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/app/pages/profesional/rup-adjuntar/rup-adjuntar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ export class RupAdjuntarPage implements OnDestroy {
item.plain64 = base64File;
item.loading = false;
this.files = [...this.files];
}).catch((err) => {
console.error('Error reading file', err);
}).catch(() => {
this.toast.danger('El servicio momentaneamente no se encuentra disponible. Utilice la opción "Adjuntar"');
});
}

Expand Down

0 comments on commit 8e63072

Please sign in to comment.