mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
improve
This commit is contained in:
@@ -8,14 +8,10 @@ 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 { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { BadRequestPage } from '../bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from '../success-message/success-message.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-opts-expediente-pr',
|
||||
@@ -68,7 +64,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
close(){
|
||||
close() {
|
||||
if( window.innerWidth <= 1024){
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
@@ -121,7 +117,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
async approve(note:string, documents:any){
|
||||
async approve(note:string, documents:any) {
|
||||
this.popoverController.dismiss();
|
||||
let body = {
|
||||
"serialNumber": this.task.SerialNumber,
|
||||
@@ -160,7 +156,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
console.log(res['data']);
|
||||
|
||||
if(body == 'descartar'){
|
||||
if(body == 'descartar') {
|
||||
if(res['data']== 'Yes'){
|
||||
let otherbody = {
|
||||
"serialNumber": this.task.SerialNumber,
|
||||
@@ -188,17 +184,17 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
//Do nothing
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(res['data']== 'Yes'){
|
||||
else {
|
||||
if(res['data']== 'Yes') {
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
// this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado');
|
||||
} finally {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
this.goBack();
|
||||
@@ -222,7 +218,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
async sendToReview(note:string, documents:any){
|
||||
async sendToReview(note:string, documents:any) {
|
||||
let body = {
|
||||
"serialNumber": this.task.SerialNumber,
|
||||
"action": "Retificar",
|
||||
@@ -276,14 +272,25 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
cssClass: classs,
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
console.log(res['data']);
|
||||
let body = res['data'];
|
||||
// alert('close '+ res['data'])
|
||||
if(res['data']){
|
||||
console.log('open discart');
|
||||
|
||||
this.distartExpedientModal(body);
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
// this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado');
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
this.goBack();
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
Reference in New Issue
Block a user