|
|
|
@ -12,27 +12,35 @@ import { TreeService } from 'src/app/service/tree.service';
|
|
|
|
|
}) |
|
|
|
|
export class StationWeeklyPlanComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
constructor() { } |
|
|
|
|
constructor(private http: HttpClient, private modal: NzModalService, private message: NzMessageService) { } |
|
|
|
|
OrganizationId |
|
|
|
|
userId |
|
|
|
|
isSupervisor |
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
} |
|
|
|
|
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 } |
|
|
|
|
{ id: 1, name: '1月', isable: true }, |
|
|
|
|
{ id: 2, name: '2月', isable: true }, |
|
|
|
|
{ id: 3, name: '3月', isable: true }, |
|
|
|
|
{ id: 4, name: '4月', isable: true }, |
|
|
|
|
{ id: 5, name: '5月', isable: true }, |
|
|
|
|
{ id: 6, name: '6月', isable: true }, |
|
|
|
|
{ id: 7, name: '7月', isable: true }, |
|
|
|
|
{ id: 8, name: '8月', isable: true }, |
|
|
|
|
{ id: 9, name: '9月', isable: true }, |
|
|
|
|
{ id: 10, name: '10月', isable: true }, |
|
|
|
|
{ id: 11, name: '11月', isable: true }, |
|
|
|
|
{ id: 12, name: '12月', isable: true } |
|
|
|
|
] |
|
|
|
|
selectedMonth |
|
|
|
|
selectedYear = 2022 |
|
|
|
|
selectedTime |
|
|
|
|
selectMonth(item) { |
|
|
|
|
this.selectedMonth = item.name |
|
|
|
|
this.selectedMonth = item.id |
|
|
|
|
// this.getTaskList()
|
|
|
|
|
} |
|
|
|
|
selectYear(e) { |
|
|
|
|
this.selectedYear = e |
|
|
|
|
// this.getTaskList()
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
isExpand = true |
|
|
|
@ -43,33 +51,194 @@ export class StationWeeklyPlanComponent implements OnInit {
|
|
|
|
|
formatOne = (percent: number): string => `${percent}%\n完成率`; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cardData = [ |
|
|
|
|
{ name: '双随机', isDetails: false, background: '#1D9DFF', icon: 'suiji.png' }, |
|
|
|
|
{ name: '行政许可', isDetails: false, background: '#42B983', icon: 'xuke.png' }, |
|
|
|
|
{ name: '熟悉演练', isDetails: false, background: '#9D80FF', icon: 'yanlian.png' }, |
|
|
|
|
{ name: '联络指导', isDetails: false, background: '#5483EA', icon: 'zhidao.png' }, |
|
|
|
|
{ name: '消防宣传', isDetails: false, background: '#FF5D2A', icon: 'xuanchuan.png' }, |
|
|
|
|
{ name: '投诉举报', isDetails: false, background: '#5087FF', icon: 'tousu.png' }, |
|
|
|
|
{ name: '火灾调查', isDetails: false, background: '#FF404D', icon: 'huozai.png' } |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
openDetails(data, type) { |
|
|
|
|
data.isDetails = type |
|
|
|
|
} |
|
|
|
|
xxx = false |
|
|
|
|
radioChange(e) { |
|
|
|
|
|
|
|
|
|
radioChange(e) { |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.xxx = !this.xxx |
|
|
|
|
}, 0); |
|
|
|
|
} |
|
|
|
|
stationData = [] |
|
|
|
|
|
|
|
|
|
//获得辖区下所有救援站
|
|
|
|
|
totalCount: string |
|
|
|
|
allOrList: any |
|
|
|
|
getAllStation() { |
|
|
|
|
let params = { |
|
|
|
|
ContainsChildren: true, |
|
|
|
|
pageSize: 9999 |
|
|
|
|
} |
|
|
|
|
stationData = [ |
|
|
|
|
{ name: '历下区A消防救援站', isExpand: true }, |
|
|
|
|
{ name: '历下区B消防救援站', isExpand: false }, |
|
|
|
|
{ name: '历下区C消防救援站', isExpand: false } |
|
|
|
|
this.http.get('/api/Organizations', { |
|
|
|
|
params: params |
|
|
|
|
}).subscribe((data: any) => { |
|
|
|
|
this.totalCount = data.totalCount |
|
|
|
|
data.items = data.items.filter(element => { |
|
|
|
|
return element.level == 'squadron' |
|
|
|
|
}); |
|
|
|
|
data.items.forEach(element => { |
|
|
|
|
element.isExpand = false |
|
|
|
|
element.isLoading = false |
|
|
|
|
}); |
|
|
|
|
this.stationData = data.items |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cardData = [ |
|
|
|
|
{ name: '双随机', isDetails: true, isloading: false, background: '#1D9DFF', icon: 'suiji.png', scale: '0/0', data: [] }, |
|
|
|
|
{ name: '行政许可', isDetails: false, isloading: false, background: '#42B983', icon: 'xuke.png', scale: '0/0', data: [] }, |
|
|
|
|
{ name: '熟悉演练', isDetails: false, isloading: false, background: '#9D80FF', icon: 'yanlian.png', scale: '0/0', data: [] }, |
|
|
|
|
{ name: '联络指导', isDetails: false, isloading: false, background: '#5483EA', icon: 'zhidao.png', scale: '0/0', data: [] }, |
|
|
|
|
{ name: '消防宣传', isDetails: false, isloading: false, background: '#FF5D2A', icon: 'xuanchuan.png', scale: '0/0', data: [] }, |
|
|
|
|
{ name: '投诉举报', isDetails: false, isloading: false, background: '#5087FF', icon: 'tousu.png', scale: '0/0', data: [] }, |
|
|
|
|
{ name: '火灾调查', isDetails: false, isloading: false, background: '#FF404D', icon: 'huozai.png', scale: '0/0', data: [] } |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isloading = false |
|
|
|
|
PageNumber = 1 |
|
|
|
|
PageSize = 9999 |
|
|
|
|
getTaskList() { |
|
|
|
|
this.isloading = true |
|
|
|
|
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' |
|
|
|
|
let params = { |
|
|
|
|
Month: selectedTime, |
|
|
|
|
// OrganizationId: this.isSupervisor ? this.OrganizationId : "",
|
|
|
|
|
SupervisorId: this.userId, |
|
|
|
|
PageNumber: this.PageNumber, |
|
|
|
|
PageSize: this.PageSize |
|
|
|
|
} |
|
|
|
|
this.http.get('/api/PlanTasks', { |
|
|
|
|
params: params |
|
|
|
|
}).subscribe((data: any) => { |
|
|
|
|
this.isloading = false |
|
|
|
|
// console.log('任务申请列表', data.items);
|
|
|
|
|
data.items.forEach(element => { |
|
|
|
|
this.cardData.forEach((item, key) => { |
|
|
|
|
element.taskType == item.name ? this.cardData[key].data.push(element) : null |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
// console.log('并入卡片数据', this.cardData)
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//接受任务
|
|
|
|
|
accept(i, item) { |
|
|
|
|
this.modal.confirm({ |
|
|
|
|
nzTitle: `确定要接受该任务吗?`, |
|
|
|
|
nzOkText: '确定', |
|
|
|
|
nzOkType: 'default', |
|
|
|
|
nzOnOk: () => { |
|
|
|
|
item.isloading = true |
|
|
|
|
this.http.post(`/api/PlanTasks/Approval/${i.id}`, null, { |
|
|
|
|
params: { |
|
|
|
|
approvalStatus: '通过' |
|
|
|
|
} |
|
|
|
|
}).subscribe({ |
|
|
|
|
next: (data) => { |
|
|
|
|
this.message.create('success', '已接受'); |
|
|
|
|
i.approvalStatus = '通过' |
|
|
|
|
item.isloading = false |
|
|
|
|
}, |
|
|
|
|
error: (err) => { |
|
|
|
|
this.message.create('warning', '接受失败'); |
|
|
|
|
item.isloading = false |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
nzCancelText: '取消' |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
//拒绝任务
|
|
|
|
|
reject(i, item) { |
|
|
|
|
this.modal.confirm({ |
|
|
|
|
nzTitle: `确定要拒绝该任务吗?`, |
|
|
|
|
nzOkText: '确定', |
|
|
|
|
nzOkType: 'default', |
|
|
|
|
nzOnOk: () => { |
|
|
|
|
item.isloading = true |
|
|
|
|
this.http.post(`/api/PlanTasks/Approval/${i.id}`, null, { |
|
|
|
|
params: { |
|
|
|
|
approvalStatus: '驳回' |
|
|
|
|
} |
|
|
|
|
}).subscribe({ |
|
|
|
|
next: (data) => { |
|
|
|
|
this.message.create('success', '已拒绝'); |
|
|
|
|
i.approvalStatus = '驳回' |
|
|
|
|
item.isloading = false |
|
|
|
|
}, |
|
|
|
|
error: (err) => { |
|
|
|
|
this.message.create('warning', '拒绝失败'); |
|
|
|
|
item.isloading = false |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
nzCancelText: '取消' |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId |
|
|
|
|
this.userId = JSON.parse(sessionStorage.getItem('userData')).id |
|
|
|
|
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 |
|
|
|
|
this.selectedMonth = new Date().getMonth() + 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.getAllStation() |
|
|
|
|
this.getTaskList() |
|
|
|
|
} |
|
|
|
|
expandcarditem(item) { |
|
|
|
|
item.isExpand = !item.isExpand |
|
|
|
|
console.log(item) |
|
|
|
|
if (item.isExpand) { |
|
|
|
|
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' |
|
|
|
|
let params = { |
|
|
|
|
Month: selectedTime, |
|
|
|
|
CompanyOrganizationId: item.id, |
|
|
|
|
PageNumber: this.PageNumber, |
|
|
|
|
approvalStatuses: '通过', |
|
|
|
|
PageSize: this.PageSize |
|
|
|
|
} |
|
|
|
|
item.isLoading = true |
|
|
|
|
this.http.get('/api/PlanTasks', { |
|
|
|
|
params: params |
|
|
|
|
}).subscribe({ |
|
|
|
|
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: [] } |
|
|
|
|
] |
|
|
|
|
data.items.forEach(element => { |
|
|
|
|
listData.forEach((item, key) => { |
|
|
|
|
element.taskType == item.name ? listData[key].data.push(element) : null |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
for (let index = 0; index < listData.length; index++) { |
|
|
|
|
const element = listData[index]; |
|
|
|
|
if (element.data.length == 0) { |
|
|
|
|
listData.splice(index, 1) |
|
|
|
|
index-- |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
item.data = listData |
|
|
|
|
console.log('点击的救援站通过数据', item) |
|
|
|
|
}, |
|
|
|
|
error: (err) => { |
|
|
|
|
this.message.create('warning', '获取数据失败'); |
|
|
|
|
item.isLoading = false |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|