|
|
|
@ -44,16 +44,30 @@ export class StationWeeklyPlanComponent implements OnInit {
|
|
|
|
|
selectMonth(item) { |
|
|
|
|
this.selectedMonth = item.id |
|
|
|
|
this.initializeData() |
|
|
|
|
this.getTuesdayThursdayNum() |
|
|
|
|
this.getTaskList() |
|
|
|
|
this.getTaskListPass(this.stationData[0]) |
|
|
|
|
} |
|
|
|
|
selectYear(e) { |
|
|
|
|
this.selectedYear = e |
|
|
|
|
this.initializeData() |
|
|
|
|
this.getTuesdayThursdayNum() |
|
|
|
|
this.getTaskList() |
|
|
|
|
this.getTaskListPass(this.stationData[0]) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//当月有几个周二周四
|
|
|
|
|
TuesdayThursdayNum = 0 |
|
|
|
|
getTuesdayThursdayNum() { |
|
|
|
|
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' |
|
|
|
|
this.http.get(`/api/TaskTargets/GetTargetCount/${selectedTime}`).subscribe((data: any) => { |
|
|
|
|
console.log('最大日期', data) |
|
|
|
|
this.TuesdayThursdayNum = data |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isExpand = true |
|
|
|
|
expand() { |
|
|
|
|
this.isExpand = !this.isExpand |
|
|
|
@ -171,7 +185,8 @@ export class StationWeeklyPlanComponent implements OnInit {
|
|
|
|
|
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' |
|
|
|
|
let params = { |
|
|
|
|
Month: selectedTime, |
|
|
|
|
SupervisorId: this.userId, |
|
|
|
|
SupervisorId: this.isSupervisor ? this.userId : null, |
|
|
|
|
AssitantOrganizationId: this.isSupervisor ? null : this.OrganizationId, |
|
|
|
|
PageNumber: this.PageNumber, |
|
|
|
|
PageSize: this.PageSize |
|
|
|
|
} |
|
|
|
@ -211,7 +226,8 @@ export class StationWeeklyPlanComponent implements OnInit {
|
|
|
|
|
let params = { |
|
|
|
|
Month: selectedTime, |
|
|
|
|
approvalStatuses: ['通过', '待检查', '已检查'], |
|
|
|
|
SupervisorId: this.userId, |
|
|
|
|
SupervisorId: this.isSupervisor ? this.userId : null, |
|
|
|
|
AssitantOrganizationId: this.isSupervisor ? null : this.OrganizationId, |
|
|
|
|
PageNumber: this.PageNumber, |
|
|
|
|
PageSize: this.PageSize |
|
|
|
|
} |
|
|
|
@ -287,7 +303,6 @@ export class StationWeeklyPlanComponent implements OnInit {
|
|
|
|
|
item.isLoading = false |
|
|
|
|
item.passed += 1 |
|
|
|
|
this.getTaskListPass(this.stationData[0]) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
error: (err) => { |
|
|
|
|
this.message.create('warning', '接受失败'); |
|
|
|
@ -329,23 +344,35 @@ export class StationWeeklyPlanComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
userName |
|
|
|
|
|
|
|
|
|
organizationName |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId |
|
|
|
|
this.userId = JSON.parse(sessionStorage.getItem('userData')).id |
|
|
|
|
this.userName = JSON.parse(sessionStorage.getItem('userData')).name |
|
|
|
|
this.stationData[0].name = this.userName |
|
|
|
|
|
|
|
|
|
this.organizationName = JSON.parse(sessionStorage.getItem('userData')).organizationName |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let roles = JSON.parse(sessionStorage.getItem('userData')).roles |
|
|
|
|
let isSupervisor = roles.find(item => { |
|
|
|
|
return item.name.indexOf('检查') != -1 |
|
|
|
|
}) |
|
|
|
|
isSupervisor ? this.isSupervisor = true : this.isSupervisor = false |
|
|
|
|
if (isSupervisor) { |
|
|
|
|
this.stationData[0].name = this.userName |
|
|
|
|
} else { |
|
|
|
|
this.stationData[0].name = this.organizationName |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.selectedMonth = new Date().getMonth() + 1 |
|
|
|
|
|
|
|
|
|
// this.getAllStation()
|
|
|
|
|
this.getTaskList() |
|
|
|
|
this.getTaskListPass(this.stationData[0]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.getTuesdayThursdayNum() |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.rollStart() |
|
|
|
|
}, 0); |
|
|
|
@ -391,10 +418,6 @@ export class StationWeeklyPlanComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
expandcarditem(item) { |
|
|
|
|
item.isExpand = !item.isExpand |
|
|
|
|
// console.log(item)
|
|
|
|
|
// if (item.isExpand) {
|
|
|
|
|
// this.getTaskListOfStation(item)
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获得消防站下的所有任务
|
|
|
|
@ -414,13 +437,13 @@ export class StationWeeklyPlanComponent 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) => { |
|
|
|
@ -435,7 +458,21 @@ export class StationWeeklyPlanComponent 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', '获取数据失败'); |
|
|
|
@ -443,6 +480,8 @@ export class StationWeeklyPlanComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
taskDetails(item) { |
|
|
|
|
// console.log(item)
|
|
|
|
|
const modal = this.modal.create({ |
|
|
|
@ -459,7 +498,11 @@ export class StationWeeklyPlanComponent implements OnInit {
|
|
|
|
|
}); |
|
|
|
|
const instance = modal.getContentComponent(); |
|
|
|
|
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!')); |
|
|
|
|
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result)); |
|
|
|
|
modal.afterClose.subscribe(result => { |
|
|
|
|
// item
|
|
|
|
|
// this.getTaskList()
|
|
|
|
|
this.getTaskListPass(this.stationData[0]) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|