|
|
|
import { HttpClient } from '@angular/common/http';
|
|
|
|
import { Component, ElementRef, OnInit, ViewContainerRef } from '@angular/core';
|
|
|
|
import { NzMessageService } from 'ng-zorro-antd/message';
|
|
|
|
import { NzModalService } from 'ng-zorro-antd/modal';
|
|
|
|
import { Observable, fromEvent } from 'rxjs';
|
|
|
|
import { debounceTime } from 'rxjs/operators';
|
|
|
|
import { AuditDetailsInformTimeComponent } from './audit-details-inform-time/audit-details-inform-time.component';
|
|
|
|
import { EditInformTimeComponent } from './edit-inform-time/edit-inform-time.component';
|
|
|
|
// import { AuditDisposeComponent } from './audit-dispose/audit-dispose.component';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-audit-inform-time',
|
|
|
|
templateUrl: './audit-inform-time.component.html',
|
|
|
|
styleUrls: ['./audit-inform-time.component.scss']
|
|
|
|
})
|
|
|
|
export class AuditInformTimeComponent implements OnInit {
|
|
|
|
|
|
|
|
constructor(private message: NzMessageService, private http: HttpClient, private element: ElementRef, private modal: NzModalService, private viewContainerRef: ViewContainerRef) { }
|
|
|
|
tableSpin = false
|
|
|
|
list = []
|
|
|
|
|
|
|
|
tableScrollHeight
|
|
|
|
|
|
|
|
resizeListener
|
|
|
|
ngOnInit(): void {
|
|
|
|
// 页面监听
|
|
|
|
this.tableScrollHeight = '0px'
|
|
|
|
this.resizeListener = fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => {
|
|
|
|
let tableHeader = this.element.nativeElement.querySelector(`.ant-table-header`).clientHeight
|
|
|
|
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - tableHeader) + 'px'
|
|
|
|
});
|
|
|
|
|
|
|
|
this.getTimeList()
|
|
|
|
}
|
|
|
|
|
|
|
|
ngOnDestroy(): void {
|
|
|
|
this.resizeListener.unsubscribe()
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SkipCount: string = '0'
|
|
|
|
MaxResultCount: string = '50'
|
|
|
|
async getTimeList() {
|
|
|
|
let params = {
|
|
|
|
OrganizationUnitId: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
|
|
|
|
IsContainsChildren: 'true',
|
|
|
|
SkipCount: this.SkipCount,
|
|
|
|
MaxResultCount: this.MaxResultCount,
|
|
|
|
}
|
|
|
|
this.tableSpin = true
|
|
|
|
await new Promise((resolve, reject) => {
|
|
|
|
this.http.get('/api/services/app/OrganizationValidityLicenseRule/GetCurOrgRules', {
|
|
|
|
params: params
|
|
|
|
}).subscribe((data: any) => {
|
|
|
|
this.list = data.result
|
|
|
|
this.list = [...this.list]
|
|
|
|
console.log('时间表格', data)
|
|
|
|
this.tableSpin = false
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
let tableHeader = this.element.nativeElement.querySelector(`.ant-table-header`).clientHeight
|
|
|
|
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - tableHeader) + 'px'
|
|
|
|
}, 0);
|
|
|
|
resolve(data)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
edit(item) {
|
|
|
|
console.log('item', item)
|
|
|
|
if (item.auditStatus == 1) {
|
|
|
|
this.message.create('warning', '审核中不允许编辑');
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
const modal = this.modal.create({
|
|
|
|
nzContent: EditInformTimeComponent,
|
|
|
|
nzViewContainerRef: this.viewContainerRef,
|
|
|
|
nzWidth: 600,
|
|
|
|
nzBodyStyle: {
|
|
|
|
'border': '1px solid #91CCFF',
|
|
|
|
'border-radius': '0px',
|
|
|
|
'padding': '7px',
|
|
|
|
'box-shadow': '0 0 8px 0 #fff',
|
|
|
|
'background-image': 'linear-gradient(#003665, #000f25)'
|
|
|
|
},
|
|
|
|
nzComponentParams: {
|
|
|
|
data: item
|
|
|
|
},
|
|
|
|
nzFooter: null,
|
|
|
|
nzClosable: false,
|
|
|
|
nzOnOk: async () => {
|
|
|
|
this.getTimeList()
|
|
|
|
}
|
|
|
|
});
|
|
|
|
const instance = modal.getContentComponent();
|
|
|
|
modal.afterClose.subscribe(result => { });
|
|
|
|
}
|
|
|
|
details(item) {
|
|
|
|
console.log('item', item)
|
|
|
|
const modal = this.modal.create({
|
|
|
|
nzContent: AuditDetailsInformTimeComponent,
|
|
|
|
nzViewContainerRef: this.viewContainerRef,
|
|
|
|
nzWidth: 650,
|
|
|
|
nzBodyStyle: {
|
|
|
|
'border': '1px solid #91CCFF',
|
|
|
|
'border-radius': '0px',
|
|
|
|
'padding': '7px',
|
|
|
|
'box-shadow': '0 0 8px 0 #fff',
|
|
|
|
'background-image': 'linear-gradient(#003665, #000f25)'
|
|
|
|
},
|
|
|
|
nzComponentParams: {
|
|
|
|
data: item
|
|
|
|
},
|
|
|
|
nzFooter: null,
|
|
|
|
nzClosable: false,
|
|
|
|
nzOnOk: async () => {
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
const instance = modal.getContentComponent();
|
|
|
|
modal.afterClose.subscribe(result => { });
|
|
|
|
}
|
|
|
|
|
|
|
|
unCommit(item) {
|
|
|
|
let params = {
|
|
|
|
id: item.id
|
|
|
|
}
|
|
|
|
this.http.post('/api/services/app/OrganizationValidityLicenseRule/Uncommit', '', { params: params }).subscribe((data) => {
|
|
|
|
this.message.create('success', '撤销审核成功');
|
|
|
|
this.getTimeList()
|
|
|
|
}, err => {
|
|
|
|
this.message.create('error', '撤销审核失败');
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|