Browse Source

[完善]申诉增加字段

beijing
邵佳豪 2 years ago
parent
commit
5114565da8
  1. 1
      src/app/pages/audit/audit-ing/appeal-details/appeal-details.component.scss
  2. 7
      src/app/pages/audit/audit-ing/audit-dispose/audit-dispose.component.scss
  3. 14
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.html
  4. 383
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts

1
src/app/pages/audit/audit-ing/appeal-details/appeal-details.component.scss

@ -68,6 +68,7 @@
.appealData { .appealData {
display: flex; display: flex;
color: #C4E2FC; color: #C4E2FC;
margin: 12px 0;
.name { .name {
width: 15.5%; width: 15.5%;

7
src/app/pages/audit/audit-ing/audit-dispose/audit-dispose.component.scss

@ -93,6 +93,7 @@
.appealData { .appealData {
display: flex; display: flex;
color: #C4E2FC; color: #C4E2FC;
margin: 12px 0;
.name { .name {
width: 12.5%; width: 12.5%;
@ -104,11 +105,13 @@
overflow: hidden; overflow: hidden;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
span{
span {
margin-bottom: 3px; margin-bottom: 3px;
cursor: pointer; cursor: pointer;
} }
span:hover{
span:hover {
text-decoration: underline; text-decoration: underline;
} }
} }

14
src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.html

@ -54,7 +54,7 @@
<ng-container *ngIf="!data.positive; else elseTemplate"> <ng-container *ngIf="!data.positive; else elseTemplate">
<span *ngIf="data.appealStatus == 5" style="color: #4BFFD4;">申诉成功 ( 处理人 : {{data.handleUserName}}&nbsp; <span *ngIf="data.appealStatus == 5" style="color: #4BFFD4;">申诉成功 ( 处理人 : {{data.handleUserName}}&nbsp;
处理时间 : {{data.lastModificationTime | 处理时间 : {{data.lastModificationTime |
date:"yyyy-MM-dd HH:mm:ss"}} ) </span> date:"yyyy-MM-dd HH:mm:ss"}} ) </span>
<span style="color: #4BFFD4;cursor: default;">已进行误报处置</span> <span style="color: #4BFFD4;cursor: default;">已进行误报处置</span>
</ng-container> </ng-container>
<ng-template #elseTemplate> <ng-template #elseTemplate>
@ -105,7 +105,7 @@
<textarea <textarea
*ngIf="!data.handleTime && isSubmit && (data.appealStatus == 0 || data.appealStatus == 3 || data.appealStatus == 4)" *ngIf="!data.handleTime && isSubmit && (data.appealStatus == 0 || data.appealStatus == 3 || data.appealStatus == 4)"
[(ngModel)]="content"></textarea> [(ngModel)]="content"></textarea>
<span *ngIf="data.handleTime">{{content}}</span> <span *ngIf="data.handleTime && content">{{content}}</span>
</div> </div>
<div class="disposeTime" *ngIf="data.handleTime"> <div class="disposeTime" *ngIf="data.handleTime">
<span style="margin-right: 12px;"> <span style="margin-right: 12px;">
@ -115,5 +115,13 @@
处置时间:{{data.handleTime|date:"yyyy-MM-dd HH:mm:ss"}} 处置时间:{{data.handleTime|date:"yyyy-MM-dd HH:mm:ss"}}
</span> </span>
</div> </div>
<div class="disposeTime" *ngIf="data.appealStatus == 1">
<span style="color: #4BFFD4;cursor: default;">
<span>申诉人:</span>
<span style="margin-right: 12px;">{{data.appealLog.creatorUser.name}}</span>
<span>申诉时间:</span>
<span>{{data.appealLog.committedTime | date:"yyyy-MM-dd HH:mm:ss"}}</span>
</span>
</div>
</div> </div>
</div> </div>

383
src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts

@ -1,190 +1,206 @@
import { HttpClient } from '@angular/common/http'; import { HttpClient } from "@angular/common/http";
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input } from "@angular/core";
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { DomSanitizer } from '@angular/platform-browser'; import { DomSanitizer } from "@angular/platform-browser";
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from "ng-zorro-antd/message";
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; import { NzModalRef, NzModalService } from "ng-zorro-antd/modal";
import { NzTreeModule } from 'ng-zorro-antd/tree'; import { NzTreeModule } from "ng-zorro-antd/tree";
import { ObjectsSimpleService } from 'src/app/service/objectsSimple.service'; import { ObjectsSimpleService } from "src/app/service/objectsSimple.service";
import Viewer from 'viewerjs'; import Viewer from "viewerjs";
@Component({ @Component({
selector: 'app-get-out-of-line-details', selector: "app-get-out-of-line-details",
templateUrl: './get-out-of-line-details.component.html', templateUrl: "./get-out-of-line-details.component.html",
styleUrls: ['./get-out-of-line-details.component.scss'] styleUrls: ["./get-out-of-line-details.component.scss"],
}) })
export class GetOutOfLineDetailsComponent implements OnInit { export class GetOutOfLineDetailsComponent implements OnInit {
@Input() data: any @Input() data: any;
constructor(private objectsSrv: ObjectsSimpleService, private fb: FormBuilder, private http: HttpClient, private message: NzMessageService, private modal: NzModalService, private initialModal: NzModalRef, private sanitizer: DomSanitizer,private openmodal: NzModalRef) { } constructor(
private objectsSrv: ObjectsSimpleService,
private fb: FormBuilder,
private http: HttpClient,
private message: NzMessageService,
private modal: NzModalService,
private initialModal: NzModalRef,
private sanitizer: DomSanitizer,
private openmodal: NzModalRef
) {}
imgUrl: string;
vedioUrl: string;
content;
details;
imgUrl: string isMisinformation: boolean = false; //误报按钮的显隐
vedioUrl: string
content
details
isImage = true; //传过来的文件是否是图片
fileUrl;
isMisinformation: boolean = false//误报按钮的显隐 isLicenseWarning = false;
isSubmit;
isImage = true//传过来的文件是否是图片
fileUrl
isLicenseWarning = false
isSubmit
ngOnInit(): void { ngOnInit(): void {
console.log("预警信息", this.data);
console.log('预警信息', this.data) if (this.data.violation.violationType == "证照资质") {
this.isLicenseWarning = true;
if (this.data.violation.violationType == '证照资质') {
this.isLicenseWarning = true
} else { } else {
this.isLicenseWarning = false this.isLicenseWarning = false;
} }
this.details = this.data.content1;
this.details = this.data.content1 this.vedioUrl = this.data.violateVideo;
this.vedioUrl = this.data.violateVideo this.content = this.data.handleRecord;
this.content = this.data.handleRecord this.imgUrl = this.data.violateImage;
this.imgUrl = this.data.violateImage
if (this.imgUrl) { if (this.imgUrl) {
if (this.getFileType(this.imgUrl) == 'img') { if (this.getFileType(this.imgUrl) == "img") {
this.isImage = true this.isImage = true;
} else { } else {
this.isImage = false this.isImage = false;
if (this.getFileType(this.imgUrl) == 'word') { if (this.getFileType(this.imgUrl) == "word") {
let arr = this.imgUrl.split('.') let arr = this.imgUrl.split(".");
arr[arr.length - 1] = 'pdf' arr[arr.length - 1] = "pdf";
this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl(arr.join('.')); this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl(
} else if (this.getFileType(this.imgUrl) == 'pdf') { arr.join(".")
this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.imgUrl); );
} else if (this.getFileType(this.imgUrl) == "pdf") {
this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl(
this.imgUrl
);
} }
} }
} }
let loginUserInfo;
let loginUserInfo if (sessionStorage.getItem("isGasStation") == "true") {
if (sessionStorage.getItem('isGasStation') == 'true') { loginUserInfo = JSON.parse(
loginUserInfo = JSON.parse(sessionStorage.getItem('userdataOfgasstation')) sessionStorage.getItem("userdataOfgasstation")
);
} else { } else {
loginUserInfo = JSON.parse(sessionStorage.getItem('userdata')) loginUserInfo = JSON.parse(sessionStorage.getItem("userdata"));
} }
if (loginUserInfo.userName == 'admin' || sessionStorage.getItem('isGasStation') == 'true') { if (
this.isSubmit = true loginUserInfo.userName == "admin" ||
sessionStorage.getItem("isGasStation") == "true"
) {
this.isSubmit = true;
} else { } else {
this.isSubmit = false this.isSubmit = false;
} }
console.log('this.isSubmit', this.isSubmit) console.log("this.isSubmit", this.isSubmit);
if (loginUserInfo.permissions.find((item) => { if (
return item.name == 'Data.Violation.Positive.Censor' loginUserInfo.permissions.find((item) => {
}) && this.data.violation.eventSystemName.indexOf("证照有效期") == -1) { return item.name == "Data.Violation.Positive.Censor";
this.isMisinformation = true }) &&
this.data.violation.eventSystemName.indexOf("证照有效期") == -1
) {
this.isMisinformation = true;
} else { } else {
this.isMisinformation = false this.isMisinformation = false;
} }
} }
fileList = [] fileList = [];
isLoadingSave: boolean = false isLoadingSave: boolean = false;
uploadIndex: string uploadIndex: string;
filechange(e) { filechange(e) {
this.isLoadingSave = true this.isLoadingSave = true;
let file = e.target.files[0] || null //获取上传的文件 let file = e.target.files[0] || null; //获取上传的文件
this.openFileSelect(file, `stationPhotos/${this.data.gasStation.id}/appealFile/${this.data.id}`) this.openFileSelect(
file,
`stationPhotos/${this.data.gasStation.id}/appealFile/${this.data.id}`
);
} }
//设置文件路径并上传 //设置文件路径并上传
postFilePath postFilePath;
async openFileSelect(file: File, extensionPath: string) { async openFileSelect(file: File, extensionPath: string) {
this.postFilePath = extensionPath; this.postFilePath = extensionPath;
let fileSize = file.size || null //上传文件的总大小 let fileSize = file.size || null; //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB 超过5MB要分块上传 let shardSize = 5 * 1024 * 1024; //5MB 超过5MB要分块上传
if (fileSize >= shardSize) // 超过5MB要分块上传 if (fileSize >= shardSize) {
{ // 超过5MB要分块上传
await this.postFileByMul(file); await this.postFileByMul(file);
} } //普通上传
else //普通上传 else {
{
await this.postFile(file); await this.postFile(file);
} }
} }
//上传文件 //上传文件
async postFile(file: File) { async postFile(file: File) {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
this.objectsSrv.postFile(this.postFilePath, file).subscribe(data => { this.objectsSrv.postFile(this.postFilePath, file).subscribe((data) => {
let dataObj = data as any; let dataObj = data as any;
let filePath: string = ObjectsSimpleService.baseUrl + dataObj.objectName; let filePath: string =
this.fileList.push(filePath) ObjectsSimpleService.baseUrl + dataObj.objectName;
this.isLoadingSave = false this.fileList.push(filePath);
resolve('success') this.isLoadingSave = false;
resolve("success");
}); });
}) });
} }
/** /**
* *
* @param file * @param file
*/ */
postFileByMul(file: File) { postFileByMul(file: File) {
this.objectsSrv.postFile_MultipartUpload(this.postFilePath, file).then((value) => { this.objectsSrv
let dataObj = value as any; .postFile_MultipartUpload(this.postFilePath, file)
let filePath = dataObj.filePath .then((value) => {
this.fileList.push(filePath) let dataObj = value as any;
this.isLoadingSave = false let filePath = dataObj.filePath;
}); this.fileList.push(filePath);
this.isLoadingSave = false;
});
} }
lookfile(item) { lookfile(item) {
if (!item) { if (!item) {
return return;
} }
if (this.getFileType(item) == 'word') { if (this.getFileType(item) == "word") {
let arr = item.split('.') let arr = item.split(".");
arr[arr.length - 1] = 'pdf' arr[arr.length - 1] = "pdf";
window.open(arr.join('.')) window.open(arr.join("."));
} else if (this.getFileType(item) == 'pdf') { } else if (this.getFileType(item) == "pdf") {
window.open(item) window.open(item);
} else { } else {
this.viewImg(item) this.viewImg(item);
} }
} }
delete(fileList, key) { delete(fileList, key) {
this.modal.confirm({ this.modal.confirm({
nzTitle: `确定要删除这个文件吗?`, nzTitle: `确定要删除这个文件吗?`,
nzOkText: '确定', nzOkText: "确定",
nzOkType: 'primary', nzOkType: "primary",
nzOnOk: () => { nzOnOk: () => {
fileList.splice(key, 1) fileList.splice(key, 1);
}, },
nzCancelText: '取消' nzCancelText: "取消",
}); });
} }
//查看图片 //查看图片
viewImg(url) { viewImg(url) {
let dom = document.getElementById(`viewerjs`) let dom = document.getElementById(`viewerjs`);
let pObjs = dom.childNodes; let pObjs = dom.childNodes;
let node = document.createElement("img") let node = document.createElement("img");
node.style.display = "none"; node.style.display = "none";
node.src = url; node.src = url;
node.id = 'img' node.id = "img";
dom.appendChild(node) dom.appendChild(node);
setTimeout(() => { setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), { let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden: () => { hidden: () => {
dom.removeChild(pObjs[0]); dom.removeChild(pObjs[0]);
viewer.destroy(); viewer.destroy();
} },
}); });
node.click(); node.click();
}, 0); }, 0);
@ -192,85 +208,101 @@ export class GetOutOfLineDetailsComponent implements OnInit {
//获取文件格式 //获取文件格式
getFileType(name: string): string { getFileType(name: string): string {
let suffix 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')) { if (
suffix = 'img' name.substring(name.length - 4).includes("png") ||
} else if (name.substring(name.length - 4).includes('doc') || name.substring(name.length - 4).includes('docx')) { name.substring(name.length - 4).includes("jpg") ||
suffix = 'word' name.substring(name.length - 4).includes("jpeg") ||
} else if (name.substring(name.length - 4).includes('pdf')) { name.substring(name.length - 4).includes("webp")
suffix = 'pdf' ) {
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 return suffix;
} }
selectedType: string = "img";
selectedType: string = 'img'
contentType(type) { contentType(type) {
this.selectedType = type this.selectedType = type;
} }
submit() { submit() {
let body = { let body = {
id: this.data.id, id: this.data.id,
handleRecord: this.content handleRecord: this.content,
} };
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http
this.message.create('success', '处置成功!'); .post("/api/services/app/ViolateRecord/HandleViolateRecord", body)
this.data.handleTime = new Date() .subscribe((data) => {
this.data.handleStateStr = '已处置' this.message.create("success", "处置成功!");
this.data.handleRecord = this.content this.data.handleTime = new Date();
}) this.data.handleStateStr = "已处置";
this.data.handleRecord = this.content;
});
} }
//误报 //误报
misinformation() { misinformation() {
this.modal.confirm({ this.modal.confirm({
nzTitle: '判定该预警为误报吗?', nzTitle: "判定该预警为误报吗?",
nzOkText: '确定', nzOkText: "确定",
nzOkType: 'primary', nzOkType: "primary",
nzOnOk: () => { nzOnOk: () => {
let body = { let body = {
id: this.data.id, id: this.data.id,
positive: false positive: false,
} };
this.http.post('/api/services/app/ViolateRecord/CensorViolateRecord', body).subscribe(data => { this.http
this.message.create('success', '处置成功!'); .post("/api/services/app/ViolateRecord/CensorViolateRecord", body)
// this.data.handleTime = new Date() .subscribe(
this.initialModal.triggerOk() (data) => {
}, err => { this.message.create("success", "处置成功!");
this.message.create('warning', '处置失败,请联系管理员!'); // this.data.handleTime = new Date()
}) this.initialModal.triggerOk();
},
(err) => {
this.message.create("warning", "处置失败,请联系管理员!");
}
);
}, },
nzCancelText: '取消', nzCancelText: "取消",
nzOnCancel: () => console.log('Cancel') nzOnCancel: () => console.log("Cancel"),
}) });
} }
// 申诉 // 申诉
isAppeal isAppeal;
appealValue appealValue;
appeal() { appeal() {
this.isAppeal = true this.isAppeal = true;
} }
handleOk() { handleOk() {
let body = { let body = {
appealReason: this.appealValue, appealReason: this.appealValue,
appealAttachments: this.fileList appealAttachments: this.fileList,
} };
this.http.post('/api/services/app/ViolateRecord/Appeal', body, { this.http
params: { .post("/api/services/app/ViolateRecord/Appeal", body, {
id: this.data.id params: {
} id: this.data.id,
}).subscribe(data => { },
this.message.create('success', '申诉提交成功'); })
this.isAppeal = false; .subscribe(
this.data.appealStatus = 1 (data: any) => {
}, err => { this.message.create("success", "申诉提交成功");
this.message.create('warning', '申诉提交失败,请联系管理员!'); this.isAppeal = false;
}) this.data.appealStatus = 1;
this.data.appealLog = data.result.appealLog;
},
(err) => {
this.message.create("warning", "申诉提交失败,请联系管理员!");
}
);
} }
handleCancel(): void { handleCancel(): void {
@ -278,19 +310,24 @@ export class GetOutOfLineDetailsComponent implements OnInit {
} }
Unappeal() { Unappeal() {
this.http.post('/api/services/app/ViolateRecord/Unappeal', null, { this.http
params: { .post("/api/services/app/ViolateRecord/Unappeal", null, {
id: this.data.id params: {
} id: this.data.id,
}).subscribe(data => { },
this.message.create('success', '申诉撤销成功'); })
this.data.appealStatus = 4 .subscribe(
}, err => { (data) => {
this.message.create('warning', '申诉撤销失败,请联系管理员!'); this.message.create("success", "申诉撤销成功");
}) this.data.appealStatus = 4;
},
(err) => {
this.message.create("warning", "申诉撤销失败,请联系管理员!");
}
);
} }
closeModel(){ closeModel() {
this.openmodal.close() this.openmodal.close();
} }
} }

Loading…
Cancel
Save