mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Fix
This commit is contained in:
@@ -6,11 +6,11 @@ import { CreateProcessPage } from 'src/app/modals/create-process/create-process.
|
||||
import { DarParecerPage } from 'src/app/modals/dar-parecer/dar-parecer.page';
|
||||
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||
import { PermissionService } from 'src/app/OtherService/permission.service';
|
||||
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 { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Location } from '@angular/common';
|
||||
import { PedidoService } from 'src/app/Rules/pedido.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-request-options',
|
||||
@@ -35,7 +35,7 @@ export class RequestOptionsPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
private router: Router,
|
||||
public p: PermissionService,
|
||||
private location: Location
|
||||
private pedidoService: PedidoService
|
||||
) {
|
||||
this.task = this.navParams.get('task');
|
||||
this.fulltask = this.navParams.get('fulltask');
|
||||
@@ -137,7 +137,6 @@ export class RequestOptionsPage implements OnInit {
|
||||
if(res['data']=='openDiscart') {
|
||||
console.log('open discart');
|
||||
|
||||
this.distartExpedientModal();
|
||||
} else {
|
||||
this.popoverController.dismiss('close')
|
||||
}
|
||||
@@ -145,29 +144,6 @@ export class RequestOptionsPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
async distartExpedientModal() {
|
||||
this.popoverController.dismiss();
|
||||
console.log(this.fulltask);
|
||||
const modal = await this.modalController.create({
|
||||
component: DiscartExpedientModalPage,
|
||||
componentProps: {
|
||||
serialNumber: this.fulltask.serialNumber,
|
||||
folderId: this.fulltask.workflowInstanceDataFields.FolderID,
|
||||
action: 'complete',
|
||||
},
|
||||
cssClass: 'discart-expedient-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
if(res['data']=='close') {
|
||||
this.close();
|
||||
} else {}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
async repreciar(note:string, documents:any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
@@ -195,7 +171,7 @@ export class RequestOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
async openAddNoteModal(actionName:string) {
|
||||
this.popoverController.dismiss();
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
classs = 'modal modal-desktop'
|
||||
@@ -229,7 +205,7 @@ export class RequestOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
if(res.data){
|
||||
if(res.data) {
|
||||
if(actionName == 'Solicitar Reapreciação') {
|
||||
|
||||
await this.repreciar(res.data.note, docs);
|
||||
@@ -237,29 +213,27 @@ export class RequestOptionsPage implements OnInit {
|
||||
else if(actionName == 'Arquivar') {
|
||||
await this.arquivar(res.data.note, docs);
|
||||
this.popoverController.dismiss('close')
|
||||
this.modalController.dismiss('close');
|
||||
alert('close')
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
async arquivar(note:string, documents:any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Arquivo",
|
||||
"ActionTypeId": 95,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
await this.pedidoService.arquivar({serialNumber: this.serialNumber,
|
||||
documents,
|
||||
note
|
||||
}).toPromise()
|
||||
|
||||
this.toastService.successMessage('Processo arquivado')
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não arquivado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -290,7 +264,6 @@ export class RequestOptionsPage implements OnInit {
|
||||
|
||||
async openDelegarModal(task: any) {
|
||||
|
||||
this.popoverController.dismiss();
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
@@ -307,7 +280,13 @@ export class RequestOptionsPage implements OnInit {
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
modal.onDidDismiss().then( async (res)=> {
|
||||
|
||||
if(res['data']=='close') {
|
||||
this.popoverController.dismiss('close');
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user