cancel jobs

This commit is contained in:
CHIEFSOFT\ameye
2023-12-11 19:24:30 -05:00
parent f428c4912a
commit b16a0a628f
3 changed files with 22 additions and 6 deletions
+2 -2
View File
@@ -65,7 +65,7 @@ menuData:any;
uid: string,
sessionid: string,
job_mode:string,
limit:20,
limit:number,
page:1,
offset: 0
};
@@ -82,7 +82,7 @@ menuData:any;
uid: this.sessionDataProviderService.member_uid,
sessionid: this.sessionDataProviderService.session ,
job_mode: job_mode,
limit:20,
limit:12,
page:1,
offset: 0
}
@@ -59,6 +59,9 @@
<ion-col></ion-col>
<ion-col> <ion-button color="danger" size="small" shape="round" expand="block" fill="solid" (click)="cancelThisJob()">Cancel Task</ion-button></ion-col>
</ion-row>
<ion-row>
{{pendingActionResult}}
</ion-row>
</ion-grid>
<ion-card-content style="padding: 5px; font-size: 14px; text-align: center;">
+17 -4
View File
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import {AlertController, NavController} from "@ionic/angular";
import {AlertController, LoadingController, NavController} from "@ionic/angular";
import {Router} from "@angular/router";
import {SessionDataProviderService} from "../../store/session-data-provider.service";
import {WrenchService} from "../../services/wrench.service";
@@ -19,6 +19,7 @@ export class JobpastduePage implements OnInit {
private navctr: NavController,
private router: Router,
private alertController:AlertController,
private loadingCtrl: LoadingController,
public sessionDataProviderService: SessionDataProviderService,
private wrenchService: WrenchService
) {
@@ -62,7 +63,10 @@ export class JobpastduePage implements OnInit {
extension: 2,
reason:''
};
const loading = await this.loadingCtrl.create({
message: 'Extending Job Timeline...',
duration: 3000,
});
//debugger;
const alert = await this.alertController.create({
@@ -78,9 +82,11 @@ export class JobpastduePage implements OnInit {
{
text: "Extend Now",
handler: () => {
loading.present();
this.wrenchService.activeJobStatus(this.reqData).subscribe(
res => {
if (res?.internal_return > 0){
loading.dismiss();
this.pendingActionResult = "Task due was extended 2 days from today";
setTimeout(()=>{
this.pendingActionResult ='';
@@ -109,6 +115,10 @@ export class JobpastduePage implements OnInit {
reason:''
};
const loading = await this.loadingCtrl.create({
message: 'Cancelling Job...',
duration: 5000,
});
const alert = await this.alertController.create({
header: "Cancel Job",
@@ -123,12 +133,15 @@ export class JobpastduePage implements OnInit {
{
text: "Cancel Now",
handler: () => {
loading.present();
this.wrenchService.activeJobStatus(this.reqData).subscribe(
res => {
if (res?.internal_return > 0){
this.pendingActionResult = "Task due was extended 2 days from today";
if (res?.internal_return == 0){
loading.dismiss();
this.pendingActionResult = res.result ;
setTimeout(()=>{
this.pendingActionResult ='';
this.onBack();
},3000);
}
}