mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +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);
|
||||
|
||||
try {
|
||||
await this.processes.postDespatcho(this.postData).toPromise();
|
||||
//await this.processes.postDespatcho(this.postData).toPromise();
|
||||
this.FinalizarDespacho();
|
||||
this.toastService.badRequest('Despacho criado');
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<ion-header class="ion-no-border px-20">
|
||||
<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-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>
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
|
||||
<div class="text">Correspondência por ler</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>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<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-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
</ion-header>
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<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-list>
|
||||
</ion-item>
|
||||
|
||||
+50
-73
@@ -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 { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expedient-task-modal',
|
||||
@@ -175,7 +176,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
attendees = attendees.map(function(val) {
|
||||
return {
|
||||
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);
|
||||
|
||||
this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
|
||||
//this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
|
||||
await this.toastService.successMessage('Processo efetuado', () =>{
|
||||
this.modalController.dismiss(action_despacho);
|
||||
});
|
||||
@@ -368,88 +369,70 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async addParticipants() {
|
||||
/* console.log('HERES'); */
|
||||
|
||||
|
||||
this.adding = "intervenient";
|
||||
this.contacts = this.taskParticipants;
|
||||
|
||||
if(window.innerWidth <=800){
|
||||
|
||||
this.showAttendees=false;
|
||||
async openAttendees() {
|
||||
|
||||
if(window.innerWidth <= 1024) {
|
||||
const modal = await this.modalController.create({
|
||||
component: AddParticipantsModalPage,
|
||||
component: AttendeesPage,
|
||||
componentProps: {
|
||||
eventPersons: this.participants
|
||||
adding: this.adding,
|
||||
taskParticipants: this.taskParticipants,
|
||||
taskParticipantsCc: this.taskParticipantsCc
|
||||
},
|
||||
cssClass: 'add-participants-modal',
|
||||
cssClass: 'attendee modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res) => {
|
||||
this.taskParticipants = res.data;
|
||||
let newattendees: EventPerson[] = res['data'];
|
||||
if(newattendees!= null){
|
||||
newattendees.forEach(newattendee => {
|
||||
let att = {
|
||||
'UserEmail': newattendee.EmailAddress,
|
||||
'UserType': 'I',
|
||||
};
|
||||
if(this.participants == null){
|
||||
this.participants = new Array();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
|
||||
if(data){
|
||||
data = data['data'];
|
||||
|
||||
const newAttendees: EventPerson[] = data['taskParticipants'];
|
||||
const newAttendeesCC: EventPerson[] = data['taskParticipantsCc'];
|
||||
|
||||
this.setIntervenient(newAttendees);
|
||||
this.setIntervenientCC(newAttendeesCC);
|
||||
}
|
||||
this.participants.push(att);
|
||||
});
|
||||
}
|
||||
this.postData.UsersSelected = this.participants;
|
||||
console.log(this.postData);
|
||||
});
|
||||
} 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() {
|
||||
|
||||
this.adding = "CC";
|
||||
this.contacts = this.taskParticipantsCc;
|
||||
|
||||
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
|
||||
this.openAttendees();
|
||||
}
|
||||
|
||||
dynamicSetIntervenient({taskParticipants, taskParticipantsCc}){
|
||||
this.taskParticipants = taskParticipants;
|
||||
this.taskParticipantsCc = taskParticipantsCc;
|
||||
}
|
||||
|
||||
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() {
|
||||
this.showAttendees = false;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<ion-header class="ion-no-border px-20">
|
||||
<ion-toolbar class="px-10">
|
||||
<ion-title class="pa-0">Adicionar intervenientes</ion-title>
|
||||
<ion-title>Agenda Desktop</ion-title>
|
||||
</ion-toolbar>
|
||||
<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>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<ion-content>
|
||||
<ion-item-group>
|
||||
<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-item-group>
|
||||
<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 { EventsService } from 'src/app/services/events.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 { BadRequestPage } from '../../popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage} from '../../popover/success-message/success-message.page';
|
||||
@@ -140,7 +141,8 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
public alertController: AlertController,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private processes:ProcessesService,
|
||||
private animationController: AnimationController
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
|
||||
this.serialNumber = this.navParams.get('serialNumber');
|
||||
@@ -253,9 +255,9 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
}
|
||||
|
||||
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
|
||||
this.successMessage('Evento editado')
|
||||
this.toastService.successMessage('Evento editado');
|
||||
}, 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') {
|
||||
delete document.action
|
||||
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{
|
||||
//this.successMessage()
|
||||
this.toastService.successMessage();
|
||||
}, error =>{
|
||||
this.badRequest()
|
||||
this.toastService.badRequest();
|
||||
});
|
||||
} else if(document['action'] == 'delete') {
|
||||
delete document.action
|
||||
this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{
|
||||
//this.successMessage()
|
||||
this.toastService.successMessage()
|
||||
}, 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