Browse Source

档案类证照对接接口

beijing
陈鹏飞 3 years ago
parent
commit
5c2d2fd1a3
  1. 38
      src/app/pages/license/file-category/details-file-category/details-file-category.component.html
  2. 31
      src/app/pages/license/file-category/details-file-category/details-file-category.component.ts
  3. 11
      src/app/pages/license/file-category/edit-file-category/edit-file-category.component.html
  4. 6
      src/app/pages/license/file-category/edit-file-category/edit-file-category.component.ts
  5. 25
      src/app/pages/license/file-category/file-category.component.html
  6. 66
      src/app/pages/license/file-category/file-category.component.ts

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

@ -7,42 +7,34 @@
</div>
<div class="content">
<p>证件名称: &nbsp;&nbsp;建设用地规划许可证</p>
<p>证件名称: &nbsp;&nbsp;{{data.licenseTypeName}}</p>
<div class="cutoffrule"></div>
<p>有效期类型: &nbsp;&nbsp;1523天</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 src="/api/Objects/sinochemweb/stationPhotos/175/timg.jpg" alt=""
(click)="viewImg('/api/Objects/sinochemweb/stationPhotos/175/timg.jpg')"></p>
<!-- <p>是否年检: &nbsp;&nbsp;是</p>
<div class="cutoffrule"></div> -->
<p>证件图片: &nbsp;&nbsp;<img *ngIf="data.imageUrl" [src]="data.imageUrl" (click)="viewImg(data.imageUrl)"></p>
<div class="cutoffrule"></div>
<p class="recordP">
<span>审核记录</span>
<span>
<span style="margin-right: 6px;">
审核次数:6
审核次数:{{auditList.length}}
</span>
<span>
驳回次数:2
驳回次数:{{getRejectNum()}}
</span>
</span>
</p>
<nz-timeline>
<nz-timeline-item>
<span style="margin-right: 12px;">2022.04.02</span>
<span>审核完成</span>
</nz-timeline-item>
<nz-timeline-item>
<span style="margin-right: 12px;">2022.04.02</span>
<span>审核完成</span>
</nz-timeline-item>
<nz-timeline-item>
<span style="margin-right: 12px;">2022.04.02</span>
<span>审核完成</span>
</nz-timeline-item>
<nz-timeline-item>
<span style="margin-right: 12px;">2022.04.02</span>
<span>审核完成</span>
<nz-timeline-item *ngFor="let item of auditList">
<span style="margin-right: 12px;">{{item.creationTime | date:"yyyy/MM/dd"}}</span>
<span *ngIf="item.auditStatus == 0"></span>
<span *ngIf="item.auditStatus == 1">审核中</span>
<span *ngIf="item.auditStatus == 2">审核通过</span>
<span *ngIf="item.auditStatus == 3">审核驳回</span>
<span *ngIf="item.auditStatus == 4">已撤销审核</span>
<span *ngIf="item.auditStatus == 5">审核完成</span>
</nz-timeline-item>
</nz-timeline>
<ng-template #soccerTemplate>

31
src/app/pages/license/file-category/details-file-category/details-file-category.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';
@Component({
selector: 'app-details-file-category',
templateUrl: './details-file-category.component.html',
@ -12,19 +13,42 @@ import Viewer from 'viewerjs';
export class DetailsFileCategoryComponent implements OnInit {
@Input() data?: any;
constructor(private modal: NzModalRef) { }
constructor(private modal: NzModalRef, private http: HttpClient) { }
ngOnInit(): void {
this.getAuditLogging()
}
auditList: any[] = [];
//获取审核记录
getAuditLogging() {
if (this.data.auditLogId == 0) {
return
}
let params = { id: this.data.auditLogId }
this.http.get(`/api/services/app/ContentAuditLog/Get`,{params}).subscribe((data: any)=>{
this.auditList = data.result.actionList || []
console.log(this.auditList)
})
}
//获取驳回次数
getRejectNum(): number {
let num = 0
this.auditList.forEach(item=>{
if (item.auditStatus == 3) {
num = num + 1
}
})
return num
}
destroyModal() {
this.modal.destroy({ data: 'this the result data' });
}
//查看图片
viewImg(url) {
// url.split('?')[0]
let dom = document.getElementById(`viewerjs`)
let pObjs = dom.childNodes;
let node = document.createElement("img")
@ -42,4 +66,5 @@ export class DetailsFileCategoryComponent implements OnInit {
node.click();
}, 0);
}
}

11
src/app/pages/license/file-category/edit-file-category/edit-file-category.component.html

@ -6,7 +6,7 @@
<i nz-icon nzType="close" nzTheme="outline" (click)="destroyModal()"></i>
</div>
<form nz-form [formGroup]="validateForm" class="form">
<p>证件名称: 建设用地规划许可证</p>
<p>证件名称: {{data2.licenseTypeName || ''}}</p>
<div class="cutoffrule"></div>
@ -14,8 +14,10 @@
<nz-form-item>
<nz-form-control>
<nz-select formControlName="type">
<nz-option nzValue="0" nzLabel="不适用"></nz-option>
<nz-select formControlName="type" [(ngModel)]="validatyType">
<nz-option nzValue="0" nzLabel="有"></nz-option>
<nz-option nzValue="1" nzLabel="无"></nz-option>
<nz-option nzValue="2" nzLabel="不适用"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
@ -24,8 +26,7 @@
<div class="uploadDivbox">
<div class="uploadDiv" style="margin-right: 12px;">
<img *ngIf="imageUrl" style="width: 100%;height: 100%;cursor: pointer;" [src]="imageUrl" alt=""
(click)="viewImg(imageUrl)">
<img *ngIf="data2 && data2.imageUrl" style="width: 100%;height: 100%;cursor: pointer;" [src]="data2.imageUrl" (click)="viewImg(imageUrl)">
<input *ngIf="!imageUrl" (change)="filechange($event)" class="fileinput" type="file" name="" id="">
<button *ngIf="!imageUrl" nz-button [nzLoading]=""><i nz-icon nzType="upload"
nzTheme="outline"></i>上传附件</button>

6
src/app/pages/license/file-category/edit-file-category/edit-file-category.component.ts

@ -23,12 +23,14 @@ export class EditFileCategoryComponent implements OnInit {
type: [null, [Validators.required]]
});
this.data2 = JSON.parse(JSON.stringify(this.data))
this.validatyType = (this.data2.validatyType).toString()
console.log(this.data2)
}
validatyType: string
isLongTerm = false
imageUrl = '/api/Objects/sinochemweb/stationPhotos/175/timg.jpg'
validityChange($event) {
console.log($event)
this.isLongTerm = $event
}
@ -70,6 +72,7 @@ export class EditFileCategoryComponent implements OnInit {
let dataObj = data as any;
let filePath: string = ObjectsSimpleService.baseUrl + dataObj.objectName;
this.imageUrl = filePath
this.data2.imageUrl = filePath
console.log('上传成功', filePath)
resolve('success')
});
@ -85,6 +88,7 @@ export class EditFileCategoryComponent implements OnInit {
let dataObj = value as any;
let filePath = dataObj.filePath
this.imageUrl = filePath
this.data2.imageUrl = filePath
console.log('上传成功', filePath)
});

25
src/app/pages/license/file-category/file-category.component.html

@ -17,19 +17,30 @@
<tbody id="table">
<tr *ngFor="let item of headerTable.data;let key = index">
<td>
<span style="margin-left: 25%;">证件名称</span>
<span style="margin-left: 25%;">{{item.licenseTypeName || ''}}</span>
</td>
<td>
<span *ngIf="item.validatyType == 0"></span>
<span *ngIf="item.validatyType == 1"></span>
<span *ngIf="item.validatyType == 2">不适用</span>
</td>
<td>
<img *ngIf="item.imageUrl" [src]="item.imageUrl" (click)="viewImg(item.imageUrl)">
</td>
<td>有效期类型</td>
<td>{{item.committedTime | date:"yyyy/MM/dd"}}<span *ngIf="!item.committedTime">未提交审核</span></td>
<td>
<img src="../../../../assets/images/bgImg.png" alt=""
(click)="viewImg('../../../../assets/images/bgImg.png')">
<span *ngIf="item.auditStatus == 0"></span>
<span *ngIf="item.auditStatus == 1">审核中</span>
<span *ngIf="item.auditStatus == 2">审核通过</span>
<span *ngIf="item.auditStatus == 3">审核驳回</span>
<span *ngIf="item.auditStatus == 4">未提交审核</span>
<span *ngIf="item.auditStatus == 5">审核完成</span>
</td>
<td>提交时间</td>
<td>审核状态</td>
<td class="operation">
<span class="blueColor" (click)="edit(item)">编辑</span>
<span class="blueColor" (click)="details(item)">详情</span>
<span class="blueColor">提交审核</span>
<span class="blueColor" (click)="cancelReview(item)" *ngIf="item.auditStatus === 1">撤销审核</span>
<span class="blueColor" (click)="submitReview(item)" *ngIf="item.auditStatus === 4">提交审核</span>
</td>
</tr>
</tbody>

66
src/app/pages/license/file-category/file-category.component.ts

@ -17,7 +17,7 @@ export class FileCategoryComponent implements OnInit {
constructor(private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient) { }
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 = []; //tabelData
tableScrollHeight
ngOnInit(): void {
@ -26,10 +26,21 @@ export class FileCategoryComponent 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('userdataOfgasstation'));
let params = { orgId: data.organization.id || "" }
this.http.get(`/api/services/app/StationFileLicense/GetStationList`,{params}).subscribe((info: any)=>{
this.list = info.result
console.log(info.result)
})
}
//查看图片
viewImg(url) {
// url.split('?')[0]
let dom = document.getElementById(`viewerjs`)
let pObjs = dom.childNodes;
let node = document.createElement("img")
@ -49,11 +60,10 @@ export class FileCategoryComponent implements OnInit {
}
dispose() {
console.log('处置')
}
edit(item) {
console.log('item', item)
const modal = this.modal.create({
nzContent: EditFileCategoryComponent,
nzViewContainerRef: this.viewContainerRef,
@ -71,34 +81,21 @@ export class FileCategoryComponent implements OnInit {
nzFooter: null,
nzClosable: false,
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise(resolve => {
let body = {
id: item.id,
name: instance.validateForm.value.name,
storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'),
maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'),
validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'),
organizationUnitId: item.organizationUnitId
}
// this.http.put('/api/services/app/FireEquipment/Update', body).subscribe(data => {
// resolve(data)
// this.message.create('success', '修改成功!');
// return true
// })
await new Promise(resolve => {
instance.data2.validatyType = Number(instance.validatyType)
this.http.post('/api/services/app/StationFileLicense/Create', instance.data2).subscribe(data => {
resolve(data);
this.getStationList();
this.message.create('success', '修改成功!');
return true
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
})
}
});
const instance = modal.getContentComponent();
modal.afterClose.subscribe(result => { });
}
details(item) {
console.log('item', item)
const modal = this.modal.create({
nzContent: DetailsFileCategoryComponent,
nzViewContainerRef: this.viewContainerRef,
@ -122,4 +119,23 @@ export class FileCategoryComponent implements OnInit {
const instance = modal.getContentComponent();
modal.afterClose.subscribe(result => { });
}
//提交审核
submitReview(item){
let params = { id: item.id }
this.http.post('/api/services/app/StationFileLicense/Commit', {},{params}).subscribe(data => {
this.message.create('success', '提交审核成功!');
this.getStationList();
})
}
//撤销审核
cancelReview(item){
let params = { id: item.id }
this.http.post('/api/services/app/StationFileLicense/Uncommit', {},{params}).subscribe(data => {
this.message.create('success', '撤销审核成功!');
this.getStationList();
})
}
}

Loading…
Cancel
Save