job group

This commit is contained in:
CHIEFSOFT\ameye
2023-12-09 08:53:00 -05:00
parent c758e8b44b
commit 090a127eaa
8 changed files with 109 additions and 5 deletions
@@ -179,7 +179,7 @@
</ion-card-header>
<ion-card-content>
<ion-button color="secondary" expand="block" >Request Extension</ion-button>
<ion-button color="secondary" size="small" shape="round" expand="block" (click)="requestExtension()">Request Extension</ion-button>
</ion-card-content>
</ion-card>
</div>
@@ -303,4 +303,52 @@ export class ActivetaskPage implements OnInit {
}
}
async requestExtension(){
let reqData = {
contract: this.jobData.contract,
contract_uid: this.jobData.contract_uid,
job_action: 'NOTIFY_REQEXTENT',
}
const loading = await this.loadingCtrl.create({
message: 'Sending...',
duration: 2500,
});
const alert = await this.alertController.create({
header: "Request Extensions",
message: "Confirm you are ready to send request?",
buttons: [
{
text: "Cancel",
role: "cancel",
handler: () => {
// this.getMyOffersData();
},
},
{
text: "Send Request",
handler: () => {
loading.present();
// API CALL TO MARK TASK AS COMPLETED BY WORKER
this.wrenchService.workerJobAction(reqData).subscribe((res)=> {
loading.dismiss();
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']);
}
}
);
},
},
],
});
await alert.present();
}
}