cancel task

This commit is contained in:
CHIEFSOFT\ameye
2023-08-24 11:20:02 -04:00
parent b312173c57
commit 52d54c215f
2 changed files with 43 additions and 6 deletions
+38 -1
View File
@@ -178,8 +178,45 @@ export class ActivetaskPage implements OnInit {
});
await alert.present();
}
taskCancel(){
async taskCancel(){
let reqData = {
contract: this.jobData.contract,
contract_uid: this.jobData.contract_uid,
job_action: 'NOTIFY_CANCEL',
}
const alert = await this.alertController.create({
header: "Confirm Cancel Request.",
message: "The task owner will be informed of this cancellation. Once completed, we cannot reverse this action.",
buttons: [
{
text: "Cancel",
role: "cancel",
handler: () => {
// this.getMyOffersData();
},
},
{
text: "Confirm Cancel ?",
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();
}
+5 -5
View File
@@ -109,11 +109,11 @@
</div>
<div class="route">
<ion-item lines="none" (click)="onProfile()">
<ion-icon name="person-outline" color="dark"></ion-icon>
<ion-label>Edit Profile</ion-label>
<ion-icon name="chevron-forward-outline" color="medium"></ion-icon>
</ion-item>
<!-- <ion-item lines="none" (click)="onProfile()">-->
<!-- <ion-icon name="person-outline" color="dark"></ion-icon>-->
<!-- <ion-label>Edit Profile</ion-label>-->
<!-- <ion-icon name="chevron-forward-outline" color="medium"></ion-icon>-->
<!-- </ion-item>-->
<ion-item lines="none" (click)="onFamily()">
<ion-icon name="people-outline"></ion-icon>