complete task

This commit is contained in:
CHIEFSOFT\ameye
2023-08-24 08:30:48 -04:00
parent cc8f9d37db
commit b312173c57
7 changed files with 194 additions and 117 deletions
+44 -2
View File
@@ -1,5 +1,5 @@
import {Component, OnInit, ViewChild} from '@angular/core';
import {NavController} from "@ionic/angular";
import {AlertController, NavController} from "@ionic/angular";
import {Router} from "@angular/router";
import { SessionDataProviderService } from 'src/app/store/session-data-provider.service';
import { BlogDataService } from 'src/app/store/blog-data.service';
@@ -21,6 +21,7 @@ export class ActivetaskPage implements OnInit {
private navctr: NavController,
private router: Router,
public sessionDataProviderService: SessionDataProviderService,
private alertController:AlertController,
private wrenchService: WrenchService,
public blogDataService: BlogDataService
) {
@@ -136,10 +137,51 @@ export class ActivetaskPage implements OnInit {
);
}
taskCompleted(){
async taskCompleted(){
// alert(100);
let reqData = {
contract: this.jobData.contract,
contract_uid: this.jobData.contract_uid,
job_action: 'NOTIFY_COMPLETE',
}
const alert = await this.alertController.create({
header: "Confirm the task is completed.",
message: "The task owner will confirm the completion acceptance or rejection soon.",
buttons: [
{
text: "Cancel",
role: "cancel",
handler: () => {
// this.getMyOffersData();
},
},
{
text: "Confirm Completed ?",
handler: () => {
// start
// API CALL TO MARK TASK AS COMPLETED BY WORKER
this.wrenchService.workerJobAction(reqData).subscribe((res)=> {
if (res.status != 200 || res.data.internal_return < 0) {
// setReqStatus({loading:false, status: false, message: 'unable to complete request. Try again'})
// Alert("Unable to set task as completed, try again soon");
} else {
this.router.navigate(['mytasks']);
}
}
);
// this.router.navigate(['mytasks']);
// end
},
},
],
});
await alert.present();
}
taskCancel(){
}
}