mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Fixe merge and improve sucess message
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user