From 0abba86ae21c280a01b27527376a33e9bb2de428 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Thu, 12 May 2022 11:07:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E6=89=B9=E5=AF=B9=E6=8E=A5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../audit-dispose.component.html | 47 +++-- .../audit-dispose/audit-dispose.component.ts | 42 ++++- .../audit/audit-ing/audit-ing.component.html | 30 ++- .../audit/audit-ing/audit-ing.component.ts | 173 +++++++++++++++--- 4 files changed, 235 insertions(+), 57 deletions(-) diff --git a/src/app/pages/audit/audit-ing/audit-dispose/audit-dispose.component.html b/src/app/pages/audit/audit-ing/audit-dispose/audit-dispose.component.html index 4715ade..14f841f 100644 --- a/src/app/pages/audit/audit-ing/audit-dispose/audit-dispose.component.html +++ b/src/app/pages/audit/audit-ing/audit-dispose/audit-dispose.component.html @@ -7,29 +7,38 @@
-

山东省某中化公司-淄博区域-淄博市第十六加油站

-
-

证件名称:   营业执照

-
-

证件编号:   Z201800041501

-
-

证件有效期:   2018.12.02—2025.01.12

-
-

办理类型:   年度公示

-
-

有效期类型:   1523天

-
-

是否年检:   是

+

{{data.gasStation.companyName}} - {{data.gasStation.stationName}}

+
+

证件名称:   {{data.getData.licenseTypeName}}

+
+
+
+
+

证件编号:   {{data.getData.licenseCode || ''}}

+
+

证件有效期:   {{data.getData.validityStartTime | date:"yyyy/MM/dd"}} - {{data.getData.validityEndTime | date:"yyyy/MM/dd"}}

+
+

办理类型:   {{data.getData.handleType || ''}}

+
+

有效期类型:   {{data.getData.validityDays || 0}}天

+
+

是否年检:   

+
+
+

有效期类型:   不适用

+
+
-

证件图片:   

+

证件图片:    + + +

审批意见:

- +
- - + +
diff --git a/src/app/pages/audit/audit-ing/audit-dispose/audit-dispose.component.ts b/src/app/pages/audit/audit-ing/audit-dispose/audit-dispose.component.ts index 42d0e24..db1ccd1 100644 --- a/src/app/pages/audit/audit-ing/audit-dispose/audit-dispose.component.ts +++ b/src/app/pages/audit/audit-ing/audit-dispose/audit-dispose.component.ts @@ -4,6 +4,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { HttpClient } from '@angular/common/http'; import { ObjectsSimpleService } from 'src/app/service/objectsSimple.service'; import Viewer from 'viewerjs'; +import { NzMessageService } from 'ng-zorro-antd/message'; @Component({ @@ -14,22 +15,39 @@ import Viewer from 'viewerjs'; export class AuditDisposeComponent implements OnInit { @Input() data?: any; - constructor(private modal: NzModalRef) { } - + constructor(private modal: NzModalRef, private message: NzMessageService) { } + textarea: string = ""; //审批意见 ngOnInit(): void { + console.log(this.data) } destroyModal() { this.modal.destroy(); } - ok() { + + isPass: boolean; + ok(isPass: boolean) { + this.isPass = isPass; this.modal.triggerOk() } + + //获取文件格式 + getFileType(name: string):string { + let suffix + if (name.substring(name.length-4).includes('png') || name.substring(name.length-4).includes('jpg') || name.substring(name.length-4).includes('jpeg') || name.substring(name.length-4).includes('webp')) { + suffix = 'img' + } else if (name.substring(name.length-4).includes('doc') || name.substring(name.length-4).includes('docx')) { + suffix = 'word' + } else if (name.substring(name.length-4).includes('pdf')) { + suffix = 'pdf' + } + return suffix + } + //查看图片 viewImg(url) { - // url.split('?')[0] let dom = document.getElementById(`viewerjs`) let pObjs = dom.childNodes; let node = document.createElement("img") @@ -48,4 +66,20 @@ export class AuditDisposeComponent implements OnInit { }, 0); } + //查看文件 + lookFile(item) { + if (!item.imageUrl) { + return + } + if (this.getFileType(item.imageUrl) == 'word') { + let arr = item.imageUrl.split('.') + arr[arr.length - 1] = 'pdf' + window.open(arr.join('.')) + } else if (this.getFileType(item.imageUrl) == 'pdf') { + window.open(item.imageUrl) + } else { + this.message.create('warning', '暂不支持查看!'); + } + } + } diff --git a/src/app/pages/audit/audit-ing/audit-ing.component.html b/src/app/pages/audit/audit-ing/audit-ing.component.html index 1536bd2..bb34896 100644 --- a/src/app/pages/audit/audit-ing/audit-ing.component.html +++ b/src/app/pages/audit/audit-ing/audit-ing.component.html @@ -9,7 +9,7 @@ 审批信息 加油站名称 - 区域 + 区域 省公司 提交时间 审批状态 @@ -19,17 +19,29 @@ - 审批类型 + {{item.auditTitle || ''}} + + + 油站信息 + 更新类证照提醒时间 + 更新类证照 + 档案类证照 + + {{item.gasStation.stationName}} + {{item.gasStation.locationName}} + {{item.gasStation.companyName}} + {{item.committedTime | date:"yyyy/MM/dd"}} + + + 审核中 + 审核通过 + 审核驳回 + 未提交审核 + 审核完成 - 审批信息 - 加油站名称 - 区域 - 省公司 - 提交时间 - 审批状态 处置 - 详情 + 详情 diff --git a/src/app/pages/audit/audit-ing/audit-ing.component.ts b/src/app/pages/audit/audit-ing/audit-ing.component.ts index 78e6ac7..2d7e9e8 100644 --- a/src/app/pages/audit/audit-ing/audit-ing.component.ts +++ b/src/app/pages/audit/audit-ing/audit-ing.component.ts @@ -1,8 +1,13 @@ +import { HttpClient } from '@angular/common/http'; import { Component, 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 { DetailsFileCategoryComponent } from '../../license/file-category/details-file-category/details-file-category.component'; +import { DetailsUpdateCategoryComponent } from '../../license/update-category/details-update-category/details-update-category.component'; import { AuditDisposeComponent } from './audit-dispose/audit-dispose.component'; + @Component({ selector: 'app-audit-ing', templateUrl: './audit-ing.component.html', @@ -10,9 +15,9 @@ import { AuditDisposeComponent } from './audit-dispose/audit-dispose.component'; }) export class AuditIngComponent implements OnInit { - constructor(private modal: NzModalService, private viewContainerRef: ViewContainerRef) { } + constructor(private modal: NzModalService, private viewContainerRef: ViewContainerRef,private http: HttpClient,private message: NzMessageService) { } tableSpin = false - list = [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] + list = [] tableScrollHeight ngOnInit(): void { @@ -21,34 +26,152 @@ export class AuditIngComponent implements OnInit { fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => { this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px' }); + this.getStationList() + } + + //获取当前油站档案类证照 + getStationList() { + let data = JSON.parse(sessionStorage.getItem('userdata')); + let params = { + OrganizationUnitId: data.organization.id || "" , + IsContainsChildren: "true", + AuditStatuses: "1", + } + this.http.get(`/api/services/app/ContentAuditLog/GetAuditting`,{params}).subscribe((info: any)=>{ + info.result.items.forEach(element => { + element.itemData = JSON.parse(element.itemData) + }); + this.list = info.result.items || [] + console.log(this.list) + }) } dispose(item) { - console.log('item', item) - const modal = this.modal.create({ - nzContent: AuditDisposeComponent, - 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 () => { - - } - }); - const instance = modal.getContentComponent(); - modal.afterClose.subscribe(result => { }); + // if (item.auditStatus != 1) { + // return + // } + this.getData(item).then(res=>{ + item.getData = res + const modal = this.modal.create({ + nzContent: AuditDisposeComponent, + 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 () => { + await new Promise(resolve => { + let url + if (item.auditType == 0) { + + } else if (item.auditType == 1) { + + } else if (item.auditType == 2) { + url = '/api/services/app/StationValidityLicense/Audit' + } else if (item.auditType) { + url = '/api/services/app/StationFileLicense/Audit' + } + let params = { + id: item.getData.id, + remark: instance.textarea + } + let body = instance.isPass? 2 : 3; + this.http.post(url,body,{params}).subscribe(data => { + resolve(data); + this.getStationList(); + this.message.create('success', '审核完成!'); + return true + }) + }) + } + }); + const instance = modal.getContentComponent(); + modal.afterClose.subscribe(result => { }); + }) + } + + details(item) { + let component + if (item.auditType == 0) { + + } else if (item.auditType == 1) { + + } else if (item.auditType == 2) { + component = DetailsUpdateCategoryComponent + } else if (item.auditType) { + component = DetailsFileCategoryComponent + } + if (item.getData) { + const modal = this.modal.create({ + nzContent: component, + 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: item.getData + }, + nzFooter: null, + nzClosable: false, + }); + } else { + this.getData(item).then(res=>{ + item.getData = res + const modal = this.modal.create({ + nzContent: component, + 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: item.getData + }, + nzFooter: null, + nzClosable: false, + }); + }) + } + } + + //获取证照类data + getData(item) { + let url + if (item.auditType == 0) { + + } else if (item.auditType == 1) { + + } else if (item.auditType == 2) { + url = '/api/services/app/StationValidityLicense/Get' + } else if (item.auditType) { + url = '/api/services/app/StationFileLicense/Get' + } + return new Promise((resolve, reject)=>{ + let params = { id: item.itemId } + this.http.get(url,{params}).subscribe((data: any)=>{ + resolve(data.result) + }) + }) } }