中化加油站项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

103 lines
2.9 KiB

import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { NzMessageService } from 'ng-zorro-antd/message';
import { Observable, fromEvent } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
@Component({
selector: 'app-inform',
templateUrl: './inform.component.html',
styleUrls: ['./inform.component.scss']
})
export class InformComponent implements OnInit {
constructor(private http: HttpClient, private message: NzMessageService) { }
tableSpin = false
list = []
tableScrollHeight
ngOnInit(): void {
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px'
// 页面监听
fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => {
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px'
});
this.getInform()
}
dispose() {
console.log('处置')
}
//获取当前油站通知
SkipCount = '0'
MaxResultCount = '100'
getInform() {
this.tableSpin = true
let data = JSON.parse(sessionStorage.getItem('userdataOfgasstation'));
let params: any = {
OrganizationUnitId: data.organization.id || "",
Active: true,
SkipCount: this.SkipCount,
MaxResultCount: this.MaxResultCount
}
this.http.get(`/api/services/app/StationValidityLicenseNotificationRecord/GetAll`, { params: params }).subscribe((data: any) => {
this.list = data.result.items
this.tableSpin = false
console.log(data.result.items)
})
}
//获取办理类型
getHandleTypes(handleTypes: any[]): string {
if (!handleTypes || !handleTypes.length) {
return
}
let names: string[] = []
let handleTypeList = JSON.parse(JSON.stringify(handleTypes));
let list: handleTypeList[] = new handleType().list;
handleTypeList.forEach(item => {
list.find(element => {
item == element.value ? names.push(element.name) : null
})
})
return names.join(',')
}
//处置
updateState(item, type) {
let body = {
id: item.id,
operation: type
}
this.http.put('/api/services/app/StationValidityLicenseNotificationRecord/UpdateState', body).subscribe(data => {
this.getInform()
this.message.create('success', '操作成功');
}, err => {
this.message.create('error', '操作失败');
})
}
}
//办理类型
export class handleType {
list: handleTypeList[] = [
{ value: 0, name: "无" },
{ value: 1, name: "年度公示" },
{ value: 2, name: "年检" },
{ value: 3, name: "到期换证" },
{ value: 4, name: "年度执行报告" },
{ value: 5, name: "到期检测" },
{ value: 6, name: "年度复训" },
{ value: 7, name: "年度检测" },
{ value: 8, name: "到期备案" },
{ value: 9, name: "到期评价" },
]
}
export class handleTypeList {
value: number
name: string
}