+
{{ Document.Assunto || "Sem assunto" }} Rascunho
{{ Document.Sender}}{{ Document.DocDate | date: 'dd-MM-yyyy HH:mm' }}
diff --git a/src/app/shared/gabinete-digital/generic/task-details/task-details.page.scss b/src/app/shared/gabinete-digital/generic/task-details/task-details.page.scss
index a030067a5..3538bd4f8 100644
--- a/src/app/shared/gabinete-digital/generic/task-details/task-details.page.scss
+++ b/src/app/shared/gabinete-digital/generic/task-details/task-details.page.scss
@@ -183,9 +183,6 @@ ion-button{
}
}
@media only screen and (min-width: 801px) {
- .div-icon{
- display: none;
- }
.content{
width: 65%;
border-right: 1px solid #d8d8d8;
@@ -261,7 +258,8 @@ ion-button{
}
.mobile-header {
- flex-grow: 1;
+ display: flex;
+ justify-content: space-around;
}
.content-details {
diff --git a/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts b/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts
index ad347b67c..be4244646 100644
--- a/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts
+++ b/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts
@@ -46,7 +46,7 @@ export class PendentesPage implements OnInit {
private router: Router,
private sortService: SortService,
private storage: Storage,
- public TaskService: TaskService,
+ public TaskService: TaskService,
public ThemeService: ThemeService) {
this.loggeduser = SessionStore.user;
}
@@ -82,7 +82,7 @@ export class PendentesPage implements OnInit {
}
-
+
ngOnDestroy() {
this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
@@ -99,7 +99,7 @@ export class PendentesPage implements OnInit {
async dynamicSearch() {
if(this.showSearch && this.searchSubject) {
-
+
const list = this.pendentesstore.list.filter((task) => {
let subject = task.Folio || task.Subject || task.workflowInstanceDataFields.Subject
subject = subject.toLowerCase();
@@ -146,11 +146,11 @@ export class PendentesPage implements OnInit {
this.listToPresent = pendentesList
this.pendentesstore.reset(pendentesList);
this.storage.set('pendente-list',pendentesList).then(() => {
-
+
})
this.dynamicSearch()
-
+
}, (error) => {
this.skeletonLoader = false;
if(error.status == 0){
@@ -165,7 +165,7 @@ export class PendentesPage implements OnInit {
this.listToPresent =pendentes
})
}
-
+
doRefresh(event) {
if (event) {
setTimeout(() => {
@@ -183,13 +183,13 @@ export class PendentesPage implements OnInit {
async viewTaskDetails({ SerialNumber, WorkflowName, activityInstanceName }:customTask) {
- //
+ //
if(WorkflowName == 'Despacho') {
this.router.navigate(['/home/gabinete-digital/despachos',SerialNumber,'gabinete-digital']);
}
else if (WorkflowName == 'Despacho do Presidente da República') {
- this.router.navigate(['/home/gabinete-digital/despachos', SerialNumber, 'gabinete-digital']);
+ this.router.navigate(['/home/gabinete-digital/despachos-pr', SerialNumber, 'gabinete-digital']);
}
else if(WorkflowName == 'Pedido de Parecer' || WorkflowName == 'Pedido de Deferimento' || WorkflowName == 'Pedido de Parecer do Presidente') {
this.router.navigate(['/home/gabinete-digital/pedidos',SerialNumber,'gabinete-digital']);
@@ -207,7 +207,7 @@ export class PendentesPage implements OnInit {
this.router.navigate(['/home/gabinete-digital/despachos',SerialNumber,'gabinete-digital']);
}
else {
-
+
}
}
diff --git a/src/app/shared/popover/desktop/deploma-options/deploma-options-routing.module.ts b/src/app/shared/popover/desktop/deploma-options/deploma-options-routing.module.ts
new file mode 100644
index 000000000..3b1c53b2a
--- /dev/null
+++ b/src/app/shared/popover/desktop/deploma-options/deploma-options-routing.module.ts
@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { DiplomaOptionsPage } from './deploma-options.page';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: DiplomaOptionsPage
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule],
+})
+export class DeplomaOptionsPageRoutingModule {}
diff --git a/src/app/shared/popover/desktop/deploma-options/deploma-options.module.ts b/src/app/shared/popover/desktop/deploma-options/deploma-options.module.ts
new file mode 100644
index 000000000..e6866f35a
--- /dev/null
+++ b/src/app/shared/popover/desktop/deploma-options/deploma-options.module.ts
@@ -0,0 +1,30 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { DeplomaOptionsPageRoutingModule } from './deploma-options-routing.module';
+
+import { DiplomaOptionsPage } from './deploma-options.page';
+import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
+import { CreateProcessPageModule } from 'src/app/modals/create-process/create-process.module';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ DeplomaOptionsPageRoutingModule,
+ CreateProcessPageModule
+ ],
+ declarations: [
+ DiplomaOptionsPage,
+ ],
+ exports: [DiplomaOptionsPage],
+ entryComponents: [
+ DiplomaOptionsPage,
+ CreateProcessPage
+ ]
+})
+export class DeplomaOptionsPageModule {}
diff --git a/src/app/shared/popover/desktop/deploma-options/deploma-options.page.html b/src/app/shared/popover/desktop/deploma-options/deploma-options.page.html
new file mode 100644
index 000000000..87e350eda
--- /dev/null
+++ b/src/app/shared/popover/desktop/deploma-options/deploma-options.page.html
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
diff --git a/src/app/shared/popover/desktop/deploma-options/deploma-options.page.scss b/src/app/shared/popover/desktop/deploma-options/deploma-options.page.scss
new file mode 100644
index 000000000..60dbe2483
--- /dev/null
+++ b/src/app/shared/popover/desktop/deploma-options/deploma-options.page.scss
@@ -0,0 +1,56 @@
+@import '~src/function.scss';
+
+.options-container{
+ --padding-top:20px !important;
+ --padding-bottom:20px !important;
+ --padding-start:20px !important;
+ --padding-end:20px !important;
+}
+.arrow-right {
+ margin-bottom: 20px;
+ .arrow-right-icon {
+ width: 37px;
+ float: right;
+ font-size: rem(35);
+ overflow: hidden;
+ }
+}
+.buttons {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-around;
+}
+.solid {
+ width: 90%;
+ border-top: 1px solid #bbb;
+ margin: 0 auto !important;
+ }
+ .btn-ok, .btn-cancel, .btn-delete{
+ width: 100% !important;
+ margin: 5px 5px 5px 5px !important;
+ }
+
+@media only screen and (max-width: 800px) {
+ .btn-ok, .btn-cancel, .btn-delete{
+ width: 100% !important;
+ min-width: 300px;
+ }
+}
+@media only screen and (min-width: 1024px) {
+ .arrow-right{
+ display: flex;
+ justify-content: flex-end;
+ }
+ .btn-cancel{
+ width: 100% !important;
+ margin-bottom: 10px !important;
+ }
+ .btn-delete, .btn-ok{
+ width: 100% !important;
+ margin-bottom: 10px !important;
+ margin-top: 10px !important;
+ }
+ /* .solid{
+ display: block;
+ } */
+}
diff --git a/src/app/shared/popover/desktop/deploma-options/deploma-options.page.spec.ts b/src/app/shared/popover/desktop/deploma-options/deploma-options.page.spec.ts
new file mode 100644
index 000000000..46b0d3958
--- /dev/null
+++ b/src/app/shared/popover/desktop/deploma-options/deploma-options.page.spec.ts
@@ -0,0 +1,24 @@
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+import { IonicModule } from '@ionic/angular';
+
+import { DeplomaOptionsPage } from './deploma-options.page';
+
+describe('DeplomaOptionsPage', () => {
+ let component: DeplomaOptionsPage;
+ let fixture: ComponentFixture
;
+
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ declarations: [ DeplomaOptionsPage ],
+ imports: [IonicModule.forRoot()]
+ }).compileComponents();
+
+ fixture = TestBed.createComponent(DeplomaOptionsPage);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ }));
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/shared/popover/desktop/deploma-options/deploma-options.page.ts b/src/app/shared/popover/desktop/deploma-options/deploma-options.page.ts
new file mode 100644
index 000000000..e9ca3988c
--- /dev/null
+++ b/src/app/shared/popover/desktop/deploma-options/deploma-options.page.ts
@@ -0,0 +1,428 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController, NavParams, PopoverController } from '@ionic/angular';
+import { AddNotePage } from 'src/app/modals/add-note/add-note.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 { 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';
+import { TaskService } from 'src/app/services/task.service'
+import { PopupQuestionPage } from 'src/app/modals/popup-question/popup-question.page';
+
+@Component({
+ selector: 'app-deploma-options',
+ templateUrl: './deploma-options.page.html',
+ styleUrls: ['./deploma-options.page.scss'],
+})
+export class DiplomaOptionsPage implements OnInit {
+
+
+ serialNumber: string;
+ profile: string;
+ task: any
+ fulltask: any
+ DraftIds = ""
+ DraftNames = ""
+ asDraft: boolean;
+
+
+ constructor(
+ public popoverController: PopoverController,
+ private modalController: ModalController,
+ private processes: ProcessesService,
+ private navParams: NavParams,
+ private toastService: ToastService,
+ private RouteService: RouteService,
+ public p: PermissionService,
+ private despachoService: DespachoService,
+ private httpErroHandle: HttpErrorHandle,
+ public TaskService: TaskService) {
+ this.serialNumber = this.navParams.get('serialNumber');
+ this.task = this.navParams.get('task');
+ this.fulltask = this.navParams.get('fulltask');
+
+ this.DraftIds = this.navParams.get("DraftIds");
+ this.DraftNames = this.navParams.get("DraftNames");
+ this.asDraft = this.navParams.get('asDraft');
+
+
+ console.log('this.task', this.task)
+
+ }
+
+ ngOnInit() {
+ console.log(this.task.activityInstanceName)
+
+ }
+
+ async openAddNoteModal(actionName: string) {
+ // this.popoverController.dismiss();
+ let classs;
+ if (window.innerWidth <= 800) {
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: AddNotePage,
+ componentProps: {
+ actionName: actionName
+ },
+ cssClass: classs,
+ backdropDismiss: true
+ });
+
+ modal.onDidDismiss().then(async (res) => {
+ if (res.data) {
+
+
+ const DocumentToSave = res.data.documents.map((e) => {
+ return {
+ ApplicationId: e.ApplicationType,
+ SourceId: e.Id,
+ }
+ });
+
+ let docs = {
+ ProcessInstanceID: "",
+ Attachments: DocumentToSave,
+ }
+
+ if (actionName == 'Solicitar assinatura') {
+ await this.askSignature(res.data.note, docs);
+ this.goBack();
+ } else if (actionName == 'Solicitar alteração') {
+ await this.askToChange(res.data.note, docs);
+ this.goBack();
+ } else if (actionName == 'Assinar Diploma') {
+ await this.sign(res.data.note, docs);
+ this.goBack();
+ } 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();
+ } else if (actionName == 'AssinarNew') {
+ await this.AssinarNew(res.data.note, docs)
+ }
+ }
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async askToChange(note: string, documents: any) {
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Retificar",
+ "ActionTypeId": 99999841,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList": documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.close();
+ this.toastService._successMessage()
+ } catch (error) {
+ if (error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+
+ async openBookMeetingModal(task: any) {
+ this.popoverController.dismiss();
+ let classs;
+ if (window.innerWidth <= 800) {
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: BookMeetingModalPage,
+ componentProps: {
+ task: this.task,
+ fulltask: this.fulltask
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+ await modal.present();
+ modal.onDidDismiss().then(
+ () => { },
+ (error) => {
+ console.log(error)
+ }
+ )
+ }
+
+
+ async askSignature(note: string, documents: any) {
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Aprovar",
+ "ActionTypeId": 99999840,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList": documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.close();
+ this.toastService._successMessage()
+ } catch (error) {
+ if (error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+
+ async sign(note?: string, documents?: any) {
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Assinado",
+ "ActionTypeId": 99999842,
+ "FolderId": this.task.FolderID,
+ "dataFields": {
+ "ReviewUserComment": note,
+ "InstanceIDNew": this.task.InstanceID,
+ "DraftIds": "",
+ },
+ "AttachmentList": {
+ "ProcessInstanceID": this.task.InstanceID,
+ /* "DraftIds": null, */
+ "Attachments": []
+ },
+ }
+
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.httpErroHandle.httpsSucessMessagge('Assinado')
+ } catch (error) {
+ if (error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+ this.toastService._badRequest()
+ }
+ } finally { }
+ }
+
+ async AssinarNew(note?, doc?) {
+
+ if (this.asDraft) {
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: PopupQuestionPage,
+ componentProps: {
+ title: 'Deseja assinar este Diploma?',
+ /* message: 'Nota: Ao Efetuar esta operação, o tratamento deste diploma não poderá ser realizado a partir da caixa de correspondência' */
+
+ },
+ cssClass: "popup-question discart-expedient-modal",
+ backdropDismiss: true
+ });
+
+ modal.onDidDismiss().then(async (res) => {
+ const data = res.data
+ if (data == "Yes") {
+
+ console.log(' diploma options Draft draft',this.DraftIds)
+ let body = {
+ "InstanceId": this.task.InstanceID,
+ "FolderId": this.task.FolderID,
+ "DraftIds": this.task.DraftIds,
+ "OriginalFileName": this.DraftNames
+ }
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.presidentialActionsSignature(body).toPromise()
+ await this.sign()
+ this.TaskService.loadDiplomas()
+ this.goBack();
+ } catch (error) {
+ this.httpErroHandle.httpStatusHandle(error)
+ }
+ finally {
+ loader.remove()
+ }
+ }
+
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ } else {
+ this.httpErroHandle.validationMessagge("diplomaAsDraft");
+ }
+
+ }
+
+
+ async finish(note: string, documents: any) {
+
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Concluir",
+ "ActionTypeId": 95,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList": documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise();
+ this.toastService._successMessage('Processo concluído')
+ } catch (error) {
+ if (error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ }
+ finally {
+ loader.remove()
+ }
+
+ }
+
+ 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'
+ }
+
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: CreateProcessPage,
+ componentProps: {
+ taskAction: taskAction,
+ task: task,
+ profile: this.profile,
+ fulltask: this.fulltask
+ },
+ cssClass: classs,
+ });
+ modal.onDidDismiss().then(async (res) => {
+
+
+ if (res['data'] == 'openDiscart') {
+ await this.distartExpedientModal();
+ }
+
+ this.goBack();
+ }, (error) => {
+ console.log(error)
+ }).catch(e => {
+ console.log(e)
+ })
+
+ await modal.present();
+ }
+
+ async distartExpedientModal() {
+
+ this.modalController.dismiss()
+ 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
+ });
+
+ modal.onDidDismiss().then(res => {
+ if (res['data'] == 'close') {
+ this.close();
+ /*
+ this.close();
+ this.openMenu(); */
+ }
+
+ }, (error) => {
+ console.log(error)
+ }).catch(e => {
+ console.log(e)
+ })
+
+ await modal.present();
+
+ }
+
+ goBack() {
+ this.RouteService.goBack()
+ this.TaskService.loadDiplomas()
+ }
+
+
+ close() {
+ this.popoverController.dismiss();
+ }
+
+}
diff --git a/src/app/shared/popover/desktop/despachos-options/despachos-options-routing.module.ts b/src/app/shared/popover/desktop/despachos-options/despachos-options-routing.module.ts
new file mode 100644
index 000000000..247b1696e
--- /dev/null
+++ b/src/app/shared/popover/desktop/despachos-options/despachos-options-routing.module.ts
@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { DespachosOptionsPage } from './despachos-options.page';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: DespachosOptionsPage
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule],
+})
+export class DespachosOptionsPageRoutingModule {}
diff --git a/src/app/shared/popover/desktop/despachos-options/despachos-options.module.ts b/src/app/shared/popover/desktop/despachos-options/despachos-options.module.ts
new file mode 100644
index 000000000..1819906f6
--- /dev/null
+++ b/src/app/shared/popover/desktop/despachos-options/despachos-options.module.ts
@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { DespachosOptionsPageRoutingModule } from './despachos-options-routing.module';
+
+import { DespachosOptionsPage } from './despachos-options.page';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ DespachosOptionsPageRoutingModule
+ ],
+ declarations: [DespachosOptionsPage]
+})
+export class DespachosOptionsPageModule {}
diff --git a/src/app/shared/popover/desktop/despachos-options/despachos-options.page.html b/src/app/shared/popover/desktop/despachos-options/despachos-options.page.html
new file mode 100644
index 000000000..43eb6c605
--- /dev/null
+++ b/src/app/shared/popover/desktop/despachos-options/despachos-options.page.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/shared/popover/desktop/despachos-options/despachos-options.page.scss b/src/app/shared/popover/desktop/despachos-options/despachos-options.page.scss
new file mode 100644
index 000000000..0fc2784b5
--- /dev/null
+++ b/src/app/shared/popover/desktop/despachos-options/despachos-options.page.scss
@@ -0,0 +1,40 @@
+@import '~src/function.scss';
+
+.options-container {
+ --padding-top:20px !important;
+ --padding-bottom:20px !important;
+ --padding-start:20px !important;
+ --padding-end:20px !important;
+
+}
+.arrow-right {
+ display: none;
+ margin-bottom: 20px;
+ .arrow-right-icon {
+ width: 37px;
+ float: right;
+ font-size: rem(35);
+ overflow: hidden;
+ }
+}
+.buttons {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-around;
+}
+.solid {
+ display: none;
+ width: 90%;
+ border-top: 1px solid #bbb;
+ margin: 0 auto !important;
+ }
+ .btn-ok, .btn-cancel, .btn-delete{
+ width: 100% !important;
+ margin: 5px 5px 5px 5px !important;
+ }
+
+.pr-options {
+ .btn-ok, .btn-cancel{
+ width: 100% !important;
+ }
+}
diff --git a/src/app/shared/popover/desktop/despachos-options/despachos-options.page.spec.ts b/src/app/shared/popover/desktop/despachos-options/despachos-options.page.spec.ts
new file mode 100644
index 000000000..80e0e3a7f
--- /dev/null
+++ b/src/app/shared/popover/desktop/despachos-options/despachos-options.page.spec.ts
@@ -0,0 +1,24 @@
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+import { IonicModule } from '@ionic/angular';
+
+import { DespachosOptionsPage } from './despachos-options.page';
+
+describe('DespachosOptionsPage', () => {
+ let component: DespachosOptionsPage;
+ let fixture: ComponentFixture;
+
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ declarations: [ DespachosOptionsPage ],
+ imports: [IonicModule.forRoot()]
+ }).compileComponents();
+
+ fixture = TestBed.createComponent(DespachosOptionsPage);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ }));
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/shared/popover/desktop/despachos-options/despachos-options.page.ts b/src/app/shared/popover/desktop/despachos-options/despachos-options.page.ts
new file mode 100644
index 000000000..5d918d424
--- /dev/null
+++ b/src/app/shared/popover/desktop/despachos-options/despachos-options.page.ts
@@ -0,0 +1,402 @@
+import { Component, OnInit } from '@angular/core';
+import { ProcessesService } from 'src/app/services/processes.service';
+import { ModalController, NavParams, PopoverController } from '@ionic/angular';
+import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
+import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
+import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
+import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
+import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
+import { ToastService } from 'src/app/services/toast.service';
+import { customTask, fullTask } from 'src/app/models/dailyworktask.model';
+import { PermissionService } from 'src/app/services/permission.service';
+import { ThemeService } from 'src/app/services/theme.service'
+import { RouteService } from 'src/app/services/route.service';
+import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
+import { environment } from 'src/environments/environment';
+import { TaskService } from 'src/app/services/task.service'
+
+@Component({
+ selector: 'app-despachos-options',
+ templateUrl: './despachos-options.page.html',
+ styleUrls: ['./despachos-options.page.scss'],
+})
+export class DespachosOptionsPage implements OnInit {
+
+ task: customTask
+ fulltask: fullTask;
+ serialNumber: string;
+ environment = environment
+
+ constructor(
+ private processes: ProcessesService,
+ private modalController: ModalController,
+ public popoverController: PopoverController,
+ private navParams: NavParams,
+ private toastService: ToastService,
+ public p: PermissionService,
+ public ThemeService: ThemeService,
+ private RouteService: RouteService,
+ private httpErrorHandle: HttpErrorHandle,
+ public TaskService: TaskService
+ ) {
+
+ this.task = this.navParams.get('task')
+ this.fulltask = this.navParams.get('fulltask')
+
+
+ this.serialNumber = this.task.SerialNumber
+ }
+
+ ngOnInit() {
+ }
+
+
+ async openTaskProcessModal(taskAction: any, task: any) {
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: CreateProcessPage,
+ componentProps: {
+ taskAction: taskAction,
+ task: task,
+ fulltask: this.fulltask
+ },
+ cssClass: classs,
+ });
+
+ modal.onDidDismiss().then( res => {
+ // this.goBack();
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ sendExpedienteToPending() {
+ const loader = this.toastService.loading()
+ this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
+ this.httpErrorHandle.httpsSucessMessagge('Enviar para Pendentes')
+ loader.remove()
+
+ this.goBack('back');
+ },(error)=>{
+ loader.remove()
+ this.httpErrorHandle.httpStatusHandle(error)
+ });
+ }
+
+ async distartExpedientModal() {
+
+ this.modalController.dismiss()
+ 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
+ });
+
+
+ modal.onDidDismiss().then(res=>{
+ if(res['data']=='close'){
+ this.goBack('back');
+ }
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+
+ async openBookMeetingModal(task: any) {
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: BookMeetingModalPage,
+ componentProps: {
+ task: this.task,
+ fulltask:this.fulltask
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then(() => {
+ this.goBack('no');
+ }, (error) => {
+ console.log(error)
+ })
+
+ await modal.present();
+ }
+
+ async openDelegarModal(task: any) {
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: DelegarPage,
+ componentProps: {
+ task: this.task,
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+ modal.onDidDismiss().then(res => {
+ if(res){
+ const data = res.data;
+ if(data == 'close') {
+ this.goBack('back');
+ }
+ }
+
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async generateDiploma(note:string, documents:any){
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Reencaminhar",
+ "ActionTypeId": 99999839,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.toastService._successMessage()
+ this.goBack('back');
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+ async openAddNoteModal(actionName:string) {
+
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: AddNotePage,
+ componentProps: {
+ showAttachmentBtn: true,
+ actionName:actionName
+ },
+ cssClass: classs,
+ backdropDismiss: true
+ });
+
+ await modal.present();
+
+ modal.onDidDismiss().then(async (res) => {
+
+ if(res.data) {
+
+ const DocumentToSave = res.data.documents.map((e) => {
+ return {
+ ApplicationId: e.ApplicationType,
+ SourceId: e.Id,
+ }
+ });
+
+ let docs = {
+ ProcessInstanceID: "",
+ Attachments: DocumentToSave,
+ }
+
+ if(actionName == 'Executado') {
+ await this.executado(res.data.note, docs);
+ }
+ else if(actionName == 'Arquivar') {
+ await this.arquivar(res.data.note, docs);
+ }
+ else if(actionName == 'Gerar Diploma') {
+ await this.generateDiploma(res.data.note, docs);
+ }
+ else if(actionName == 'Concluido') {
+ this.concluir(res.data.note, docs);
+ }
+ else if(actionName == 'Reexecução') {
+ await this.reexecutar(res.data.note, docs);
+ }
+
+ }
+ }, (error) => {
+ console.log(error)
+ });
+ }
+
+
+
+ async concluir(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()
+ this.httpErrorHandle.httpsSucessMessagge('Concluir Despacho')
+ this.TaskService.loadDiplomas()
+ } catch (error) {
+ this.httpErrorHandle.httpStatusHandle(error)
+ }
+ finally {
+ loader.remove()
+ }
+
+ }
+
+ 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()
+ this.toastService._successMessage('Processo arquivado')
+ this.goBack('back');
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest('Processo não arquivado')
+ }
+ } finally {
+ loader.remove()
+ }
+
+
+ }
+
+
+ async executado(note:string, documents:any) {
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Conhecimento",
+ "ActionTypeId": 104,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.goBack('back');
+ this.toastService._successMessage()
+ } catch(error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+
+
+ async reexecutar(note:string, documents:any){
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Reexecução",
+ "ActionTypeId": 100000010,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.toastService._successMessage()
+ this.goBack('back');
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+ goBack(params) {
+ this.popoverController.dismiss(params)
+ }
+
+}
diff --git a/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options-routing.module.ts b/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options-routing.module.ts
new file mode 100644
index 000000000..ad795c4a1
--- /dev/null
+++ b/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options-routing.module.ts
@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { DespachosPrOptionsPage } from './despachos-pr-options.page';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: DespachosPrOptionsPage
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule],
+})
+export class DespachosPrOptionsPageRoutingModule {}
diff --git a/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options.module.ts b/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options.module.ts
new file mode 100644
index 000000000..9d9d93f52
--- /dev/null
+++ b/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options.module.ts
@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { DespachosPrOptionsPageRoutingModule } from './despachos-pr-options-routing.module';
+
+import { DespachosPrOptionsPage } from './despachos-pr-options.page';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ DespachosPrOptionsPageRoutingModule
+ ],
+ declarations: [DespachosPrOptionsPage]
+})
+export class DespachosPrOptionsPageModule {}
diff --git a/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options.page.html b/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options.page.html
new file mode 100644
index 000000000..56bd1cd09
--- /dev/null
+++ b/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options.page.html
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options.page.scss b/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options.page.scss
new file mode 100644
index 000000000..1922fb246
--- /dev/null
+++ b/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options.page.scss
@@ -0,0 +1,49 @@
+@import '~src/function.scss';
+
+:host {
+ height: 100% !important;
+ width: 100% !important;
+}
+
+.options-container{
+ --padding-top:20px !important;
+ --padding-bottom:20px !important;
+ --padding-start:20px !important;
+ --padding-end:20px !important;
+ width: 100%;
+}
+.arrow-right{
+ display: none;
+ margin-bottom: 20px;
+ .arrow-right-icon{
+ width: 37px;
+ float: right;
+ font-size: rem(35);
+ overflow: hidden;
+ }
+}
+.buttons{
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-around;
+}
+.solid {
+ display: none;
+ width: 90%;
+ border-top: 1px solid #bbb;
+ margin: 0 auto !important;
+ }
+ .btn-ok, .btn-cancel{
+ //width: 50% !important;
+ margin-bottom: 5px !important;
+ margin-top: 5px !important;
+}
+.btn-ok, .btn-cancel, .btn-delete{
+ width: 100% !important;
+}
+
+
+.desk{
+ text-align: left;
+ background-color: white;
+}
diff --git a/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options.page.spec.ts b/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options.page.spec.ts
new file mode 100644
index 000000000..4d505a9c7
--- /dev/null
+++ b/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options.page.spec.ts
@@ -0,0 +1,24 @@
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+import { IonicModule } from '@ionic/angular';
+
+import { DespachosPrOptionsPage } from './despachos-pr-options.page';
+
+describe('DespachosPrOptionsPage', () => {
+ let component: DespachosPrOptionsPage;
+ let fixture: ComponentFixture;
+
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ declarations: [ DespachosPrOptionsPage ],
+ imports: [IonicModule.forRoot()]
+ }).compileComponents();
+
+ fixture = TestBed.createComponent(DespachosPrOptionsPage);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ }));
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options.page.ts b/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options.page.ts
new file mode 100644
index 000000000..c1f36ad52
--- /dev/null
+++ b/src/app/shared/popover/desktop/despachos-pr-options/despachos-pr-options.page.ts
@@ -0,0 +1,430 @@
+import { Component, OnInit } from '@angular/core';
+import { ProcessesService } from 'src/app/services/processes.service';
+import { ActivatedRoute, Router } from '@angular/router';
+import { ModalController } from '@ionic/angular';
+import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
+import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
+import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
+import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
+import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
+import { ToastService } from 'src/app/services/toast.service';
+import { PermissionService } from 'src/app/services/permission.service';
+import { ThemeService } from 'src/app/services/theme.service'
+import { RouteService } from 'src/app/services/route.service';
+import { environment } from 'src/environments/environment';
+import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
+import { TaskService } from 'src/app/services/task.service'
+
+
+@Component({
+ selector: 'app-despachos-pr-options',
+ templateUrl: './despachos-pr-options.page.html',
+ styleUrls: ['./despachos-pr-options.page.scss'],
+})
+export class DespachosPrOptionsPage implements OnInit {
+
+
+ task: any;
+ fulltask: any;
+ serialNumber: string;
+ profile: string
+ environment = environment
+
+ constructor(private activateRoute: ActivatedRoute,
+ private processes: ProcessesService,
+ private router: Router,
+ private modalController: ModalController,
+ private activatedRoute: ActivatedRoute,
+ private toastService: ToastService,
+ private RouteService: RouteService,
+ public p: PermissionService,
+ public ThemeService: ThemeService,
+ public TaskService: TaskService,
+ private httpErroHandle: HttpErrorHandle,
+ ) { }
+
+ ngOnInit() {
+
+ this.profile = "mdgpr";
+
+ this.activatedRoute.queryParams.subscribe(params => {
+ if(params["serialNumber"]) {
+ this.serialNumber = params["serialNumber"];
+
+ }
+ });
+
+ if(this.task.serialNumber) {
+ this.serialNumber = this.task.serialNumber
+ } else if(this.task.SerialNumber) {
+ this.serialNumber = this.task.SerialNumber
+ }
+
+ }
+
+ close () {
+ this.goBack()
+ }
+
+
+ async openExpedientActionsModal(taskAction: any, task: any) {
+ // this.modalController.dismiss();
+ this.modalController.dismiss();
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+ const modal = await this.modalController.create({
+ component: CreateProcessPage,
+ componentProps: {
+ taskAction: taskAction,
+ task: task,
+ profile: this.profile,
+ fulltask: this.fulltask
+ },
+ cssClass: classs,
+ });
+
+ modal.onDidDismiss().then( (res)=> {
+
+ if(res['data']=='openDiscart') {
+
+
+ this.distartExpedientModal();
+
+ } else {
+ this.goBack()
+ }
+
+ this.modalController.dismiss('close')
+
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ sendExpedienteToPending() {
+ const loader = this.toastService.loading()
+ this.processes.SetTaskToPending(this.serialNumber).subscribe(res=>{
+
+ this.httpErroHandle.httpsSucessMessagge('Enviar para Pendentes')
+ this.modalController.dismiss('close')
+ loader.remove()
+ },(error)=>{
+ loader.remove()
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest('Processo não encontrado')
+ }
+ });
+ }
+
+ async distartExpedientModal() {
+ this.modalController.dismiss();
+
+ 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
+ });
+
+ modal.onDidDismiss().then(res=>{
+ if(res['data']=='close'){
+ this.close();
+ /*
+ this.close();
+ this.openMenu(); */
+ }
+ this.modalController.dismiss('close')
+
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+
+ async openBookMeetingModal(task: any) {
+ this.modalController.dismiss();
+ 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: this.task,
+ fulltask:this.fulltask
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then(
+ ()=> {},
+ (error) => {
+ console.log(error)
+ }
+ )
+
+ await modal.present();
+
+ }
+
+ async openDelegarModal(task: any) {
+ this.modalController.dismiss();
+ 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: DelegarPage,
+ componentProps: {
+ task: this.task,
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then(res => {
+ if(res) {
+ const data = res.data;
+ if(data == 'close') {
+ this.goBack();
+ }
+ }
+
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async generateDiploma(note:string, documents:any) {
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Reencaminhar",
+ "ActionTypeId": 99999839,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.toastService._successMessage()
+ this.close();
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+ async openAddNoteModal(actionName:string) {
+ this.modalController.dismiss();
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop'
+ }
+ const modal = await this.modalController.create({
+ component: AddNotePage,
+ componentProps: {
+ showAttachmentBtn: true,
+ actionName:actionName
+ },
+ cssClass: classs,
+ backdropDismiss: true
+ });
+
+ modal.onDidDismiss().then(async (res) => {
+
+ if(res.data){
+
+
+
+ const DocumentToSave = res.data.documents.map((e) => {
+ return {
+ ApplicationId: e.ApplicationType,
+ SourceId: e.Id,
+ }
+ });
+
+ let docs = {
+ ProcessInstanceID: "",
+ Attachments: DocumentToSave,
+ }
+
+ if(actionName == 'Executado') {
+ await this.executado(res.data.note, docs);
+ }
+ else if(actionName == 'Arquivar') {
+ await this.arquivar(res.data.note, docs);
+ }
+ else if(actionName == 'Gerar Diploma') {
+ await this.generateDiploma(res.data.note, docs);
+ }
+ else if(actionName == 'Reexecução') {
+ await this.reexecutar(res.data.note, docs);
+ }
+ else if(actionName == 'Concluido') {
+ await this.concluir(res.data.note, docs);
+ }
+
+ this.goBack();
+ }
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+
+ async concluir(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()
+ this.httpErroHandle.httpsSucessMessagge('Concluir Despacho')
+ this.close();
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ }
+ finally {
+ loader.remove()
+ }
+
+ }
+
+ 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()
+ this.toastService.successMessage('Processo arquivado')
+ this.close();
+ } catch (error) {
+ this.toastService.badRequest('Processo não arquivado')
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+
+ async executado(note:string, documents:any){
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Conhecimento",
+ "ActionTypeId": 104,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.httpErroHandle.httpsSucessMessagge('Executado')
+ this.close();
+ this.toastService.successMessage()
+ } catch(error) {
+ this.toastService.badRequest()
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+
+ async reexecutar(note:string, documents:any){
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Reexecução",
+ "ActionTypeId": 100000010,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.httpErroHandle.httpsSucessMessagge('Reexecução')
+ this.toastService.successMessage()
+ this.close();
+ } catch (error) {
+ this.toastService.badRequest()
+ } finally {
+ loader.remove()
+ }
+ }
+
+ goBack() {
+ this.RouteService.goBack();
+ this.TaskService.loadDiplomas()
+ }
+
+ cancle() {
+ this.modalController.dismiss()
+ }
+
+}
diff --git a/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options-routing.module.ts b/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options-routing.module.ts
new file mode 100644
index 000000000..42c90e474
--- /dev/null
+++ b/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options-routing.module.ts
@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { DiplomasGerarOptionsPage } from './diplomas-gerar-options.page';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: DiplomasGerarOptionsPage
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule],
+})
+export class DiplomasGerarOptionsPageRoutingModule {}
diff --git a/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options.module.ts b/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options.module.ts
new file mode 100644
index 000000000..3a64808ef
--- /dev/null
+++ b/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options.module.ts
@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { DiplomasGerarOptionsPageRoutingModule } from './diplomas-gerar-options-routing.module';
+
+import { DiplomasGerarOptionsPage } from './diplomas-gerar-options.page';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ DiplomasGerarOptionsPageRoutingModule
+ ],
+ declarations: [DiplomasGerarOptionsPage]
+})
+export class DiplomasGerarOptionsPageModule {}
diff --git a/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options.page.html b/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options.page.html
new file mode 100644
index 000000000..5f0257527
--- /dev/null
+++ b/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options.page.html
@@ -0,0 +1,12 @@
+
diff --git a/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options.page.scss b/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options.page.scss
new file mode 100644
index 000000000..22c26e431
--- /dev/null
+++ b/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options.page.scss
@@ -0,0 +1,67 @@
+@import '~src/function.scss';
+
+.wrapper{
+ width: 100% !important;
+ padding-top:20px !important;
+ padding-bottom:20px !important;
+ }
+ .arrow-right{
+ display: none;
+ margin-bottom: 20px;
+ .arrow-right-icon{
+ width: 37px;
+ float: right;
+ font-size: rem(35);
+ overflow: hidden;
+ }
+ }
+ .buttons{
+ width: 100% !important;
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-around;
+ margin: 0 auto !important;
+ }
+ .solid {
+ display: none;
+ width: 90%;
+ border-top: 1px solid #bbb;
+ margin: 0 auto !important;
+ }
+ .btn-ok, .btn-cancel{
+ //width: 50% !important;
+ margin-bottom: 5px !important;
+ margin-top: 5px !important;
+ }
+ @media only screen and (max-width: 800px) {
+ .container{
+ width: 100% !important;
+ }
+ .btn-ok, .btn-cancel, .btn-delete{
+ width: 47% !important;
+ }
+ }
+ @media only screen and (min-width: 1024px) {
+ .container{
+ width: 100% !important;
+
+ }
+ .arrow-right{
+ display: flex;
+ justify-content: flex-end;
+ }
+ .btn-cancel{
+ display: none;
+ width: 100% !important;
+ margin-bottom: 10px !important;
+ }
+ .btn-delete, .btn-ok{
+ width: 100% !important;
+ margin-bottom: 10px !important;
+ margin-top: 10px !important;
+ }
+ /* .solid{
+ display: block;
+ } */
+ }
+
\ No newline at end of file
diff --git a/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options.page.spec.ts b/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options.page.spec.ts
new file mode 100644
index 000000000..b22d013a1
--- /dev/null
+++ b/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options.page.spec.ts
@@ -0,0 +1,24 @@
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+import { IonicModule } from '@ionic/angular';
+
+import { DiplomasGerarOptionsPage } from './diplomas-gerar-options.page';
+
+describe('DiplomasGerarOptionsPage', () => {
+ let component: DiplomasGerarOptionsPage;
+ let fixture: ComponentFixture;
+
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ declarations: [ DiplomasGerarOptionsPage ],
+ imports: [IonicModule.forRoot()]
+ }).compileComponents();
+
+ fixture = TestBed.createComponent(DiplomasGerarOptionsPage);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ }));
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options.page.ts b/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options.page.ts
new file mode 100644
index 000000000..8db44ef05
--- /dev/null
+++ b/src/app/shared/popover/desktop/diplomas-gerar-options/diplomas-gerar-options.page.ts
@@ -0,0 +1,208 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController, NavParams, PopoverController } from '@ionic/angular';
+import { ProcessesService } from 'src/app/services/processes.service';
+import { Router } from '@angular/router';
+import { ToastService } from 'src/app/services/toast.service';
+import { ThemeService } from 'src/app/services/theme.service'
+import { DespachoService } from 'src/app/Rules/despacho.service'
+import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
+import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
+import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
+import { customTask, fullTask } from 'src/app/models/dailyworktask.model';
+import { RouteService } from 'src/app/services/route.service';
+import { TaskService } from 'src/app/services/task.service'
+
+@Component({
+ selector: 'app-diplomas-gerar-options',
+ templateUrl: './diplomas-gerar-options.page.html',
+ styleUrls: ['./diplomas-gerar-options.page.scss'],
+})
+export class DiplomasGerarOptionsPage implements OnInit {
+
+ task: customTask
+ fulltask: fullTask;
+ serialNumber: string;
+
+ constructor(
+ private processes: ProcessesService,
+ public popoverController: PopoverController,
+ private modalController: ModalController,
+ private toastService: ToastService,
+ public ThemeService: ThemeService,
+ private despachoService: DespachoService,
+ private navParams: NavParams,
+ private router: Router,
+ private RouteService: RouteService,
+ public TaskService: TaskService
+ ) { }
+
+ ngOnInit() {
+ this.task = this.navParams.get('task')
+ this.fulltask = this.navParams.get('fulltask')
+ this.serialNumber = this.navParams.get('serialNumber')
+ }
+
+
+ async enviarDiploma({note = '', documents = [], serialnumber}) {
+
+ let classs;
+ if (window.innerWidth <= 800) {
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'add-note-modal-no-height'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: AddNotePage,
+ componentProps: {
+ showAttachmentBtn: true,
+ actionName:false
+ },
+ cssClass: classs,
+ backdropDismiss: true
+ });
+
+ modal.onDidDismiss().then(async (res) => {
+ if (res.data) {
+
+ const DocumentToSave = res.data.documents.map((e) => {
+ return {
+ ApplicationId: e.ApplicationType,
+ SourceId: e.Id,
+ }
+ });
+
+ let docs = {
+ ProcessInstanceID: "",
+ Attachments: DocumentToSave,
+ }
+
+ let body = {
+ "serialNumber": serialnumber,
+ "action": "Enviar diploma",
+ "ActionTypeId": 104,
+ "dataFields": {
+ "ReviewUserComment": res.data.note,
+ },
+ "AttachmentList" : docs,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise();
+ this.modalController.dismiss('sucess');
+ this.toastService._successMessage();
+ this.goBack()
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest();
+ }
+ } finally {
+ loader.remove()
+ }
+
+
+ }
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+
+ }
+
+ async sendExpedienteToPending() {
+ const loader = this.toastService.loading()
+ this.despachoService.sendExpedienteToPending(this.serialNumber).subscribe(res => {
+ this.goBack();
+ this.toastService._badRequest("Processo enviado para Pendentes")
+ loader.remove()
+ },
+ error => {
+ loader.remove()
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest("Processo não enviado para Pendentes")
+ }
+ });
+ }
+
+
+ async openBookMeetingModal() {
+ let classs;
+ if (window.innerWidth <= 800) {
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: BookMeetingModalPage,
+ componentProps: {
+ task: this.task,
+ fulltask:this.fulltask
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then(
+ ()=>{},
+ (error) => {
+ console.log(error)
+ }
+ )
+
+ await modal.present();
+ }
+
+ async openDelegarModal() {
+ let classs;
+ if (window.innerWidth <= 800) {
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: DelegarPage,
+ componentProps: {
+ task: this.task,
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then(res => {
+ if(res) {
+ const data = res.data;
+ if(data == 'close') {
+ this.goBack();
+ }
+ }
+
+ }, (error) => {
+ console.log(error)
+ });
+
+
+ await modal.present();
+ }
+
+
+ goBack() {
+
+ this.popoverController.dismiss();
+ this.RouteService.goBack();
+ this.TaskService.loadDespachos();
+ }
+
+}
diff --git a/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options-routing.module.ts b/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options-routing.module.ts
new file mode 100644
index 000000000..1a78a21f0
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options-routing.module.ts
@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { DkDeplomasOptionsPage } from './dk-deplomas-options.page';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: DkDeplomasOptionsPage
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule],
+})
+export class DkDeplomasOptionsPageRoutingModule {}
diff --git a/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options.module.ts b/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options.module.ts
new file mode 100644
index 000000000..4d09bf71b
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options.module.ts
@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { DkDeplomasOptionsPageRoutingModule } from './dk-deplomas-options-routing.module';
+
+import { DkDeplomasOptionsPage } from './dk-deplomas-options.page';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ DkDeplomasOptionsPageRoutingModule
+ ],
+ declarations: [DkDeplomasOptionsPage]
+})
+export class DkDeplomasOptionsPageModule {}
diff --git a/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options.page.html b/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options.page.html
new file mode 100644
index 000000000..f7f874f11
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options.page.html
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options.page.scss b/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options.page.scss
new file mode 100644
index 000000000..104fc7fae
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options.page.scss
@@ -0,0 +1,38 @@
+@import '~src/function.scss';
+
+.options-container {
+ --padding-top:20px !important;
+ --padding-bottom:20px !important;
+ --padding-start:20px !important;
+ --padding-end:20px !important;
+
+}
+.arrow-right {
+ margin-bottom: 20px;
+ .arrow-right-icon {
+ width: 37px;
+ float: right;
+ font-size: rem(35);
+ overflow: hidden;
+ }
+}
+.buttons {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-around;
+}
+.solid {
+ width: 90%;
+ border-top: 1px solid #bbb;
+ margin: 0 auto !important;
+ }
+ .btn-ok, .btn-cancel, .btn-delete{
+ width: 100% !important;
+ margin: 5px 5px 5px 5px !important;
+ }
+
+.pr-options {
+ .btn-ok, .btn-cancel{
+ width: 100% !important;
+ }
+}
diff --git a/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options.page.spec.ts b/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options.page.spec.ts
new file mode 100644
index 000000000..9906c30e6
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options.page.spec.ts
@@ -0,0 +1,24 @@
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+import { IonicModule } from '@ionic/angular';
+
+import { DkDeplomasOptionsPage } from './dk-deplomas-options.page';
+
+describe('DkDeplomasOptionsPage', () => {
+ let component: DkDeplomasOptionsPage;
+ let fixture: ComponentFixture;
+
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ declarations: [ DkDeplomasOptionsPage ],
+ imports: [IonicModule.forRoot()]
+ }).compileComponents();
+
+ fixture = TestBed.createComponent(DkDeplomasOptionsPage);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ }));
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options.page.ts b/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options.page.ts
new file mode 100644
index 000000000..6bff06daf
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-deplomas-options/dk-deplomas-options.page.ts
@@ -0,0 +1,402 @@
+import { Component, OnInit } from '@angular/core';
+import { ProcessesService } from 'src/app/services/processes.service';
+import { ModalController, NavParams, PopoverController } from '@ionic/angular';
+import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
+import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
+import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
+import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
+import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
+import { ToastService } from 'src/app/services/toast.service';
+import { customTask, fullTask } from 'src/app/models/dailyworktask.model';
+import { PermissionService } from 'src/app/services/permission.service';
+import { ThemeService } from 'src/app/services/theme.service'
+import { RouteService } from 'src/app/services/route.service';
+import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
+import { environment } from 'src/environments/environment';
+import { TaskService } from 'src/app/services/task.service'
+
+@Component({
+ selector: 'app-dk-deplomas-options',
+ templateUrl: './dk-deplomas-options.page.html',
+ styleUrls: ['./dk-deplomas-options.page.scss'],
+})
+export class DkDeplomasOptionsPage implements OnInit {
+
+
+ task: customTask
+ fulltask: fullTask;
+ serialNumber: string;
+ environment = environment
+
+ constructor(
+ private processes: ProcessesService,
+ private modalController: ModalController,
+ public popoverController: PopoverController,
+ private navParams: NavParams,
+ private toastService: ToastService,
+ public p: PermissionService,
+ public ThemeService: ThemeService,
+ private RouteService: RouteService,
+ private httpErrorHandle: HttpErrorHandle,
+ public TaskService: TaskService
+ ) {
+
+ this.task = this.navParams.get('task')
+ this.fulltask = this.navParams.get('fulltask')
+
+
+ this.serialNumber = this.task.SerialNumber
+ }
+
+ ngOnInit() {
+ }
+
+
+ async openTaskProcessModal(taskAction: any, task: any) {
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: CreateProcessPage,
+ componentProps: {
+ taskAction: taskAction,
+ task: task,
+ fulltask: this.fulltask
+ },
+ cssClass: classs,
+ });
+
+ modal.onDidDismiss().then( res => {
+ // this.goBack();
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ sendExpedienteToPending() {
+ const loader = this.toastService.loading()
+ this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
+ this.httpErrorHandle.httpsSucessMessagge('Enviar para Pendentes')
+ loader.remove()
+
+ this.goBack('back');
+ },(error)=>{
+ loader.remove()
+ this.httpErrorHandle.httpStatusHandle(error)
+ });
+ }
+
+ async distartExpedientModal() {
+
+ this.modalController.dismiss()
+ 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
+ });
+
+
+ modal.onDidDismiss().then(res=>{
+ if(res['data']=='close'){
+ this.goBack('back');
+ }
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+
+ async openBookMeetingModal(task: any) {
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: BookMeetingModalPage,
+ componentProps: {
+ task: this.task,
+ fulltask:this.fulltask
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then(() => {
+ this.goBack('no');
+ }, (error) => {
+ console.log(error)
+ })
+
+ await modal.present();
+ }
+
+ async openDelegarModal(task: any) {
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: DelegarPage,
+ componentProps: {
+ task: this.task,
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+ modal.onDidDismiss().then(res => {
+ if(res){
+ const data = res.data;
+ if(data == 'close') {
+ this.goBack('back');
+ }
+ }
+
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async generateDiploma(note:string, documents:any){
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Reencaminhar",
+ "ActionTypeId": 99999839,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.toastService._successMessage()
+ this.goBack('back');
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+ async openAddNoteModal(actionName:string) {
+
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: AddNotePage,
+ componentProps: {
+ showAttachmentBtn: true,
+ actionName:actionName
+ },
+ cssClass: classs,
+ backdropDismiss: true
+ });
+
+ await modal.present();
+
+ modal.onDidDismiss().then(async (res) => {
+
+ if(res.data) {
+
+ const DocumentToSave = res.data.documents.map((e) => {
+ return {
+ ApplicationId: e.ApplicationType,
+ SourceId: e.Id,
+ }
+ });
+
+ let docs = {
+ ProcessInstanceID: "",
+ Attachments: DocumentToSave,
+ }
+
+ if(actionName == 'Executado') {
+ await this.executado(res.data.note, docs);
+ }
+ else if(actionName == 'Arquivar') {
+ await this.arquivar(res.data.note, docs);
+ }
+ else if(actionName == 'Gerar Diploma') {
+ await this.generateDiploma(res.data.note, docs);
+ }
+ else if(actionName == 'Concluido') {
+ this.concluir(res.data.note, docs);
+ }
+ else if(actionName == 'Reexecução') {
+ await this.reexecutar(res.data.note, docs);
+ }
+
+ }
+ }, (error) => {
+ console.log(error)
+ });
+ }
+
+
+
+ async concluir(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()
+ this.httpErrorHandle.httpsSucessMessagge('Concluir Despacho')
+ this.TaskService.loadDiplomas()
+ } catch (error) {
+ this.httpErrorHandle.httpStatusHandle(error)
+ }
+ finally {
+ loader.remove()
+ }
+
+ }
+
+ 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()
+ this.toastService._successMessage('Processo arquivado')
+ this.goBack('back');
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest('Processo não arquivado')
+ }
+ } finally {
+ loader.remove()
+ }
+
+
+ }
+
+
+ async executado(note:string, documents:any) {
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Conhecimento",
+ "ActionTypeId": 104,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.goBack('back');
+ this.toastService._successMessage()
+ } catch(error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+
+
+ async reexecutar(note:string, documents:any){
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Reexecução",
+ "ActionTypeId": 100000010,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.toastService._successMessage()
+ this.goBack('back');
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+ goBack(params) {
+ this.popoverController.dismiss(params)
+ }
+}
diff --git a/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options-routing.module.ts b/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options-routing.module.ts
new file mode 100644
index 000000000..13c9a9a7d
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options-routing.module.ts
@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { DkDespachosOptionsPage } from './dk-despachos-options.page';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: DkDespachosOptionsPage
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule],
+})
+export class DkDespachosOptionsPageRoutingModule {}
diff --git a/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options.module.ts b/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options.module.ts
new file mode 100644
index 000000000..645420cac
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options.module.ts
@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { DkDespachosOptionsPageRoutingModule } from './dk-despachos-options-routing.module';
+
+import { DkDespachosOptionsPage } from './dk-despachos-options.page';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ DkDespachosOptionsPageRoutingModule
+ ],
+ declarations: [DkDespachosOptionsPage]
+})
+export class DkDespachosOptionsPageModule {}
diff --git a/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options.page.html b/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options.page.html
new file mode 100644
index 000000000..43eb6c605
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options.page.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options.page.scss b/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options.page.scss
new file mode 100644
index 000000000..0fc2784b5
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options.page.scss
@@ -0,0 +1,40 @@
+@import '~src/function.scss';
+
+.options-container {
+ --padding-top:20px !important;
+ --padding-bottom:20px !important;
+ --padding-start:20px !important;
+ --padding-end:20px !important;
+
+}
+.arrow-right {
+ display: none;
+ margin-bottom: 20px;
+ .arrow-right-icon {
+ width: 37px;
+ float: right;
+ font-size: rem(35);
+ overflow: hidden;
+ }
+}
+.buttons {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-around;
+}
+.solid {
+ display: none;
+ width: 90%;
+ border-top: 1px solid #bbb;
+ margin: 0 auto !important;
+ }
+ .btn-ok, .btn-cancel, .btn-delete{
+ width: 100% !important;
+ margin: 5px 5px 5px 5px !important;
+ }
+
+.pr-options {
+ .btn-ok, .btn-cancel{
+ width: 100% !important;
+ }
+}
diff --git a/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options.page.spec.ts b/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options.page.spec.ts
new file mode 100644
index 000000000..71ea195b8
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options.page.spec.ts
@@ -0,0 +1,24 @@
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+import { IonicModule } from '@ionic/angular';
+
+import { DkDespachosOptionsPage } from './dk-despachos-options.page';
+
+describe('DkDespachosOptionsPage', () => {
+ let component: DkDespachosOptionsPage;
+ let fixture: ComponentFixture;
+
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ declarations: [ DkDespachosOptionsPage ],
+ imports: [IonicModule.forRoot()]
+ }).compileComponents();
+
+ fixture = TestBed.createComponent(DkDespachosOptionsPage);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ }));
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options.page.ts b/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options.page.ts
new file mode 100644
index 000000000..6bc087d82
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-despachos-options/dk-despachos-options.page.ts
@@ -0,0 +1,403 @@
+import { Component, OnInit } from '@angular/core';
+import { ProcessesService } from 'src/app/services/processes.service';
+import { ModalController, NavParams, PopoverController } from '@ionic/angular';
+import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
+import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
+import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
+import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
+import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
+import { ToastService } from 'src/app/services/toast.service';
+import { customTask, fullTask } from 'src/app/models/dailyworktask.model';
+import { PermissionService } from 'src/app/services/permission.service';
+import { ThemeService } from 'src/app/services/theme.service'
+import { RouteService } from 'src/app/services/route.service';
+import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
+import { environment } from 'src/environments/environment';
+import { TaskService } from 'src/app/services/task.service'
+
+@Component({
+ selector: 'app-dk-despachos-options',
+ templateUrl: './dk-despachos-options.page.html',
+ styleUrls: ['./dk-despachos-options.page.scss'],
+})
+export class DkDespachosOptionsPage implements OnInit {
+
+ task: customTask
+ fulltask: fullTask;
+ serialNumber: string;
+ environment = environment
+
+ constructor(
+ private processes: ProcessesService,
+ private modalController: ModalController,
+ public popoverController: PopoverController,
+ private navParams: NavParams,
+ private toastService: ToastService,
+ public p: PermissionService,
+ public ThemeService: ThemeService,
+ private RouteService: RouteService,
+ private httpErrorHandle: HttpErrorHandle,
+ public TaskService: TaskService
+ ) {
+
+ this.task = this.navParams.get('task')
+ this.fulltask = this.navParams.get('fulltask')
+
+
+ this.serialNumber = this.task.SerialNumber
+ }
+
+ ngOnInit() {
+ }
+
+
+ async openTaskProcessModal(taskAction: any, task: any) {
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: CreateProcessPage,
+ componentProps: {
+ taskAction: taskAction,
+ task: task,
+ fulltask: this.fulltask
+ },
+ cssClass: classs,
+ });
+
+ modal.onDidDismiss().then( res => {
+ // this.goBack();
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ sendExpedienteToPending() {
+ const loader = this.toastService.loading()
+ this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
+ this.httpErrorHandle.httpsSucessMessagge('Enviar para Pendentes')
+ loader.remove()
+
+ this.goBack('back');
+ },(error)=>{
+ loader.remove()
+ this.httpErrorHandle.httpStatusHandle(error)
+ });
+ }
+
+ async distartExpedientModal() {
+
+ this.modalController.dismiss()
+ 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
+ });
+
+
+ modal.onDidDismiss().then(res=>{
+ if(res['data']=='close'){
+ this.goBack('back');
+ }
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+
+ async openBookMeetingModal(task: any) {
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: BookMeetingModalPage,
+ componentProps: {
+ task: this.task,
+ fulltask:this.fulltask
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then(() => {
+ this.goBack('no');
+ }, (error) => {
+ console.log(error)
+ })
+
+ await modal.present();
+ }
+
+ async openDelegarModal(task: any) {
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: DelegarPage,
+ componentProps: {
+ task: this.task,
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+ modal.onDidDismiss().then(res => {
+ if(res){
+ const data = res.data;
+ if(data == 'close') {
+ this.goBack('back');
+ }
+ }
+
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async generateDiploma(note:string, documents:any){
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Reencaminhar",
+ "ActionTypeId": 99999839,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.toastService._successMessage()
+ this.goBack('back');
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+ async openAddNoteModal(actionName:string) {
+
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: AddNotePage,
+ componentProps: {
+ showAttachmentBtn: true,
+ actionName:actionName
+ },
+ cssClass: classs,
+ backdropDismiss: true
+ });
+
+ await modal.present();
+
+ modal.onDidDismiss().then(async (res) => {
+
+ if(res.data) {
+
+ const DocumentToSave = res.data.documents.map((e) => {
+ return {
+ ApplicationId: e.ApplicationType,
+ SourceId: e.Id,
+ }
+ });
+
+ let docs = {
+ ProcessInstanceID: "",
+ Attachments: DocumentToSave,
+ }
+
+ if(actionName == 'Executado') {
+ await this.executado(res.data.note, docs);
+ }
+ else if(actionName == 'Arquivar') {
+ await this.arquivar(res.data.note, docs);
+ }
+ else if(actionName == 'Gerar Diploma') {
+ await this.generateDiploma(res.data.note, docs);
+ }
+ else if(actionName == 'Concluido') {
+ this.concluir(res.data.note, docs);
+ }
+ else if(actionName == 'Reexecução') {
+ await this.reexecutar(res.data.note, docs);
+ }
+
+ }
+ }, (error) => {
+ console.log(error)
+ });
+ }
+
+
+
+ async concluir(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()
+ this.httpErrorHandle.httpsSucessMessagge('Concluir Despacho')
+ this.TaskService.loadDiplomas()
+ } catch (error) {
+ this.httpErrorHandle.httpStatusHandle(error)
+ }
+ finally {
+ loader.remove()
+ }
+
+ }
+
+ 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()
+ this.toastService._successMessage('Processo arquivado')
+ this.goBack('back');
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest('Processo não arquivado')
+ }
+ } finally {
+ loader.remove()
+ }
+
+
+ }
+
+
+ async executado(note:string, documents:any) {
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Conhecimento",
+ "ActionTypeId": 104,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.goBack('back');
+ this.toastService._successMessage()
+ } catch(error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+
+
+ async reexecutar(note:string, documents:any){
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Reexecução",
+ "ActionTypeId": 100000010,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.toastService._successMessage()
+ this.goBack('back');
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+ goBack(params) {
+ this.popoverController.dismiss(params)
+ }
+
+
+}
diff --git a/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options-routing.module.ts b/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options-routing.module.ts
new file mode 100644
index 000000000..080d594bf
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options-routing.module.ts
@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { DkDespachosPrOptionsPage } from './dk-despachos-pr-options.page';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: DkDespachosPrOptionsPage
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule],
+})
+export class DkDespachosPrOptionsPageRoutingModule {}
diff --git a/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options.module.ts b/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options.module.ts
new file mode 100644
index 000000000..1367d99ef
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options.module.ts
@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { DkDespachosPrOptionsPageRoutingModule } from './dk-despachos-pr-options-routing.module';
+
+import { DkDespachosPrOptionsPage } from './dk-despachos-pr-options.page';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ DkDespachosPrOptionsPageRoutingModule
+ ],
+ declarations: [DkDespachosPrOptionsPage]
+})
+export class DkDespachosPrOptionsPageModule {}
diff --git a/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options.page.html b/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options.page.html
new file mode 100644
index 000000000..56bd1cd09
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options.page.html
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options.page.scss b/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options.page.scss
new file mode 100644
index 000000000..f45ba4e5d
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options.page.scss
@@ -0,0 +1,49 @@
+@import '~src/function.scss';
+
+:host {
+ height: 100% !important;
+ width: 100% !important;
+}
+
+.options-container{
+ --padding-top:20px !important;
+ --padding-bottom:20px !important;
+ --padding-start:20px !important;
+ --padding-end:20px !important;
+ width: 100%;
+}
+.arrow-right{
+ display: none;
+ margin-bottom: 20px;
+ .arrow-right-icon{
+ width: 37px;
+ float: right;
+ font-size: rem(35);
+ overflow: hidden;
+ }
+}
+.buttons{
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-around;
+}
+.solid {
+ display: none;
+ width: 90%;
+ border-top: 1px solid #bbb;
+ margin: 0 auto !important;
+ }
+ .btn-ok, .btn-cancel{
+ //width: 50% !important;
+ margin-bottom: 5px !important;
+ margin-top: 5px !important;
+}
+.btn-ok, .btn-cancel, .btn-delete{
+ width: 100% !important;
+}
+
+
+.desk{
+ text-align: left;
+ background-color: white;
+}
\ No newline at end of file
diff --git a/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options.page.spec.ts b/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options.page.spec.ts
new file mode 100644
index 000000000..0514d638e
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options.page.spec.ts
@@ -0,0 +1,24 @@
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+import { IonicModule } from '@ionic/angular';
+
+import { DkDespachosPrOptionsPage } from './dk-despachos-pr-options.page';
+
+describe('DkDespachosPrOptionsPage', () => {
+ let component: DkDespachosPrOptionsPage;
+ let fixture: ComponentFixture;
+
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ declarations: [ DkDespachosPrOptionsPage ],
+ imports: [IonicModule.forRoot()]
+ }).compileComponents();
+
+ fixture = TestBed.createComponent(DkDespachosPrOptionsPage);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ }));
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options.page.ts b/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options.page.ts
new file mode 100644
index 000000000..e2a4eac92
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-despachos-pr-options/dk-despachos-pr-options.page.ts
@@ -0,0 +1,430 @@
+import { Component, OnInit } from '@angular/core';
+import { ProcessesService } from 'src/app/services/processes.service';
+import { ActivatedRoute, Router } from '@angular/router';
+import { ModalController } from '@ionic/angular';
+import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
+import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
+import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
+import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
+import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
+import { ToastService } from 'src/app/services/toast.service';
+import { PermissionService } from 'src/app/services/permission.service';
+import { ThemeService } from 'src/app/services/theme.service'
+import { RouteService } from 'src/app/services/route.service';
+import { environment } from 'src/environments/environment';
+import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
+import { TaskService } from 'src/app/services/task.service'
+
+
+@Component({
+ selector: 'app-dk-despachos-pr-options',
+ templateUrl: './dk-despachos-pr-options.page.html',
+ styleUrls: ['./dk-despachos-pr-options.page.scss'],
+})
+export class DkDespachosPrOptionsPage implements OnInit {
+
+
+ task: any;
+ fulltask: any;
+ serialNumber: string;
+ profile: string
+ environment = environment
+
+ constructor(private activateRoute: ActivatedRoute,
+ private processes: ProcessesService,
+ private router: Router,
+ private modalController: ModalController,
+ private activatedRoute: ActivatedRoute,
+ private toastService: ToastService,
+ private RouteService: RouteService,
+ public p: PermissionService,
+ public ThemeService: ThemeService,
+ public TaskService: TaskService,
+ private httpErroHandle: HttpErrorHandle,
+ ) { }
+
+ ngOnInit() {
+
+ this.profile = "mdgpr";
+
+ this.activatedRoute.queryParams.subscribe(params => {
+ if(params["serialNumber"]) {
+ this.serialNumber = params["serialNumber"];
+
+ }
+ });
+
+ if(this.task.serialNumber) {
+ this.serialNumber = this.task.serialNumber
+ } else if(this.task.SerialNumber) {
+ this.serialNumber = this.task.SerialNumber
+ }
+
+ }
+
+ close () {
+ this.goBack()
+ }
+
+
+ async openExpedientActionsModal(taskAction: any, task: any) {
+ // this.modalController.dismiss();
+ this.modalController.dismiss();
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+ const modal = await this.modalController.create({
+ component: CreateProcessPage,
+ componentProps: {
+ taskAction: taskAction,
+ task: task,
+ profile: this.profile,
+ fulltask: this.fulltask
+ },
+ cssClass: classs,
+ });
+
+ modal.onDidDismiss().then( (res)=> {
+
+ if(res['data']=='openDiscart') {
+
+
+ this.distartExpedientModal();
+
+ } else {
+ this.goBack()
+ }
+
+ this.modalController.dismiss('close')
+
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ sendExpedienteToPending() {
+ const loader = this.toastService.loading()
+ this.processes.SetTaskToPending(this.serialNumber).subscribe(res=>{
+
+ this.httpErroHandle.httpsSucessMessagge('Enviar para Pendentes')
+ this.modalController.dismiss('close')
+ loader.remove()
+ },(error)=>{
+ loader.remove()
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest('Processo não encontrado')
+ }
+ });
+ }
+
+ async distartExpedientModal() {
+ this.modalController.dismiss();
+
+ 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
+ });
+
+ modal.onDidDismiss().then(res=>{
+ if(res['data']=='close'){
+ this.close();
+ /*
+ this.close();
+ this.openMenu(); */
+ }
+ this.modalController.dismiss('close')
+
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+
+ async openBookMeetingModal(task: any) {
+ this.modalController.dismiss();
+ 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: this.task,
+ fulltask:this.fulltask
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then(
+ ()=> {},
+ (error) => {
+ console.log(error)
+ }
+ )
+
+ await modal.present();
+
+ }
+
+ async openDelegarModal(task: any) {
+ this.modalController.dismiss();
+ 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: DelegarPage,
+ componentProps: {
+ task: this.task,
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then(res => {
+ if(res) {
+ const data = res.data;
+ if(data == 'close') {
+ this.goBack();
+ }
+ }
+
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async generateDiploma(note:string, documents:any) {
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Reencaminhar",
+ "ActionTypeId": 99999839,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.toastService._successMessage()
+ this.close();
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+ async openAddNoteModal(actionName:string) {
+ this.modalController.dismiss();
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop'
+ }
+ const modal = await this.modalController.create({
+ component: AddNotePage,
+ componentProps: {
+ showAttachmentBtn: true,
+ actionName:actionName
+ },
+ cssClass: classs,
+ backdropDismiss: true
+ });
+
+ modal.onDidDismiss().then(async (res) => {
+
+ if(res.data){
+
+
+
+ const DocumentToSave = res.data.documents.map((e) => {
+ return {
+ ApplicationId: e.ApplicationType,
+ SourceId: e.Id,
+ }
+ });
+
+ let docs = {
+ ProcessInstanceID: "",
+ Attachments: DocumentToSave,
+ }
+
+ if(actionName == 'Executado') {
+ await this.executado(res.data.note, docs);
+ }
+ else if(actionName == 'Arquivar') {
+ await this.arquivar(res.data.note, docs);
+ }
+ else if(actionName == 'Gerar Diploma') {
+ await this.generateDiploma(res.data.note, docs);
+ }
+ else if(actionName == 'Reexecução') {
+ await this.reexecutar(res.data.note, docs);
+ }
+ else if(actionName == 'Concluido') {
+ await this.concluir(res.data.note, docs);
+ }
+
+ this.goBack();
+ }
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+
+ async concluir(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()
+ this.httpErroHandle.httpsSucessMessagge('Concluir Despacho')
+ this.close();
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ }
+ finally {
+ loader.remove()
+ }
+
+ }
+
+ 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()
+ this.toastService.successMessage('Processo arquivado')
+ this.close();
+ } catch (error) {
+ this.toastService.badRequest('Processo não arquivado')
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+
+ async executado(note:string, documents:any){
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Conhecimento",
+ "ActionTypeId": 104,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.httpErroHandle.httpsSucessMessagge('Executado')
+ this.close();
+ this.toastService.successMessage()
+ } catch(error) {
+ this.toastService.badRequest()
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+
+ async reexecutar(note:string, documents:any){
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Reexecução",
+ "ActionTypeId": 100000010,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.httpErroHandle.httpsSucessMessagge('Reexecução')
+ this.toastService.successMessage()
+ this.close();
+ } catch (error) {
+ this.toastService.badRequest()
+ } finally {
+ loader.remove()
+ }
+ }
+
+ goBack() {
+ this.RouteService.goBack();
+ this.TaskService.loadDiplomas()
+ }
+
+ cancle() {
+ this.modalController.dismiss()
+ }
+
+}
diff --git a/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options-routing.module.ts b/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options-routing.module.ts
new file mode 100644
index 000000000..e635f2a31
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options-routing.module.ts
@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { DkDiplomasGerarOptionsPage } from './dk-diplomas-gerar-options.page';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: DkDiplomasGerarOptionsPage
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule],
+})
+export class DkDiplomasGerarOptionsPageRoutingModule {}
diff --git a/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.module.ts b/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.module.ts
new file mode 100644
index 000000000..8059b4db7
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.module.ts
@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { DkDiplomasGerarOptionsPageRoutingModule } from './dk-diplomas-gerar-options-routing.module';
+
+import { DkDiplomasGerarOptionsPage } from './dk-diplomas-gerar-options.page';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ DkDiplomasGerarOptionsPageRoutingModule
+ ],
+ declarations: [DkDiplomasGerarOptionsPage]
+})
+export class DkDiplomasGerarOptionsPageModule {}
diff --git a/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.page.html b/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.page.html
new file mode 100644
index 000000000..5f0257527
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.page.html
@@ -0,0 +1,12 @@
+
diff --git a/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.page.scss b/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.page.scss
new file mode 100644
index 000000000..22c26e431
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.page.scss
@@ -0,0 +1,67 @@
+@import '~src/function.scss';
+
+.wrapper{
+ width: 100% !important;
+ padding-top:20px !important;
+ padding-bottom:20px !important;
+ }
+ .arrow-right{
+ display: none;
+ margin-bottom: 20px;
+ .arrow-right-icon{
+ width: 37px;
+ float: right;
+ font-size: rem(35);
+ overflow: hidden;
+ }
+ }
+ .buttons{
+ width: 100% !important;
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-around;
+ margin: 0 auto !important;
+ }
+ .solid {
+ display: none;
+ width: 90%;
+ border-top: 1px solid #bbb;
+ margin: 0 auto !important;
+ }
+ .btn-ok, .btn-cancel{
+ //width: 50% !important;
+ margin-bottom: 5px !important;
+ margin-top: 5px !important;
+ }
+ @media only screen and (max-width: 800px) {
+ .container{
+ width: 100% !important;
+ }
+ .btn-ok, .btn-cancel, .btn-delete{
+ width: 47% !important;
+ }
+ }
+ @media only screen and (min-width: 1024px) {
+ .container{
+ width: 100% !important;
+
+ }
+ .arrow-right{
+ display: flex;
+ justify-content: flex-end;
+ }
+ .btn-cancel{
+ display: none;
+ width: 100% !important;
+ margin-bottom: 10px !important;
+ }
+ .btn-delete, .btn-ok{
+ width: 100% !important;
+ margin-bottom: 10px !important;
+ margin-top: 10px !important;
+ }
+ /* .solid{
+ display: block;
+ } */
+ }
+
\ No newline at end of file
diff --git a/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.page.spec.ts b/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.page.spec.ts
new file mode 100644
index 000000000..502e4302c
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.page.spec.ts
@@ -0,0 +1,24 @@
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+import { IonicModule } from '@ionic/angular';
+
+import { DkDiplomasGerarOptionsPage } from './dk-diplomas-gerar-options.page';
+
+describe('DkDiplomasGerarOptionsPage', () => {
+ let component: DkDiplomasGerarOptionsPage;
+ let fixture: ComponentFixture;
+
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ declarations: [ DkDiplomasGerarOptionsPage ],
+ imports: [IonicModule.forRoot()]
+ }).compileComponents();
+
+ fixture = TestBed.createComponent(DkDiplomasGerarOptionsPage);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ }));
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.page.ts b/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.page.ts
new file mode 100644
index 000000000..04b6ee275
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-diplomas-gerar-options/dk-diplomas-gerar-options.page.ts
@@ -0,0 +1,209 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController, NavParams, PopoverController } from '@ionic/angular';
+import { ProcessesService } from 'src/app/services/processes.service';
+import { Router } from '@angular/router';
+import { ToastService } from 'src/app/services/toast.service';
+import { ThemeService } from 'src/app/services/theme.service'
+import { DespachoService } from 'src/app/Rules/despacho.service'
+import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
+import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
+import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
+import { customTask, fullTask } from 'src/app/models/dailyworktask.model';
+import { RouteService } from 'src/app/services/route.service';
+import { TaskService } from 'src/app/services/task.service'
+
+@Component({
+ selector: 'app-dk-diplomas-gerar-options',
+ templateUrl: './dk-diplomas-gerar-options.page.html',
+ styleUrls: ['./dk-diplomas-gerar-options.page.scss'],
+})
+export class DkDiplomasGerarOptionsPage implements OnInit {
+
+
+ task: customTask
+ fulltask: fullTask;
+ serialNumber: string;
+
+ constructor(
+ private processes: ProcessesService,
+ public popoverController: PopoverController,
+ private modalController: ModalController,
+ private toastService: ToastService,
+ public ThemeService: ThemeService,
+ private despachoService: DespachoService,
+ private navParams: NavParams,
+ private router: Router,
+ private RouteService: RouteService,
+ public TaskService: TaskService
+ ) { }
+
+ ngOnInit() {
+ this.task = this.navParams.get('task')
+ this.fulltask = this.navParams.get('fulltask')
+ this.serialNumber = this.navParams.get('serialNumber')
+ }
+
+
+ async enviarDiploma({note = '', documents = [], serialnumber}) {
+
+ let classs;
+ if (window.innerWidth <= 800) {
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'add-note-modal-no-height'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: AddNotePage,
+ componentProps: {
+ showAttachmentBtn: true,
+ actionName:false
+ },
+ cssClass: classs,
+ backdropDismiss: true
+ });
+
+ modal.onDidDismiss().then(async (res) => {
+ if (res.data) {
+
+ const DocumentToSave = res.data.documents.map((e) => {
+ return {
+ ApplicationId: e.ApplicationType,
+ SourceId: e.Id,
+ }
+ });
+
+ let docs = {
+ ProcessInstanceID: "",
+ Attachments: DocumentToSave,
+ }
+
+ let body = {
+ "serialNumber": serialnumber,
+ "action": "Enviar diploma",
+ "ActionTypeId": 104,
+ "dataFields": {
+ "ReviewUserComment": res.data.note,
+ },
+ "AttachmentList" : docs,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise();
+ this.modalController.dismiss('sucess');
+ this.toastService._successMessage();
+ this.goBack()
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest();
+ }
+ } finally {
+ loader.remove()
+ }
+
+
+ }
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+
+ }
+
+ async sendExpedienteToPending() {
+ const loader = this.toastService.loading()
+ this.despachoService.sendExpedienteToPending(this.serialNumber).subscribe(res => {
+ this.goBack();
+ this.toastService._badRequest("Processo enviado para Pendentes")
+ loader.remove()
+ },
+ error => {
+ loader.remove()
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest("Processo não enviado para Pendentes")
+ }
+ });
+ }
+
+
+ async openBookMeetingModal() {
+ let classs;
+ if (window.innerWidth <= 800) {
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: BookMeetingModalPage,
+ componentProps: {
+ task: this.task,
+ fulltask:this.fulltask
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then(
+ ()=>{},
+ (error) => {
+ console.log(error)
+ }
+ )
+
+ await modal.present();
+ }
+
+ async openDelegarModal() {
+ let classs;
+ if (window.innerWidth <= 800) {
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: DelegarPage,
+ componentProps: {
+ task: this.task,
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then(res => {
+ if(res) {
+ const data = res.data;
+ if(data == 'close') {
+ this.goBack();
+ }
+ }
+
+ }, (error) => {
+ console.log(error)
+ });
+
+
+ await modal.present();
+ }
+
+
+ goBack() {
+
+ this.popoverController.dismiss();
+ this.RouteService.goBack();
+ this.TaskService.loadDespachos();
+ }
+
+}
diff --git a/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente-routing.module.ts b/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente-routing.module.ts
new file mode 100644
index 000000000..cec4c4070
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente-routing.module.ts
@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { DKOptsExpedientePage } from './dk-opts-expediente.page';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: DKOptsExpedientePage
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule],
+})
+export class DKOptsExpedientePageRoutingModule {}
diff --git a/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente.module.ts b/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente.module.ts
new file mode 100644
index 000000000..9efb4b9d0
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente.module.ts
@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { DKOptsExpedientePageRoutingModule } from './dk-opts-expediente-routing.module';
+
+import { DKOptsExpedientePage } from './dk-opts-expediente.page';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ DKOptsExpedientePageRoutingModule
+ ],
+ declarations: [DKOptsExpedientePage]
+})
+export class DKOptsExpedientePageModule {}
diff --git a/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente.page.html b/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente.page.html
new file mode 100644
index 000000000..6568a3d28
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente.page.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente.page.scss b/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente.page.scss
new file mode 100644
index 000000000..391fb1401
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente.page.scss
@@ -0,0 +1,66 @@
+@import '~src/function.scss';
+
+.options-container{
+ --padding-top:20px !important;
+ --padding-bottom:20px !important;
+ --padding-start:20px !important;
+ --padding-end:20px !important;
+ width: 100%;
+}
+.arrow-right{
+ display: none;
+ margin-bottom: 20px;
+ .arrow-right-icon{
+ width: 37px;
+ float: right;
+ font-size: rem(35);
+ overflow: hidden;
+ }
+}
+.buttons{
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-around;
+}
+.solid {
+ display: none;
+ width: 90%;
+ border-top: 1px solid #bbb;
+ margin: 0 auto !important;
+ }
+ .btn-ok, .btn-cancel{
+ //width: 50% !important;
+ margin-bottom: 5px !important;
+ margin-top: 5px !important;
+}
+@media only screen and (max-width: 800px) {
+ .btn-ok, .btn-cancel, .btn-delete{
+ width: 100% !important;
+ }
+}
+@media only screen and (min-width: 1024px) {
+ .arrow-right{
+ display: flex;
+ justify-content: flex-end;
+ }
+ .btn-cancel{
+ // display: none;
+ width: 100% !important;
+ margin-bottom: 10px !important;
+ }
+ .btn-delete, .btn-ok{
+ width: 100% !important;
+ margin-bottom: 10px !important;
+ margin-top: 10px !important;
+ }
+ /* .solid{
+ display: block;
+ } */
+}
+
+
+.desk{
+ text-align: left;
+ background-color: white;
+ color: var(--profile-text-color);
+}
diff --git a/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente.page.spec.ts b/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente.page.spec.ts
new file mode 100644
index 000000000..0bc993587
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente.page.spec.ts
@@ -0,0 +1,24 @@
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+import { IonicModule } from '@ionic/angular';
+
+import { DKOptsExpedientePage } from './dk-opts-expediente.page';
+
+describe('DKOptsExpedientePage', () => {
+ let component: DKOptsExpedientePage;
+ let fixture: ComponentFixture;
+
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ declarations: [ DKOptsExpedientePage ],
+ imports: [IonicModule.forRoot()]
+ }).compileComponents();
+
+ fixture = TestBed.createComponent(DKOptsExpedientePage);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ }));
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente.page.ts b/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente.page.ts
new file mode 100644
index 000000000..92548ec39
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-opts-expediente/dk-opts-expediente.page.ts
@@ -0,0 +1,464 @@
+import { Component, OnInit } from '@angular/core';
+import { NavigationExtras, Router } from '@angular/router';
+import { ModalController, NavParams, PopoverController } from '@ionic/angular';
+import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
+import { expedienteTask } from 'src/app/models/dailyworktask.model';
+import { SearchList } from 'src/app/models/search-document';
+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 { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
+import { SearchPage } from 'src/app/pages/search/search.page';
+import { SearchDocumentPipe } from 'src/app/pipes/search-document.pipe';
+import { AttachmentsService } from 'src/app/services/attachments.service';
+import { ProcessesService } from 'src/app/services/processes.service';
+import { ToastService } from 'src/app/services/toast.service';
+import { ExpedienteService } from 'src/app/Rules/expediente.service';
+import { PermissionService } from 'src/app/services/permission.service';
+import { ThemeService } from 'src/app/services/theme.service'
+import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
+import { RouteService } from 'src/app/services/route.service';
+import { SessionStore } from 'src/app/store/session.service';
+import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
+import { environment } from 'src/environments/environment';
+import { TaskService } from 'src/app/services/task.service';
+import { DataService } from 'src/app/services/data.service';
+
+@Component({
+ selector: 'app-dk-opts-expediente',
+ templateUrl: './dk-opts-expediente.page.html',
+ styleUrls: ['./dk-opts-expediente.page.scss'],
+})
+export class DKOptsExpedientePage implements OnInit {
+
+
+ task: expedienteTask
+ fulltask: any;
+ profile:string;
+ caller:string;
+
+ showEnviarPendentes = false
+ searchDocumentPipe = new SearchDocumentPipe()
+ documents:SearchList[] = [];
+
+ SessionStore = SessionStore;
+ environment = environment
+
+ constructor(
+ private popoverController: PopoverController,
+ private modalController: ModalController,
+ private navParams: NavParams,
+ private processes: ProcessesService,
+ private toastService: ToastService,
+ private router: Router,
+ public p: PermissionService,
+ private attachmentsService: AttachmentsService,
+ private RouteService: RouteService,
+ private expedienteService: ExpedienteService,
+ public ThemeService: ThemeService,
+ private httpErrorHanlde: HttpErrorHandle,
+ public TaskService: TaskService,
+ private dataService: DataService,
+ ) {
+
+ }
+
+ ngOnInit() {
+
+ }
+
+ async openNewGroupPage() {
+
+ // this.dataService.set("newGroup", true);
+ // this.dataService.set("task", this.task);
+ // this.dataService.set("newGroupName", this.task.Folio);
+ // this.dataService.set("documents", this.fulltask.Documents);
+ // this.dataService.set("link", window.location.pathname);
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: NewGroupPage,
+ cssClass: 'modal modal-desktop',
+ componentProps: {
+ name: this.task.Folio,
+ task: this.task,
+ documents: this.fulltask.Documents,
+ },
+ });
+
+ modal.onDidDismiss().then(
+ ()=>{},
+ (error) => {
+ console.log(error)
+ })
+
+ await modal.present();
+ }
+
+ close() {
+ if( window.innerWidth < 801) {
+ this.popoverController.dismiss();
+ }
+ else{
+ this.popoverController.dismiss();
+ }
+ }
+
+ goBack() {
+ this.TaskService.loadExpedientes()
+ this.RouteService.goBack()
+ }
+
+ attachDocument(){
+ this.getDoc();
+ }
+
+ async getDoc() {
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: SearchPage,
+ cssClass: 'modal-width-100-width-background modal',
+ componentProps: {
+ type: 'AccoesPresidenciais & ArquivoDespachoElect',
+ showSearchInput: true,
+ select: true
+ }
+ });
+
+ modal.onDidDismiss().then( async (res)=>{
+ if(res){
+ const data = res.data;
+ this.documents.push(data.selected);
+ this.documents.forEach((element: any) =>{
+
+ let body = {
+ "InstanceID": this.task.InstanceID,
+ "WorkflowDisplayName": this.task.WorkflowName,
+ "FolderID": this.task.FolderId,
+ "DispatchNumber": this.task.DispatchNumber,
+ "AttachmentsProcessLastInstanceID": this.task.AttachmentsProcessLastInstanceID,
+ "Attachments": []
+ }
+
+ const Attachments = this.searchDocumentPipe.transformToAttachment(element)
+ body.Attachments = Attachments;
+
+ const loader = this.toastService.loading()
+
+ this.attachmentsService.AddAttachment(body).subscribe((res)=> {
+ this.toastService._successMessage()
+ }, (error) => {
+ this.httpErrorHanlde.httpStatusHandle(error)
+ },()=> {
+ loader.remove()
+ });
+
+ });
+
+ this.popoverController.dismiss()
+
+ }
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+
+ }
+
+ async openAddNoteModal(actionName:string) {
+ let classs;
+ if( window.innerWidth < 801) {
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'add-note-modal'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: AddNotePage,
+ componentProps:{
+ showAttachmentBtn: false,
+ actionName:actionName
+ },
+ cssClass: classs,
+ //backdropDismiss: true
+ });
+
+ modal.onDidDismiss().then( async (res) => {
+
+ if(res.data){
+ const DocumentToSave = res.data.documents.map((e) => {
+ return {
+ ApplicationId: e.ApplicationType,
+ SourceId: e.Id,
+ }
+ });
+
+ let docs = {
+ ProcessInstanceID: "",
+ Attachments: DocumentToSave,
+ }
+
+ if(actionName == 'Aprovar') {
+ await this.approve(res.data.note, docs);
+ }
+ else if(actionName == 'Revisão') {
+ await this.sendToReview(res.data.note, docs);
+ }
+ this.popoverController.dismiss();
+ this.goBack();
+ }
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async sendToReview(note:string, documents:any) {
+ let body = {
+ "serialNumber": this.task.SerialNumber,
+ "action": "Retificar",
+ "ActionTypeId": 99999877,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.TaskService.loadExpedientes()
+ this.close();
+ this.toastService._successMessage()
+ } catch(error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ } finally {
+ loader.remove()
+ }
+ }
+
+ sendExpedienteToPending() {
+ this.close();
+ this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
+ this.TaskService.loadExpedientes()
+ this.goBack();
+ },(error) => {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest('Processo não encontrado')
+ }
+ });
+ }
+
+ async approve(note:string, documents:any){
+ let body = {
+ "serialNumber": this.task.SerialNumber,
+ "action": "Aprovar",
+ "ActionTypeId": 100000004 ,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise();
+ this.TaskService.loadExpedientes()
+ this.close();
+ this.httpErrorHanlde.httpsSucessMessagge('Avaliação Superiror')
+ } catch(error) {
+ this.httpErrorHanlde.httpStatusHandle(error)
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+ async openBookMeetingModal() {
+ this.close();
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: BookMeetingModalPage,
+ componentProps: {
+ task: this.task,
+ fulltask: this.fulltask
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then(
+ ()=>{},
+ (error) => {
+ console.log(error)
+ }
+ )
+
+ await modal.present();
+ }
+
+ async openExpedientActionsModal(taskAction: any, task: any) {
+
+
+
+ this.close();
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: ExpedientTaskModalPage,
+ componentProps: {
+ taskAction: taskAction,
+ task: task,
+ },
+ cssClass: classs,
+ });
+
+ modal.onDidDismiss().then(async res=>{
+
+ let body = res['data'];
+ if(res['data']){
+ const loader = this.toastService.loading()
+ try {
+ await this.processes.CompleteTask(body).toPromise();
+ this.TaskService.loadExpedientes()
+ this.goBack();
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest('Processo não descartado')
+ }
+ } finally {
+ loader.remove()
+ }
+ }
+ else{
+
+ }
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async distartExpedientModal(body:any){
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: DiscartExpedientModalPage,
+ componentProps: {
+ },
+ cssClass: 'discart-expedient-modal',
+ backdropDismiss: false
+ });
+
+
+ modal.onDidDismiss().then( async (res) => {
+
+
+ if(body == 'descartar') {
+ if(res['data']== 'Yes') {
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.expedienteService.discard({SerialNumber: this.task.SerialNumber}).toPromise()
+ this.TaskService.loadExpedientes()
+ this.toastService._successMessage('Processo descartado');
+ this.goBack();
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest('Processo não descartado')
+ }
+ } finally {
+ loader.remove()
+ }
+
+
+ }
+ else if(res['data'] == 'No'){
+ //Do nothing
+ }
+ }
+ else{
+ if(res['data']== 'Yes') {
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise();
+ this.toastService._successMessage('Processo descartado');
+ this.TaskService.loadExpedientes()
+ this.goBack();
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest('Processo não descartado')
+ }
+ } finally {
+ loader.remove()
+ }
+ this.goBack();
+ }
+ else if(res['data'] == 'No'){
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
+ this.TaskService.loadExpedientes()
+ this.toastService._successMessage();
+ this.goBack();
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+ this.toastService._badRequest()
+ }
+ } finally {
+ loader.remove()
+ }
+ }
+ }
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+
+}
diff --git a/src/app/shared/popover/desktop/dk-request-options/dk-request-options-routing.module.ts b/src/app/shared/popover/desktop/dk-request-options/dk-request-options-routing.module.ts
new file mode 100644
index 000000000..195619109
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-request-options/dk-request-options-routing.module.ts
@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { DKRequestOptionsPage } from './dk-request-options.page';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: DKRequestOptionsPage
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule],
+})
+export class DKRequestOptionsPageRoutingModule {}
diff --git a/src/app/shared/popover/desktop/dk-request-options/dk-request-options.module.ts b/src/app/shared/popover/desktop/dk-request-options/dk-request-options.module.ts
new file mode 100644
index 000000000..bc3648d2c
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-request-options/dk-request-options.module.ts
@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { DKRequestOptionsPageRoutingModule } from './dk-request-options-routing.module';
+
+import { DKRequestOptionsPage } from './dk-request-options.page';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ DKRequestOptionsPageRoutingModule
+ ],
+ declarations: [DKRequestOptionsPage]
+})
+export class DKRequestOptionsPageModule {}
diff --git a/src/app/shared/popover/desktop/dk-request-options/dk-request-options.page.html b/src/app/shared/popover/desktop/dk-request-options/dk-request-options.page.html
new file mode 100644
index 000000000..593e95eae
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-request-options/dk-request-options.page.html
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/shared/popover/desktop/dk-request-options/dk-request-options.page.scss b/src/app/shared/popover/desktop/dk-request-options/dk-request-options.page.scss
new file mode 100644
index 000000000..87ba77bba
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-request-options/dk-request-options.page.scss
@@ -0,0 +1,65 @@
+@import '~src/function.scss';
+
+.wrapper{
+ width: 100% !important;
+ padding-top:20px !important;
+ padding-bottom:20px !important;
+}
+.arrow-right{
+ display: none;
+ margin-bottom: 20px;
+ .arrow-right-icon{
+ width: 37px;
+ float: right;
+ font-size: rem(35);
+ overflow: hidden;
+ }
+}
+.buttons{
+ width: 100% !important;
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-around;
+ margin: 0 auto !important;
+}
+.solid {
+ display: none;
+ width: 90%;
+ border-top: 1px solid #bbb;
+ margin: 0 auto !important;
+ }
+ .btn-ok, .btn-cancel{
+ //width: 50% !important;
+ margin-bottom: 5px !important;
+ margin-top: 5px !important;
+}
+@media only screen and (max-width: 800px) {
+ .container{
+ width: 100% !important;
+ }
+ .btn-ok, .btn-cancel, .btn-delete{
+ width: 100% !important;
+ }
+}
+@media only screen and (min-width: 1024px) {
+ .container{
+ width: 100% !important;
+
+ }
+ .arrow-right{
+ display: flex;
+ justify-content: flex-end;
+ }
+ .btn-cancel{
+ width: 100% !important;
+ margin-bottom: 10px !important;
+ }
+ .btn-delete, .btn-ok{
+ width: 100% !important;
+ margin-bottom: 10px !important;
+ margin-top: 10px !important;
+ }
+ /* .solid{
+ display: block;
+ } */
+}
diff --git a/src/app/shared/popover/desktop/dk-request-options/dk-request-options.page.spec.ts b/src/app/shared/popover/desktop/dk-request-options/dk-request-options.page.spec.ts
new file mode 100644
index 000000000..d8786450b
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-request-options/dk-request-options.page.spec.ts
@@ -0,0 +1,24 @@
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+import { IonicModule } from '@ionic/angular';
+
+import { DKRequestOptionsPage } from './dk-request-options.page';
+
+describe('DKRequestOptionsPage', () => {
+ let component: DKRequestOptionsPage;
+ let fixture: ComponentFixture;
+
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ declarations: [ DKRequestOptionsPage ],
+ imports: [IonicModule.forRoot()]
+ }).compileComponents();
+
+ fixture = TestBed.createComponent(DKRequestOptionsPage);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ }));
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/shared/popover/desktop/dk-request-options/dk-request-options.page.ts b/src/app/shared/popover/desktop/dk-request-options/dk-request-options.page.ts
new file mode 100644
index 000000000..99a4ba32e
--- /dev/null
+++ b/src/app/shared/popover/desktop/dk-request-options/dk-request-options.page.ts
@@ -0,0 +1,400 @@
+import { Component, OnInit } from '@angular/core';
+import { ActivatedRoute } from '@angular/router';
+import { ModalController, NavParams, PopoverController } from '@ionic/angular';
+import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
+import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
+import { DarParecerPage } from 'src/app/modals/dar-parecer/dar-parecer.page';
+import { DelegarPage } from 'src/app/modals/delegar/delegar.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 { PedidoService } from 'src/app/Rules/pedido.service';
+import { PermissionService } from 'src/app/services/permission.service';
+import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
+import { ForwardPage } from 'src/app/modals/forward/forward.page';
+import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
+
+
+@Component({
+ selector: 'app-dk-request-options',
+ templateUrl: './dk-request-options.page.html',
+ styleUrls: ['./dk-request-options.page.scss'],
+})
+export class DKRequestOptionsPage implements OnInit {
+
+
+ task:any;
+ fulltask: any;
+ profile:string;
+ serialNumber : string;
+ showEnviarPendentes = false;
+ taskActions = [];
+
+ constructor(
+ private popoverController: PopoverController,
+ private modalController: ModalController,
+ private navParams: NavParams,
+ private processes: ProcessesService,
+ private activatedRoute: ActivatedRoute,
+ private toastService: ToastService,
+ public p: PermissionService,
+ private pedidoService: PedidoService,
+ private httpErrorHandle: HttpErrorHandle
+ ) {
+ this.task = this.navParams.get('task');
+ this.fulltask = this.navParams.get('fulltask');
+ this.serialNumber = this.navParams.get('serialNumber');
+ this.taskActions = this.navParams.get('actions');
+
+ this.activatedRoute.queryParams.subscribe(params => {
+ if(params["serialNumber"]) {
+ this.serialNumber = params["serialNumber"];
+ //
+ }
+ });
+
+ if(this.task.serialNumber) {
+ this.serialNumber = this.task.serialNumber
+ } else if (this.task.SerialNumber) {
+ this.serialNumber = this.task.SerialNumber
+ }
+
+ this.showEnviarPendentes = this.navParams.get('showEnviarPendentes');
+
+ if(!this.showEnviarPendentes) this.showEnviarPendentes = false
+
+ }
+
+ ngOnInit() {
+
+ this.profile = "mdgpr";
+
+ window.onresize = (event) => {
+ if( window.innerWidth >= 800){
+ this.popoverController.dismiss();
+ }
+ };
+ }
+
+ checkStringInArray(str) {
+ return this.taskActions.includes(str);
+ }
+
+ close() {
+ this.popoverController.dismiss('close')
+ }
+ cancel(){
+ this.popoverController.dismiss();
+ }
+
+ sendExpedienteToPending() {
+ const loader = this.toastService.loading()
+ this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
+
+ this.httpErrorHandle.httpsSucessMessagge('Enviar para Pendentes')
+ this.close();
+ loader.remove()
+ }, (error)=> {
+ loader.remove()
+
+ this.httpErrorHandle.httpStatusHandle(error)
+ });
+
+ }
+
+ async openBookMeetingModal(task: any) {
+ this.popoverController.dismiss();
+ let classs;
+ if( window.innerWidth <= 800) {
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: BookMeetingModalPage,
+ componentProps: {
+ task: this.task,
+ fulltask: this.fulltask
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then(
+ ()=>{}
+ , (error) => {
+ console.log(error)
+ })
+
+ await modal.present();
+ }
+
+ async openNewGroupPage(){
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: NewGroupPage,
+ cssClass: 'modal modal-desktop',
+ componentProps: {
+ name: this.task.Folio,
+ task: this.task,
+ documents: this.fulltask.Documents,
+ },
+ });
+
+ modal.onDidDismiss().then( () => {
+ this.popoverController.dismiss('close');
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async newGroup(){
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: NewGroupPage,
+ cssClass: 'modal modal-desktop',
+ componentProps: {
+ name: this.task.Folio,
+ },
+ });
+ await modal.present();
+ modal.onDidDismiss().then(
+ ()=>{},
+ (error) => {
+ console.log(error)
+ })
+ }
+
+ async openExpedientActionsModal(taskAction: any, task: any) {
+
+ //this.modalController.dismiss();
+ let classs;
+ if( window.innerWidth <= 800) {
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: CreateProcessPage,
+ componentProps: {
+ taskAction: taskAction,
+ task: task,
+ profile: this.profile,
+ fulltask: this.fulltask
+ },
+ cssClass: classs,
+ });
+
+ modal.onDidDismiss().then(res=> {
+
+ if(res['data']=='openDiscart') {
+
+
+ } else {
+ this.popoverController.dismiss('close')
+ }
+
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async repreciar(note:string, documents:any) {
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Reapreciação",
+ "ActionTypeId": 100000009,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.close();
+ this.httpErrorHandle.httpsSucessMessagge('Solicitar Reapreciação')
+ } catch (error) {
+ this.httpErrorHandle.httpStatusHandle(error);
+ }
+ finally {
+ loader.remove()
+ }
+
+ }
+
+ async openAddNoteModal(actionName:string) {
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: AddNotePage,
+ componentProps:{
+ showAttachmentBtn: true,
+ actionName:actionName
+ },
+ cssClass: classs,
+ backdropDismiss: true
+ });
+
+ modal.onDidDismiss().then(async (res) => {
+
+
+ const DocumentToSave = res.data.documents.map((e) => {
+ return {
+ ApplicationId: e.ApplicationType,
+ SourceId: e.Id,
+ }
+ });
+
+ let docs = {
+ ProcessInstanceID: "",
+ Attachments: DocumentToSave,
+ }
+
+
+ if(res.data) {
+ if(actionName == 'Solicitar Reapreciação') {
+
+ await this.repreciar(res.data.note, docs);
+ }
+ else if(actionName == 'Arquivar') {
+ await this.arquivar(res.data.note, docs);
+ this.popoverController.dismiss('close')
+ }
+ }
+
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async arquivar(note:string, documents:any) {
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.pedidoService.arquivar({serialNumber: this.serialNumber,
+ documents,
+ note
+ }).toPromise()
+
+ this.httpErrorHandle.httpsSucessMessagge('Arquivar')
+ } catch (error) {
+ this.httpErrorHandle.httpStatusHandle(error)
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+ async openDarParecer(task: any) {
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: DarParecerPage,
+ componentProps: {
+ serialNumber: this.task.SerialNumber,
+ ProcessInstanceID: this.task.ProcessInstanceID,
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then( () => {
+ this.popoverController.dismiss('close');
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+
+ }
+
+ async openForwardModal(tasK: any) {
+ let classs;
+ if (window.innerWidth <= 800) {
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: ForwardPage,
+ componentProps: {
+ task: this.task,
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then(() => {
+ this.popoverController.dismiss('close');
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async openDelegarModal(task: any) {
+
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: DelegarPage,
+ componentProps: {
+ task: this.task,
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then( async (res)=> {
+
+ if(res['data']=='close') {
+ this.popoverController.dismiss('close');
+ }
+
+ }, (error) => {
+ console.log(error)
+ })
+
+ await modal.present();
+ }
+
+
+
+}
diff --git a/src/app/shared/popover/desktop/opts-expediente/opts-expediente-routing.module.ts b/src/app/shared/popover/desktop/opts-expediente/opts-expediente-routing.module.ts
new file mode 100644
index 000000000..b0ca6d569
--- /dev/null
+++ b/src/app/shared/popover/desktop/opts-expediente/opts-expediente-routing.module.ts
@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { OptsExpedientePage } from './opts-expediente.page';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: OptsExpedientePage
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule],
+})
+export class OptsExpedientePageRoutingModule {}
diff --git a/src/app/shared/popover/desktop/opts-expediente/opts-expediente.module.ts b/src/app/shared/popover/desktop/opts-expediente/opts-expediente.module.ts
new file mode 100644
index 000000000..f2d9a571d
--- /dev/null
+++ b/src/app/shared/popover/desktop/opts-expediente/opts-expediente.module.ts
@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { OptsExpedientePageRoutingModule } from './opts-expediente-routing.module';
+
+import { OptsExpedientePage } from './opts-expediente.page';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ OptsExpedientePageRoutingModule
+ ],
+ declarations: [OptsExpedientePage]
+})
+export class OptsExpedientePageModule {}
diff --git a/src/app/shared/popover/desktop/opts-expediente/opts-expediente.page.html b/src/app/shared/popover/desktop/opts-expediente/opts-expediente.page.html
new file mode 100644
index 000000000..6568a3d28
--- /dev/null
+++ b/src/app/shared/popover/desktop/opts-expediente/opts-expediente.page.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/shared/popover/desktop/opts-expediente/opts-expediente.page.scss b/src/app/shared/popover/desktop/opts-expediente/opts-expediente.page.scss
new file mode 100644
index 000000000..391fb1401
--- /dev/null
+++ b/src/app/shared/popover/desktop/opts-expediente/opts-expediente.page.scss
@@ -0,0 +1,66 @@
+@import '~src/function.scss';
+
+.options-container{
+ --padding-top:20px !important;
+ --padding-bottom:20px !important;
+ --padding-start:20px !important;
+ --padding-end:20px !important;
+ width: 100%;
+}
+.arrow-right{
+ display: none;
+ margin-bottom: 20px;
+ .arrow-right-icon{
+ width: 37px;
+ float: right;
+ font-size: rem(35);
+ overflow: hidden;
+ }
+}
+.buttons{
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-around;
+}
+.solid {
+ display: none;
+ width: 90%;
+ border-top: 1px solid #bbb;
+ margin: 0 auto !important;
+ }
+ .btn-ok, .btn-cancel{
+ //width: 50% !important;
+ margin-bottom: 5px !important;
+ margin-top: 5px !important;
+}
+@media only screen and (max-width: 800px) {
+ .btn-ok, .btn-cancel, .btn-delete{
+ width: 100% !important;
+ }
+}
+@media only screen and (min-width: 1024px) {
+ .arrow-right{
+ display: flex;
+ justify-content: flex-end;
+ }
+ .btn-cancel{
+ // display: none;
+ width: 100% !important;
+ margin-bottom: 10px !important;
+ }
+ .btn-delete, .btn-ok{
+ width: 100% !important;
+ margin-bottom: 10px !important;
+ margin-top: 10px !important;
+ }
+ /* .solid{
+ display: block;
+ } */
+}
+
+
+.desk{
+ text-align: left;
+ background-color: white;
+ color: var(--profile-text-color);
+}
diff --git a/src/app/shared/popover/desktop/opts-expediente/opts-expediente.page.spec.ts b/src/app/shared/popover/desktop/opts-expediente/opts-expediente.page.spec.ts
new file mode 100644
index 000000000..2db20e545
--- /dev/null
+++ b/src/app/shared/popover/desktop/opts-expediente/opts-expediente.page.spec.ts
@@ -0,0 +1,24 @@
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+import { IonicModule } from '@ionic/angular';
+
+import { OptsExpedientePage } from './opts-expediente.page';
+
+describe('OptsExpedientePage', () => {
+ let component: OptsExpedientePage;
+ let fixture: ComponentFixture;
+
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ declarations: [ OptsExpedientePage ],
+ imports: [IonicModule.forRoot()]
+ }).compileComponents();
+
+ fixture = TestBed.createComponent(OptsExpedientePage);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ }));
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/shared/popover/desktop/opts-expediente/opts-expediente.page.ts b/src/app/shared/popover/desktop/opts-expediente/opts-expediente.page.ts
new file mode 100644
index 000000000..585c2c96f
--- /dev/null
+++ b/src/app/shared/popover/desktop/opts-expediente/opts-expediente.page.ts
@@ -0,0 +1,462 @@
+import { Component, OnInit } from '@angular/core';
+import { NavigationExtras, Router } from '@angular/router';
+import { ModalController, NavParams, PopoverController } from '@ionic/angular';
+import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
+import { expedienteTask } from 'src/app/models/dailyworktask.model';
+import { SearchList } from 'src/app/models/search-document';
+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 { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
+import { SearchPage } from 'src/app/pages/search/search.page';
+import { SearchDocumentPipe } from 'src/app/pipes/search-document.pipe';
+import { AttachmentsService } from 'src/app/services/attachments.service';
+import { ProcessesService } from 'src/app/services/processes.service';
+import { ToastService } from 'src/app/services/toast.service';
+import { ExpedienteService } from 'src/app/Rules/expediente.service';
+import { PermissionService } from 'src/app/services/permission.service';
+import { ThemeService } from 'src/app/services/theme.service'
+import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
+import { RouteService } from 'src/app/services/route.service';
+import { SessionStore } from 'src/app/store/session.service';
+import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
+import { environment } from 'src/environments/environment';
+import { TaskService } from 'src/app/services/task.service';
+import { DataService } from 'src/app/services/data.service';
+
+@Component({
+ selector: 'app-opts-expediente',
+ templateUrl: './opts-expediente.page.html',
+ styleUrls: ['./opts-expediente.page.scss'],
+})
+export class OptsExpedientePage implements OnInit {
+
+ task: expedienteTask
+ fulltask: any;
+ profile:string;
+ caller:string;
+
+ showEnviarPendentes = false
+ searchDocumentPipe = new SearchDocumentPipe()
+ documents:SearchList[] = [];
+
+ SessionStore = SessionStore;
+ environment = environment
+
+ constructor(
+ private popoverController: PopoverController,
+ private modalController: ModalController,
+ private navParams: NavParams,
+ private processes: ProcessesService,
+ private toastService: ToastService,
+ private router: Router,
+ public p: PermissionService,
+ private attachmentsService: AttachmentsService,
+ private RouteService: RouteService,
+ private expedienteService: ExpedienteService,
+ public ThemeService: ThemeService,
+ private httpErrorHanlde: HttpErrorHandle,
+ public TaskService: TaskService,
+ private dataService: DataService,
+ ) {
+
+ }
+
+ ngOnInit() {
+
+ }
+
+ async openNewGroupPage() {
+
+ // this.dataService.set("newGroup", true);
+ // this.dataService.set("task", this.task);
+ // this.dataService.set("newGroupName", this.task.Folio);
+ // this.dataService.set("documents", this.fulltask.Documents);
+ // this.dataService.set("link", window.location.pathname);
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: NewGroupPage,
+ cssClass: 'modal modal-desktop',
+ componentProps: {
+ name: this.task.Folio,
+ task: this.task,
+ documents: this.fulltask.Documents,
+ },
+ });
+
+ modal.onDidDismiss().then(
+ ()=>{},
+ (error) => {
+ console.log(error)
+ })
+
+ await modal.present();
+ }
+
+ close() {
+ if( window.innerWidth < 801) {
+ this.popoverController.dismiss();
+ }
+ else{
+ this.popoverController.dismiss();
+ }
+ }
+
+ goBack() {
+ this.TaskService.loadExpedientes()
+ this.RouteService.goBack()
+ }
+
+ attachDocument(){
+ this.getDoc();
+ }
+
+ async getDoc() {
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: SearchPage,
+ cssClass: 'modal-width-100-width-background modal',
+ componentProps: {
+ type: 'AccoesPresidenciais & ArquivoDespachoElect',
+ showSearchInput: true,
+ select: true
+ }
+ });
+
+ modal.onDidDismiss().then( async (res)=>{
+ if(res){
+ const data = res.data;
+ this.documents.push(data.selected);
+ this.documents.forEach((element: any) =>{
+
+ let body = {
+ "InstanceID": this.task.InstanceID,
+ "WorkflowDisplayName": this.task.WorkflowName,
+ "FolderID": this.task.FolderId,
+ "DispatchNumber": this.task.DispatchNumber,
+ "AttachmentsProcessLastInstanceID": this.task.AttachmentsProcessLastInstanceID,
+ "Attachments": []
+ }
+
+ const Attachments = this.searchDocumentPipe.transformToAttachment(element)
+ body.Attachments = Attachments;
+
+ const loader = this.toastService.loading()
+
+ this.attachmentsService.AddAttachment(body).subscribe((res)=> {
+ this.toastService._successMessage()
+ }, (error) => {
+ this.httpErrorHanlde.httpStatusHandle(error)
+ },()=> {
+ loader.remove()
+ });
+
+ });
+
+ this.popoverController.dismiss()
+
+ }
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+
+ }
+
+ async openAddNoteModal(actionName:string) {
+ let classs;
+ if( window.innerWidth < 801) {
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'add-note-modal'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: AddNotePage,
+ componentProps:{
+ showAttachmentBtn: false,
+ actionName:actionName
+ },
+ cssClass: classs,
+ //backdropDismiss: true
+ });
+
+ modal.onDidDismiss().then( async (res) => {
+
+ if(res.data){
+ const DocumentToSave = res.data.documents.map((e) => {
+ return {
+ ApplicationId: e.ApplicationType,
+ SourceId: e.Id,
+ }
+ });
+
+ let docs = {
+ ProcessInstanceID: "",
+ Attachments: DocumentToSave,
+ }
+
+ if(actionName == 'Aprovar') {
+ await this.approve(res.data.note, docs);
+ }
+ else if(actionName == 'Revisão') {
+ await this.sendToReview(res.data.note, docs);
+ }
+ this.popoverController.dismiss();
+ this.goBack();
+ }
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async sendToReview(note:string, documents:any) {
+ let body = {
+ "serialNumber": this.task.SerialNumber,
+ "action": "Retificar",
+ "ActionTypeId": 99999877,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.TaskService.loadExpedientes()
+ this.close();
+ this.toastService._successMessage()
+ } catch(error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest()
+ }
+ } finally {
+ loader.remove()
+ }
+ }
+
+ sendExpedienteToPending() {
+ this.close();
+ this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
+ this.TaskService.loadExpedientes()
+ this.goBack();
+ },(error) => {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest('Processo não encontrado')
+ }
+ });
+ }
+
+ async approve(note:string, documents:any){
+ let body = {
+ "serialNumber": this.task.SerialNumber,
+ "action": "Aprovar",
+ "ActionTypeId": 100000004 ,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise();
+ this.TaskService.loadExpedientes()
+ this.close();
+ this.httpErrorHanlde.httpsSucessMessagge('Avaliação Superiror')
+ } catch(error) {
+ this.httpErrorHanlde.httpStatusHandle(error)
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+ async openBookMeetingModal() {
+ this.close();
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: BookMeetingModalPage,
+ componentProps: {
+ task: this.task,
+ fulltask: this.fulltask
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then(
+ ()=>{},
+ (error) => {
+ console.log(error)
+ }
+ )
+
+ await modal.present();
+ }
+
+ async openExpedientActionsModal(taskAction: any, task: any) {
+
+
+
+ this.close();
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: ExpedientTaskModalPage,
+ componentProps: {
+ taskAction: taskAction,
+ task: task,
+ },
+ cssClass: classs,
+ });
+
+ modal.onDidDismiss().then(async res=>{
+
+ let body = res['data'];
+ if(res['data']){
+ const loader = this.toastService.loading()
+ try {
+ await this.processes.CompleteTask(body).toPromise();
+ this.TaskService.loadExpedientes()
+ this.goBack();
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest('Processo não descartado')
+ }
+ } finally {
+ loader.remove()
+ }
+ }
+ else{
+
+ }
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async distartExpedientModal(body:any){
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: DiscartExpedientModalPage,
+ componentProps: {
+ },
+ cssClass: 'discart-expedient-modal',
+ backdropDismiss: false
+ });
+
+
+ modal.onDidDismiss().then( async (res) => {
+
+
+ if(body == 'descartar') {
+ if(res['data']== 'Yes') {
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.expedienteService.discard({SerialNumber: this.task.SerialNumber}).toPromise()
+ this.TaskService.loadExpedientes()
+ this.toastService._successMessage('Processo descartado');
+ this.goBack();
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest('Processo não descartado')
+ }
+ } finally {
+ loader.remove()
+ }
+
+
+ }
+ else if(res['data'] == 'No'){
+ //Do nothing
+ }
+ }
+ else{
+ if(res['data']== 'Yes') {
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise();
+ this.toastService._successMessage('Processo descartado');
+ this.TaskService.loadExpedientes()
+ this.goBack();
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+
+ this.toastService._badRequest('Processo não descartado')
+ }
+ } finally {
+ loader.remove()
+ }
+ this.goBack();
+ }
+ else if(res['data'] == 'No'){
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
+ this.TaskService.loadExpedientes()
+ this.toastService._successMessage();
+ this.goBack();
+ } catch (error) {
+ if(error.status == 0) {
+ this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
+ } else {
+ this.toastService._badRequest()
+ }
+ } finally {
+ loader.remove()
+ }
+ }
+ }
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+}
diff --git a/src/app/shared/popover/desktop/request-options/request-options-routing.module.ts b/src/app/shared/popover/desktop/request-options/request-options-routing.module.ts
new file mode 100644
index 000000000..59bb38c36
--- /dev/null
+++ b/src/app/shared/popover/desktop/request-options/request-options-routing.module.ts
@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { RequestOptionsPage } from './request-options.page';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: RequestOptionsPage
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule],
+})
+export class RequestOptionsPageRoutingModule {}
diff --git a/src/app/shared/popover/desktop/request-options/request-options.module.ts b/src/app/shared/popover/desktop/request-options/request-options.module.ts
new file mode 100644
index 000000000..fddddf01d
--- /dev/null
+++ b/src/app/shared/popover/desktop/request-options/request-options.module.ts
@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { RequestOptionsPageRoutingModule } from './request-options-routing.module';
+
+import { RequestOptionsPage } from './request-options.page';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ RequestOptionsPageRoutingModule
+ ],
+ declarations: [RequestOptionsPage]
+})
+export class RequestOptionsPageModule {}
diff --git a/src/app/shared/popover/desktop/request-options/request-options.page.html b/src/app/shared/popover/desktop/request-options/request-options.page.html
new file mode 100644
index 000000000..593e95eae
--- /dev/null
+++ b/src/app/shared/popover/desktop/request-options/request-options.page.html
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/shared/popover/desktop/request-options/request-options.page.scss b/src/app/shared/popover/desktop/request-options/request-options.page.scss
new file mode 100644
index 000000000..fc0b2ccf2
--- /dev/null
+++ b/src/app/shared/popover/desktop/request-options/request-options.page.scss
@@ -0,0 +1,66 @@
+@import '~src/function.scss';
+
+.wrapper{
+ width: 100% !important;
+ padding-top:20px !important;
+ padding-bottom:20px !important;
+}
+.arrow-right{
+ display: none;
+ margin-bottom: 20px;
+ .arrow-right-icon{
+ width: 37px;
+ float: right;
+ font-size: rem(35);
+ overflow: hidden;
+ }
+}
+.buttons{
+ width: 100% !important;
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-around;
+ margin: 0 auto !important;
+}
+.solid {
+ display: none;
+ width: 90%;
+ border-top: 1px solid #bbb;
+ margin: 0 auto !important;
+ }
+ .btn-ok, .btn-cancel{
+ //width: 50% !important;
+ margin-bottom: 5px !important;
+ margin-top: 5px !important;
+}
+@media only screen and (max-width: 800px) {
+ .container{
+ width: 100% !important;
+ }
+ .btn-ok, .btn-cancel, .btn-delete{
+ width: 47% !important;
+ }
+}
+@media only screen and (min-width: 1024px) {
+ .container{
+ width: 100% !important;
+
+ }
+ .arrow-right{
+ display: flex;
+ justify-content: flex-end;
+ }
+ .btn-cancel{
+ // display: none;
+ width: 100% !important;
+ margin-bottom: 10px !important;
+ }
+ .btn-delete, .btn-ok{
+ width: 100% !important;
+ margin-bottom: 10px !important;
+ margin-top: 10px !important;
+ }
+ /* .solid{
+ display: block;
+ } */
+}
diff --git a/src/app/shared/popover/desktop/request-options/request-options.page.spec.ts b/src/app/shared/popover/desktop/request-options/request-options.page.spec.ts
new file mode 100644
index 000000000..41c8cefda
--- /dev/null
+++ b/src/app/shared/popover/desktop/request-options/request-options.page.spec.ts
@@ -0,0 +1,24 @@
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+import { IonicModule } from '@ionic/angular';
+
+import { RequestOptionsPage } from './request-options.page';
+
+describe('RequestOptionsPage', () => {
+ let component: RequestOptionsPage;
+ let fixture: ComponentFixture;
+
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ declarations: [ RequestOptionsPage ],
+ imports: [IonicModule.forRoot()]
+ }).compileComponents();
+
+ fixture = TestBed.createComponent(RequestOptionsPage);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ }));
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/shared/popover/desktop/request-options/request-options.page.ts b/src/app/shared/popover/desktop/request-options/request-options.page.ts
new file mode 100644
index 000000000..0296cee4d
--- /dev/null
+++ b/src/app/shared/popover/desktop/request-options/request-options.page.ts
@@ -0,0 +1,398 @@
+import { Component, OnInit } from '@angular/core';
+import { ActivatedRoute } from '@angular/router';
+import { ModalController, NavParams, PopoverController } from '@ionic/angular';
+import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
+import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
+import { DarParecerPage } from 'src/app/modals/dar-parecer/dar-parecer.page';
+import { DelegarPage } from 'src/app/modals/delegar/delegar.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 { PedidoService } from 'src/app/Rules/pedido.service';
+import { PermissionService } from 'src/app/services/permission.service';
+import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
+import { ForwardPage } from 'src/app/modals/forward/forward.page';
+import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
+
+
+@Component({
+ selector: 'app-request-options',
+ templateUrl: './request-options.page.html',
+ styleUrls: ['./request-options.page.scss'],
+})
+export class RequestOptionsPage implements OnInit {
+
+ task:any;
+ fulltask: any;
+ profile:string;
+ serialNumber : string;
+ showEnviarPendentes = false;
+ taskActions = [];
+
+ constructor(
+ private popoverController: PopoverController,
+ private modalController: ModalController,
+ private navParams: NavParams,
+ private processes: ProcessesService,
+ private activatedRoute: ActivatedRoute,
+ private toastService: ToastService,
+ public p: PermissionService,
+ private pedidoService: PedidoService,
+ private httpErrorHandle: HttpErrorHandle
+ ) {
+ this.task = this.navParams.get('task');
+ this.fulltask = this.navParams.get('fulltask');
+ this.serialNumber = this.navParams.get('serialNumber');
+ this.taskActions = this.navParams.get('actions');
+
+ this.activatedRoute.queryParams.subscribe(params => {
+ if(params["serialNumber"]) {
+ this.serialNumber = params["serialNumber"];
+ //
+ }
+ });
+
+ if(this.task.serialNumber) {
+ this.serialNumber = this.task.serialNumber
+ } else if (this.task.SerialNumber) {
+ this.serialNumber = this.task.SerialNumber
+ }
+
+ this.showEnviarPendentes = this.navParams.get('showEnviarPendentes');
+
+ if(!this.showEnviarPendentes) this.showEnviarPendentes = false
+
+ }
+
+ ngOnInit() {
+
+ this.profile = "mdgpr";
+
+ window.onresize = (event) => {
+ if( window.innerWidth >= 800){
+ this.popoverController.dismiss();
+ }
+ };
+ }
+
+ checkStringInArray(str) {
+ return this.taskActions.includes(str);
+ }
+
+ close() {
+ this.popoverController.dismiss('close')
+ }
+ cancel(){
+ this.popoverController.dismiss();
+ }
+
+ sendExpedienteToPending() {
+ const loader = this.toastService.loading()
+ this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
+
+ this.httpErrorHandle.httpsSucessMessagge('Enviar para Pendentes')
+ this.close();
+ loader.remove()
+ }, (error)=> {
+ loader.remove()
+
+ this.httpErrorHandle.httpStatusHandle(error)
+ });
+
+ }
+
+ async openBookMeetingModal(task: any) {
+ this.popoverController.dismiss();
+ let classs;
+ if( window.innerWidth <= 800) {
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: BookMeetingModalPage,
+ componentProps: {
+ task: this.task,
+ fulltask: this.fulltask
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then(
+ ()=>{}
+ , (error) => {
+ console.log(error)
+ })
+
+ await modal.present();
+ }
+
+ async openNewGroupPage(){
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: NewGroupPage,
+ cssClass: 'modal modal-desktop',
+ componentProps: {
+ name: this.task.Folio,
+ task: this.task,
+ documents: this.fulltask.Documents,
+ },
+ });
+
+ modal.onDidDismiss().then( () => {
+ this.popoverController.dismiss('close');
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async newGroup(){
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: NewGroupPage,
+ cssClass: 'modal modal-desktop',
+ componentProps: {
+ name: this.task.Folio,
+ },
+ });
+ await modal.present();
+ modal.onDidDismiss().then(
+ ()=>{},
+ (error) => {
+ console.log(error)
+ })
+ }
+
+ async openExpedientActionsModal(taskAction: any, task: any) {
+
+ //this.modalController.dismiss();
+ let classs;
+ if( window.innerWidth <= 800) {
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: CreateProcessPage,
+ componentProps: {
+ taskAction: taskAction,
+ task: task,
+ profile: this.profile,
+ fulltask: this.fulltask
+ },
+ cssClass: classs,
+ });
+
+ modal.onDidDismiss().then(res=> {
+
+ if(res['data']=='openDiscart') {
+
+
+ } else {
+ this.popoverController.dismiss('close')
+ }
+
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async repreciar(note:string, documents:any) {
+ let body = {
+ "serialNumber": this.serialNumber,
+ "action": "Reapreciação",
+ "ActionTypeId": 100000009,
+ "dataFields": {
+ "ReviewUserComment": note,
+ },
+ "AttachmentList" :documents,
+ }
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.processes.CompleteTask(body).toPromise()
+ this.close();
+ this.httpErrorHandle.httpsSucessMessagge('Solicitar Reapreciação')
+ } catch (error) {
+ this.httpErrorHandle.httpStatusHandle(error);
+ }
+ finally {
+ loader.remove()
+ }
+
+ }
+
+ async openAddNoteModal(actionName:string) {
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: AddNotePage,
+ componentProps:{
+ showAttachmentBtn: true,
+ actionName:actionName
+ },
+ cssClass: classs,
+ backdropDismiss: true
+ });
+
+ modal.onDidDismiss().then(async (res) => {
+
+
+ const DocumentToSave = res.data.documents.map((e) => {
+ return {
+ ApplicationId: e.ApplicationType,
+ SourceId: e.Id,
+ }
+ });
+
+ let docs = {
+ ProcessInstanceID: "",
+ Attachments: DocumentToSave,
+ }
+
+
+ if(res.data) {
+ if(actionName == 'Solicitar Reapreciação') {
+
+ await this.repreciar(res.data.note, docs);
+ }
+ else if(actionName == 'Arquivar') {
+ await this.arquivar(res.data.note, docs);
+ this.popoverController.dismiss('close')
+ }
+ }
+
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async arquivar(note:string, documents:any) {
+
+ const loader = this.toastService.loading()
+
+ try {
+ await this.pedidoService.arquivar({serialNumber: this.serialNumber,
+ documents,
+ note
+ }).toPromise()
+
+ this.httpErrorHandle.httpsSucessMessagge('Arquivar')
+ } catch (error) {
+ this.httpErrorHandle.httpStatusHandle(error)
+ } finally {
+ loader.remove()
+ }
+
+ }
+
+ async openDarParecer(task: any) {
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: DarParecerPage,
+ componentProps: {
+ serialNumber: this.task.SerialNumber,
+ ProcessInstanceID: this.task.ProcessInstanceID,
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then( () => {
+ this.popoverController.dismiss('close');
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+
+ }
+
+ async openForwardModal(tasK: any) {
+ let classs;
+ if (window.innerWidth <= 800) {
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: ForwardPage,
+ componentProps: {
+ task: this.task,
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then(() => {
+ this.popoverController.dismiss('close');
+ }, (error) => {
+ console.log(error)
+ });
+
+ await modal.present();
+ }
+
+ async openDelegarModal(task: any) {
+
+
+ let classs;
+ if( window.innerWidth <= 800){
+ classs = 'book-meeting-modal modal modal-desktop'
+ } else {
+ classs = 'modal modal-desktop showAsideOptions'
+ }
+
+ this.modalController.dismiss()
+ const modal = await this.modalController.create({
+ component: DelegarPage,
+ componentProps: {
+ task: this.task,
+ },
+ cssClass: classs,
+ backdropDismiss: false
+ });
+
+ modal.onDidDismiss().then( async (res)=> {
+
+ if(res['data']=='close') {
+ this.popoverController.dismiss('close');
+ }
+
+ }, (error) => {
+ console.log(error)
+ })
+
+ await modal.present();
+ }
+
+
+}
diff --git a/src/app/shared/publication/new-publication/new-publication.page.html b/src/app/shared/publication/new-publication/new-publication.page.html
index 507ae0b7f..5a51efaec 100644
--- a/src/app/shared/publication/new-publication/new-publication.page.html
+++ b/src/app/shared/publication/new-publication/new-publication.page.html
@@ -3,7 +3,7 @@
-
+
{{ publicationTitle }}
Campos marcados com * são obrigatórios
@@ -16,7 +16,7 @@
-
@@ -27,7 +27,7 @@
-