job history
This commit is contained in:
@@ -7,6 +7,9 @@ import { IonicModule } from '@ionic/angular';
|
||||
import { HistoryPageRoutingModule } from './history-routing.module';
|
||||
|
||||
import { HistoryPage } from './history.page';
|
||||
import {
|
||||
HistoryCompletedJobsComponent
|
||||
} from "../../components/history/history-completed-jobs/history-completed-jobs.component";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -15,6 +18,6 @@ import { HistoryPage } from './history.page';
|
||||
IonicModule,
|
||||
HistoryPageRoutingModule
|
||||
],
|
||||
declarations: [HistoryPage]
|
||||
declarations: [HistoryPage,HistoryCompletedJobsComponent]
|
||||
})
|
||||
export class HistoryPageModule {}
|
||||
|
||||
@@ -36,11 +36,12 @@
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
|
||||
<app-history-completed-jobs *ngIf="current_report==='COMPLETED_JOBS';"></app-history-completed-jobs>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -21,8 +21,11 @@ historyTypes:any=[];
|
||||
this.historyTypes= this.sessionDataProviderService.history_types;
|
||||
}
|
||||
|
||||
current_report:string = '';
|
||||
refreshReport(){
|
||||
this.current_report = this.slected_report_type;
|
||||
|
||||
//alert(this.slected_report_type);
|
||||
}
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
@@ -153,6 +153,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -248,6 +248,9 @@ export class WrenchService {
|
||||
return this.getPostData("activetaskslist", usrData);
|
||||
}
|
||||
|
||||
getMyJobsReportData(usrData) {
|
||||
return this.getPostData("tasksreport", usrData);
|
||||
}
|
||||
addRecipientAccount(reqData){
|
||||
return this.getPostData("addrecipient", reqData);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
|
||||
import {Router} from "@angular/router";
|
||||
import {SessionDataProviderService} from "./session-data-provider.service";
|
||||
import {WrenchService} from "../services/wrench.service";
|
||||
import { apiConst} from "../../constants/constant";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -11,6 +12,8 @@ export class TasksDataService {
|
||||
active_job_count:number =0;
|
||||
pastdue_job_count:number =0;
|
||||
review_job_count:number =0;
|
||||
completed_job_count:number =0;
|
||||
|
||||
session_image_server:string='';
|
||||
curr_session:string='';
|
||||
|
||||
@@ -39,11 +42,13 @@ export class TasksDataService {
|
||||
jobsPastDueData: [];
|
||||
|
||||
jobsTotalData:any;
|
||||
jobsReportTotalData:any;
|
||||
|
||||
jobsData: [];
|
||||
async getJobsData(){
|
||||
|
||||
this.usrData = {
|
||||
action:11200,
|
||||
action: apiConst.WRENCHBOARD_JOB_USERACTIVE,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session ,
|
||||
@@ -60,7 +65,7 @@ export class TasksDataService {
|
||||
console.log("getMyActiveJobsData RETURN->", this.jobsTotalData);
|
||||
this.session_image_server = this.jobsTotalData.session_image_server;
|
||||
|
||||
let AllResult = this.jobsTotalData.result_list;;
|
||||
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')
|
||||
@@ -71,4 +76,33 @@ export class TasksDataService {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
jobsTotalCompletedData:any;
|
||||
jobsCompletedData: [];
|
||||
async getJobsHistoryData(){
|
||||
|
||||
this.usrData = {
|
||||
action: apiConst.WRENCHBOARD_JOB_REPORT,
|
||||
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.curr_session = this.sessionDataProviderService.session;
|
||||
this.wrenchService.getMyJobsReportData(this.usrData).subscribe(
|
||||
jobsReportTotalData => {
|
||||
this.jobsReportTotalData = jobsReportTotalData;
|
||||
this.session_image_server = this.jobsReportTotalData.session_image_server;
|
||||
let AllResult = this.jobsReportTotalData.result_list;
|
||||
this.jobsCompletedData = AllResult.filter((item) => item.status_description == 'COMPLETED')
|
||||
this.completed_job_count = this.jobsCompletedData?.length;
|
||||
// debugger;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user