mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
All changes i made
This commit is contained in:
@@ -22,6 +22,7 @@ import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.pag
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
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';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente-pr',
|
||||
@@ -60,7 +61,8 @@ export class ExpedientePrPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private RouteService: RouteService,
|
||||
public ThemeService: ThemeService
|
||||
public ThemeService: ThemeService,
|
||||
private httpErroHandle: HttpErrorHandle
|
||||
|
||||
) {
|
||||
this.loggeduser = SessionStore.user;
|
||||
@@ -137,18 +139,13 @@ export class ExpedientePrPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
|
||||
|
||||
this.toastService._successMessage('Processo enviado para pendentes')
|
||||
this.httpErroHandle.httpsSucessMessagge('Enviar para Pendente')
|
||||
this.goBack();
|
||||
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')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -193,16 +190,12 @@ export class ExpedientePrPage implements OnInit {
|
||||
|
||||
}, (error)=>{
|
||||
try {
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
} finally {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Não é possível visualizar este processo no modo offline')
|
||||
} else {
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -312,14 +305,9 @@ export class ExpedientePrPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.close();
|
||||
this.toastService._successMessage('Processo aprovado')
|
||||
this.httpErroHandle.httpsSucessMessagge('Aprovar')
|
||||
} 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 aprovado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -342,14 +330,9 @@ export class ExpedientePrPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.toastService._successMessage()
|
||||
this.httpErroHandle.httpsSucessMessagge('Rever')
|
||||
} catch(error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -468,15 +451,10 @@ export class ExpedientePrPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.toastService._successMessage('Processo descartado');
|
||||
this.httpErroHandle.httpsSucessMessagge('Arquivar')
|
||||
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')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user