mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -435,6 +435,17 @@ export class CreateProcessPage implements OnInit {
|
|||||||
"AttachmentList" :null,
|
"AttachmentList" :null,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(this.task.activityInstanceName =='Tarefa de Despacho'){
|
||||||
|
body = {
|
||||||
|
"serialNumber": this.task.serialNumber,
|
||||||
|
"action": "Conhecimento",
|
||||||
|
"ActionTypeId": 92,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": message,
|
||||||
|
},
|
||||||
|
"AttachmentList" :null,
|
||||||
|
}
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
body = {
|
body = {
|
||||||
"serialNumber": this.task.serialNumber,
|
"serialNumber": this.task.serialNumber,
|
||||||
|
|||||||
+1
-32
@@ -45,7 +45,6 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private activateRoute: ActivatedRoute,
|
|
||||||
private processes: ProcessesService,
|
private processes: ProcessesService,
|
||||||
private iab: InAppBrowser,
|
private iab: InAppBrowser,
|
||||||
private attachments: AttachmentsService,
|
private attachments: AttachmentsService,
|
||||||
@@ -59,35 +58,17 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private animationController: AnimationController,
|
private animationController: AnimationController,
|
||||||
) {
|
) {
|
||||||
|
this.activatedRoute.paramMap.subscribe(params => {
|
||||||
this.activateRoute.paramMap.subscribe(params => {
|
|
||||||
console.log(params["params"]);
|
|
||||||
|
|
||||||
if(params["params"].SerialNumber) {
|
if(params["params"].SerialNumber) {
|
||||||
this.serialnumber = params["params"].SerialNumber;
|
this.serialnumber = params["params"].SerialNumber;
|
||||||
}
|
}
|
||||||
if(params["params"].caller) {
|
if(params["params"].caller) {
|
||||||
this.caller = params["params"].caller;
|
this.caller = params["params"].caller;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.profile = "mdgpr";
|
|
||||||
|
|
||||||
this.activateRoute.paramMap.subscribe(paramMap => {
|
|
||||||
if (!paramMap["params"].SerialNumber) {
|
|
||||||
console.log('HERE');
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.log(paramMap);
|
|
||||||
|
|
||||||
this.LoadTaskDetail(this.serialnumber);
|
|
||||||
this.LoadRelatedEvents(this.serialnumber);
|
|
||||||
});
|
|
||||||
this.LoadTaskDetail(this.serialnumber);
|
this.LoadTaskDetail(this.serialnumber);
|
||||||
this.LoadRelatedEvents(this.serialnumber);
|
this.LoadRelatedEvents(this.serialnumber);
|
||||||
}
|
}
|
||||||
@@ -115,7 +96,6 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
console.log('HERE');
|
|
||||||
this.activatedRoute.paramMap.subscribe(params => {
|
this.activatedRoute.paramMap.subscribe(params => {
|
||||||
switch (params["params"].caller) {
|
switch (params["params"].caller) {
|
||||||
case 'events':
|
case 'events':
|
||||||
@@ -155,8 +135,6 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
async LoadTaskDetail(serial: string) {
|
async LoadTaskDetail(serial: string) {
|
||||||
|
|
||||||
this.processes.GetTask(serial).subscribe(res => {
|
this.processes.GetTask(serial).subscribe(res => {
|
||||||
/* console.log(res); */
|
|
||||||
|
|
||||||
this.task = {
|
this.task = {
|
||||||
"SerialNumber": res.serialNumber,
|
"SerialNumber": res.serialNumber,
|
||||||
"Folio": res.workflowInstanceDataFields.Subject,
|
"Folio": res.workflowInstanceDataFields.Subject,
|
||||||
@@ -171,11 +149,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
"WorkflowName": res.workflowDisplayName,
|
"WorkflowName": res.workflowDisplayName,
|
||||||
"Status": res.workflowInstanceDataFields.Status,
|
"Status": res.workflowInstanceDataFields.Status,
|
||||||
}
|
}
|
||||||
|
|
||||||
//console.log('task', this.task);
|
|
||||||
|
|
||||||
this.fulltask = res;
|
this.fulltask = res;
|
||||||
//console.log('GetTask', res);
|
|
||||||
|
|
||||||
let thedate = new Date(this.task.CreateDate);
|
let thedate = new Date(this.task.CreateDate);
|
||||||
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
||||||
@@ -188,8 +162,6 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
this.cc = users.filter(user=>{
|
this.cc = users.filter(user=>{
|
||||||
return user.Type == 'CC';
|
return user.Type == 'CC';
|
||||||
});
|
});
|
||||||
console.log(users);
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -201,14 +173,12 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
async LoadRelatedEvents(serial: string) {
|
async LoadRelatedEvents(serial: string) {
|
||||||
if (this.eventsList == null) {
|
if (this.eventsList == null) {
|
||||||
this.attachments.getAttachmentsBySerial(serial).subscribe(res => {
|
this.attachments.getAttachmentsBySerial(serial).subscribe(res => {
|
||||||
console.log(res);
|
|
||||||
res.forEach(att => {
|
res.forEach(att => {
|
||||||
if (this.eventsList == null) {
|
if (this.eventsList == null) {
|
||||||
this.eventsList = new Array();
|
this.eventsList = new Array();
|
||||||
}
|
}
|
||||||
this.events.getEvent(att.ParentId).subscribe(event => {
|
this.events.getEvent(att.ParentId).subscribe(event => {
|
||||||
this.eventsList.push(event);
|
this.eventsList.push(event);
|
||||||
console.log(this.eventsList);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -217,7 +187,6 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
|
|
||||||
viewDocument(){
|
viewDocument(){
|
||||||
this.processes.GetDocumentUrl(this.task.DocId, this.task.FsId).subscribe(res=>{
|
this.processes.GetDocumentUrl(this.task.DocId, this.task.FsId).subscribe(res=>{
|
||||||
console.log(res);
|
|
||||||
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||||
const browser = this.iab.create(url,"_blank");
|
const browser = this.iab.create(url,"_blank");
|
||||||
browser.show();
|
browser.show();
|
||||||
|
|||||||
@@ -245,9 +245,7 @@ export class EventsService {
|
|||||||
getEvent(eventid: string): Observable<Event>{
|
getEvent(eventid: string): Observable<Event>{
|
||||||
let geturl = environment.apiURL + 'calendar/GetEvent';
|
let geturl = environment.apiURL + 'calendar/GetEvent';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
console.log(eventid);
|
|
||||||
|
|
||||||
|
|
||||||
params = params.set("EventId", eventid);
|
params = params.set("EventId", eventid);
|
||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
|
|||||||
@@ -244,7 +244,6 @@ export class ProcessesService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GetDocumentDetails(DocId:string, FsId:string){
|
GetDocumentDetails(DocId:string, FsId:string){
|
||||||
console.log(DocId);
|
|
||||||
|
|
||||||
const geturl = environment.apiURL + 'search/documents';
|
const geturl = environment.apiURL + 'search/documents';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
||||||
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
|
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
|
||||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
@@ -19,8 +19,8 @@
|
|||||||
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
||||||
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
|
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
|
||||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
@@ -28,8 +28,8 @@
|
|||||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
|
||||||
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
|
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
|
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
|
||||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export class DespachosOptionsPage implements OnInit {
|
|||||||
this.goBack()
|
this.goBack()
|
||||||
}
|
}
|
||||||
|
|
||||||
async openExpedientActionsModal(taskAction: any, task: any) {
|
async openTaskProcessModal(taskAction: any, task: any) {
|
||||||
this.popoverController.dismiss();
|
this.popoverController.dismiss();
|
||||||
let classs;
|
let classs;
|
||||||
if( window.innerWidth <= 800){
|
if( window.innerWidth <= 800){
|
||||||
@@ -58,11 +58,7 @@ export class DespachosOptionsPage implements OnInit {
|
|||||||
});
|
});
|
||||||
await modal.present();
|
await modal.present();
|
||||||
modal.onDidDismiss().then(res=>{
|
modal.onDidDismiss().then(res=>{
|
||||||
console.log(res['data']);
|
this.goBack();
|
||||||
if(res['data']=='openDiscart'){
|
|
||||||
console.log('open discart');
|
|
||||||
this.distartExpedientModal();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,16 +271,7 @@ export class DespachosOptionsPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
goBack() {
|
goBack() {
|
||||||
|
this.router.navigate(['/home/gabinete-digital/despachos']);
|
||||||
let navigationExtras: NavigationExtras = {
|
|
||||||
queryParams: {
|
|
||||||
// "despachospr": true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.router.navigate(['/home/gabinete-digital/despachos'], navigationExtras);
|
|
||||||
|
|
||||||
// window.history.back()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<button (click)="openExpedientActionsModal('1',fulltask)" full class="btn-ok" shape="round" >Pedido de Parecer</button>
|
<button (click)="openExpedientActionsModal('1',fulltask)" full class="btn-ok" shape="round" >Pedido de Parecer</button>
|
||||||
<button (click)="openExpedientActionsModal('2',fulltask)" full class="btn-ok" shape="round" >Pedido de Deferimento</button>
|
<button (click)="openExpedientActionsModal('2',fulltask)" full class="btn-ok" shape="round" >Pedido de Deferimento</button>
|
||||||
<button (click)="openBookMeetingModal()" full class="btn-ok" shape="round" >Marcar reunião</button>
|
<button (click)="openBookMeetingModal()" full class="btn-ok" shape="round" >Marcar reunião</button>
|
||||||
<button (click)="distartExpedientModal()" full class="btn-ok" shape="round" >Descartar</button>
|
<button (click)="distartExpedientModal('descartar')" full class="btn-ok" shape="round" >Descartar</button>
|
||||||
<button (click)="sendExpedienteToPending()" full class="btn-ok" shape="round" *ngIf="showEnviarPendentes" >Enviar para pendentes</button>
|
<button (click)="sendExpedienteToPending()" full class="btn-ok" shape="round" *ngIf="showEnviarPendentes" >Enviar para pendentes</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
|
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
||||||
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||||
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||||
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||||
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||||
import { ProcessesService } from 'src/app/services/processes.service';
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-opts-expediente',
|
selector: 'app-opts-expediente',
|
||||||
@@ -14,6 +16,7 @@ export class OptsExpedientePage implements OnInit {
|
|||||||
task:any;
|
task:any;
|
||||||
fulltask: any;
|
fulltask: any;
|
||||||
profile:string;
|
profile:string;
|
||||||
|
caller:string;
|
||||||
|
|
||||||
showEnviarPendentes = false
|
showEnviarPendentes = false
|
||||||
|
|
||||||
@@ -22,20 +25,19 @@ export class OptsExpedientePage implements OnInit {
|
|||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
private navParams: NavParams,
|
private navParams: NavParams,
|
||||||
private processes: ProcessesService,
|
private processes: ProcessesService,
|
||||||
|
private toastService: ToastService,
|
||||||
|
private router: Router,
|
||||||
|
private activatedRoute: ActivatedRoute,
|
||||||
) {
|
) {
|
||||||
this.task = this.navParams.get('task');
|
this.task = this.navParams.get('task');
|
||||||
this.fulltask = this.navParams.get('fulltask');
|
this.fulltask = this.navParams.get('fulltask');
|
||||||
|
|
||||||
this.showEnviarPendentes = this.navParams.get('showEnviarPendentes');
|
if(this.task.Status != 'Pending'){
|
||||||
|
this.showEnviarPendentes = true;
|
||||||
if(!this.showEnviarPendentes) this.showEnviarPendentes = false
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
console.log(this.task);
|
|
||||||
this.profile = "mdgpr";
|
|
||||||
|
|
||||||
window.onresize = (event) => {
|
window.onresize = (event) => {
|
||||||
if( window.innerWidth >= 800){
|
if( window.innerWidth >= 800){
|
||||||
this.popoverController.dismiss();
|
this.popoverController.dismiss();
|
||||||
@@ -52,10 +54,50 @@ export class OptsExpedientePage implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
goBack() {
|
||||||
|
if(this.task.Status == "Pending" && this.caller != 'events'){
|
||||||
|
if (window.innerWidth <= 800) {
|
||||||
|
this.router.navigate(['/home/gabinete-digital/pendentes']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let navigationExtras: NavigationExtras = {
|
||||||
|
queryParams: {
|
||||||
|
"pendentes": true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.activatedRoute.paramMap.subscribe(params => {
|
||||||
|
switch (params["params"].caller) {
|
||||||
|
case 'events':
|
||||||
|
this.router.navigate(['/home',params["params"].caller]);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'gabinete-digital':
|
||||||
|
let navigationExtras: NavigationExtras = {
|
||||||
|
queryParams: {
|
||||||
|
"expedientes": true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( window.innerWidth < 801) {
|
||||||
|
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||||
|
} else {
|
||||||
|
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sendExpedienteToPending() {
|
sendExpedienteToPending() {
|
||||||
|
this.close();
|
||||||
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
|
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
|
||||||
console.log(res);
|
this.goBack();
|
||||||
this.close();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,45 +134,82 @@ export class OptsExpedientePage implements OnInit {
|
|||||||
componentProps: {
|
componentProps: {
|
||||||
taskAction: taskAction,
|
taskAction: taskAction,
|
||||||
task: task,
|
task: task,
|
||||||
profile: this.profile,
|
|
||||||
},
|
},
|
||||||
cssClass: classs,
|
cssClass: classs,
|
||||||
});
|
});
|
||||||
await modal.present();
|
await modal.present();
|
||||||
modal.onDidDismiss().then(res=>{
|
modal.onDidDismiss().then(res=>{
|
||||||
console.log(res['data']);
|
console.log(res['data']);
|
||||||
if(res['data']=='openDiscart'){
|
let body = res['data'];
|
||||||
console.log('open discart');
|
if(res['data']){
|
||||||
|
console.log('open discart')
|
||||||
this.distartExpedientModal();
|
this.distartExpedientModal(body);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
console.log('Not open');
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async distartExpedientModal(){
|
async distartExpedientModal(body:any){
|
||||||
this.close();
|
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
component: DiscartExpedientModalPage,
|
component: DiscartExpedientModalPage,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
serialNumber: this.fulltask.serialNumber,
|
|
||||||
folderId: this.fulltask.workflowInstanceDataFields.FolderID,
|
|
||||||
action: 'complete',
|
|
||||||
},
|
},
|
||||||
cssClass: 'discart-expedient-modal',
|
cssClass: 'discart-expedient-modal',
|
||||||
backdropDismiss: false
|
backdropDismiss: false
|
||||||
});
|
});
|
||||||
|
|
||||||
await modal.present();
|
await modal.present();
|
||||||
modal.onDidDismiss().then(res=>{
|
modal.onDidDismiss().then( async (res)=>{
|
||||||
if(res['data']=='close'){
|
console.log(res['data']);
|
||||||
this.close();
|
|
||||||
/* console.log('2Expedient Discard closed2');
|
if(body == 'descartar'){
|
||||||
this.close();
|
if(res['data']== 'Yes'){
|
||||||
this.openMenu(); */
|
let otherbody = {
|
||||||
|
"serialNumber": this.task.SerialNumber,
|
||||||
|
"action": "Passivo",
|
||||||
|
"ActionTypeId": 99999877,
|
||||||
|
"dataFields": {
|
||||||
|
"Note": "",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(otherbody).toPromise()
|
||||||
|
this.toastService.successMessage('Processo descartado');
|
||||||
|
this.goBack();
|
||||||
|
} catch (error) {
|
||||||
|
this.toastService.badRequest('Processo não descartado')
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(res['data'] == 'No'){
|
||||||
|
//Do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(res['data']== 'Yes'){
|
||||||
|
try {
|
||||||
|
await this.processes.CompleteTask(body).toPromise();
|
||||||
|
this.toastService.successMessage('Processo descartado');
|
||||||
|
this.goBack();
|
||||||
|
} catch (error) {
|
||||||
|
this.toastService.badRequest('Processo não descartado')
|
||||||
|
}
|
||||||
|
this.goBack();
|
||||||
|
}
|
||||||
|
else if(res['data'] == 'No'){
|
||||||
|
console.log('Update');
|
||||||
|
try {
|
||||||
|
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
|
||||||
|
this.toastService.successMessage();
|
||||||
|
this.goBack();
|
||||||
|
} catch (error) {
|
||||||
|
this.toastService.badRequest()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user