mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Add task from aganda
This commit is contained in:
+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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user