|
|
|
@ -1,10 +1,13 @@
|
|
|
|
|
import { HttpClient } from '@angular/common/http'; |
|
|
|
|
import { Component, OnInit, ViewChild } from '@angular/core'; |
|
|
|
|
import { Component, OnInit, ViewChild, ViewContainerRef } from '@angular/core'; |
|
|
|
|
import { FormBuilder, FormGroup } from '@angular/forms'; |
|
|
|
|
import { TreeService } from 'src/app/service/tree.service'; |
|
|
|
|
import { fromEvent, Subject } from 'rxjs'; |
|
|
|
|
import { debounceTime } from 'rxjs/operators'; // 引入debounceTime、Subject
|
|
|
|
|
import { NzFormatEmitEvent, NzTreeNodeOptions } from 'ng-zorro-antd/tree'; |
|
|
|
|
import { NzMessageService } from 'ng-zorro-antd/message'; |
|
|
|
|
import { NzModalService } from 'ng-zorro-antd/modal'; |
|
|
|
|
import { EditOrComponent } from './edit-or/edit-or.component'; |
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-zhi-indicators', |
|
|
|
|
templateUrl: './zhi-indicators.component.html', |
|
|
|
@ -13,50 +16,114 @@ import { NzFormatEmitEvent, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
|
|
|
|
export class ZhiIndicatorsComponent implements OnInit { |
|
|
|
|
validateForm!: FormGroup; |
|
|
|
|
|
|
|
|
|
constructor(private fb: FormBuilder, private http: HttpClient, private toTree: TreeService) { } |
|
|
|
|
constructor(private fb: FormBuilder, private http: HttpClient, private toTree: TreeService, private message: NzMessageService, private modal: NzModalService, private viewContainerRef: ViewContainerRef) { } |
|
|
|
|
private valueChange = new Subject<string>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.getAllOrganization() |
|
|
|
|
this.getCompanies() |
|
|
|
|
//保存防抖
|
|
|
|
|
this.valueChange.pipe(debounceTime(1000)).subscribe(data => { |
|
|
|
|
console.log(data); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
saveItem() { |
|
|
|
|
this.valueChange.next('xxxx'); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
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.initializeData() |
|
|
|
|
this.getTaskList('投诉举报') |
|
|
|
|
this.getTaskList('行政许可') |
|
|
|
|
} |
|
|
|
|
selectYear(e) { |
|
|
|
|
this.selectedYear = e |
|
|
|
|
this.initializeData() |
|
|
|
|
this.getTaskList('投诉举报') |
|
|
|
|
this.getTaskList('行政许可') |
|
|
|
|
} |
|
|
|
|
initializeData() { |
|
|
|
|
this.complaint.isExpand = true |
|
|
|
|
this.complaint.isPopover = false |
|
|
|
|
this.complaint.isLoading = false |
|
|
|
|
this.complaint.search1 = '' |
|
|
|
|
this.complaint.search1Value = [] |
|
|
|
|
this.complaint.search2 = '' |
|
|
|
|
this.complaint.search2Value = [] |
|
|
|
|
this.complaint.selectedMenu = 1 |
|
|
|
|
this.complaint.data = [] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.permission.isExpand = true |
|
|
|
|
this.permission.isPopover = false |
|
|
|
|
this.permission.isLoading = false |
|
|
|
|
this.permission.search1 = '' |
|
|
|
|
this.permission.search1Value = [] |
|
|
|
|
this.permission.search2 = '' |
|
|
|
|
this.permission.search2Value = [] |
|
|
|
|
this.permission.selectedMenu = 1 |
|
|
|
|
this.permission.data = [] |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//投诉举报
|
|
|
|
|
complaint = { |
|
|
|
|
name: '投诉举报', |
|
|
|
|
allocated: 0, |
|
|
|
|
isExpand: true,//卡片展开
|
|
|
|
|
isPopover: false,//选择单位气泡卡片
|
|
|
|
|
isLoading: false, |
|
|
|
|
search1: '',//选择单位气泡卡片---单位选择列表
|
|
|
|
|
search1Value: [], |
|
|
|
|
search2: '',//选择单位气泡卡片---组织选择列表
|
|
|
|
|
search2Value: [], |
|
|
|
|
searchAll: [], |
|
|
|
|
selectedMenu: 1,//选择单位气泡卡片
|
|
|
|
|
data: [ |
|
|
|
|
],//表格数据
|
|
|
|
|
nodes: [], |
|
|
|
|
unitList: [] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//行政许可
|
|
|
|
|
permission = { |
|
|
|
|
name: '行政许可', |
|
|
|
|
allocated: 0, |
|
|
|
|
isExpand: true,//卡片展开
|
|
|
|
|
isPopover: false,//选择单位气泡卡片
|
|
|
|
|
isLoading: false, |
|
|
|
|
search1: '',//选择单位气泡卡片---单位选择列表
|
|
|
|
|
search1Value: [], |
|
|
|
|
search2: '',//选择单位气泡卡片---组织选择列表
|
|
|
|
|
search2Value: [], |
|
|
|
|
searchAll: [], |
|
|
|
|
selectedMenu: 1,//选择单位气泡卡片
|
|
|
|
|
data: [],//表格数据
|
|
|
|
|
nodes: [], |
|
|
|
|
unitList: [] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 双随机
|
|
|
|
|
doubleRandom = { |
|
|
|
|
name: '双随机', |
|
|
|
|
allocated: 0, |
|
|
|
|
isExpand: true,//卡片展开
|
|
|
|
|
isPopover: false,//选择单位气泡卡片
|
|
|
|
|
isLoading: false, |
|
|
|
|
search1: '',//选择单位气泡卡片---单位选择列表
|
|
|
|
|
search1Value: [], |
|
|
|
|
search2: '',//选择单位气泡卡片---组织选择列表
|
|
|
|
|
search2Value: [], |
|
|
|
|
searchAll: [], |
|
|
|
|
selectedMenu: 1,//选择单位气泡卡片
|
|
|
|
|
data: [ |
|
|
|
|
{ explain: '' } |
|
|
|
@ -67,41 +134,25 @@ export class ZhiIndicatorsComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
// 熟悉演练
|
|
|
|
|
rehearsal = { |
|
|
|
|
isExpand: false,//卡片展开
|
|
|
|
|
name: '熟悉演练', |
|
|
|
|
allocated: 0, |
|
|
|
|
isExpand: true,//卡片展开
|
|
|
|
|
isPopover: false,//选择单位气泡卡片
|
|
|
|
|
isLoading: false, |
|
|
|
|
search1: '',//选择单位气泡卡片---单位选择列表
|
|
|
|
|
search1Value: [], |
|
|
|
|
search2: '',//选择单位气泡卡片---组织选择列表
|
|
|
|
|
search2Value: [], |
|
|
|
|
searchAll: [], |
|
|
|
|
selectedMenu: 1,//选择单位气泡卡片
|
|
|
|
|
data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],//表格数据
|
|
|
|
|
data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],//表格数据
|
|
|
|
|
nodes: [], |
|
|
|
|
unitList: [] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PageNumber = 1 |
|
|
|
|
PageSize = 50 |
|
|
|
|
totalCount: number |
|
|
|
|
getCompanies(CompanyName?: string) { |
|
|
|
|
let params = { |
|
|
|
|
CompanyName: CompanyName, |
|
|
|
|
PageNumber: this.PageNumber, |
|
|
|
|
PageSize: this.PageSize |
|
|
|
|
} |
|
|
|
|
this.http.get('/api/Companies', { |
|
|
|
|
params: params |
|
|
|
|
}).subscribe((data: any) => { |
|
|
|
|
console.log(data); |
|
|
|
|
this.totalCount = data.totalCount |
|
|
|
|
data.items.forEach(element => { |
|
|
|
|
element.label = element.companyName |
|
|
|
|
element.value = element.id |
|
|
|
|
}); |
|
|
|
|
this.doubleRandom.unitList = this.doubleRandom.unitList.concat(data.items); |
|
|
|
|
this.doubleRandom.unitList = [...this.doubleRandom.unitList] |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PageNumber |
|
|
|
|
moreData() { |
|
|
|
|
this.PageNumber += 1 |
|
|
|
|
this.getCompanies() |
|
|
|
@ -116,15 +167,31 @@ export class ZhiIndicatorsComponent implements OnInit {
|
|
|
|
|
data.search1Value = arr |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isPopover(data) { |
|
|
|
|
console.log(data) |
|
|
|
|
data.isPopover = !data.isPopover |
|
|
|
|
data.unitList.forEach(element => { |
|
|
|
|
element.checked = false |
|
|
|
|
// data.data.forEach(item => {
|
|
|
|
|
// if (element.id == item.company.id) {
|
|
|
|
|
// element.checked = true
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//搜索框提交
|
|
|
|
|
submitForm(data): void { |
|
|
|
|
data.unitList = [] |
|
|
|
|
this.PageNumber = 1 |
|
|
|
|
this.getCompanies(data.search1) |
|
|
|
|
this.getCompanies(data) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 弹出 tab
|
|
|
|
|
popoverMenuSelect(data, type) { |
|
|
|
|
data.selectedMenu = type |
|
|
|
@ -134,64 +201,281 @@ export class ZhiIndicatorsComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
totalCount: number |
|
|
|
|
unitList = [] |
|
|
|
|
async getCompanies(incomingData?: any) { |
|
|
|
|
let params = { |
|
|
|
|
CompanyName: incomingData ? incomingData.search1 : '', |
|
|
|
|
PageNumber: 1, |
|
|
|
|
PageSize: 99999 |
|
|
|
|
} |
|
|
|
|
let p = new Promise<void>((resolve, reject) => { |
|
|
|
|
this.http.get('/api/Companies', { |
|
|
|
|
params: params |
|
|
|
|
}).subscribe((data: any) => { |
|
|
|
|
this.totalCount = data.totalCount |
|
|
|
|
data.items.forEach(element => { |
|
|
|
|
element.label = element.companyName |
|
|
|
|
element.value = element.id |
|
|
|
|
element.parentId = element.organizationId |
|
|
|
|
element.key = element.id |
|
|
|
|
element.title = element.companyName |
|
|
|
|
element.level = 4 |
|
|
|
|
}); |
|
|
|
|
this.unitList = data.items |
|
|
|
|
|
|
|
|
|
nzExpandAll = false; |
|
|
|
|
if (incomingData && incomingData.name == '投诉举报') { |
|
|
|
|
this.complaint.unitList = JSON.parse(JSON.stringify(this.unitList)) |
|
|
|
|
} else if (incomingData && incomingData.name == '行政许可') { |
|
|
|
|
this.permission.unitList = JSON.parse(JSON.stringify(this.unitList)) |
|
|
|
|
} else if (incomingData && incomingData.name == '双随机') { |
|
|
|
|
this.doubleRandom.unitList = JSON.parse(JSON.stringify(this.unitList)) |
|
|
|
|
} else if (incomingData && incomingData.name == '熟悉演练') { |
|
|
|
|
this.rehearsal.unitList = JSON.parse(JSON.stringify(this.unitList)) |
|
|
|
|
} else { |
|
|
|
|
this.complaint.unitList = JSON.parse(JSON.stringify(this.unitList)) |
|
|
|
|
this.permission.unitList = JSON.parse(JSON.stringify(this.unitList)) |
|
|
|
|
this.doubleRandom.unitList = JSON.parse(JSON.stringify(this.unitList)) |
|
|
|
|
this.rehearsal.unitList = JSON.parse(JSON.stringify(this.unitList)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// this.complaint.unitList = this.complaint.unitList.concat(JSON.parse(JSON.stringify(data.items)));
|
|
|
|
|
// this.complaint.unitList = [...this.complaint.unitList]
|
|
|
|
|
// this.permission.unitList = this.permission.unitList.concat(JSON.parse(JSON.stringify(data.items)));
|
|
|
|
|
// this.permission.unitList = [...this.permission.unitList]
|
|
|
|
|
// this.doubleRandom.unitList = this.doubleRandom.unitList.concat(JSON.parse(JSON.stringify(data.items)));
|
|
|
|
|
// this.doubleRandom.unitList = [...this.doubleRandom.unitList]
|
|
|
|
|
// this.rehearsal.unitList = this.rehearsal.unitList.concat(JSON.parse(JSON.stringify(data.items)));
|
|
|
|
|
// this.rehearsal.unitList = [...this.rehearsal.unitList]
|
|
|
|
|
|
|
|
|
|
resolve(data) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
return p |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
allOrList: any |
|
|
|
|
nodes |
|
|
|
|
getAllOrganization() { |
|
|
|
|
async getAllOrganization() { |
|
|
|
|
let params = { |
|
|
|
|
ContainsChildren: true, |
|
|
|
|
pageSize: 9999 |
|
|
|
|
} |
|
|
|
|
this.http.get('/api/Organizations', { |
|
|
|
|
params: params |
|
|
|
|
}).subscribe((data: any) => { |
|
|
|
|
data.items.forEach(element => { |
|
|
|
|
element.key = element.id |
|
|
|
|
element.title = element.name |
|
|
|
|
element.selectable = false |
|
|
|
|
}); |
|
|
|
|
this.allOrList = data.items |
|
|
|
|
this.nodes = [...this.toTree.toTree(data.items)] |
|
|
|
|
|
|
|
|
|
this.doubleRandom.nodes = JSON.parse(JSON.stringify(this.nodes)) |
|
|
|
|
this.rehearsal.nodes = JSON.parse(JSON.stringify(this.nodes)) |
|
|
|
|
return new Promise<void>((resolve, reject) => { |
|
|
|
|
this.http.get('/api/Organizations', { |
|
|
|
|
params: params |
|
|
|
|
}).subscribe((data: any) => { |
|
|
|
|
console.log(9999999) |
|
|
|
|
data.items.forEach(element => { |
|
|
|
|
element.key = element.id |
|
|
|
|
element.title = element.name |
|
|
|
|
element.selectable = false |
|
|
|
|
element.disableCheckbox = true |
|
|
|
|
}); |
|
|
|
|
this.allOrList = JSON.parse(JSON.stringify(data.items)) |
|
|
|
|
resolve(data) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
//获得除了检查员的其他用户
|
|
|
|
|
users |
|
|
|
|
async getUsers() { |
|
|
|
|
return new Promise<void>((resolve, reject) => { |
|
|
|
|
let params = { |
|
|
|
|
OrganizationId: this.OrganizationId, |
|
|
|
|
OrganizationLevel: 'squadron', |
|
|
|
|
ContainsChildren: true, |
|
|
|
|
PageNumber: 1, |
|
|
|
|
PageSize: 9999 |
|
|
|
|
} |
|
|
|
|
this.http.get('/api/Users', { |
|
|
|
|
params: params |
|
|
|
|
}).subscribe((data: any) => { |
|
|
|
|
console.log('用户列表', data.items) |
|
|
|
|
data.items.forEach(element => { |
|
|
|
|
element.key = element.id |
|
|
|
|
element.title = element.name |
|
|
|
|
element.parentId = element.organizationId |
|
|
|
|
}); |
|
|
|
|
this.users = data.items |
|
|
|
|
resolve(data) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
editOr(incomingData, item) { |
|
|
|
|
const modal = this.modal.create({ |
|
|
|
|
nzTitle: '修改协助机构', |
|
|
|
|
nzContent: EditOrComponent, |
|
|
|
|
nzViewContainerRef: this.viewContainerRef, |
|
|
|
|
nzWidth: 660, |
|
|
|
|
nzMaskClosable: false, |
|
|
|
|
nzComponentParams: { |
|
|
|
|
selectedData: item.supervisorIds, |
|
|
|
|
organizationList: JSON.parse(JSON.stringify(this.allOrList)), |
|
|
|
|
users: JSON.parse(JSON.stringify(this.users)), |
|
|
|
|
}, |
|
|
|
|
nzOnOk: async () => { |
|
|
|
|
if (instance.validateForm.valid) { |
|
|
|
|
await new Promise((resolve, reject) => { |
|
|
|
|
let body = { |
|
|
|
|
supervisorIds: instance.validateForm.value.organization, |
|
|
|
|
} |
|
|
|
|
this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({ |
|
|
|
|
next: async (data: any) => { |
|
|
|
|
this.message.create('success', '修改成功'); |
|
|
|
|
incomingData.name == '投诉举报' ? this.getTaskList('投诉举报') : null |
|
|
|
|
incomingData.name == '行政许可' ? this.getTaskList('行政许可') : null |
|
|
|
|
resolve(data) |
|
|
|
|
}, |
|
|
|
|
error: (err) => { |
|
|
|
|
this.message.create('warning', '修改失败'); |
|
|
|
|
reject(err) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.message.create('warning', '请填写完整!'); |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
const instance = modal.getContentComponent(); |
|
|
|
|
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!')); |
|
|
|
|
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result)); |
|
|
|
|
} |
|
|
|
|
orcheckbox(data, $event, node) { |
|
|
|
|
if ($event) { |
|
|
|
|
data.search2Value.push(node.origin.name) |
|
|
|
|
data.search2Value.push(node.origin.id) |
|
|
|
|
} else { |
|
|
|
|
for (let index = 0; index < data.search2Value.length; index++) { |
|
|
|
|
const element = data.search2Value[index]; |
|
|
|
|
if (element == node.origin.name) { |
|
|
|
|
if (element == node.origin.id) { |
|
|
|
|
data.search2Value.splice(index, 1) |
|
|
|
|
index-- |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
console.log(data.search2Value) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
OrganizationId |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId |
|
|
|
|
this.selectedMonth = new Date().getMonth() + 1 |
|
|
|
|
//保存防抖
|
|
|
|
|
this.valueChange.pipe(debounceTime(1000)).subscribe((item: any) => { |
|
|
|
|
let body = { |
|
|
|
|
description: item.description, |
|
|
|
|
} |
|
|
|
|
return new Promise<void>((resolve, reject) => { |
|
|
|
|
this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({ |
|
|
|
|
next: async (data: any) => { |
|
|
|
|
this.message.create('success', '实时保存成功'); |
|
|
|
|
resolve(data) |
|
|
|
|
}, |
|
|
|
|
error: (err) => { |
|
|
|
|
this.message.create('warning', '保存失败'); |
|
|
|
|
reject(err) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
this.getUsers() |
|
|
|
|
Promise.all([this.getCompanies(), this.getAllOrganization()]) |
|
|
|
|
.then((results) => { |
|
|
|
|
let arr = [...JSON.parse(JSON.stringify(this.allOrList)), ...JSON.parse(JSON.stringify(this.unitList))] |
|
|
|
|
this.nodes = [...this.toTree.toTree(arr)] |
|
|
|
|
this.complaint.nodes = JSON.parse(JSON.stringify(this.nodes)) |
|
|
|
|
this.permission.nodes = JSON.parse(JSON.stringify(this.nodes)) |
|
|
|
|
this.doubleRandom.nodes = JSON.parse(JSON.stringify(this.nodes)) |
|
|
|
|
this.rehearsal.nodes = JSON.parse(JSON.stringify(this.nodes)) |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.getTaskList('投诉举报') |
|
|
|
|
this.getTaskList('行政许可') |
|
|
|
|
} |
|
|
|
|
//选择单位 确认按钮
|
|
|
|
|
selectedUnit(data, type) { |
|
|
|
|
let arr = [...data.search1Value, ...data.search2Value] |
|
|
|
|
let arrSet = [...new Set(arr)] |
|
|
|
|
data.isLoading = true |
|
|
|
|
this.http.post(`/api/PlanTasks/Many`, null, { |
|
|
|
|
params: { |
|
|
|
|
companyIds: arrSet, |
|
|
|
|
taskType: type |
|
|
|
|
} |
|
|
|
|
}).subscribe({ |
|
|
|
|
next: (item) => { |
|
|
|
|
data.isLoading = false |
|
|
|
|
data.isPopover = false |
|
|
|
|
this.message.create('success', '派发成功'); |
|
|
|
|
type == '投诉举报' ? this.getTaskList('投诉举报', data) : null |
|
|
|
|
type == '行政许可' ? this.getTaskList('行政许可', data) : null |
|
|
|
|
}, |
|
|
|
|
error: (err) => { |
|
|
|
|
this.message.create('warning', '派发失败'); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async getTaskList(TaskType, carddata?: any) { |
|
|
|
|
|
|
|
|
|
carddata ? carddata.isLoading = true : null |
|
|
|
|
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' |
|
|
|
|
let params = { |
|
|
|
|
Month: selectedTime, |
|
|
|
|
OrganizationId: this.OrganizationId, |
|
|
|
|
TaskType: TaskType, |
|
|
|
|
PageNumber: 1, |
|
|
|
|
PageSize: 99999 |
|
|
|
|
} |
|
|
|
|
var p = await new Promise<void>((resolve, reject) => { |
|
|
|
|
this.http.get('/api/PlanTasks', { |
|
|
|
|
params: params |
|
|
|
|
}).subscribe((data: any) => { |
|
|
|
|
TaskType == '投诉举报' ? this.complaint.allocated = 0 : null |
|
|
|
|
TaskType == '行政许可' ? this.permission.allocated = 0 : null |
|
|
|
|
carddata ? carddata.isLoading = false : null |
|
|
|
|
console.log(TaskType + '任务列表', data.items); |
|
|
|
|
TaskType == '投诉举报' ? this.complaint.data = data.items : null |
|
|
|
|
TaskType == '行政许可' ? this.permission.data = data.items : null |
|
|
|
|
|
|
|
|
|
data.items.forEach(item => { |
|
|
|
|
if (item.supervisorIds.length != 0) { |
|
|
|
|
TaskType == '投诉举报' ? this.complaint.allocated += 1 : null |
|
|
|
|
TaskType == '行政许可' ? this.permission.allocated += 1 : null |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
resolve(data) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
return p |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// this.valueChange.next('xxxx');
|
|
|
|
|
//修改任务描述
|
|
|
|
|
async taskDescChange(incomingData, item) { |
|
|
|
|
this.valueChange.next(item); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ngOnDestroy(): void { |
|
|
|
|
//Called once, before the instance is destroyed.
|
|
|
|
|
//Add 'implements OnDestroy' to the class.
|
|
|
|
|
console.log('毁灭了') |
|
|
|
|
this.doubleRandom.isPopover = false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
nzEvent(event: NzFormatEmitEvent): any { |
|
|
|
|
console.log(event); |
|
|
|
|
// load child async
|
|
|
|
|
if(event.node.origin.companyName){ |
|
|
|
|
if (event.node.origin.companyName) { |
|
|
|
|
return new Promise<void>((resolve, reject) => { |
|
|
|
|
reject() |
|
|
|
|
resolve() |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if (event.node.origin.level === 3 && !event.node.origin.companyName) { |
|
|
|
|
if (event.node.origin.level === 'squadron' && !event.node.origin.companyName) { |
|
|
|
|
const node = event.node; |
|
|
|
|
console.log(node?.getChildren()) |
|
|
|
|
console.log(888) |
|
|
|
|
if (node?.getChildren().length === 0) { |
|
|
|
|
this.loadNode(event.node.origin.id).then(data => { |
|
|
|
|
node.addChildren(data); |
|
|
|
|