mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Fix
This commit is contained in:
@@ -56,6 +56,19 @@ export class PedidoService {
|
||||
return this.processes.CompleteTask(body)
|
||||
}
|
||||
|
||||
arquivar({note = "", serialNumber, documents= [] }) {
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
"action": "Arquivo",
|
||||
"ActionTypeId": 95,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
return this.processes.CompleteTask(body)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ export class DelegarPage implements OnInit {
|
||||
}
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss(null);
|
||||
this.modalController.dismiss('close');
|
||||
}
|
||||
|
||||
cancelTask() {
|
||||
@@ -100,13 +100,20 @@ export class DelegarPage implements OnInit {
|
||||
"DelegatedUserEmail": this.taskParticipants[0].EmailAddress,
|
||||
}
|
||||
console.log(body);
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
this.processes.DelegateTask(body).subscribe(res=>{
|
||||
|
||||
console.log(res);
|
||||
this.toastService.successMessage('Processo delegado')
|
||||
this.close();
|
||||
},
|
||||
(error)=>{
|
||||
this.toastService.badRequest("Processo não delegado")
|
||||
},
|
||||
()=>{
|
||||
loader.remove()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
interface BookMeetingModalPagecomponentProps {
|
||||
task: any
|
||||
}
|
||||
interface BookMeetingModalPageReturn {}
|
||||
@@ -4,12 +4,9 @@ import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
||||
import { formatDate } from '@angular/common';
|
||||
import { Event } from '../../../../models/event.model';
|
||||
import { AnimationController, MenuController, ModalController, PopoverController } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
|
||||
import { momentG } from 'src/plugin/momentG'
|
||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||
@@ -23,6 +20,7 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ForwardPage } from 'src/app/modals/forward/forward.page';
|
||||
import { PermissionService } from 'src/app/OtherService/permission.service';
|
||||
import { Location } from '@angular/common';
|
||||
import { PedidoService } from 'src/app/Rules/pedido.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -50,8 +48,6 @@ export class PedidoPage implements OnInit {
|
||||
constructor(private activatedRoute: ActivatedRoute,
|
||||
private processes: ProcessesService,
|
||||
private iab: InAppBrowser,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private events: EventsService,
|
||||
private menu: MenuController,
|
||||
private router: Router,
|
||||
private modalController: ModalController,
|
||||
@@ -61,7 +57,8 @@ export class PedidoPage implements OnInit {
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
public p: PermissionService,
|
||||
private location: Location
|
||||
private location: Location,
|
||||
private pedidoService: PedidoService
|
||||
) {
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
|
||||
@@ -218,6 +215,8 @@ export class PedidoPage implements OnInit {
|
||||
this.goBack()
|
||||
}
|
||||
|
||||
alert(JSON.stringify(res)+' nada')
|
||||
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -247,25 +246,20 @@ export class PedidoPage implements OnInit {
|
||||
}
|
||||
|
||||
async arquivar(note:string, documents:any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"action": "Arquivo",
|
||||
"ActionTypeId": 95,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
await this.pedidoService.arquivar({serialNumber: this.serialnumber,
|
||||
documents,
|
||||
note
|
||||
}).toPromise()
|
||||
|
||||
this.toastService.successMessage('Processo arquivado')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
} finally {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -348,22 +342,22 @@ export class PedidoPage implements OnInit {
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
async viewEventDetail(eventId: any) {
|
||||
// async viewEventDetail(eventId: any) {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewEventPage,
|
||||
componentProps: {
|
||||
eventId: eventId,
|
||||
},
|
||||
cssClass: 'modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res) => {
|
||||
if (res) {
|
||||
}
|
||||
});
|
||||
}
|
||||
// const modal = await this.modalController.create({
|
||||
// component: ViewEventPage,
|
||||
// componentProps: {
|
||||
// eventId: eventId,
|
||||
// },
|
||||
// cssClass: 'modal modal-desktop',
|
||||
// backdropDismiss: false
|
||||
// });
|
||||
// await modal.present();
|
||||
// modal.onDidDismiss().then((res) => {
|
||||
// if (res) {
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
async distartExpedientModal(){
|
||||
console.log(this.fulltask);
|
||||
@@ -491,11 +485,11 @@ export class PedidoPage implements OnInit {
|
||||
await this.repreciar(res.data.note, docs);
|
||||
this.goBack();
|
||||
}
|
||||
else if(actionName == 'Arquivar'){
|
||||
else if(actionName == 'Arquivar') {
|
||||
await this.arquivar(res.data.note, docs);
|
||||
this.goBack();
|
||||
}
|
||||
else if(actionName == 'Assignar'){
|
||||
else if(actionName == 'Assignar') {
|
||||
await this.assignar(res.data.note, docs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@ export class ModalService {
|
||||
) { }
|
||||
|
||||
|
||||
BookMeetingModalPage(task, { classs, backdropDismiss = false }) {
|
||||
BookMeetingModalPage(e:BookMeetingModalPagecomponentProps, { classs, backdropDismiss = false }) {
|
||||
return this.modalController.create({
|
||||
component: BookMeetingModalPage,
|
||||
componentProps: {
|
||||
task: task,
|
||||
task: e.task,
|
||||
},
|
||||
cssClass: classs,
|
||||
backdropDismiss
|
||||
|
||||
@@ -6,11 +6,11 @@ import { CreateProcessPage } from 'src/app/modals/create-process/create-process.
|
||||
import { DarParecerPage } from 'src/app/modals/dar-parecer/dar-parecer.page';
|
||||
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||
import { PermissionService } from 'src/app/OtherService/permission.service';
|
||||
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Location } from '@angular/common';
|
||||
import { PedidoService } from 'src/app/Rules/pedido.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-request-options',
|
||||
@@ -35,7 +35,7 @@ export class RequestOptionsPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
private router: Router,
|
||||
public p: PermissionService,
|
||||
private location: Location
|
||||
private pedidoService: PedidoService
|
||||
) {
|
||||
this.task = this.navParams.get('task');
|
||||
this.fulltask = this.navParams.get('fulltask');
|
||||
@@ -137,7 +137,6 @@ export class RequestOptionsPage implements OnInit {
|
||||
if(res['data']=='openDiscart') {
|
||||
console.log('open discart');
|
||||
|
||||
this.distartExpedientModal();
|
||||
} else {
|
||||
this.popoverController.dismiss('close')
|
||||
}
|
||||
@@ -145,29 +144,6 @@ export class RequestOptionsPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
async distartExpedientModal() {
|
||||
this.popoverController.dismiss();
|
||||
console.log(this.fulltask);
|
||||
const modal = await this.modalController.create({
|
||||
component: DiscartExpedientModalPage,
|
||||
componentProps: {
|
||||
serialNumber: this.fulltask.serialNumber,
|
||||
folderId: this.fulltask.workflowInstanceDataFields.FolderID,
|
||||
action: 'complete',
|
||||
},
|
||||
cssClass: 'discart-expedient-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
if(res['data']=='close') {
|
||||
this.close();
|
||||
} else {}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
async repreciar(note:string, documents:any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
@@ -195,7 +171,7 @@ export class RequestOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
async openAddNoteModal(actionName:string) {
|
||||
this.popoverController.dismiss();
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
classs = 'modal modal-desktop'
|
||||
@@ -229,7 +205,7 @@ export class RequestOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
if(res.data){
|
||||
if(res.data) {
|
||||
if(actionName == 'Solicitar Reapreciação') {
|
||||
|
||||
await this.repreciar(res.data.note, docs);
|
||||
@@ -237,29 +213,27 @@ export class RequestOptionsPage implements OnInit {
|
||||
else if(actionName == 'Arquivar') {
|
||||
await this.arquivar(res.data.note, docs);
|
||||
this.popoverController.dismiss('close')
|
||||
this.modalController.dismiss('close');
|
||||
alert('close')
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
async arquivar(note:string, documents:any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Arquivo",
|
||||
"ActionTypeId": 95,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
await this.pedidoService.arquivar({serialNumber: this.serialNumber,
|
||||
documents,
|
||||
note
|
||||
}).toPromise()
|
||||
|
||||
this.toastService.successMessage('Processo arquivado')
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não arquivado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -290,7 +264,6 @@ export class RequestOptionsPage implements OnInit {
|
||||
|
||||
async openDelegarModal(task: any) {
|
||||
|
||||
this.popoverController.dismiss();
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
@@ -307,7 +280,13 @@ export class RequestOptionsPage implements OnInit {
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
modal.onDidDismiss().then( async (res)=> {
|
||||
|
||||
if(res['data']=='close') {
|
||||
this.popoverController.dismiss('close');
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user