Process pending

This commit is contained in:
CHIEFSOFT\ameye
2023-12-11 11:08:56 -05:00
parent 02233921ab
commit 0411363a31
3 changed files with 148 additions and 1 deletions
@@ -49,6 +49,7 @@
<ion-row>
<ion-col style="text-align: center">
<ion-button
(click)="pendingJobExtend()"
shape="round"
size="small"
>
@@ -57,6 +58,7 @@
</ion-col>
<ion-col style="text-align: center">
<ion-button
(click)="pendingJobSendToMe()"
shape="round"
size="small"
>
@@ -73,6 +75,7 @@
<ion-col style="text-align: center">
<ion-button
(click)="pendingJobCancel()"
shape="round"
size="small"
>
@@ -87,6 +90,9 @@
</ion-grid>
<ion-grid style="background-color: lightgray;">
<ion-row>
<ion-col>
{{pendingActionResult}}
</ion-col>
<ion-col style="text-align: right;">
<ion-button
(click)="setCloseModal()"
@@ -1,6 +1,6 @@
import { Router } from '@angular/router';
import {Component, OnInit, Input } from '@angular/core';
import { NavController } from '@ionic/angular';
import {AlertController, NavController} from '@ionic/angular';
import {SessionDataProviderService} from "../../store/session-data-provider.service";
import {WrenchService} from "../../services/wrench.service";
@@ -21,6 +21,7 @@ export class MyjobOffersComponent implements OnInit {
constructor(
private navctr: NavController,
private router: Router,
private alertController:AlertController,
public sessionDataProviderService: SessionDataProviderService,
private wrenchService: WrenchService
) {
@@ -97,4 +98,132 @@ export class MyjobOffersComponent implements OnInit {
);
}
reqData: {
action:number,
member_id: number,
uid: string,
sessionid: string,
job_uid: string,
offer_code: string,
mode: number,
extend_days:number
};
async pendingJobExtend(){
this.reqData = {
action:13041,
member_id: this.sessionDataProviderService.member_id,
uid: this.sessionDataProviderService.member_uid,
sessionid: this.sessionDataProviderService.session,
job_uid: this.currentJobSelected.job_uid,
offer_code: this.currentJobSelected .offer_code,
mode: 200,
extend_days: 2
};
const alert = await this.alertController.create({
header: "Extend Timeline",
message: "Confirm you are ready to extend timeline now ?",
buttons: [
{
text: "Cancel",
role: "cancel",
handler: () => {
},
},
{
text: "Extend Now",
handler: () => {
this.wrenchService.pendingJobExtend(this.reqData).subscribe(
res => {
if (res?.internal_return > 0){
this.pendingActionResult = "Task due was extended 2 days from today";
setTimeout(()=>{
this.pendingActionResult ='';
},3000);
}
}
);
},
},
],
});
await alert.present();
// return this.getPostData("pendingjobextend", reqData);
}
pendingActionResult:string='';
async pendingJobSendToMe(){
this.reqData = {
action:13042,
member_id: this.sessionDataProviderService.member_id,
uid: this.sessionDataProviderService.member_uid,
sessionid: this.sessionDataProviderService.session,
job_uid: this.currentJobSelected.job_uid,
offer_code: this.currentJobSelected .offer_code,
mode: 200,
extend_days: 0
};
const alert = await this.alertController.create({
header: "Send Details.",
message: "Confirm you want to send Task details to your email ?.",
buttons: [
{
text: "Cancel",
role: "cancel",
handler: () => {
// this.getMyOffersData();
},
},
{
text: "Send Now",
handler: () => {
this.wrenchService.pendingJobSendToMe(this.reqData).subscribe(
res => {
if (res?.internal_return > 0){
this.pendingActionResult = "Message Sent";
setTimeout(()=>{
this.pendingActionResult ='';
},3000);
}
}
);
},
},
],
});
await alert.present();
// return this.getPostData("pendingjobsendtome", reqData);
}
//
async pendingJobCancel(){
const alert = await this.alertController.create({
header: "Log out",
message: "Confirm you are ready to log out now.",
buttons: [
{
text: "Cancel",
role: "cancel",
handler: () => {
// this.getMyOffersData();
},
},
{
text: "Log out",
handler: () => {
// this.sessionDataProviderService.DestroySessionOnLogout();
// this.router.navigate(['logout']);
},
},
],
});
await alert.present();
// return this.getPostData("pendingjobcancel", reqData);
}
//
}
+12
View File
@@ -179,6 +179,18 @@ export class WrenchService {
return this.getPostData("getwallets", usrData);
}
pendingJobExtend(reqData){
return this.getPostData("pendingjobextend", reqData);
}
pendingJobSendToMe(reqData){
return this.getPostData("pendingjobsendtome", reqData);
}
pendingJobCancel(reqData){
return this.getPostData("pendingjobcancel", reqData);
}
jobGroupData(reqData){
return this.getPostData("jobgrouplist", reqData);
}