cancel jobs
This commit is contained in:
@@ -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;">
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user