mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<ion-header>
|
||||
<ion-header class="ion-no-border">
|
||||
<div class="title">
|
||||
<div class="thetitle"><ion-label >Diplomas</ion-label></div>
|
||||
<div class="theicon">
|
||||
@@ -7,7 +7,7 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<ion-toolbar>
|
||||
<!-- <ion-toolbar>
|
||||
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
||||
<ion-segment-button value="validar">
|
||||
Diplomas por validar
|
||||
@@ -16,7 +16,7 @@
|
||||
Diplomas assinados PR
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
</ion-toolbar> -->
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
|
||||
@@ -28,6 +28,7 @@ constructor(
|
||||
private alertService: AlertService,
|
||||
) {
|
||||
this.profile = 'mdgpr';
|
||||
this.segment = 'validar'
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -44,8 +45,11 @@ notImplemented(){
|
||||
}
|
||||
|
||||
async LoadList(){
|
||||
this.diplomasList = new Array();
|
||||
|
||||
|
||||
let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
||||
this.diplomasList = new Array();
|
||||
|
||||
console.log(diplomas);
|
||||
switch (this.segment) {
|
||||
case 'validar':
|
||||
@@ -120,5 +124,4 @@ async viewPedidoDetail(serialNumber:any) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</ion-header>
|
||||
</div>
|
||||
<ion-item-sliding class="overflow-y-auto">
|
||||
|
||||
{{ eventProcess.serialNumber }}
|
||||
<div class="px-20">
|
||||
<div class="ion-item-container width-100">
|
||||
<ion-input placeholder="Assunto" [(ngModel)]="eventProcess.workflowInstanceDataFields.Subject"></ion-input>
|
||||
@@ -191,7 +191,7 @@
|
||||
<div class="d-flex container-div width-100" >
|
||||
<ion-list class="width-100 ">
|
||||
<ion-item class="width-100" *ngFor="let document of loadedAttachments">
|
||||
<ion-label class="width-100 d-block list">
|
||||
<ion-label class="width-100 d-block list" *ngIf="document.action != 'delete' ">
|
||||
<p class="d-flex ion-justify-content-between">
|
||||
<span class="attach-title-item">{{document.SourceName}}</span>
|
||||
<span class="app-name" *ngIf="document.ApplicationId == 8"> Correspondencia </span>
|
||||
|
||||
@@ -2,12 +2,13 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { AlertController, ModalController, NavParams } from '@ionic/angular';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page';
|
||||
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 { Event } from '../../../models/event.model';
|
||||
import { Event, EventToApproveEdit } from '../../../models/event.model';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -18,9 +19,11 @@ import { Event } from '../../../models/event.model';
|
||||
export class EditEventToApproveComponent implements OnInit {
|
||||
|
||||
serialNumber: string
|
||||
loadedAttachments:any
|
||||
loadedAttachments: Attachment[]
|
||||
|
||||
|
||||
eventProcess = {
|
||||
serialNumber: "",
|
||||
taskStartDate: "",
|
||||
workflowInstanceDataFields:{
|
||||
Body: "",
|
||||
@@ -30,11 +33,87 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
EndDate: '',
|
||||
Location: '',
|
||||
Subject: '',
|
||||
InstanceId: ''
|
||||
InstanceId: '',
|
||||
EventType: '',
|
||||
StartDate: '',
|
||||
MDEmail: '',
|
||||
MDName: '',
|
||||
IsAllDayEvent: '',
|
||||
Message: ''
|
||||
}
|
||||
}
|
||||
|
||||
show =false
|
||||
// event ={
|
||||
// "serialNumber":"9073_118",
|
||||
// "originator":{
|
||||
// "email":"gilson.manuel@gabinetedigital.local",
|
||||
// "manager":"",
|
||||
// "displayName":"",
|
||||
// "fqn":"K2:GABINETEDIGITAL\\gilson.manuel",
|
||||
// "username":"GABINETEDIGITAL\\gilson.manuel"
|
||||
// },
|
||||
// "actions":null,
|
||||
// "workflowInstanceFolio":"Final do sprint",
|
||||
// "taskStartDate":"4/30/2021 9:06:48 AM",
|
||||
// "workflowID":4365,
|
||||
// "workflowInstanceID":9073,
|
||||
// "workflowName":"MDGPR\\Agenda Oficial MDGPR",
|
||||
// "workflowDisplayName":"Agenda Oficial MDGPR",
|
||||
// "formURL":"http://bpmdev.gabinetedigital.local/Runtime/Runtime/Form/Exchange+Calendar+Meeting+Approval/?SerialNo=9073_118",
|
||||
// "workflowInstanceDataFields": {
|
||||
// "Body":"Será fechado o sprint 1 - 26 Abr - 30 Abr",
|
||||
// "Location":"Equilibrium - Sala de reuniões",
|
||||
// "Subject":"Final do sprint",
|
||||
// "StartDate":"2021-04-30T15:00:00",
|
||||
// "EndDate":"2021-04-30T15:30:00",
|
||||
// "Participants":"gilson.manuel@gabinetedigital.local;tiago.kayaya@gabinetedigital.local;solange.vandunem@gabinetedigital.local",
|
||||
// "CC":"",
|
||||
// "ReviewerComments":"teste",
|
||||
// "Role":0,
|
||||
// "MDName":"Paulo Pinto",
|
||||
// "MDEmail":"paulo.pinto@gabinetedigital.local",
|
||||
// "PREmail":"",
|
||||
// "OriginatorComments":"",
|
||||
// "Status":"Active",
|
||||
// "TimeZone":"W. Central Africa Standard Time",
|
||||
// "Agenda":"Oficial",
|
||||
// "EventType":"Reunião",
|
||||
// "EventID":"",
|
||||
// "IsRecurring":false,
|
||||
// "ParticipantsList":[
|
||||
// {
|
||||
// "$type":null,
|
||||
// "EmailAddress":"gilson.manuel@gabinetedigital.local",
|
||||
// "Name":"Gilson Manuel",
|
||||
// "IsRequired":true
|
||||
// },
|
||||
// {
|
||||
// "$type":null,
|
||||
// "EmailAddress":"tiago.kayaya@gabinetedigital.local",
|
||||
// "Name":"Tiago Kayaya",
|
||||
// "IsRequired":true
|
||||
// },
|
||||
// {
|
||||
// "$type":null,
|
||||
// "EmailAddress":"solange.vandunem@gabinetedigital.local",
|
||||
// "Name":"Solange Van-Dúnem",
|
||||
// "IsRequired":true
|
||||
// }
|
||||
// ],
|
||||
// "EventOrganizer":"{\"$type\":\"Gabinete.k2RESTidentifier_EventPerson, Gabinete, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\",\"EmailAddress\":\"agenda.mdgpr@gabinetedigital.local\",\"Name\":\"Agenda do Ministro e Director do Gabinete do PR\",\"IsRequired\":true}",
|
||||
// "CreateEvent":"",
|
||||
// "IsAllDayEvent":false,
|
||||
// "SerializedItem":"{\"$type\":\"GabineteDigitalV4.k2RESTidentifier_NotificationData[], GabineteDigitalV4, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\",\"$values\":[{\"$type\":\"GabineteDigitalV4.k2RESTidentifier_NotificationData, GabineteDigitalV4, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\",\"Service\":\"gabinete-digital\",\"Object\":\"event-list\",\"idObject\":\"9073_118\"}]}",
|
||||
// "MDwxUserID":261,
|
||||
// "DeserializedItem":"{\"$type\":\"GabineteDigitalV4.k2RESTidentifier_NotificationData, GabineteDigitalV4, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\",\"Service\":\"gabinete-digital\",\"Object\":\"event-list\",\"idObject\":\"9073_118\"}",
|
||||
// "Message":"Foi actualizado o",
|
||||
// "InstanceId":"R0RfR0FCSU5FVEVESUdJVEFMXGdpbHNvbi5tYW51ZWxfMjAyMS0wNC0zMCAwODowNDoyN1o=",
|
||||
// "For Each Result":"",
|
||||
// "For Each Index":0
|
||||
// }
|
||||
// }
|
||||
|
||||
show = false
|
||||
|
||||
postEvent: Event;
|
||||
isRecurring:string;
|
||||
@@ -78,7 +157,6 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
|
||||
const result = await this.processes.GetTask(this.serialNumber).subscribe( result =>{
|
||||
this.eventProcess = result
|
||||
console.log('this.eventProcess', this.eventProcess);
|
||||
|
||||
console.log(this.eventProcess.workflowInstanceDataFields.Subject)
|
||||
|
||||
@@ -114,7 +192,7 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
}
|
||||
|
||||
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => {
|
||||
if(e.IsRequired){
|
||||
if(e.IsRequired) {
|
||||
this.taskParticipants.push(e);
|
||||
} else {
|
||||
this.taskParticipantsCc.push(e);
|
||||
@@ -139,10 +217,55 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
save() {
|
||||
save() {
|
||||
|
||||
this.taskParticipantsCc.forEach(e=>{
|
||||
e.IsRequired = false
|
||||
})
|
||||
|
||||
this.eventProcess.workflowInstanceDataFields.ParticipantsList = this.taskParticipants.concat(this.taskParticipantsCc)
|
||||
|
||||
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e=>{
|
||||
|
||||
if(e.hasOwnProperty('$type')) {
|
||||
delete e.$type
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
const event: any = {
|
||||
Agenda: this.eventProcess.workflowInstanceDataFields.Agenda,
|
||||
Body: this.eventProcess.workflowInstanceDataFields.Body,
|
||||
EndDate: this.eventProcess.workflowInstanceDataFields.EndDate,
|
||||
EventType: this.eventProcess.workflowInstanceDataFields.EventType,
|
||||
IsAllDayEvent: this.eventProcess.workflowInstanceDataFields.IsAllDayEvent,
|
||||
IsRecurring: this.eventProcess.workflowInstanceDataFields.IsRecurring,
|
||||
Location: this.eventProcess.workflowInstanceDataFields.Location,
|
||||
Subject: this.eventProcess.workflowInstanceDataFields.Subject,
|
||||
serialNumber: this.eventProcess.serialNumber,
|
||||
StartDate: this.eventProcess.workflowInstanceDataFields.StartDate,
|
||||
MDEmail: this.eventProcess.workflowInstanceDataFields.MDEmail,
|
||||
MDName: this.eventProcess.workflowInstanceDataFields.MDName,
|
||||
Message: this.eventProcess.workflowInstanceDataFields.Message,
|
||||
ParticipantsList: this.eventProcess.workflowInstanceDataFields.ParticipantsList,
|
||||
Private: false,
|
||||
ReviewerComments: ''
|
||||
}
|
||||
|
||||
this.eventsService.postEventToApproveEdit(event).subscribe()
|
||||
|
||||
|
||||
this.loadedAttachments.forEach((document:any)=>{
|
||||
if(document['action'] == 'add'){
|
||||
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{});
|
||||
} else if(document['action'] == 'delete') {
|
||||
this.attachmentsService.deleteEventAttachmentById(document).subscribe( res=>{})
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
alert('save')
|
||||
}
|
||||
|
||||
async openAttendees() {
|
||||
@@ -206,17 +329,22 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
|
||||
|
||||
async getAttachments() {
|
||||
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
|
||||
|
||||
console.log(this.loadedAttachments)
|
||||
let result: any = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
|
||||
|
||||
result.forEach((e)=>{
|
||||
e.action = false
|
||||
})
|
||||
|
||||
this.loadedAttachments = result
|
||||
|
||||
console.log('this.loadedAttachments', this.loadedAttachments, result)
|
||||
}
|
||||
|
||||
deleteAttachment(attachmentID: string) {
|
||||
deleteAttachment(attachment: Attachment) {
|
||||
|
||||
this.attachmentsService.deleteEventAttachmentById(attachment.Id).subscribe( res=>{})
|
||||
|
||||
this.attachmentsService.deleteEventAttachmentById(attachmentID).subscribe(
|
||||
res=>{
|
||||
this.loadedAttachments = this.loadedAttachments.filter(e=> e.Id.toString() != attachmentID);
|
||||
})
|
||||
}
|
||||
|
||||
async getDoc() {
|
||||
@@ -233,24 +361,31 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
if(res){
|
||||
|
||||
const data = res.data;
|
||||
const data: SearchDocument = res.data.selected;
|
||||
|
||||
//data.selected
|
||||
const DocumentToSave = {
|
||||
SourceTitle: data.selected.Assunto,
|
||||
const DocumentToSave: any = {
|
||||
SourceTitle: data.Assunto,
|
||||
ParentId: this.InstanceId,
|
||||
Source: '1',
|
||||
SourceId: data.selected.Id,
|
||||
ApplicationId: data.selected.ApplicationType.toString(),
|
||||
SourceId: data.Id,
|
||||
ApplicationId: data.ApplicationType.toString(),
|
||||
Id: '',
|
||||
Link: '',
|
||||
SerialNumber: ''
|
||||
SerialNumber: '',
|
||||
action: 'add',
|
||||
CreateDate: data.Data,
|
||||
Data: data.Data,
|
||||
Description: data.DocTypeDesc,
|
||||
SourceName: data.Assunto,
|
||||
Stakeholders: data.EntidadeOrganicaNome,
|
||||
};
|
||||
|
||||
await this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{
|
||||
this.getAttachments();
|
||||
});
|
||||
|
||||
this.loadedAttachments.push(DocumentToSave)
|
||||
|
||||
// await this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{
|
||||
// this.getAttachments();
|
||||
// });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user