You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
2.4 KiB
98 lines
2.4 KiB
import { HttpClient } from '@angular/common/http'; |
|
import { Component, OnInit } from '@angular/core'; |
|
|
|
@Component({ |
|
selector: 'app-da-subordinate-audit', |
|
templateUrl: './da-subordinate-audit.component.html', |
|
styleUrls: ['./da-subordinate-audit.component.scss'] |
|
}) |
|
export class DaSubordinateAuditComponent implements OnInit { |
|
|
|
constructor(private http: HttpClient) { } |
|
|
|
OrganizationId |
|
selectedTab = 0 |
|
selectTab(item) { |
|
this.selectedTab = item |
|
} |
|
ngOnInit(): void { |
|
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId |
|
let month = new Date().getMonth() + 1 |
|
this.selectedMonth = month + '月' |
|
|
|
this.getTaskList() |
|
|
|
} |
|
months = [ |
|
{ name: '1月', isable: true }, |
|
{ name: '2月', isable: true }, |
|
{ name: '3月', isable: true }, |
|
{ name: '4月', isable: true }, |
|
{ name: '5月', isable: true }, |
|
{ name: '6月', isable: true }, |
|
{ name: '7月', isable: true }, |
|
{ name: '8月', isable: true }, |
|
{ name: '9月', isable: true }, |
|
{ name: '10月', isable: true }, |
|
{ name: '11月', isable: true }, |
|
{ name: '12月', isable: true } |
|
] |
|
selectedMonth |
|
selectMonth(item) { |
|
this.selectedMonth = item.name |
|
} |
|
|
|
|
|
nzLoading = false |
|
PageNumber = 1 |
|
PageSize = 9999 |
|
|
|
data = [ |
|
{ id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [] }, |
|
{ id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [] } |
|
] |
|
|
|
|
|
getTaskList() { |
|
this.nzLoading = true |
|
let params = { |
|
|
|
OrganizationId: this.OrganizationId, |
|
PageNumber: this.PageNumber, |
|
PageSize: this.PageSize |
|
} |
|
this.http.get('/api/PlanTasks', { |
|
params: params |
|
}).subscribe((data: any) => { |
|
this.nzLoading = false |
|
|
|
let arr1 = [] |
|
let arr2 = [] |
|
data.items.forEach(element => { |
|
if (element.taskName == '熟悉演练') { |
|
arr1.push(element) |
|
} |
|
if (element.taskName == '联络指导') { |
|
arr2.push(element) |
|
} |
|
}); |
|
arr1.forEach(item => { |
|
if (!!item.approvalStatus) { |
|
this.data[0].finished += 1 |
|
} |
|
}); |
|
arr2.forEach(item => { |
|
if (!!item.approvalStatus) { |
|
this.data[1].finished += 1 |
|
} |
|
}); |
|
this.data[0].totalCount = arr1.length |
|
this.data[0].list = [...arr1] |
|
this.data[1].totalCount = arr2.length |
|
this.data[1].list = [...arr2] |
|
|
|
}) |
|
} |
|
|
|
|
|
}
|
|
|