Browse Source

[完善]审核记录详情

beijing
邵佳豪 2 years ago
parent
commit
30e53f30d1
  1. 8
      proxy.config.json
  2. 4
      src/app/pages/audit/audit-ing/appeal-details/appeal-details.component.html
  3. 2
      src/app/pages/audit/audit-ing/audit-ing.component.ts
  4. 2
      src/app/pages/audit/audit-record/audit-record.component.ts
  5. 20
      src/app/pages/license/file-category/details-file-category/details-file-category.component.html
  6. 10
      src/app/pages/license/update-category/details-update-category/details-update-category.component.html
  7. 424
      src/app/pages/plan-admin/file-license-list/file-license-list.component.ts
  8. 3
      src/app/pages/plan-admin/update-license-list/update-license-list.component.html
  9. 445
      src/app/pages/plan-admin/update-license-list/update-license-list.component.ts
  10. 3
      src/theme.less

8
proxy.config.json

@ -1,16 +1,14 @@
{
"/api": {
"target": "https://znaq.sinochemoilmarketing.com/",
"测试": "http://121.36.37.70:8906/",
"target": "http://121.36.37.70:8906/",
"测试1": "http://121.36.37.70:8906/",
"测试2": "https://znaq.sinochemoilmarketing.com/",
"测试3": "https://gas.anxincloud.cn/",
"secure": false,
"changeOrigin": true
},
"/signalr": {
"target": "https://znaq.sinochemoilmarketing.com/",
"测试": "http://121.36.37.70:8906/",
"测试2": "https://znaq.sinochemoilmarketing.com/",
"target": "http://121.36.37.70:8906/",
"secure": false,
"ws": true,
"logLevel": "debug"

4
src/app/pages/audit/audit-ing/appeal-details/appeal-details.component.html

@ -1,4 +1,4 @@
<div class="box">
<div class="box" id="appealDetails">
<div class="title">
<div class="titlecontent">
详情
@ -28,7 +28,7 @@
</div>
</div>
<div class="cutoffrule"></div>
<p>审核人员: {{data.auditUser.name}}</p>
<p>审核人员: {{data.auditUser?.name || ""}}</p>
<div class="cutoffrule"></div>
<p>审核时间: {{data.auditTime | date:"yyyy-MM-dd HH:mm:ss"}}</p>
<div class="cutoffrule"></div>

2
src/app/pages/audit/audit-ing/audit-ing.component.ts

@ -106,6 +106,7 @@ export class AuditIngComponent implements OnInit {
data: item
},
nzFooter: null,
nzKeyboard:false,
nzClosable: false,
nzOnOk: async () => {
await new Promise(resolve => {
@ -169,6 +170,7 @@ export class AuditIngComponent implements OnInit {
nzComponentParams: {
data: item.getData
},
nzKeyboard:false,
nzFooter: null,
nzClosable: false,
});

2
src/app/pages/audit/audit-record/audit-record.component.ts

@ -280,8 +280,8 @@ export class AuditRecordComponent implements OnInit {
},
nzComponentParams: {
data: item.getData,
},
nzKeyboard:false,
nzFooter: null,
nzClosable: false,
});

20
src/app/pages/license/file-category/details-file-category/details-file-category.component.html

@ -9,14 +9,18 @@
<div class="content">
<p>证照名称: &nbsp;&nbsp;{{data.licenseTypeName}}</p>
<div class="cutoffrule"></div>
<p>有无证照: &nbsp;&nbsp;<span *ngIf="data.validatyType == 0">不适用</span><span *ngIf="data.validatyType == 1"></span><span *ngIf="data.validatyType == 2"></span></p>
<p>有无证照: &nbsp;&nbsp;<span *ngIf="data.validatyType == 0">不适用</span><span
*ngIf="data.validatyType == 1">无</span><span *ngIf="data.validatyType == 2"></span></p>
<div class="cutoffrule"></div>
<!-- <p>是否年检: &nbsp;&nbsp;是</p>
<div class="cutoffrule"></div> -->
<p>附件: &nbsp;&nbsp;
<img *ngIf="data.imageUrl && getFileType(data.imageUrl) == 'img'" [src]="data.imageUrl" (click)="viewImg(data.imageUrl)">
<img *ngIf="data.imageUrl && getFileType(data.imageUrl) == 'word'" src="../../../../assets/images/license/word.png" (click)="lookFile(data)">
<img *ngIf="data.imageUrl && getFileType(data.imageUrl) == 'pdf'" src="../../../../assets/images/license/pdf.png" (click)="lookFile(data)">
<img *ngIf="data.imageUrl && getFileType(data.imageUrl) == 'img'" [src]="data.imageUrl"
(click)="viewImg(data.imageUrl)">
<img *ngIf="data.imageUrl && getFileType(data.imageUrl) == 'word'"
src="../../../../assets/images/license/word.png" (click)="lookFile(data)">
<img *ngIf="data.imageUrl && getFileType(data.imageUrl) == 'pdf'"
src="../../../../assets/images/license/pdf.png" (click)="lookFile(data)">
</p>
<div class="cutoffrule"></div>
<p>说明: &nbsp;&nbsp;{{data.remark}}</p>
@ -35,15 +39,11 @@
<nz-timeline>
<nz-timeline-item *ngFor="let item of auditList">
<span>{{item.creationTime | date:"yyyy/MM/dd"}}</span>
<span style="margin: 0 10px;">{{item.organizationName}} {{item.auditStatus | auditStatus}}</span>
<span style="margin: 0 10px;">{{item.organizationName}}-{{item.user ? item.user.name : ''}}
{{item.auditStatus | auditStatus}}</span>
<span *ngIf="item.auditStatus == 3">驳回说明:{{item.remark}}</span>
</nz-timeline-item>
</nz-timeline>
<ng-template #soccerTemplate>
<div class="circle">
</div>
</ng-template>
</div>

10
src/app/pages/license/update-category/details-update-category/details-update-category.component.html

@ -69,16 +69,12 @@
</p>
<nz-timeline>
<nz-timeline-item *ngFor="let item of auditList">
<span>{{item.creationTime | date:"yyyy/MM/dd"}}</span>
<span style="margin: 0 10px;">{{item.organizationName}} {{item.auditStatus | auditStatus}}</span>
<span>{{item.creationTime | date:"yyyy/MM/dd HH:mm:ss"}}</span>
<span style="margin: 0 10px;">{{item.organizationName}}-{{item.user ? item.user.name : ''}}
{{item.auditStatus | auditStatus}}</span>
<span *ngIf="item.auditStatus == 3">驳回说明:{{item.remark}}</span>
</nz-timeline-item>
</nz-timeline>
<ng-template #soccerTemplate>
<div class="circle">
</div>
</ng-template>
</div>

424
src/app/pages/plan-admin/file-license-list/file-license-list.component.ts

@ -1,96 +1,142 @@
import { Component, OnInit, ViewChild, ElementRef, ViewContainerRef } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { TreeService } from 'src/app/service/tree.service';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzContextMenuService, NzDropdownMenuComponent } from 'ng-zorro-antd/dropdown';
import { NzFormatEmitEvent, NzTreeComponent, NzTreeNode } from 'ng-zorro-antd/tree';
import { Router } from '@angular/router';
import { NavChangeService } from 'src/app/service/navChange.service';
import { fromEvent } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
import 'linqjs';
import { DetailsUpdateCategoryComponent } from '../../license/update-category/details-update-category/details-update-category.component';
import { NzModalService } from 'ng-zorro-antd/modal';
import { NzMessageService } from 'ng-zorro-antd/message';
import { DetailsFileCategoryComponent } from '../../license/file-category/details-file-category/details-file-category.component';
import {
Component,
OnInit,
ViewChild,
ElementRef,
ViewContainerRef,
} from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { TreeService } from "src/app/service/tree.service";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import {
NzContextMenuService,
NzDropdownMenuComponent,
} from "ng-zorro-antd/dropdown";
import {
NzFormatEmitEvent,
NzTreeComponent,
NzTreeNode,
} from "ng-zorro-antd/tree";
import { Router } from "@angular/router";
import { NavChangeService } from "src/app/service/navChange.service";
import { fromEvent } from "rxjs";
import { debounceTime } from "rxjs/operators";
import "linqjs";
import { DetailsUpdateCategoryComponent } from "../../license/update-category/details-update-category/details-update-category.component";
import { NzModalService } from "ng-zorro-antd/modal";
import { NzMessageService } from "ng-zorro-antd/message";
import { DetailsFileCategoryComponent } from "../../license/file-category/details-file-category/details-file-category.component";
@Component({
selector: 'app-file-license-list',
templateUrl: './file-license-list.component.html',
styleUrls: ['./file-license-list.component.scss']
selector: "app-file-license-list",
templateUrl: "./file-license-list.component.html",
styleUrls: ["./file-license-list.component.scss"],
})
export class FileLicenseListComponent implements OnInit {
validateForm!: FormGroup;
constructor(private modal: NzModalService, private viewContainerRef: ViewContainerRef, private element: ElementRef, private navChangeService: NavChangeService, private http: HttpClient, private toTree: TreeService, private fb: FormBuilder, private nzContextMenuService: NzContextMenuService, private router: Router, private message: NzMessageService) { }
button=false
tableScrollHeight
tableScrollWeight
resizeListener
constructor(
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private element: ElementRef,
private navChangeService: NavChangeService,
private http: HttpClient,
private toTree: TreeService,
private fb: FormBuilder,
private nzContextMenuService: NzContextMenuService,
private router: Router,
private message: NzMessageService
) {}
button = false;
tableScrollHeight;
tableScrollWeight;
resizeListener;
async ngOnInit(): Promise<void> {
this.tableScrollHeight = '100px'
this.tableScrollWeight = '100px'
this.tableScrollHeight = "100px";
this.tableScrollWeight = "100px";
// 页面监听
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 - 10) + 'px'
});
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 -
10 +
"px";
});
this.validateForm = this.fb.group({
organization: [null],
name: [null]
name: [null],
});
this.tableSpin = true
this.tableSpin = true;
await this.getAllOrganization()
this.getStationLicenses()
this.returnLastMenus()
await this.getAllOrganization();
this.getStationLicenses();
this.returnLastMenus();
}
ngOnDestroy(): void {
this.resizeListener.unsubscribe()
this.resizeListener.unsubscribe();
}
//获取所有组织机构
nodes: any = []
nodes: any = [];
async getAllOrganization() {
let OrganizationUnitId = JSON.parse(sessionStorage.getItem('userdata')).organization.id
let OrganizationUnitId = JSON.parse(sessionStorage.getItem("userdata"))
.organization.id;
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true"
}
IsContainsChildren: "true",
};
await new Promise((resolve, reject) => {
this.http.get('/api/services/app/Organization/GetAll', {
params: params
}).subscribe((data: any) => {
data.result.items.forEach(element => {
if (element.id == OrganizationUnitId) {
element.parentId = null
}
element.key = element.id
element.title = element.displayName
});
this.nodes = [...this.toTree.toTree(data.result.items)]
this.validateForm.patchValue({
organization: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
this.http
.get("/api/services/app/Organization/GetAll", {
params: params,
})
.subscribe((data: any) => {
data.result.items.forEach((element) => {
if (element.id == OrganizationUnitId) {
element.parentId = null;
}
element.key = element.id;
element.title = element.displayName;
});
this.nodes = [...this.toTree.toTree(data.result.items)];
this.validateForm.patchValue({
organization: JSON.parse(sessionStorage.getItem("userdata"))
.organization.id,
});
resolve(data);
});
resolve(data)
})
})
});
}
ngAfterViewInit(): void {
fromEvent(this.element.nativeElement.querySelector(`.ant-table-body`) as HTMLCanvasElement, 'scroll').pipe(debounceTime(100)).subscribe(async (event: any) => { //监听 DOM 滚动事件
if (event.target.scrollHeight - (event.target.scrollTop + event.target.clientHeight) <= 10) {
if (this.totalCount > this.list.length) {
console.log('需要加载数据了', event)
this.SkipCount = String(Number(this.SkipCount) + 50)
await this.getStationLicenses()
fromEvent(
this.element.nativeElement.querySelector(
`.ant-table-body`
) as HTMLCanvasElement,
"scroll"
)
.pipe(debounceTime(100))
.subscribe(async (event: any) => {
//监听 DOM 滚动事件
if (
event.target.scrollHeight -
(event.target.scrollTop + event.target.clientHeight) <=
10
) {
if (this.totalCount > this.list.length) {
console.log("需要加载数据了", event);
this.SkipCount = String(Number(this.SkipCount) + 50);
await this.getStationLicenses();
}
}
}
});
});
}
submitForm(): void {
@ -98,9 +144,9 @@ export class FileLicenseListComponent implements OnInit {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
this.list = []
this.SkipCount = '0'
this.getStationLicenses()
this.list = [];
this.SkipCount = "0";
this.getStationLicenses();
}
resetForm(e: MouseEvent): void {
@ -111,159 +157,175 @@ export class FileLicenseListComponent implements OnInit {
this.validateForm.controls[key].updateValueAndValidity();
}
this.validateForm.patchValue({
organization: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
organization: JSON.parse(sessionStorage.getItem("userdata")).organization
.id,
});
this.list = []
this.SkipCount = '0'
this.getStationLicenses()
this.list = [];
this.SkipCount = "0";
this.getStationLicenses();
}
tableSpin: boolean
totalCount: any //总数
tableSpin: boolean;
totalCount: any; //总数
//获取点击组织机构的所有加油站
SkipCount: string = '0'
MaxResultCount: string = '50'
SkipCount: string = "0";
MaxResultCount: string = "50";
orId
list: any = []
isLoading = false
orId;
list: any = [];
isLoading = false;
async getStationLicenses() {
this.isLoading = true
this.isLoading = true;
let params = {
StationName: this.validateForm.value.name,
OrganizationUnitId: this.validateForm.value.organization,
IsContainsChildren: 'true',
IsContainsChildren: "true",
SkipCount: this.SkipCount,
MaxResultCount: this.MaxResultCount,
// Sorting: ' BuildingBasicInfo.Id asc'
}
this.tableSpin = true
};
this.tableSpin = true;
await new Promise((resolve, reject) => {
this.http.get('/api/services/app/StationFileLicense/GetStationLicenses', {
params: params
}).subscribe((data: any) => {
this.totalCount = data.result.totalCount
let arr = []
data.result.data.forEach(element => {
let keyArr = Object.keys(element);
let valueArr = Object.values(element);
let newElement = (keyArr as any).zip(valueArr, (a, b) => { return { name: a, value: b } });
this.http
.get("/api/services/app/StationFileLicense/GetStationLicenses", {
params: params,
})
.subscribe((data: any) => {
this.totalCount = data.result.totalCount;
let arr = [];
data.result.data.forEach((element) => {
let keyArr = Object.keys(element);
let valueArr = Object.values(element);
let newElement = (keyArr as any).zip(valueArr, (a, b) => {
return { name: a, value: b };
});
//修改排头
let newArr = []
for (let index = 0; index < newElement.length; index++) {
const item = newElement[index];
if (item.name == '公司名称') {
newArr[0] = item
newElement.splice(index--, 1)
}
if (item.name == '区域名称') {
newArr[1] = item
newElement.splice(index--, 1)
}
if (item.name == '油站名称') {
newArr[2] = item
newElement.splice(index--, 1)
//修改排头
let newArr = [];
for (let index = 0; index < newElement.length; index++) {
const item = newElement[index];
if (item.name == "公司名称") {
newArr[0] = item;
newElement.splice(index--, 1);
}
if (item.name == "区域名称") {
newArr[1] = item;
newElement.splice(index--, 1);
}
if (item.name == "油站名称") {
newArr[2] = item;
newElement.splice(index--, 1);
}
}
}
let atLastArr = newArr.concat(newElement);
arr.push(atLastArr)
});
let atLastArr = newArr.concat(newElement);
arr.push(atLastArr);
});
setTimeout(() => {
let tableHeader = this.element.nativeElement.querySelector(`.ant-table-header`).clientHeight
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - tableHeader - 10) + 'px'
this.tableScrollWeight = (this.list[0].length + 1) * 100 + 'px'
}, 0);
setTimeout(() => {
let tableHeader =
this.element.nativeElement.querySelector(
`.ant-table-header`
).clientHeight;
this.tableScrollHeight =
document.getElementById("tablebox").clientHeight -
tableHeader -
10 +
"px";
this.tableScrollWeight = (this.list[0].length + 1) * 100 + "px";
}, 0);
this.list = this.list.concat(arr);
this.list = [...this.list]
console.log('证照表格', this.list)
this.tableSpin = false
this.isLoading = false
resolve(data)
})
})
this.list = this.list.concat(arr);
this.list = [...this.list];
console.log("证照表格", this.list);
this.tableSpin = false;
this.isLoading = false;
resolve(data);
});
});
}
//父组件调用子组件方法
public onChildMethod() {
this.getStationLicenses()
this.getStationLicenses();
}
lookDetails(i) {
console.log(i)
console.log(i);
let params = {
Id: i.licenseId
}
this.http.get('/api/services/app/StationFileLicense/Get', { params: params }).subscribe((data: any) => {
console.log('证照信息', data)
const modal = this.modal.create({
nzContent: DetailsFileCategoryComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 450,
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: data.result
},
nzFooter: null,
nzClosable: false,
nzOnOk: async () => {
}
Id: i.licenseId,
};
this.http
.get("/api/services/app/StationFileLicense/Get", { params: params })
.subscribe((data: any) => {
console.log("证照信息", data);
const modal = this.modal.create({
nzContent: DetailsFileCategoryComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 450,
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: data.result,
},
nzFooter: null,
nzClosable: false,
nzKeyboard: false,
nzOnOk: async () => {},
});
const instance = modal.getContentComponent();
modal.afterClose.subscribe((result) => {});
});
const instance = modal.getContentComponent();
modal.afterClose.subscribe(result => { });
})
}
returnLastMenus() {
let userMenu = JSON.parse(sessionStorage.getItem('userdata')).menus
let userMenu = JSON.parse(sessionStorage.getItem("userdata")).menus;
for (let index = 0; index < userMenu.length; index++) {
for (let k = 0; k < userMenu.length; k++) {
if (userMenu[index].name=="资产类证照") {
if(userMenu[index].id==userMenu[k].parentId){
this.button = true
if (userMenu[index].name == "资产类证照") {
if (userMenu[index].id == userMenu[k].parentId) {
this.button = true;
}
}
}
}
return
return;
}
exportExcel() {
// console.log(this.validateForm)
const httpOptions = {
responseType: 'blob' as 'json',
responseType: "blob" as "json",
params: {
OrganizationUnitId: this.validateForm.value.organization
}
OrganizationUnitId: this.validateForm.value.organization,
},
};
this.http.get(`/api/services/app/StationFileLicense/ExportStationLicenses`, httpOptions).subscribe((data: any) => {
// console.log('导出成功')
// 文件名中有中文 则对文件名进行转码
const link = document.createElement('a');
const blob = new Blob([data], { type: 'application/vnd.ms-excel' });
link.setAttribute('href', window.URL.createObjectURL(blob));
link.setAttribute('download', '资产类证照' + '.xls');
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.message.create('success', `导出成功`);
}, err => {
this.message.create('error', `导出失败`);
})
this.http
.get(
`/api/services/app/StationFileLicense/ExportStationLicenses`,
httpOptions
)
.subscribe(
(data: any) => {
// console.log('导出成功')
// 文件名中有中文 则对文件名进行转码
const link = document.createElement("a");
const blob = new Blob([data], { type: "application/vnd.ms-excel" });
link.setAttribute("href", window.URL.createObjectURL(blob));
link.setAttribute("download", "资产类证照" + ".xls");
link.style.visibility = "hidden";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.message.create("success", `导出成功`);
},
(err) => {
this.message.create("error", `导出失败`);
}
);
}
}

3
src/app/pages/plan-admin/update-license-list/update-license-list.component.html

@ -82,7 +82,8 @@
<ng-container *ngIf="i.value.endDate; else elseTemplate">
<span (click)="lookDetails(i.value)" style="cursor: pointer;"
[ngClass]="{'green': i.value.licenseViolationType == 1,'yellow': i.value.licenseViolationType == 2,'red': i.value.licenseViolationType == 3}">
{{i.value.endDate == '9999-12-31T23:59:59.9999999' ? '长期' : i.value.endDate | date:"yyyy-MM-dd"}}
{{i.value.endDate == '9999-12-31T23:59:59.9999999' ? '长期' : i.value.endDate |
date:"yyyy-MM-dd"}}
</span>
</ng-container>
<ng-template #elseTemplate>

445
src/app/pages/plan-admin/update-license-list/update-license-list.component.ts

@ -1,96 +1,138 @@
import { Component, OnInit, ViewChild, ElementRef, ViewContainerRef } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { TreeService } from 'src/app/service/tree.service';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzContextMenuService, NzDropdownMenuComponent } from 'ng-zorro-antd/dropdown';
import { NzFormatEmitEvent, NzTreeComponent, NzTreeNode } from 'ng-zorro-antd/tree';
import { Router } from '@angular/router';
import { NavChangeService } from 'src/app/service/navChange.service';
import { fromEvent } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
import 'linqjs';
import { DetailsUpdateCategoryComponent } from '../../license/update-category/details-update-category/details-update-category.component';
import { NzModalService } from 'ng-zorro-antd/modal';
import { NzMessageService } from 'ng-zorro-antd/message';
import {
Component,
OnInit,
ViewChild,
ElementRef,
ViewContainerRef,
} from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { TreeService } from "src/app/service/tree.service";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import {
NzContextMenuService,
NzDropdownMenuComponent,
} from "ng-zorro-antd/dropdown";
import {
NzFormatEmitEvent,
NzTreeComponent,
NzTreeNode,
} from "ng-zorro-antd/tree";
import { Router } from "@angular/router";
import { NavChangeService } from "src/app/service/navChange.service";
import { fromEvent } from "rxjs";
import { debounceTime } from "rxjs/operators";
import "linqjs";
import { DetailsUpdateCategoryComponent } from "../../license/update-category/details-update-category/details-update-category.component";
import { NzModalService } from "ng-zorro-antd/modal";
import { NzMessageService } from "ng-zorro-antd/message";
@Component({
selector: 'app-update-license-list',
templateUrl: './update-license-list.component.html',
styleUrls: ['./update-license-list.component.scss']
selector: "app-update-license-list",
templateUrl: "./update-license-list.component.html",
styleUrls: ["./update-license-list.component.scss"],
})
export class UpdateLicenseListComponent implements OnInit {
validateForm!: FormGroup;
constructor(private modal: NzModalService, private viewContainerRef: ViewContainerRef, private element: ElementRef, private navChangeService: NavChangeService, private http: HttpClient, private toTree: TreeService, private fb: FormBuilder, private nzContextMenuService: NzContextMenuService, private router: Router, private message: NzMessageService) { }
button = false
tableScrollHeight
tableScrollWeight
resizeListener
constructor(
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private element: ElementRef,
private navChangeService: NavChangeService,
private http: HttpClient,
private toTree: TreeService,
private fb: FormBuilder,
private nzContextMenuService: NzContextMenuService,
private router: Router,
private message: NzMessageService
) {}
button = false;
tableScrollHeight;
tableScrollWeight;
resizeListener;
async ngOnInit(): Promise<void> {
this.tableScrollHeight = '100px'
this.tableScrollWeight = '100px'
this.tableScrollHeight = "100px";
this.tableScrollWeight = "100px";
// 页面监听
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 - 10) + 'px'
});
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 -
10 +
"px";
});
this.validateForm = this.fb.group({
organization: [null],
name: [null]
name: [null],
});
this.tableSpin = true
await this.getAllOrganization()
this.getStationLicenses()
this.returnLastMenus()
this.tableSpin = true;
await this.getAllOrganization();
this.getStationLicenses();
this.returnLastMenus();
}
ngOnDestroy(): void {
this.resizeListener.unsubscribe()
this.resizeListener.unsubscribe();
}
//获取所有组织机构
nodes: any = []
nodes: any = [];
async getAllOrganization() {
let OrganizationUnitId = JSON.parse(sessionStorage.getItem('userdata')).organization.id
let OrganizationUnitId = JSON.parse(sessionStorage.getItem("userdata"))
.organization.id;
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true"
}
IsContainsChildren: "true",
};
await new Promise((resolve, reject) => {
this.http.get('/api/services/app/Organization/GetAll', {
params: params
}).subscribe((data: any) => {
data.result.items.forEach(element => {
if (element.id == OrganizationUnitId) {
element.parentId = null
}
element.key = element.id
element.title = element.displayName
});
this.nodes = [...this.toTree.toTree(data.result.items)]
this.validateForm.patchValue({
organization: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
this.http
.get("/api/services/app/Organization/GetAll", {
params: params,
})
.subscribe((data: any) => {
data.result.items.forEach((element) => {
if (element.id == OrganizationUnitId) {
element.parentId = null;
}
element.key = element.id;
element.title = element.displayName;
});
this.nodes = [...this.toTree.toTree(data.result.items)];
this.validateForm.patchValue({
organization: JSON.parse(sessionStorage.getItem("userdata"))
.organization.id,
});
resolve(data);
});
resolve(data)
})
})
});
}
ngAfterViewInit(): void {
fromEvent(this.element.nativeElement.querySelector(`.ant-table-body`) as HTMLCanvasElement, 'scroll').pipe(debounceTime(100)).subscribe(async (event: any) => { //监听 DOM 滚动事件
if (event.target.scrollHeight - (event.target.scrollTop + event.target.clientHeight) <= 10) {
if (this.totalCount > this.list.length) {
console.log('需要加载数据了', event)
this.SkipCount = String(Number(this.SkipCount) + 50)
await this.getStationLicenses()
fromEvent(
this.element.nativeElement.querySelector(
`.ant-table-body`
) as HTMLCanvasElement,
"scroll"
)
.pipe(debounceTime(100))
.subscribe(async (event: any) => {
//监听 DOM 滚动事件
if (
event.target.scrollHeight -
(event.target.scrollTop + event.target.clientHeight) <=
10
) {
if (this.totalCount > this.list.length) {
console.log("需要加载数据了", event);
this.SkipCount = String(Number(this.SkipCount) + 50);
await this.getStationLicenses();
}
}
}
});
});
}
submitForm(): void {
@ -98,9 +140,9 @@ export class UpdateLicenseListComponent implements OnInit {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
this.list = []
this.SkipCount = '0'
this.getStationLicenses()
this.list = [];
this.SkipCount = "0";
this.getStationLicenses();
}
resetForm(e: MouseEvent): void {
e.preventDefault();
@ -109,157 +151,194 @@ export class UpdateLicenseListComponent implements OnInit {
this.validateForm.controls[key].markAsPristine();
this.validateForm.controls[key].updateValueAndValidity();
}
this.list = []
this.SkipCount = '0'
this.list = [];
this.SkipCount = "0";
this.validateForm.patchValue({
organization: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
organization: JSON.parse(sessionStorage.getItem("userdata")).organization
.id,
});
this.getStationLicenses()
this.getStationLicenses();
}
tableSpin: boolean
totalCount: any //总数
tableSpin: boolean;
totalCount: any; //总数
//获取点击组织机构的所有加油站
SkipCount: string = '0'
MaxResultCount: string = '50'
list: any = []
isLoading = false
SkipCount: string = "0";
MaxResultCount: string = "50";
list: any = [];
isLoading = false;
async getStationLicenses() {
this.isLoading = true
this.isLoading = true;
let params = {
StationName: this.validateForm.value.name,
OrganizationUnitId: this.validateForm.value.organization,
IsContainsChildren: 'true',
IsContainsChildren: "true",
SkipCount: this.SkipCount,
MaxResultCount: this.MaxResultCount
}
this.tableSpin = true
MaxResultCount: this.MaxResultCount,
};
this.tableSpin = true;
await new Promise((resolve, reject) => {
this.http.get('/api/services/app/StationValidityLicense/GetStationLicenses', {
params: params
}).subscribe((data: any) => {
this.totalCount = data.result.totalCount
let arr = []
data.result.data.forEach(element => {
let keyArr = Object.keys(element);
let valueArr = Object.values(element);
let newElement = (keyArr as any).zip(valueArr, (a, b) => { return { name: a, value: b } });
this.http
.get("/api/services/app/StationValidityLicense/GetStationLicenses", {
params: params,
})
.subscribe((data: any) => {
this.totalCount = data.result.totalCount;
let arr = [];
data.result.data.forEach((element) => {
let keyArr = Object.keys(element);
let valueArr = Object.values(element);
let newElement = (keyArr as any).zip(valueArr, (a, b) => {
return { name: a, value: b };
});
//修改排头
let newArr = []
for (let index = 0; index < newElement.length; index++) {
const item = newElement[index];
let arr = [
'公司名称', '区域名称', '油站名称', '营业执照', '成品油零售经营批准证书', '危险化学品经营许可证', '食品经营许可证', '烟草经营许可证', '安全生产标准化认证证书', '排污许可证', '防雷检测报告', '计量检测报告', '职业危害因素检测报告', '安全现状评价报告', '安全应急预案备案回执', '环境应急预案备案回执', '油气回收系统年检报告', '大气污染物合规性监测报告', '主要负责人证书', '安全管理人员资格证书1', '安全管理人员资格证书2'
]
for (let i = 0; i < arr.length; i++) {
const element = arr[i];
if (item.name == element) {
newArr[i] = item
newElement.splice(index--, 1)
//修改排头
let newArr = [];
for (let index = 0; index < newElement.length; index++) {
const item = newElement[index];
let arr = [
"公司名称",
"区域名称",
"油站名称",
"营业执照",
"成品油零售经营批准证书",
"危险化学品经营许可证",
"食品经营许可证",
"烟草经营许可证",
"安全生产标准化认证证书",
"排污许可证",
"防雷检测报告",
"计量检测报告",
"职业危害因素检测报告",
"安全现状评价报告",
"安全应急预案备案回执",
"环境应急预案备案回执",
"油气回收系统年检报告",
"大气污染物合规性监测报告",
"主要负责人证书",
"安全管理人员资格证书1",
"安全管理人员资格证书2",
];
for (let i = 0; i < arr.length; i++) {
const element = arr[i];
if (item.name == element) {
newArr[i] = item;
newElement.splice(index--, 1);
}
}
}
}
newArr = newArr.filter((item) => {
return item
})
let atLastArr = newArr.concat(newElement);
arr.push(atLastArr)
});
newArr = newArr.filter((item) => {
return item;
});
let atLastArr = newArr.concat(newElement);
arr.push(atLastArr);
});
setTimeout(() => {
let tableHeader = this.element.nativeElement.querySelector(`.ant-table-header`).clientHeight
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - tableHeader - 10) + 'px'
this.tableScrollWeight = (this.list[0].length + 1) * 100 + 'px'
}, 0);
setTimeout(() => {
let tableHeader =
this.element.nativeElement.querySelector(
`.ant-table-header`
).clientHeight;
this.tableScrollHeight =
document.getElementById("tablebox").clientHeight -
tableHeader -
10 +
"px";
this.tableScrollWeight = (this.list[0].length + 1) * 100 + "px";
}, 0);
this.list = this.list.concat(arr);
this.list = [...this.list]
console.log('证照表格', this.list)
this.tableSpin = false
this.isLoading = false
resolve(data)
})
})
this.list = this.list.concat(arr);
this.list = [...this.list];
console.log("证照表格", this.list);
this.tableSpin = false;
this.isLoading = false;
resolve(data);
});
});
}
//父组件调用子组件方法
public onChildMethod() {
this.getStationLicenses()
this.getStationLicenses();
}
lookDetails(i) {
console.log(i)
console.log(i);
let params = {
Id: i.licenseId
}
this.http.get('/api/services/app/StationValidityLicense/Get', { params: params }).subscribe((data: any) => {
console.log('证照信息', data)
const modal = this.modal.create({
nzContent: DetailsUpdateCategoryComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 450,
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: data.result
},
nzFooter: null,
nzClosable: false,
nzOnOk: async () => {
}
Id: i.licenseId,
};
this.http
.get("/api/services/app/StationValidityLicense/Get", { params: params })
.subscribe((data: any) => {
console.log("证照信息", data);
const modal = this.modal.create({
nzContent: DetailsUpdateCategoryComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 450,
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: data.result,
},
nzFooter: null,
nzClosable: false,
nzKeyboard:false,
nzOnOk: async () => {},
});
const instance = modal.getContentComponent();
modal.afterClose.subscribe((result) => {});
});
const instance = modal.getContentComponent();
modal.afterClose.subscribe(result => { });
})
}
returnLastMenus() {
let userMenu = JSON.parse(sessionStorage.getItem('userdata')).menus
let userMenu = JSON.parse(sessionStorage.getItem("userdata")).menus;
for (let index = 0; index < userMenu.length; index++) {
for (let k = 0; k < userMenu.length; k++) {
if (userMenu[index].name=="经营类证照") {
if(userMenu[index].id==userMenu[k].parentId){
this.button = true
if (userMenu[index].name == "经营类证照") {
if (userMenu[index].id == userMenu[k].parentId) {
this.button = true;
}
}
}
}
return
return;
}
exportExcel() {
// console.log(this.validateForm)
const httpOptions = {
responseType: 'blob' as 'json',
responseType: "blob" as "json",
params: {
OrganizationUnitId: this.validateForm.value.organization
}
OrganizationUnitId: this.validateForm.value.organization,
},
};
this.http.get(`/api/services/app/StationValidityLicense/ExportStationLicenses`, httpOptions).subscribe((data: any) => {
// console.log('导出成功')
// 文件名中有中文 则对文件名进行转码
const link = document.createElement('a');
const blob = new Blob([data], { type: 'application/vnd.ms-excel' });
link.setAttribute('href', window.URL.createObjectURL(blob));
link.setAttribute('download', '经营类证照' + '.xls');
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.message.create('success', `导出成功`);
}, err => {
this.message.create('error', `导出失败`);
})
this.http
.get(
`/api/services/app/StationValidityLicense/ExportStationLicenses`,
httpOptions
)
.subscribe(
(data: any) => {
// console.log('导出成功')
// 文件名中有中文 则对文件名进行转码
const link = document.createElement("a");
const blob = new Blob([data], { type: "application/vnd.ms-excel" });
link.setAttribute("href", window.URL.createObjectURL(blob));
link.setAttribute("download", "经营类证照" + ".xls");
link.style.visibility = "hidden";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.message.create("success", `导出成功`);
},
(err) => {
this.message.create("error", `导出失败`);
}
);
}
}

3
src/theme.less

@ -389,7 +389,8 @@
#histories,
#statisticsList,
#recordsboxadmin,
#recordsbox {
#recordsbox,
#appealDetails {
::-webkit-input-placeholder {
/* WebKit browsers */
color: #345d85;

Loading…
Cancel
Save