mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
Add task from aganda
This commit is contained in:
@@ -9,6 +9,7 @@ export class Attachment {
|
||||
CreateDate: string;
|
||||
Stakeholders: string;
|
||||
Link: string;
|
||||
ApplicationId?: string;
|
||||
//Data: any;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import { EventPerson } from './eventperson.model';
|
||||
import { SearchDocument } from './search-document';
|
||||
|
||||
export class Event{
|
||||
ParentId?: string;
|
||||
EventId: string;
|
||||
Subject: string;
|
||||
Body: EventBody;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
export class ProcessTask {
|
||||
SerialNumber: string
|
||||
actions: string;
|
||||
formURL: string
|
||||
originator: {
|
||||
email: string,
|
||||
manager: string,
|
||||
displayName: "",
|
||||
fqn: string,
|
||||
username: string
|
||||
}
|
||||
serialNumber: string
|
||||
taskStartDate: string
|
||||
workflowDisplayName: string
|
||||
workflowID: number
|
||||
workflowInstanceDataFields: {
|
||||
FsId: string,
|
||||
MessageId: string,
|
||||
UserId: string,
|
||||
DocId: string,
|
||||
ViewerRequest: string,
|
||||
}
|
||||
workflowInstanceFolio: string
|
||||
workflowInstanceID: number
|
||||
workflowName: string
|
||||
}
|
||||
+26
-16
@@ -79,6 +79,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
SourceId: this.task.workflowInstanceDataFields.DocId,
|
||||
|
||||
};
|
||||
|
||||
this.postData.DispatchFolder = this.dispatchFolder;
|
||||
this.postData.UsersSelected = this.participants;
|
||||
/* By Default TypeDeadline should be 'Normal' */
|
||||
@@ -95,10 +96,16 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.taskDate = new Date(this.task.taskStartDate);
|
||||
|
||||
this.getAttachments();
|
||||
if(!this.task.hasOwnProperty('isEvent')) {
|
||||
// if not
|
||||
this.getAttachments();
|
||||
}
|
||||
|
||||
this.getSubjectType();
|
||||
|
||||
}
|
||||
|
||||
close(){
|
||||
@@ -106,17 +113,17 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
|
||||
getSubjectType(){
|
||||
getSubjectType() {
|
||||
this.processes.GetSubjectType().subscribe(res=>{
|
||||
console.log(res);
|
||||
this.subjectTypes = res;
|
||||
});
|
||||
}
|
||||
cancelTask(){
|
||||
cancelTask() {
|
||||
this.modalController.dismiss(null);
|
||||
|
||||
}
|
||||
saveTask(){
|
||||
saveTask() {
|
||||
|
||||
let attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
attendees = attendees.map(function(val) {
|
||||
@@ -126,8 +133,8 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
};
|
||||
})
|
||||
|
||||
if(this.taskParticipants.length > 0){
|
||||
switch (this.taskType){
|
||||
if(this.taskParticipants.length > 0) {
|
||||
switch (this.taskType) {
|
||||
case '0':
|
||||
this.postData = {
|
||||
DistributionType: "Paralelo",
|
||||
@@ -138,7 +145,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
UsersSelected: attendees,
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
}
|
||||
console.log(this.postData);
|
||||
console.log('this.postData', this.postData, this.taskType);
|
||||
this.processes.postDespatcho(this.postData);
|
||||
break;
|
||||
case '1':
|
||||
@@ -168,23 +175,26 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
this.processes.postDeferimento(this.postData);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
this.modalController.dismiss('openDiscart');
|
||||
/* this.distartExpedientModal();
|
||||
this.close(); */
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.alertController.presentAlert("Lista de intervenientes vazia. Por favor, adicione 1 ou mais intervenientes.");
|
||||
}
|
||||
|
||||
}
|
||||
getAttachments(){
|
||||
|
||||
getAttachments() {
|
||||
this.attachmentsService.getAttachmentsBySerial(this.task.serialNumber).subscribe(res=>{
|
||||
this.loadedAttachments = res;
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
|
||||
async addParticipants(){
|
||||
async addParticipants() {
|
||||
/* console.log('HERES'); */
|
||||
|
||||
|
||||
@@ -227,7 +237,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
async addParticipantsCc(){
|
||||
async addParticipantsCc() {
|
||||
|
||||
this.adding = "CC";
|
||||
this.contacts = this.taskParticipantsCc;
|
||||
@@ -268,7 +278,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async distartExpedientModal(){
|
||||
async distartExpedientModal() {
|
||||
const modal = await this.modalController.create({
|
||||
component: DiscartExpedientModalPage,
|
||||
componentProps: {
|
||||
@@ -290,7 +300,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
async setContact(data:EventPerson[]){
|
||||
async setContact(data:EventPerson[]) {
|
||||
|
||||
if(this.adding == "intervenient"){
|
||||
this.taskParticipants = data;
|
||||
@@ -301,15 +311,15 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async setIntervenient(data){
|
||||
async setIntervenient(data) {
|
||||
this.taskParticipants = data;
|
||||
}
|
||||
|
||||
async setIntervenientCC(data){
|
||||
async setIntervenientCC(data) {
|
||||
this.taskParticipantsCc = data;
|
||||
}
|
||||
|
||||
async closeComponent(){
|
||||
async closeComponent() {
|
||||
this.showAttendees = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import { BookMeetingModalPage } from '../book-meeting-modal/book-meeting-modal.p
|
||||
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
|
||||
import { momentG } from 'src/plugin/momentG'
|
||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { ProcessTask } from 'src/app/models/task';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente-detail',
|
||||
@@ -84,6 +85,9 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
"FsId": res.workflowInstanceDataFields.FsId,
|
||||
"DocId": res.workflowInstanceDataFields.DocId,
|
||||
}
|
||||
|
||||
console.log('task', this.fulltask);
|
||||
|
||||
this.fulltask = res;
|
||||
console.log('GetTask', res);
|
||||
|
||||
|
||||
@@ -6,19 +6,19 @@
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<ion-list>
|
||||
<ion-item (click)="openExpedientActionsModal('0',fulltask)">
|
||||
<ion-item *ngIf="loadedAttachments.length >=1" (click)="openExpedientActionsModal('0',fulltask)">
|
||||
<ion-icon name="documents" slot="start"></ion-icon>
|
||||
<ion-label>Efectuar Despacho</ion-label>
|
||||
</ion-item>
|
||||
<ion-item (click)="openExpedientActionsModal('1',fulltask)">
|
||||
<ion-item *ngIf="loadedAttachments.length >=1" (click)="openExpedientActionsModal('1',fulltask)">
|
||||
<ion-icon name="arrow-undo" slot="start"></ion-icon>
|
||||
<ion-label>Pedido de Parecer</ion-label>
|
||||
</ion-item>
|
||||
<ion-item (click)="openExpedientActionsModal('2',fulltask)">
|
||||
<ion-item *ngIf="loadedAttachments.length >=1" (click)="openExpedientActionsModal('2',fulltask)">
|
||||
<ion-icon name="arrow-redo" slot="start"></ion-icon>
|
||||
<ion-label>Pedido de Deferimento</ion-label>
|
||||
</ion-item>
|
||||
<ion-item (click)="openBookMeetingModal(task)">
|
||||
<ion-item *ngIf="loadedAttachments.length >=1" (click)="openBookMeetingModal(task)">
|
||||
<ion-icon name="calendar" slot="start"></ion-icon>
|
||||
<ion-label>Marcar reunião</ion-label>
|
||||
</ion-item>
|
||||
@@ -30,7 +30,7 @@
|
||||
<ion-icon name="create-outline" slot="start"></ion-icon>
|
||||
<ion-label>Editar</ion-label>
|
||||
</ion-item>
|
||||
<ion-item hidden disabled>
|
||||
<ion-item *ngIf="loadedAttachments.lenght >=1" hidden disabled>
|
||||
<ion-icon name="paper-plane" slot="start"></ion-icon>
|
||||
<ion-label>Enviar para pendentes</ion-label>
|
||||
</ion-item>
|
||||
|
||||
@@ -5,10 +5,11 @@ import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { Event } from 'src/app/models/event.model';
|
||||
import { EditEventPage } from 'src/app/pages/agenda/edit-event/edit-event.page';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
import { momentG } from 'src/plugin/momentG';
|
||||
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-event',
|
||||
@@ -40,7 +41,6 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
@Output() viewEventDetailDismiss = new EventEmitter<any>();
|
||||
|
||||
|
||||
constructor(
|
||||
private eventsService: EventsService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
@@ -54,7 +54,6 @@ export class ViewEventPage implements OnInit {
|
||||
this.loadedEvent = new Event();
|
||||
this.eventBody = { BodyType : "1", Text : ""};
|
||||
this.loadedEvent.Body = this.eventBody;
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -86,10 +85,8 @@ export class ViewEventPage implements OnInit {
|
||||
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
|
||||
this.getAttachments(this.loadedEvent.EventId);
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
deleteEvent(){
|
||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async () =>
|
||||
{
|
||||
@@ -129,7 +126,6 @@ export class ViewEventPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
async openExpedientActionsModal(taskAction: any, task: any) {
|
||||
//this.modalController.dismiss();
|
||||
let classs;
|
||||
@@ -138,6 +134,21 @@ export class ViewEventPage implements OnInit {
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
|
||||
this.loadedAttachments.forEach((attachment)=>{
|
||||
task = {
|
||||
serialNumber: attachment.SourceId,
|
||||
taskStartDate: attachment.CreateDate,
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FsId: attachment.ApplicationId,
|
||||
FolderID: null,
|
||||
DocId: attachment.SourceId,
|
||||
Subject: attachment.SourceName
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ExpedientTaskModalPage,
|
||||
componentProps: {
|
||||
@@ -160,4 +171,39 @@ export class ViewEventPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async openBookMeetingModal(task: any) {
|
||||
|
||||
this.loadedAttachments.forEach((attachment)=>{
|
||||
task = {
|
||||
serialNumber: attachment.SourceId,
|
||||
taskStartDate: attachment.CreateDate,
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FsId: attachment.ApplicationId,
|
||||
FolderID: null,
|
||||
DocId: attachment.SourceId,
|
||||
Subject: attachment.SourceName
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
component: BookMeetingModalPage,
|
||||
componentProps: {
|
||||
task: task,
|
||||
},
|
||||
cssClass: classs,
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user