Saidas testastas

This commit is contained in:
Eudes Inácio
2023-02-27 22:16:15 +01:00
parent 75e6a62695
commit c037078ca7
6 changed files with 116 additions and 16 deletions
@@ -6,6 +6,11 @@ import { ProcessesService } from 'src/app/services/processes.service';
import { ToastService } from 'src/app/services/toast.service';
import { RouteService } from 'src/app/services/route.service';
import { PermissionService } from 'src/app/services/permission.service';
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
import { AttachmentList } from 'src/app/models/Excludetask';
import { DespachoService } from 'src/app/Rules/despacho.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-deploma-options',
@@ -28,14 +33,17 @@ export class DeplomaOptionsPage implements OnInit {
private navParams: NavParams,
private toastService: ToastService,
private RouteService: RouteService,
public p: PermissionService,) {
public p: PermissionService,
private despachoService: DespachoService,
private httpErroHandle: HttpErrorHandle) {
this.serialNumber = this.navParams.get('serialNumber');
this.task = this.navParams.get('task');
this.fulltask = this.navParams.get('fulltask');
}
ngOnInit() {
console.log(this.fulltask)
console.log(this.task)
}
async openAddNoteModal(actionName:string) {
@@ -85,6 +93,9 @@ export class DeplomaOptionsPage implements OnInit {
} else if(actionName == 'Concluir diploma'){
await this.finish(res.data.note, docs);
this.goBack();
} else if (actionName == 'Arquivo') {
await this.arquivar(res.data.note, docs);
this.goBack();
}
}
});
@@ -233,6 +244,80 @@ export class DeplomaOptionsPage implements OnInit {
}
async arquivar(note: string, documents: AttachmentList) {
const loader = this.toastService.loading()
try {
await this.despachoService.arquivar(note, documents, this.serialNumber).toPromise()
this.httpErroHandle.httpsSucessMessagge('Arquivar')
this.close();
} catch (error) {
this.httpErroHandle.httpStatusHandle(error)
}
finally {
loader.remove()
}
}
async openExpedientActionsModal(taskAction: any, task: any) {
let classs;
if (window.innerWidth <= 800) {
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
console.log("fulltask options", this.fulltask)
const modal = await this.modalController.create({
component: CreateProcessPage,
componentProps: {
taskAction: taskAction,
task: task,
profile: this.profile,
fulltask: this.fulltask
},
cssClass: classs,
});
await modal.present();
modal.onDidDismiss().then(async (res) => {
if (res['data'] == 'openDiscart') {
await this.distartExpedientModal();
}
this.goBack();
});
}
async distartExpedientModal() {
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();
/*
this.close();
this.openMenu(); */
}
});
}
goBack() {
this.RouteService.goBack()
}