Jon interest

This commit is contained in:
CHIEFSOFT\ameye
2023-11-18 12:52:58 -05:00
parent 54bc507dc6
commit 184d5248d5
3 changed files with 52 additions and 9 deletions
@@ -12,7 +12,7 @@ import {WrenchService} from "../../services/wrench.service";
export class InterestCardComponent implements OnInit {
@Input() intData:any;
@Input() intResponse: any;
@Input() thisObj:any;
currData:any;
constructor( private navctr: NavController,
private router: Router,
@@ -28,11 +28,11 @@ currData:any;
}
approveStart(){
this.intResponse(this.intData, "APPROVED");
async approveStart(){
this.intResponse(this.thisObj, this.intData, "APPROVED");
}
rejectStart(){
this.intResponse(this.intData, "REJECT");
async rejectStart(){
this.intResponse(this.thisObj,this.intData, "REJECT");
}
}
@@ -48,7 +48,9 @@
<ion-label>{{item.client_name}}</ion-label>
</ion-item>
<div class="ion-padding" slot="content">
<app-interest-card [intData]="item"
<app-interest-card
[intData]="item"
[thisObj]="thisObj"
[intResponse]="intResponse"
></app-interest-card>
</div>
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import {NavController} from "@ionic/angular";
import {AlertController, NavController} from "@ionic/angular";
import {Router} from "@angular/router";
import {SessionDataProviderService} from "../../store/session-data-provider.service";
import {WrenchService} from "../../services/wrench.service";
@@ -12,13 +12,14 @@ import {WrenchService} from "../../services/wrench.service";
export class JobintprocessPage implements OnInit {
session_image_server:string='';
curr_session:string='';
thisObj:any;
jobData: any;
allInterest: any;
selected_job_uid:string='';
constructor( private navctr: NavController,
private router: Router,
private alertController:AlertController,
public sessionDataProviderService: SessionDataProviderService,
private wrenchService: WrenchService) {
@@ -32,6 +33,7 @@ export class JobintprocessPage implements OnInit {
}
this.selected_job_uid = this.jobData.job_uid;
this.filterInterestList(this.allInterest);
this.thisObj = this;
}
filterIntList:[];
@@ -40,8 +42,47 @@ export class JobintprocessPage implements OnInit {
// his.jobsData = AllResult.filter((item) => item.status_description == 'ACTIVE')
}
intResponse(itemData, approveStatus){
async intResponse(thisObj,itemData, approveStatus){
var actionMessage = '';
var messageHeader ='';
var promtMessage='';
switch (approveStatus){
case "APPROVED":
actionMessage ="Confirm you are about to approve this task for this user ?";
messageHeader = "Confirm Approval";
promtMessage="Approve";
break;
case "REJECT":
actionMessage ="Confirm you are about to decline this task for this user ?";
messageHeader = "Confirm Rejection";
promtMessage = "Decline";
break;
}
//alert("It is me");
const alert = await thisObj.alertController.create({
header: messageHeader,
message: actionMessage,
buttons: [
{
text: "Cancel",
role: "cancel",
handler: () => {
// this.getMyOffersData();
},
},
{
text: promtMessage,
handler: () => {
// this.sessionDataProviderService.DestroySessionOnLogout();
// this.router.navigate(['logout']);
},
},
],
});
await alert.present();
}