mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
save
This commit is contained in:
@@ -198,7 +198,7 @@ export class CreateProcessPage implements OnInit {
|
|||||||
console.log('this.postData', this.postData, this.taskType);
|
console.log('this.postData', this.postData, this.taskType);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.processes.postDespatcho(this.postData).toPromise();
|
//await this.processes.postDespatcho(this.postData).toPromise();
|
||||||
this.FinalizarDespacho();
|
this.FinalizarDespacho();
|
||||||
this.toastService.badRequest('Despacho criado');
|
this.toastService.badRequest('Despacho criado');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<ion-header class="ion-no-border px-20">
|
<ion-header class="ion-no-border px-20">
|
||||||
<ion-toolbar class="px-10">
|
<ion-toolbar class="px-10">
|
||||||
<ion-title class="pa-0">Adicionar intervenientes</ion-title>
|
<ion-title class="pa-0">Adicionar intervenientes - A.M.</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
<ion-searchbar class="attendee-search-bar" (ionChange)="onChange($event)" placeholder="Insira email para adicionar destinatário"></ion-searchbar><!-- [(ngModel)]="searchCountryString" -->
|
<ion-searchbar class="attendee-search-bar" (ionChange)="onChange($event)" placeholder="Insira email para adicionar destinatário"></ion-searchbar><!-- [(ngModel)]="searchCountryString" -->
|
||||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
|
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
|
||||||
<div class="text">Correspondência por ler</div>
|
<div class="text">Correspondência por ler</div>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn-no-color cursor-pointer" (click)="viewExpedientListPage()">
|
<button (click)="viewExpedientListPage()" class="btn-no-color cursor-pointer">
|
||||||
<ion-icon class="icon-next" slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg"></ion-icon>
|
<ion-icon class="icon-next" slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
<ion-header class="ion-no-border">
|
<ion-header class="ion-no-border">
|
||||||
<h4>Adicionar Intervenientes</h4>
|
<h4>Adicionar Intervenientes - TK</h4>
|
||||||
<ion-searchbar (ionChange)="onChange($event)" placeholder="Pesquisar"></ion-searchbar>
|
<ion-searchbar (ionChange)="onChange($event)" placeholder="Pesquisar"></ion-searchbar>
|
||||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|||||||
+1
-1
@@ -65,7 +65,7 @@
|
|||||||
<div class="list-people">
|
<div class="list-people">
|
||||||
<ion-item lines="none">
|
<ion-item lines="none">
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-label *ngIf="taskParticipants.length == 0" class="list-people-title">Adicionar intervenientes</ion-label>
|
<ion-label *ngIf="taskParticipants.length < 1" class="list-people-title">Adicionar intervenientes</ion-label>
|
||||||
<ion-label *ngFor="let participant of taskParticipants">{{participant.Name}}</ion-label>
|
<ion-label *ngFor="let participant of taskParticipants">{{participant.Name}}</ion-label>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|||||||
+51
-74
@@ -21,6 +21,7 @@ import { User } from 'src/app/models/user.model';
|
|||||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-expedient-task-modal',
|
selector: 'app-expedient-task-modal',
|
||||||
@@ -175,7 +176,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
|||||||
attendees = attendees.map(function(val) {
|
attendees = attendees.map(function(val) {
|
||||||
return {
|
return {
|
||||||
UserEmail: val.EmailAddress,
|
UserEmail: val.EmailAddress,
|
||||||
UserType: val.IsRequired?"I": "CC"
|
UserType: val.IsRequired?"intervenient": "CC"
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -218,7 +219,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
|||||||
}
|
}
|
||||||
console.log(this.postData);
|
console.log(this.postData);
|
||||||
|
|
||||||
this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
|
//this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
|
||||||
await this.toastService.successMessage('Processo efetuado', () =>{
|
await this.toastService.successMessage('Processo efetuado', () =>{
|
||||||
this.modalController.dismiss(action_despacho);
|
this.modalController.dismiss(action_despacho);
|
||||||
});
|
});
|
||||||
@@ -368,88 +369,70 @@ export class ExpedientTaskModalPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async addParticipants() {
|
async openAttendees() {
|
||||||
/* console.log('HERES'); */
|
|
||||||
|
|
||||||
|
|
||||||
this.adding = "intervenient";
|
|
||||||
this.contacts = this.taskParticipants;
|
|
||||||
|
|
||||||
if(window.innerWidth <=800){
|
|
||||||
|
|
||||||
this.showAttendees=false;
|
|
||||||
|
|
||||||
|
if(window.innerWidth <= 1024) {
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
component: AddParticipantsModalPage,
|
component: AttendeesPage,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
eventPersons: this.participants
|
adding: this.adding,
|
||||||
|
taskParticipants: this.taskParticipants,
|
||||||
|
taskParticipantsCc: this.taskParticipantsCc
|
||||||
},
|
},
|
||||||
cssClass: 'add-participants-modal',
|
cssClass: 'attendee modal modal-desktop',
|
||||||
backdropDismiss: false
|
backdropDismiss: false
|
||||||
});
|
});
|
||||||
|
|
||||||
await modal.present();
|
await modal.present();
|
||||||
modal.onDidDismiss().then((res) => {
|
|
||||||
this.taskParticipants = res.data;
|
modal.onDidDismiss().then((data) => {
|
||||||
let newattendees: EventPerson[] = res['data'];
|
|
||||||
if(newattendees!= null){
|
if(data){
|
||||||
newattendees.forEach(newattendee => {
|
data = data['data'];
|
||||||
let att = {
|
|
||||||
'UserEmail': newattendee.EmailAddress,
|
const newAttendees: EventPerson[] = data['taskParticipants'];
|
||||||
'UserType': 'I',
|
const newAttendeesCC: EventPerson[] = data['taskParticipantsCc'];
|
||||||
};
|
|
||||||
if(this.participants == null){
|
this.setIntervenient(newAttendees);
|
||||||
this.participants = new Array();
|
this.setIntervenientCC(newAttendeesCC);
|
||||||
}
|
|
||||||
this.participants.push(att);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
this.postData.UsersSelected = this.participants;
|
|
||||||
console.log(this.postData);
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.showAttendees=true
|
this.showAttendees = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* setIntervenient(data){
|
||||||
|
this.taskParticipants = data;
|
||||||
|
//this.postData.UsersSelected = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
setIntervenientCC(data){
|
||||||
|
this.taskParticipantsCc = data;
|
||||||
|
} */
|
||||||
|
|
||||||
|
|
||||||
|
async setIntervenient(data) {
|
||||||
|
this.taskParticipants = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
async setIntervenientCC(data) {
|
||||||
|
this.taskParticipantsCc = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
async addParticipants() {
|
||||||
|
this.adding = 'intervenient'
|
||||||
|
this.openAttendees();
|
||||||
|
}
|
||||||
|
|
||||||
async addParticipantsCc() {
|
async addParticipantsCc() {
|
||||||
|
|
||||||
this.adding = "CC";
|
this.adding = "CC";
|
||||||
this.contacts = this.taskParticipantsCc;
|
this.openAttendees();
|
||||||
|
}
|
||||||
if(window.innerWidth <=800){
|
|
||||||
this.showAttendees=false;
|
|
||||||
|
|
||||||
const modal = await this.modalController.create({
|
|
||||||
component: AddParticipantsCcModalPage,
|
|
||||||
componentProps: {
|
|
||||||
eventPersons: this.participants
|
|
||||||
},
|
|
||||||
cssClass: 'add-participants-cc-modal',
|
|
||||||
backdropDismiss: false
|
|
||||||
});
|
|
||||||
await modal.present();
|
|
||||||
modal.onDidDismiss().then((res) => {
|
|
||||||
this.taskParticipantsCc = res.data;
|
|
||||||
let newattendees: EventPerson[] = res['data'];
|
|
||||||
if(newattendees!= null){
|
|
||||||
newattendees.forEach(newattendee => {
|
|
||||||
let att = {
|
|
||||||
'UserEmail': newattendee.EmailAddress,
|
|
||||||
'UserType': 'CC',
|
|
||||||
};
|
|
||||||
if(this.participants == null){
|
|
||||||
this.participants = new Array();
|
|
||||||
}
|
|
||||||
this.participants.push(att);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.postData.UsersSelected = this.participants;
|
|
||||||
console.log(this.postData);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.showAttendees=true
|
|
||||||
}
|
|
||||||
|
|
||||||
|
dynamicSetIntervenient({taskParticipants, taskParticipantsCc}){
|
||||||
|
this.taskParticipants = taskParticipants;
|
||||||
|
this.taskParticipantsCc = taskParticipantsCc;
|
||||||
}
|
}
|
||||||
|
|
||||||
async distartExpedientModal() {
|
async distartExpedientModal() {
|
||||||
@@ -485,13 +468,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async setIntervenient(data) {
|
|
||||||
this.taskParticipants = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
async setIntervenientCC(data) {
|
|
||||||
this.taskParticipantsCc = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
async closeComponent() {
|
async closeComponent() {
|
||||||
this.showAttendees = false;
|
this.showAttendees = false;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<ion-header class="ion-no-border px-20">
|
<ion-header class="ion-no-border px-20">
|
||||||
<ion-toolbar class="px-10">
|
<ion-toolbar class="px-10">
|
||||||
<ion-title class="pa-0">Adicionar intervenientes</ion-title>
|
<ion-title class="pa-0">Adicionar intervenientes</ion-title>
|
||||||
|
<ion-title>Agenda Desktop</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
<ion-searchbar class="attendee-search-bar" (ionChange)="onChange($event)" placeholder="Insira email para adicionar destinatário"></ion-searchbar><!-- [(ngModel)]="searchCountryString" -->
|
<ion-searchbar class="attendee-search-bar" (ionChange)="onChange($event)" placeholder="Insira email para adicionar destinatário"></ion-searchbar><!-- [(ngModel)]="searchCountryString" -->
|
||||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<ion-content>
|
<ion-content>
|
||||||
<ion-item-group>
|
<ion-item-group>
|
||||||
<ion-button class="btn-ok-no-width" fill="clear" color="#fff" shape="round" (click)="addAttendees()" expand="block">
|
<ion-button class="btn-ok-no-width" fill="clear" color="#fff" shape="round" (click)="addAttendees()" expand="block">
|
||||||
<ion-label>Adicionar participantes</ion-label>
|
<ion-label>Adicionar participantes XV</ion-label>
|
||||||
</ion-button>
|
</ion-button>
|
||||||
</ion-item-group>
|
</ion-item-group>
|
||||||
<ion-item-group [ngSwitch]="segment" *ngFor="let attendee of eventAttendees">
|
<ion-item-group [ngSwitch]="segment" *ngFor="let attendee of eventAttendees">
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { SearchPage } from 'src/app/pages/search/search.page';
|
|||||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||||
import { EventsService } from 'src/app/services/events.service';
|
import { EventsService } from 'src/app/services/events.service';
|
||||||
import { ProcessesService } from 'src/app/services/processes.service';
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { Event, EventToApproveEdit } from '../../../models/event.model';
|
import { Event, EventToApproveEdit } from '../../../models/event.model';
|
||||||
import { BadRequestPage } from '../../popover/bad-request/bad-request.page';
|
import { BadRequestPage } from '../../popover/bad-request/bad-request.page';
|
||||||
import { SuccessMessagePage} from '../../popover/success-message/success-message.page';
|
import { SuccessMessagePage} from '../../popover/success-message/success-message.page';
|
||||||
@@ -140,7 +141,8 @@ export class EditEventToApproveComponent implements OnInit {
|
|||||||
public alertController: AlertController,
|
public alertController: AlertController,
|
||||||
private attachmentsService: AttachmentsService,
|
private attachmentsService: AttachmentsService,
|
||||||
private processes:ProcessesService,
|
private processes:ProcessesService,
|
||||||
private animationController: AnimationController
|
private animationController: AnimationController,
|
||||||
|
private toastService: ToastService,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.serialNumber = this.navParams.get('serialNumber');
|
this.serialNumber = this.navParams.get('serialNumber');
|
||||||
@@ -253,9 +255,9 @@ export class EditEventToApproveComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
|
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
|
||||||
this.successMessage('Evento editado')
|
this.toastService.successMessage('Evento editado');
|
||||||
}, error =>{
|
}, error =>{
|
||||||
this.badRequest('Evento não editado')
|
this.toastService.badRequest('Evento não editado');
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@@ -263,16 +265,16 @@ export class EditEventToApproveComponent implements OnInit {
|
|||||||
if(document['action'] == 'add') {
|
if(document['action'] == 'add') {
|
||||||
delete document.action
|
delete document.action
|
||||||
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{
|
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{
|
||||||
//this.successMessage()
|
this.toastService.successMessage();
|
||||||
}, error =>{
|
}, error =>{
|
||||||
this.badRequest()
|
this.toastService.badRequest();
|
||||||
});
|
});
|
||||||
} else if(document['action'] == 'delete') {
|
} else if(document['action'] == 'delete') {
|
||||||
delete document.action
|
delete document.action
|
||||||
this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{
|
this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{
|
||||||
//this.successMessage()
|
this.toastService.successMessage()
|
||||||
}, error =>{
|
}, error =>{
|
||||||
this.badRequest()
|
this.toastService.badRequest()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -407,96 +409,4 @@ export class EditEventToApproveComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async successMessage(message?: any, callback?) {
|
|
||||||
|
|
||||||
const enterAnimation = (baseEl: any) => {
|
|
||||||
const backdropAnimation = this.animationController.create()
|
|
||||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
|
||||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
|
||||||
|
|
||||||
const wrapperAnimation = this.animationController.create()
|
|
||||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
|
||||||
.keyframes([
|
|
||||||
{ offset: 0, opacity: '1', right: '-100%' },
|
|
||||||
{ offset: 1, opacity: '1', right: '0px' }
|
|
||||||
]);
|
|
||||||
|
|
||||||
return this.animationController.create()
|
|
||||||
.addElement(baseEl)
|
|
||||||
.easing('ease-out')
|
|
||||||
.duration(500)
|
|
||||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
|
||||||
}
|
|
||||||
|
|
||||||
const leaveAnimation = (baseEl: any) => {
|
|
||||||
return enterAnimation(baseEl).direction('reverse');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const modal = await this.modalController.create({
|
|
||||||
enterAnimation,
|
|
||||||
leaveAnimation,
|
|
||||||
component: SuccessMessagePage,
|
|
||||||
componentProps: {
|
|
||||||
message: message || 'Processo efetuado' ,
|
|
||||||
},
|
|
||||||
cssClass: 'notification-modal'
|
|
||||||
});
|
|
||||||
|
|
||||||
modal.present()
|
|
||||||
|
|
||||||
setTimeout(()=>{
|
|
||||||
if (callback) {
|
|
||||||
callback()
|
|
||||||
}
|
|
||||||
modal.dismiss()
|
|
||||||
},7000)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
async badRequest(message?: string, callback?) {
|
|
||||||
const enterAnimation = (baseEl: any) => {
|
|
||||||
const backdropAnimation = this.animationController.create()
|
|
||||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
|
||||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
|
||||||
|
|
||||||
const wrapperAnimation = this.animationController.create()
|
|
||||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
|
||||||
.keyframes([
|
|
||||||
{ offset: 0, opacity: '1', right: '-100%' },
|
|
||||||
{ offset: 1, opacity: '1', right: '0px' }
|
|
||||||
]);
|
|
||||||
|
|
||||||
return this.animationController.create()
|
|
||||||
.addElement(baseEl)
|
|
||||||
.easing('ease-out')
|
|
||||||
.duration(500)
|
|
||||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
|
||||||
}
|
|
||||||
|
|
||||||
const leaveAnimation = (baseEl: any) => {
|
|
||||||
return enterAnimation(baseEl).direction('reverse');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const modal = await this.modalController.create({
|
|
||||||
enterAnimation,
|
|
||||||
leaveAnimation,
|
|
||||||
component: BadRequestPage,
|
|
||||||
componentProps: {
|
|
||||||
message: message || 'Processo efetuado' ,
|
|
||||||
},
|
|
||||||
cssClass: 'notification-modal'
|
|
||||||
});
|
|
||||||
|
|
||||||
modal.present()
|
|
||||||
|
|
||||||
setTimeout(()=>{
|
|
||||||
if (callback) {
|
|
||||||
callback()
|
|
||||||
}
|
|
||||||
modal.dismiss()
|
|
||||||
},7000)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user