From d4f788848cb0aab2fbebeebd02a74af928f019f5 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sun, 20 Aug 2023 14:41:54 -0400 Subject: [PATCH] active jobs filters --- src/app/pages/mytasks/mytasks.page.html | 46 +++++----- src/app/pages/mytasks/mytasks.page.ts | 115 ++++++++++++++---------- 2 files changed, 90 insertions(+), 71 deletions(-) diff --git a/src/app/pages/mytasks/mytasks.page.html b/src/app/pages/mytasks/mytasks.page.html index 9013ef7..f307e2b 100644 --- a/src/app/pages/mytasks/mytasks.page.html +++ b/src/app/pages/mytasks/mytasks.page.html @@ -65,19 +65,19 @@
+
+ + WrenchBoard Past Due + + Past Due + + - - WrenchBoard Past Due - - Past Due - - - - - You do not have any task past due. - - - + + You do not have any task past due. + + +
@@ -102,18 +102,20 @@
+
+ + Silhouette of mountains + + In Review + + - - Silhouette of mountains - - In Review - - + + No task is currently in review. + + +
- - No task is currently in review. - -
diff --git a/src/app/pages/mytasks/mytasks.page.ts b/src/app/pages/mytasks/mytasks.page.ts index 95ee87a..6f1fc3f 100644 --- a/src/app/pages/mytasks/mytasks.page.ts +++ b/src/app/pages/mytasks/mytasks.page.ts @@ -27,8 +27,8 @@ export class MytasksPage implements OnInit { ngOnInit() { // debugger; this.getJobsData(); - this.getPastDueJobsData(); - this.getInReviewJobsData(); + // this.getPastDueJobsData(); + // this.getInReviewJobsData(); } onCall() { @@ -43,69 +43,86 @@ export class MytasksPage implements OnInit { } usrData: { - action:11200, member_id: number, uid: string, sessionid: string, limit:20, page:0, offset: 0, job_mode: string + action:number, + member_id: number, + uid: string, sessionid: string, + limit:20, + page:0, + offset: 0, + job_mode: string, + allstatus: number }; jobsTotalData:any; jobsData: []; getJobsData(){ - this.usrData = {action:11200, member_id: this.sessionDataProviderService.member_id, - uid: this.sessionDataProviderService.member_uid, sessionid: this.sessionDataProviderService.session , - limit:20, page:0, offset:0, job_mode: 'ACTIVE'} + this.usrData = { + action:11200, + member_id: this.sessionDataProviderService.member_id, + uid: this.sessionDataProviderService.member_uid, + sessionid: this.sessionDataProviderService.session , + limit:20, + page:0, + offset:0, + job_mode: 'ACTIVE', + allstatus: 100 + } this.wrenchService.getMyActiveJobsData(this.usrData).subscribe( jobsTotalData => { this.jobsTotalData = jobsTotalData; - console.log("PAH HX RETURN->", this.jobsTotalData); - this.jobsData = this.jobsTotalData.result_list; - // debugger; - console.log("JOBS RETURN DATA->", this.jobsData); - this.active_job_count = this.jobsData.length; - // this.blogDataService.setBlogData(this.blogResult.blog_data); + console.log("getMyActiveJobsData RETURN->", this.jobsTotalData); + + let AllResult = this.jobsTotalData.result_list;; + this.jobsData = AllResult.filter((item) => item.status_description == 'ACTIVE') + this.jobsPastDueData =AllResult.filter((item) => item.status_description == 'PASTDUE') + this.jobsInReviewData =AllResult.filter((item) => item.status_description == 'REVIEW') + this.active_job_count = this.jobsData.length; + this.review_job_count = this.jobsPastDueData.length; + this.pastdue_job_count = this.jobsInReviewData.length; } ); - } jobsTotalPastDueData:any; - jobsPastDueData: []; - getPastDueJobsData(){ - - this.usrData = {action:11200, member_id: this.sessionDataProviderService.member_id, uid: this.sessionDataProviderService.member_uid, - sessionid: this.sessionDataProviderService.session , limit:20, page:0, offset:0, job_mode: 'PASTDUE'} - this.wrenchService.getMyActiveJobsData(this.usrData).subscribe( - jobsTotalPastDueData => { - this.jobsTotalPastDueData = jobsTotalPastDueData; - console.log("PAST DUE TOTAL RETURN->", this.jobsTotalPastDueData); - this.jobsPastDueData = this.jobsTotalPastDueData.result_list; - // debugger; - console.log("PAST DUE JOBS RETURN DATA->", this.jobsPastDueData); - // this.blogDataService.setBlogData(this.blogResult.blog_data); - } - ); - - } + jobsPastDueData: []; + // getPastDueJobsData(){ + // + // this.usrData = {action:11200, member_id: this.sessionDataProviderService.member_id, uid: this.sessionDataProviderService.member_uid, + // sessionid: this.sessionDataProviderService.session , limit:20, page:0, offset:0, job_mode: 'PASTDUE'} + // this.wrenchService.getMyActiveJobsData(this.usrData).subscribe( + // jobsTotalPastDueData => { + // this.jobsTotalPastDueData = jobsTotalPastDueData; + // console.log("PAST DUE TOTAL RETURN->", this.jobsTotalPastDueData); + // this.jobsPastDueData = this.jobsTotalPastDueData.result_list; + // // debugger; + // console.log("PAST DUE JOBS RETURN DATA->", this.jobsPastDueData); + // // this.blogDataService.setBlogData(this.blogResult.blog_data); + // } + // ); + // + // } jobsTotalInReviewData:any; jobsInReviewData: []; - getInReviewJobsData(){ - - this.usrData = {action:11200, - member_id: this.sessionDataProviderService.member_id, - uid: this.sessionDataProviderService.member_uid, - sessionid: this.sessionDataProviderService.session , - limit:20, page:0, offset:0, job_mode: 'REVIEW'} - this.wrenchService.getMyActiveJobsData(this.usrData).subscribe( - jobsTotalInReviewData => { - this.jobsTotalInReviewData = jobsTotalInReviewData; - console.log("JOBS IN REVIEW TOTAL RETURN->", this.jobsTotalInReviewData); - this.jobsInReviewData = this.jobsTotalInReviewData.result_list; - // debugger; - console.log("JOBS IN REVIEW RETURN DATA->", this.jobsInReviewData); - // this.blogDataService.setBlogData(this.blogResult.blog_data); - } - ); - - } + // getInReviewJobsData(){ + // + // this.usrData = {action:11200, + // member_id: this.sessionDataProviderService.member_id, + // uid: this.sessionDataProviderService.member_uid, + // sessionid: this.sessionDataProviderService.session , + // limit:20, page:0, offset:0, job_mode: 'REVIEW'} + // this.wrenchService.getMyActiveJobsData(this.usrData).subscribe( + // jobsTotalInReviewData => { + // this.jobsTotalInReviewData = jobsTotalInReviewData; + // console.log("JOBS IN REVIEW TOTAL RETURN->", this.jobsTotalInReviewData); + // this.jobsInReviewData = this.jobsTotalInReviewData.result_list; + // // debugger; + // console.log("JOBS IN REVIEW RETURN DATA->", this.jobsInReviewData); + // // this.blogDataService.setBlogData(this.blogResult.blog_data); + // } + // ); + // + // } }