diff --git a/src/app/home/home-routing.module.ts b/src/app/home/home-routing.module.ts
index df6c515..f98e4ba 100644
--- a/src/app/home/home-routing.module.ts
+++ b/src/app/home/home-routing.module.ts
@@ -42,7 +42,7 @@ const routes: Routes = [
},
{
path: 'audit',
- component: ZhiAuditComponent,
+ component: ZhiAuditComponent
},
{
path: 'monthlytaskoverview',
diff --git a/src/app/home/home.module.ts b/src/app/home/home.module.ts
index dbfa8d2..08f291f 100644
--- a/src/app/home/home.module.ts
+++ b/src/app/home/home.module.ts
@@ -59,8 +59,11 @@ import { ChangePasswordComponent } from './change-password/change-password.compo
import { NzUploadModule } from 'ng-zorro-antd/upload';
import { NzCardModule } from 'ng-zorro-antd/card';
import { PlanAdjustmentComponent } from './task/da-oneself-plan/plan-adjustment/plan-adjustment.component';
-import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
+import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
import { TaskDetailsComponent } from './task/station-weekly-plan/task-details/task-details.component';
+import { EditOrComponent } from './task/zhi-indicators/edit-or/edit-or.component';
+import { NzInputNumberModule } from 'ng-zorro-antd/input-number';
+import { CreateTaskComponent } from './task/station-weekly-plan/create-task/create-task.component';
@NgModule({
declarations: [
NavComponent,
@@ -95,7 +98,9 @@ import { TaskDetailsComponent } from './task/station-weekly-plan/task-details/ta
AllotPersonComponent,
ChangePasswordComponent,
PlanAdjustmentComponent,
- TaskDetailsComponent
+ TaskDetailsComponent,
+ EditOrComponent,
+ CreateTaskComponent
],
imports: [
CommonModule,
@@ -127,8 +132,9 @@ import { TaskDetailsComponent } from './task/station-weekly-plan/task-details/ta
NzSpinModule,
NzCardModule,
NzUploadModule,
- NzToolTipModule
+ NzToolTipModule,
+ NzInputNumberModule
],
- entryComponents: [AddroleComponent, EditroleComponent, AdduserComponent, EdituserComponent, AddorComponent, EditorComponent, ApplyComponent, ApplyLookComponent, LookTaskComponent, AllotPersonComponent]
+ entryComponents: [AddroleComponent, EditroleComponent, AdduserComponent, EdituserComponent, AddorComponent, EditorComponent, ApplyComponent, ApplyLookComponent, LookTaskComponent, AllotPersonComponent, EditOrComponent, CreateTaskComponent]
})
export class HomeModule { }
diff --git a/src/app/home/nav/nav.component.html b/src/app/home/nav/nav.component.html
index 49c2ab9..37515db 100644
--- a/src/app/home/nav/nav.component.html
+++ b/src/app/home/nav/nav.component.html
@@ -14,7 +14,7 @@
统计分析
-
+
系统管理
diff --git a/src/app/home/nav/nav.component.ts b/src/app/home/nav/nav.component.ts
index a812a6f..079c311 100644
--- a/src/app/home/nav/nav.component.ts
+++ b/src/app/home/nav/nav.component.ts
@@ -12,12 +12,20 @@ import { NzMessageService } from 'ng-zorro-antd/message';
})
export class NavComponent implements OnInit {
- constructor( private modal: NzModalService,private http: HttpClient,private message: NzMessageService,private viewContainerRef: ViewContainerRef,private router: Router, public token: CacheTokenService) { }
- user:""
+ constructor(private modal: NzModalService, private http: HttpClient, private message: NzMessageService, private viewContainerRef: ViewContainerRef, private router: Router, public token: CacheTokenService) { }
+ user = null
+
+ isSuperAdmin
ngOnInit(): void {
//调用服务中的function刷新token
this.token.startUp()
- this.user=JSON.parse(sessionStorage.getItem('userData')).name
+ this.user = JSON.parse(sessionStorage.getItem('userData')).name
+
+ let roles = JSON.parse(sessionStorage.getItem('userData')).roles
+ let isTrue = roles.find(item => {
+ return item.name == '超级管理员'
+ })
+ isTrue ? this.isSuperAdmin = true : this.isSuperAdmin = false
}
signOut() {
this.router.navigate(['/login'])
@@ -25,7 +33,7 @@ export class NavComponent implements OnInit {
ngOnDestroy(): void {
this.token.delete()
}
-
+
changePassword() {
const modal: any = this.modal.create({
nzTitle: '修改密码',
diff --git a/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html b/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html
index 173595b..042f91c 100644
--- a/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html
+++ b/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html
@@ -32,14 +32,15 @@
style="vertical-align: text-top;cursor: pointer;" nz-icon nzType="right-circle"
nzTheme="outline">
- 5/9
+
+ {{item.passed}}/{{item.data.length}}
完成率
- 60%
+ {{item.percentage}}%
-
@@ -51,13 +52,12 @@
nzTheme="outline">返回
-
+
- 济南历下森豪室内娱乐场
+ {{i.company.companyName}}
- 已分配
- 已检查
+ {{i.approvalStatus}}
@@ -81,7 +81,14 @@
+ [ngClass]="{'redcard': i.approvalStatus == '驳回'}">
{{i.company.companyName}}
-
+
+
+
|
+
申请人: {{i.organization.name}}
+
+
+

+
-
-
-

-

-
@@ -144,40 +150,46 @@
任务总数
+ {{countStat.statistics1.num}}
完成
-
+ [nzPercent]="countStat.statistics1.percentageComplete" nzStrokeColor="#87D068"
+ [nzShowInfo]="false" [nzStrokeWidth]="18">
- 75%
+ {{countStat.statistics1.percentageComplete}}%
-
-
-
-
+ [nzPercent]="countStat.statistics1.item1+countStat.statistics1.item2"
+ nzStrokeLinecap="square" [nzShowInfo]="false"
+ [nzSuccessPercent]="countStat.statistics1.item1">
-
-
上级指派46%
+
+
上级指派{{countStat.statistics1.item1}}%
+
-
自主任务46%
+
自主任务{{countStat.statistics1.item2}}%
+
-
申领任务46%
+
申领任务{{countStat.statistics1.item3}}%
+
@@ -185,7 +197,9 @@
- 任务总数
+ 消防救援任务总数
+ {{countStat.statistics2.num}}
@@ -195,28 +209,37 @@
+ [nzPercent]="countStat.statistics2.percentageComplete" nzStrokeColor="#87D068"
+ [nzShowInfo]="false" [nzStrokeWidth]="18">
- 75%
+ {{countStat.statistics2.percentageComplete}}%
-
-
-
-
+
+ [nzPercent]="countStat.statistics2.item1+countStat.statistics2.item2"
+ nzStrokeColor="#3658c8" nzStrokeLinecap="square" [nzShowInfo]="false"
+ [nzSuccessPercent]="countStat.statistics2.item1">
-
-
自主任务46%
+
+
上级指派{{countStat.statistics2.item1}}%
+
+
+
+
+
自主任务{{countStat.statistics2.item2}}%
+
-
-
申领任务46%
+
申领任务{{countStat.statistics2.item3}}%
+
@@ -224,7 +247,9 @@
- 任务总数
+ 检查员任务总数
+ {{countStat.statistics3.num}}
@@ -234,30 +259,39 @@
+ [nzPercent]="countStat.statistics3.percentageComplete" nzStrokeColor="#E6D91D"
+ [nzShowInfo]="false" [nzStrokeWidth]="18">
- 75%
+ {{countStat.statistics3.percentageComplete}}%
-
-
-
-
+
-
-
-
-
自主任务46%
+ [nzPercent]="countStat.statistics3.item1+countStat.statistics3.item2"
+ nzStrokeColor="#E6D91D" [nzShowInfo]="false"
+ [nzSuccessPercent]="countStat.statistics3.item1">
+
+
+
+
上级指派{{countStat.statistics3.item1}}%
-
-
+
+
+
自主任务{{countStat.statistics3.item2}}%
+
+
+
申领任务{{countStat.statistics3.item3}}%
+
+
+
@@ -276,14 +310,18 @@

{{element.name}}
-
单位总数: 7/8
-
+
+
+ 单位总数:{{element.awaitInspect}}/{{element.allUnitsNum}}
+
+
+
完成进度
-
+
-
+
{{element.isExpand ? '收起' :'展开'}}
@@ -298,12 +336,12 @@
已分配
-
0
+
{{item.inspected}}
-
+
已完成
-
0
+
{{item.finished}}
@@ -366,7 +404,7 @@
- 未发现违法违规情况
+ {{i.inspectionResult}}
检查结果
diff --git a/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.scss b/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.scss
index 350fe09..3eae21b 100644
--- a/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.scss
+++ b/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.scss
@@ -261,22 +261,19 @@
border-radius: 4px 4px 4px 4px;
opacity: 1;
display: flex;
+ margin-bottom: 18px;
+ align-items: center;
box-sizing: border-box;
padding: 0 20px;
position: relative;
- margin-bottom: 18px;
div {
display: flex;
align-items: center;
-
- img {
- margin-top: -3px;
- }
}
.unitname {
- width: 30%;
+ flex: 1;
}
.info {
@@ -285,33 +282,38 @@
justify-content: center;
align-items: center;
- span {
- margin-right: 20px;
- }
- }
+ .assistant {
+ width: 50%;
- .btn {
- flex: 1;
+ span {
+ color: #303133;
+ margin-right: 6px;
+ }
- button:nth-child(1) {
- background: #42B983;
- color: white;
+ img {
+ width: 16px;
+ height: 16px;
+ vertical-align: text-bottom;
+ }
+
+ display: inline-block;
+ text-align: left;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
- button:nth-child(2) {
- background: #FF0000;
- color: white;
- margin-left: 20px;
+ span {
+ margin-right: 20px;
}
}
+
.img {
- width: 30%;
+ flex: 1;
- .auditimg {
- position: absolute;
- right: 18%;
- top: 9%;
+ img {
+ margin-left: 40%;
}
}
@@ -329,9 +331,8 @@
}
}
- .taskauditbox:nth-child(2) {
+ .taskauditbox:nth-child(3) {
margin-bottom: 0px;
-
}
}
@@ -358,7 +359,7 @@
justify-content: space-between;
.deploycontentitem {
- width: 32%;
+ width: 33%;
height: 110px;
background: linear-gradient(180deg, #7AA3FC 0%, #2C4DC0 100%);
box-shadow: 0px 3px 8px 1px rgba(0, 0, 0, 0.0800);
@@ -379,6 +380,8 @@
.title {
text-align: left;
+ display: flex;
+ align-items: center;
}
.details {
@@ -433,7 +436,7 @@
.tips {
width: 10px;
height: 10px;
-
+
border-radius: 10px;
margin-right: 5px;
}
@@ -453,7 +456,7 @@
.deploycontentitem:nth-child(3) {
- background: linear-gradient(180deg, #73D9AA 0%, #42B983 100%);
+ background: linear-gradient(180deg, #9ef3cc 0%, #42B983 100%);
}
}
}
@@ -646,4 +649,4 @@
.cutoffrule {
width: 100%;
border-top: 1px dashed #C7CAD0;
-}
\ No newline at end of file
+}
diff --git a/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts b/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts
index 8668009..2e9a563 100644
--- a/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts
+++ b/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts
@@ -1,5 +1,5 @@
import { HttpClient } from '@angular/common/http';
-import { Component, OnInit, ViewContainerRef } from '@angular/core';
+import { Component, NgZone, OnInit, ViewContainerRef } from '@angular/core';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal';
import { AllotPersonComponent } from '../da-subordinate-audit/allot-person/allot-person.component';
@@ -10,19 +10,24 @@ import { AllotPersonComponent } from '../da-subordinate-audit/allot-person/allot
})
export class DaMonthlyTaskOverviewComponent implements OnInit {
- constructor(private http: HttpClient, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService) { }
+ constructor(private ngZone: NgZone, private http: HttpClient, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService) { }
selectedMonth
selectedYear = 2022
selectedTime
selectMonth(item) {
this.selectedMonth = item.id
+ this.getHigherTasks()
this.getTaskList()
+ this.getAllStation()
+ this.getCountStat()
}
selectYear(e) {
this.selectedYear = e
- console.log('年', e)
+ this.getHigherTasks()
this.getTaskList()
+ this.getAllStation()
+ this.getCountStat()
}
months = [
{ id: 1, name: '1月', isable: true },
@@ -40,51 +45,125 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
]
- istaskauditExpanded = true
- istaskauditexpand() {
- this.istaskauditExpanded = !this.istaskauditExpanded
- }
- isdeployboxExpanded = true
- isdeployboxexpand() {
- this.isdeployboxExpanded = !this.isdeployboxExpanded
+ OrganizationId
+ ngOnInit(): void {
+ this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
+ this.selectedMonth = new Date().getMonth() + 1
+
+ //上级任务指标
+ this.getHigherTasks()
+
+
+ // 下级任务申请
+ this.getTaskList()
+ this.getSupervisor('main')
+ this.getSupervisor('assisted')
+
+ //统计信息
+ this.getCountStat()
+
+ //本级部署
+ this.getAllStation()
}
- shuxiTaskData = {
- isExpand: true
+ //上级任务指标
+ cardData = [
+ { name: '双随机', isDetails: false, isLoading: false, background: '#1D9DFF', icon: 'suiji.png', passed: 0, inspected: 0, percentage: 0, data: [] },
+ { name: '行政许可', isDetails: false, isLoading: false, background: '#42B983', icon: 'xuke.png', passed: 0, inspected: 0, percentage: 0, data: [] },
+ { name: '熟悉演练', isDetails: false, isLoading: false, background: '#9D80FF', icon: 'yanlian.png', passed: 0, inspected: 0, percentage: 0, data: [] },
+ { name: '消防宣传', isDetails: false, isLoading: false, background: '#FF5D2A', icon: 'xuanchuan.png', passed: 0, inspected: 0, percentage: 0, data: [] },
+ { name: '投诉举报', isDetails: false, isLoading: false, background: '#5087FF', icon: 'tousu.png', passed: 0, inspected: 0, percentage: 0, data: [] },
+ { name: '火灾调查', isDetails: false, isLoading: false, background: '#FF404D', icon: 'huozai.png', passed: 0, inspected: 0, percentage: 0, data: [] }
+ ]
+
+ getHigherTasks() {
+ this.cardData.forEach((item, key) => {
+ item.data = []
+ item.passed = 0
+ item.inspected = 0
+ });
+ let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
+ let params = {
+ Month: selectedTime,
+ OrganizationId: this.OrganizationId,
+ PageNumber: 1,
+ CreationTypes: ['上级指派'],
+ PageSize: 9999
+ }
+
+ this.http.get('/api/PlanTasks', {
+ params: params
+ }).subscribe((data: any) => {
+
+ data.items.forEach(element => {
+ this.cardData.forEach((item, key) => {
+ element.taskType == item.name ? this.cardData[key].data.push(element) : null
+ });
+ });
+
+ this.cardData.forEach(element => {
+ element.data.forEach(item => {
+ item.approvalStatus == '通过' ? element.passed += 1 : null
+ item.approvalStatus == '已检查 ' ? element.inspected += 1 : null
+ })
+ })
+ this.cardData.forEach(element => {
+ element.percentage = Math.round(element.inspected / element.data.length) * 100 || 0
+ })
+ this.cardData = [...this.cardData]
+
+ })
}
- zhidaoTaskData = {
- isExpand: true
+
+ openDetails(data, type) {
+ this.ngZone.run(() => {
+ //这里写需要立即渲染的代码
+ data.isDetails = type
+ });
+
}
- PageNumber = 1
- PageSize = 9999
+ //下级任务申请打开关闭
+ expand(data) {
+ this.ngZone.run(() => {
+ //这里写需要立即渲染的代码
+ data.isExpand = !data.isExpand
+ });
+
+ }
+ istaskauditExpanded = true
+ istaskauditexpand() {
+ this.istaskauditExpanded = !this.istaskauditExpanded
+ }
taskData = [
{ id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [], isExpand: true },
- { id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [], isExpand: true }
+ { id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [], isExpand: true },
+ { id: 2, name: '双随机任务', finished: 0, totalCount: 0, list: [], isExpand: true }
]
- isloading = false
getTaskList() {
- this.isloading = true
this.taskData = [
{ id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [], isExpand: true },
- { id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [], isExpand: true }
+ { id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [], isExpand: true },
+ { id: 2, name: '双随机任务', finished: 0, totalCount: 0, list: [], isExpand: true }
+
]
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
- console.log('查询时间', selectedTime)
let params = {
Month: selectedTime,
OrganizationId: this.OrganizationId,
- PageNumber: this.PageNumber,
- PageSize: this.PageSize
+ CreationTypes: ['申领任务'],
+ PageNumber: 1,
+ PageSize: 9999
}
this.http.get('/api/PlanTasks', {
params: params
}).subscribe((data: any) => {
let arr1 = []
let arr2 = []
+ let arr3 = []
data.items.forEach(element => {
if (element.taskName == '熟悉演练') {
arr1.push(element)
@@ -92,27 +171,33 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
if (element.taskName == '联络指导') {
arr2.push(element)
}
+ if (element.taskName == '双随机') {
+ arr3.push(element)
+ }
});
arr1.forEach(item => {
- if (!!item.approvalStatus) {
+ if (item.approvalStatus == '通过') {
this.taskData[0].finished += 1
}
});
arr2.forEach(item => {
- if (!!item.approvalStatus) {
+ if (item.approvalStatus == '通过') {
this.taskData[1].finished += 1
}
});
- this.taskData[0].totalCount = arr1.length
+ arr3.forEach(item => {
+ if (item.approvalStatus == '通过') {
+ this.taskData[2].finished += 1
+ }
+ });
this.taskData[0].list = [...arr1]
- this.taskData[1].totalCount = arr2.length
this.taskData[1].list = [...arr2]
-
- this.isloading = false
-
+ this.taskData[2].list = [...arr3]
console.log('下级任务申请', this.taskData)
+
})
}
+
assitantsupervisorList
mainsupervisorList
getSupervisor(type) {
@@ -130,7 +215,6 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
}
})
}
-
allot(item) {
console.log(item)
if (this.mainsupervisorList.length == 0 || this.assitantsupervisorList.length == 0) {
@@ -159,7 +243,7 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
this.message.create('success', '分配成功');
resolve(data)
console.log(data);
-
+
this.getTaskList()
return true
},
@@ -183,52 +267,60 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
-
-
- expand(data) {
- data.isExpand = !data.isExpand
+ //获得统计信息
+ countStat: any = {
+ statistics1: {
+ num: 0, percentageComplete: 0, item1: 0, item2: 0, item3: 0
+ },
+ statistics2: {
+ num: 0, percentageComplete: 0, item1: 0, item2: 0, item3: 0
+ },
+ statistics3: {
+ num: 0, percentageComplete: 0, item1: 0, item2: 0, item3: 0
+ }
}
-
- formatOne = (percent: number): string => `${percent}%\n完成率`;
-
-
- cardData = [
- { name: '双随机', isDetails: false, background: '#1D9DFF', icon: 'suiji.png' },
- { name: '熟悉演练', isDetails: false, background: '#9D80FF', icon: 'yanlian.png' },
- { name: '投诉举报', isDetails: false, background: '#5087FF', icon: 'tousu.png' },
- { name: '行政许可', isDetails: false, background: '#42B983', icon: 'xuke.png' },
- { name: '消防宣传', isDetails: false, background: '#FF5D2A', icon: 'xuanchuan.png' },
- { name: '火灾调查', isDetails: false, background: '#FF404D', icon: 'huozai.png' }
- ]
-
- openDetails(data, type) {
- data.isDetails = type
+ getCountStat() {
+ function integer(num) {
+ return Math.round(num * 100) || 0
+ }
+ let selectedMonth = this.selectedMonth < 10 ? "0" + this.selectedMonth : this.selectedMonth;
+ let selectedTime = this.selectedYear + '-' + selectedMonth + '-' + '01'
+ this.http.get('/api/PlanTasks/GetCountStat', {
+ params: {
+ month: selectedTime
+ }
+ }).subscribe(data => {
+ console.log('统计信息', data)
+ this.countStat = {
+ statistics1: {
+ num: data['任务总数']['总数'], percentageComplete: integer(data['任务总数']['已完成'] / data['任务总数']['总数']), item1: integer(data['任务总数']['上级指派'] / data['任务总数']['总数']), item2: integer(data['任务总数']['自主任务'] / data['任务总数']['总数']), item3: integer(data['任务总数']['申领任务'] / data['任务总数']['总数'])
+ },
+ statistics2: {
+ num: data['消防救援任务总数']['总数'], percentageComplete: integer(data['任务总数']['已完成'] / data['任务总数']['总数']), item1: integer(data['消防救援任务总数']['上级指派'] / data['消防救援任务总数']['总数']), item2: integer(data['消防救援任务总数']['自主任务'] / data['消防救援任务总数']['总数']), item3: integer(data['消防救援任务总数']['申领任务'] / data['消防救援任务总数']['总数'])
+ },
+ statistics3: {
+ num: data['检查员任务总数']['总数'], percentageComplete: integer(data['任务总数']['已完成'] / data['任务总数']['总数']), item1: integer(data['检查员任务总数']['上级指派'] / data['检查员任务总数']['总数']), item2: integer(data['检查员任务总数']['自主任务'] / data['检查员任务总数']['总数']), item3: integer(data['检查员任务总数']['申领任务'] / data['检查员任务总数']['总数'])
+ }
+ }
+ })
}
- xxx = false
- radioChange(e) {
- setTimeout(() => {
- this.xxx = !this.xxx
- }, 0);
- }
- OrganizationId
- ngOnInit(): void {
- this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
- this.selectedMonth = new Date().getMonth() + 1
- this.getTaskList()
- //获得主协调查人员
- this.getSupervisor('main')
- this.getSupervisor('assisted')
- this.getAllStation()
+
+ //本级部署打开关闭
+ isdeployboxExpanded = true
+ isdeployboxexpand() {
+ this.isdeployboxExpanded = !this.isdeployboxExpanded
}
+ formatOne = (percent: number): string => `${percent}%\n完成率`;
+
//获得辖区下所有救援站
stationData = []
@@ -240,23 +332,26 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
this.http.get('/api/Organizations', {
params: params
}).subscribe((data: any) => {
- data.items = data.items.filter(element => {
- return element.level == 'squadron'
- });
- data.items.forEach(element => {
- element.isExpand = false
- element.isLoading = false
- });
- this.stationData = data.items
+ this.ngZone.run(() => {
+ data.items = data.items.filter(element => {
+ return element.level == 'squadron'
+ });
+ data.items.forEach(element => {
+ element.isExpand = false
+ element.isLoading = false
+ });
+ this.stationData = data.items
+ this.stationData[0].isExpand = true
+ this.stationData.forEach(item => {
+ this.getTaskListOfStation(item)
+ })
+ })
+
})
}
expandcarditem(item) {
item.isExpand = !item.isExpand
- console.log(item)
- if (item.isExpand) {
- this.getTaskListOfStation(item)
- }
}
//获得消防站下的所有任务
@@ -265,9 +360,9 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
let params = {
Month: selectedTime,
CompanyOrganizationId: item.id,
- PageNumber: this.PageNumber,
+ PageNumber: 1,
approvalStatuses: '通过',
- PageSize: this.PageSize
+ PageSize: 9999
}
item.isLoading = true
this.http.get('/api/PlanTasks', {
@@ -276,13 +371,13 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
next: (data: any) => {
item.isLoading = false
let listData = [
- { name: '双随机', background: '#1D9DFF', icon: 'suiji.png', scale: '0/0', data: [] },
- { name: '行政许可', background: '#42B983', icon: 'xuke.png', scale: '0/0', data: [] },
- { name: '熟悉演练', background: '#9D80FF', icon: 'yanlian.png', scale: '0/0', data: [] },
- { name: '联络指导', background: '#5483EA', icon: 'zhidao.png', scale: '0/0', data: [] },
- { name: '消防宣传', background: '#FF5D2A', icon: 'xuanchuan.png', scale: '0/0', data: [] },
- { name: '投诉举报', background: '#5087FF', icon: 'tousu.png', scale: '0/0', data: [] },
- { name: '火灾调查', background: '#FF404D', icon: 'huozai.png', scale: '0/0', data: [] }
+ { name: '双随机', background: '#1D9DFF', icon: 'suiji.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
+ { name: '行政许可', background: '#42B983', icon: 'xuke.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
+ { name: '熟悉演练', background: '#9D80FF', icon: 'yanlian.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
+ { name: '联络指导', background: '#5483EA', icon: 'zhidao.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
+ { name: '消防宣传', background: '#FF5D2A', icon: 'xuanchuan.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
+ { name: '投诉举报', background: '#5087FF', icon: 'tousu.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
+ { name: '火灾调查', background: '#FF404D', icon: 'huozai.png', scale: '0/0', data: [], inspected: 0, finished: 0 }
]
data.items.forEach(element => {
listData.forEach((item, key) => {
@@ -297,7 +392,22 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
}
}
item.data = listData
- // console.log('点击的救援站通过数据', item)
+ console.log('当前登录用户所有通过的任务', item);
+ item.allUnitsNum = 0
+ item.awaitInspect = 0
+ item.inspected = 0
+ item.finished = 0
+ item.data.forEach(element => {
+ item.allUnitsNum += element.data.length
+ element.data.forEach(i => {
+ i.approvalStatus == '待检查' ? item.awaitInspect += 1 : null
+ i.approvalStatus == '已检查' ? item.inspected += 1 : null
+ i.approvalStatus == '待检查' ? element.inspected += 1 : null
+ i.approvalStatus == '已检查' ? element.finished += 1 : null
+ });
+ });
+ item.percentage = Math.round(item.inspected / item.allUnitsNum) * 100
+
},
error: (err) => {
this.message.create('warning', '获取数据失败');
diff --git a/src/app/home/task/da-oneself-plan/da-oneself-plan.component.html b/src/app/home/task/da-oneself-plan/da-oneself-plan.component.html
index fbd0388..bf7885d 100644
--- a/src/app/home/task/da-oneself-plan/da-oneself-plan.component.html
+++ b/src/app/home/task/da-oneself-plan/da-oneself-plan.component.html
@@ -1,17 +1,18 @@
-
-
-
+
+
+
+ [ngClass]="{'selectedMonth': item.id == selectedMonth}">
{{item.name}}