mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Fixe merge and improve sucess message
This commit is contained in:
@@ -223,7 +223,7 @@ export class CreateProcessPage implements OnInit {
|
||||
}
|
||||
|
||||
}
|
||||
executado(){
|
||||
async executado(){
|
||||
let body = {
|
||||
"serialNumber": this.task.serialNumber,
|
||||
"action": "Conhecimento",
|
||||
@@ -234,7 +234,14 @@ export class CreateProcessPage implements OnInit {
|
||||
"AttachmentList" :null,
|
||||
|
||||
}
|
||||
this.processes.CompleteTask(body);
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
async addParticipants() {
|
||||
|
||||
@@ -3,6 +3,8 @@ import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
|
||||
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dar-parecer',
|
||||
@@ -34,7 +36,7 @@ export class DarParecerPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
save() {
|
||||
async save() {
|
||||
|
||||
const DocumentToSave = this.documents.map((e) => {
|
||||
return {
|
||||
@@ -58,8 +60,16 @@ export class DarParecerPage implements OnInit {
|
||||
"AttachmentList": docs,
|
||||
}
|
||||
console.log(body);
|
||||
this.processes.CompleteTask(body);
|
||||
this.modalController.dismiss();
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.modalController.dismiss();
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
removeAttachment(index: number){
|
||||
@@ -84,4 +94,40 @@ export class DarParecerPage implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
async successMessage(message?: string) {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: SuccessMessageComponent,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
modal.dismiss()
|
||||
},3000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest() {
|
||||
const modal = await this.modalController.create({
|
||||
component: BadRequestComponent,
|
||||
componentProps: {
|
||||
message: 'hello',
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
modal.dismiss()
|
||||
},1000)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ export class DespachoPrPage implements OnInit {
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.successMessage()
|
||||
} catch(error) {
|
||||
@@ -204,7 +204,7 @@ export class DespachoPrPage implements OnInit {
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
@@ -225,7 +225,7 @@ export class DespachoPrPage implements OnInit {
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
@@ -245,7 +245,7 @@ export class DespachoPrPage implements OnInit {
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
@@ -266,7 +266,7 @@ export class DespachoPrPage implements OnInit {
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
|
||||
@@ -195,7 +195,7 @@ export class DespachoPage implements OnInit {
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.successMessage()
|
||||
} catch(error) {
|
||||
@@ -214,7 +214,7 @@ export class DespachoPage implements OnInit {
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
@@ -235,9 +235,10 @@ export class DespachoPage implements OnInit {
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
this.close();
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.close();
|
||||
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
"AttachmentList": [],
|
||||
}
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.goBack();
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
|
||||
@@ -150,7 +150,7 @@ export class DiplomaPage implements OnInit {
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
@@ -170,7 +170,7 @@ export class DiplomaPage implements OnInit {
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
|
||||
+2
-2
@@ -93,12 +93,12 @@ export class ApproveEventModalPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
approveTask(serialNumber:string){
|
||||
async approveTask(serialNumber:string){
|
||||
console.log('approveTask SERIALNUMBER: ', serialNumber)
|
||||
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
|
||||
console.log(body);
|
||||
try {
|
||||
this.processes.PostTaskAction(body).toPromise()
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
this.successMessage()
|
||||
|
||||
@@ -59,23 +59,23 @@ export class ApproveEventPage implements OnInit {
|
||||
this.getTask();
|
||||
}
|
||||
|
||||
notImplemented(){
|
||||
notImplemented() {
|
||||
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
|
||||
}
|
||||
|
||||
close(){
|
||||
close() {
|
||||
/* this.router.navigate(['/home/gabinete-digital/event-list']); */
|
||||
this.closeEventToApprove.emit();
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
goBack(){
|
||||
goBack() {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"eventos": true,
|
||||
"eventos": true,
|
||||
}
|
||||
};
|
||||
if( window.innerWidth < 801){
|
||||
if( window.innerWidth < 801) {
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
} else {
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
@@ -92,14 +92,14 @@ export class ApproveEventPage implements OnInit {
|
||||
this.getAttachments(instanceId);
|
||||
}
|
||||
|
||||
approveTask(serialNumber:string){
|
||||
async approveTask(serialNumber:string){
|
||||
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
|
||||
console.log(body);
|
||||
|
||||
try {
|
||||
this.processes.PostTaskAction(body).toPromise()
|
||||
this.modalController.dismiss(serialNumber);
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
this.successMessage()
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
@@ -120,25 +120,22 @@ export class ApproveEventPage implements OnInit {
|
||||
/* console.log('Emendar'); */
|
||||
this.menu.close();
|
||||
this.openEmendMessageModal(serialNumber);
|
||||
this.modalController.dismiss(null);
|
||||
this.goBack();
|
||||
}
|
||||
|
||||
rejectTask(serialNumber:string){
|
||||
async rejectTask(serialNumber:string){
|
||||
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
console.log(body);
|
||||
|
||||
try {
|
||||
this.processes.PostTaskAction(body).toPromise()
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
this.successMessage()
|
||||
this.goBack();
|
||||
await this.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
async getAttachments(instanceId:string){
|
||||
@@ -183,7 +180,7 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then(res => {
|
||||
modal.onDidDismiss().then( async (res) => {
|
||||
console.log(res.data);
|
||||
|
||||
if(res.data !== ''){
|
||||
@@ -196,7 +193,7 @@ export class ApproveEventPage implements OnInit {
|
||||
console.log(body);
|
||||
|
||||
try {
|
||||
this.processes.PostTaskAction(body).toPromise()
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
//this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.goToEventsToApprove();
|
||||
this.successMessage()
|
||||
|
||||
+1
@@ -147,6 +147,7 @@
|
||||
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||
<div hidden class="solid"></div>
|
||||
<button hidden class="btn-cancel" shape="round" >Delegar</button>
|
||||
<button hidden (click)="showToast()" class="btn-cancel" shape="round" >ShowToast</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
+30
-5
@@ -17,6 +17,7 @@ import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart
|
||||
import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page';
|
||||
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
|
||||
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente-detail',
|
||||
@@ -49,6 +50,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
private alertService: AlertService,
|
||||
public popoverController: PopoverController,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
if(params["serialNumber"]) {
|
||||
@@ -80,6 +82,10 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
showToast(){
|
||||
this.toastService.presentToast('Não foi possível fazer login"');
|
||||
}
|
||||
|
||||
goBack(){
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
@@ -219,21 +225,28 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
console.log(res['data']);
|
||||
console.log(body);
|
||||
|
||||
if(body == 'descartar'){
|
||||
if(res['data']== 'Yes'){
|
||||
let otherbody = {
|
||||
"serialNumber": body.serialNumber,
|
||||
"serialNumber": this.task.SerialNumber,
|
||||
"action": "Passivo",
|
||||
"ActionTypeId": 94,
|
||||
"dataFields": {
|
||||
"Note": "",
|
||||
}
|
||||
}
|
||||
this.processes.CompleteTask(otherbody);
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
//Do nothing
|
||||
@@ -241,14 +254,26 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
}
|
||||
else{
|
||||
if(res['data']== 'Yes'){
|
||||
this.processes.CompleteTask(body);
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
|
||||
|
||||
this.goBack();
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
console.log('Update');
|
||||
|
||||
this.processes.UpdateTaskStatus(this.task.FolderId);
|
||||
|
||||
try {
|
||||
await this.processes.UpdateTaskStatus(this.task.FolderId);
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -197,7 +197,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.successMessage()
|
||||
} catch(error) {
|
||||
@@ -217,7 +217,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.successMessage()
|
||||
} catch(error) {
|
||||
@@ -311,7 +311,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
console.log(res['data']);
|
||||
console.log(body);
|
||||
|
||||
@@ -325,7 +325,15 @@ export class ExpedientePrPage implements OnInit {
|
||||
"Note": "",
|
||||
}
|
||||
}
|
||||
this.processes.CompleteTask(otherbody);
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
//Do nothing
|
||||
@@ -333,14 +341,30 @@ export class ExpedientePrPage implements OnInit {
|
||||
}
|
||||
else{
|
||||
if(res['data']== 'Yes'){
|
||||
this.processes.CompleteTask(body);
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
this.goBack();
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
console.log('Update');
|
||||
|
||||
this.processes.UpdateTaskStatus(this.task.FolderId);
|
||||
try {
|
||||
await this.processes.UpdateTaskStatus(this.task.FolderId);
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -22,6 +22,8 @@ import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-
|
||||
import { RequestOptionsPage } from 'src/app/shared/popover/request-options/request-options.page';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
|
||||
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-pedido',
|
||||
@@ -188,7 +190,7 @@ export class PedidoPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
repreciar(note:string, documents:any) {
|
||||
async repreciar(note:string, documents:any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"action": "Reapreciação",
|
||||
@@ -198,11 +200,19 @@ export class PedidoPage implements OnInit {
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
this.processes.CompleteTask(body);
|
||||
this.close();
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
|
||||
this.successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
arquivar(note:string, documents:any) {
|
||||
async arquivar(note:string, documents:any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"action": "Arquivo",
|
||||
@@ -212,8 +222,17 @@ export class PedidoPage implements OnInit {
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
this.processes.CompleteTask(body);
|
||||
this.close();
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
sendExpedienteToPending(){
|
||||
@@ -402,4 +421,41 @@ export class PedidoPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
async successMessage(message?: string) {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: SuccessMessageComponent,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
modal.dismiss()
|
||||
},3000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest() {
|
||||
const modal = await this.modalController.create({
|
||||
component: BadRequestComponent,
|
||||
componentProps: {
|
||||
message: 'hello',
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
modal.dismiss()
|
||||
},1000)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ export class ProcessesService {
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
};
|
||||
return this.http.post<any>(`${geturl}`, body, options).toPromise()
|
||||
return this.http.post<any>(`${geturl}`, body, options)
|
||||
}
|
||||
|
||||
UpdateTaskStatus(FolderId:string): Observable<any>{
|
||||
|
||||
@@ -84,7 +84,7 @@ export class ApproveEventComponent implements OnInit {
|
||||
console.log(body);
|
||||
|
||||
try {
|
||||
this.processes.PostTaskAction(body).toPromise()
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
this.modalController.dismiss(serialNumber);
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
@@ -115,7 +115,7 @@ export class ApproveEventComponent implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async rejectTask(serialNumber:string){
|
||||
async rejectTask(serialNumber:string) {
|
||||
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
console.log(body);
|
||||
@@ -167,11 +167,11 @@ export class ApproveEventComponent implements OnInit {
|
||||
},
|
||||
cssClass: 'emend-message-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
});-
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then(res => {
|
||||
modal.onDidDismiss().then( async (res) => {
|
||||
console.log(res.data);
|
||||
|
||||
if(res.data !== ''){
|
||||
@@ -182,9 +182,18 @@ export class ApproveEventComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
console.log(body);
|
||||
this.processes.PostTaskAction(body).toPromise()
|
||||
//this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.goToEventsToApprove();
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
//this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.goToEventsToApprove();
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
//this.alertService.presentAlert('Operação cancelada!');
|
||||
|
||||
@@ -169,7 +169,7 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
if(this.profile=='mdgpr') {
|
||||
this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).subscribe(
|
||||
(id) => {
|
||||
async (id) => {
|
||||
|
||||
const eventId: string = id;
|
||||
|
||||
@@ -186,7 +186,7 @@ export class NewEventPage implements OnInit {
|
||||
};
|
||||
});
|
||||
|
||||
DocumentToSave.forEach((attachments, i) => {
|
||||
await DocumentToSave.forEach((attachments, i) => {
|
||||
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{
|
||||
|
||||
if(DocumentToSave.length == (i+1)){
|
||||
|
||||
@@ -96,7 +96,7 @@ export class DeplomaOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
@@ -135,7 +135,7 @@ export class DeplomaOptionsPage implements OnInit {
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
|
||||
@@ -173,7 +173,7 @@ export class DespachosOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
@@ -248,7 +248,7 @@ export class DespachosOptionsPage implements OnInit {
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
@@ -270,7 +270,7 @@ export class DespachosOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.successMessage()
|
||||
} catch(error) {
|
||||
@@ -327,7 +327,7 @@ export class DespachosOptionsPage implements OnInit {
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
|
||||
@@ -174,7 +174,7 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
@@ -249,7 +249,7 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
@@ -271,7 +271,7 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.successMessage()
|
||||
} catch(error) {
|
||||
@@ -328,7 +328,7 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
|
||||
@@ -117,7 +117,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body);
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.successMessage()
|
||||
} catch(error) {
|
||||
@@ -139,11 +139,20 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
console.log(res['data']);
|
||||
if(res['data']== 'Yes'){
|
||||
this.processes.CompleteTask(body);
|
||||
this.goBack();
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.goBack();
|
||||
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
let otherbody = {
|
||||
@@ -154,7 +163,15 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
"Note": "",
|
||||
}
|
||||
}
|
||||
this.processes.CompleteTask(otherbody);
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//Volta na lista principal
|
||||
this.goBack();
|
||||
|
||||
@@ -8,6 +8,8 @@ import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discar
|
||||
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 { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
|
||||
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -149,7 +151,7 @@ export class RequestOptionsPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
repreciar(note:string, documents:any) {
|
||||
async repreciar(note:string, documents:any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"action": "Reapreciação",
|
||||
@@ -159,8 +161,15 @@ export class RequestOptionsPage implements OnInit {
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
this.processes.CompleteTask(body);
|
||||
this.close();
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async openAddNoteModal(actionName:string) {
|
||||
@@ -208,7 +217,7 @@ export class RequestOptionsPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
arquivar(note:string, documents:any) {
|
||||
async arquivar(note:string, documents:any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"action": "Arquivo",
|
||||
@@ -218,8 +227,16 @@ export class RequestOptionsPage implements OnInit {
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
this.processes.CompleteTask(body);
|
||||
this.close();
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
async openDarParecer(task: any) {
|
||||
@@ -265,4 +282,40 @@ export class RequestOptionsPage implements OnInit {
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
|
||||
|
||||
async successMessage(message?: string) {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: SuccessMessageComponent,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
modal.dismiss()
|
||||
},3000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest() {
|
||||
const modal = await this.modalController.create({
|
||||
component: BadRequestComponent,
|
||||
componentProps: {
|
||||
message: 'hello',
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
modal.dismiss()
|
||||
},1000)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user