vio_warning_info.js
3.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import {getViolationWarningInformation} from "@/api/casefile/violationWarningInformation";
import {listReplyApprovalProcess} from "@/api/casefile/replyApprovalProcess";
import {historyFromData} from '@/api/activiti/historyFormdata'
export default {
name: "violationWarningInformationInfo",
props: {
businessKey: {
type: String
},
idInfo: {
type: String
},
entryType: {
type: Number
},
},
data() {
return {
form: {},
fileEntityList: [],
open: false,
replyApprovalProcessList: [],
openImg: false,
img: [],
showPic: null,
picImage: null,
slide1: [],
videoSrc: [],
}
},
created() {
this.listData({dictType:"vio_warning"}).then(res=>{
this.caseType = res.rows;
});
this.init();
},
methods: {
getCaseType(type){
for(let i in this.caseType){
if(this.caseType[i].dictValue == type){
return this.caseType[i].dictLabel;
}
}
return type;
},
init() {
let id = this.idInfo.split(":");
if (id.length == 2) {
id = id[1];
}
getViolationWarningInformation(id).then(response => {
this.form = response.data.violationWarningInformation;
let files = JSON.stringify(response.data.uploadFiles);
this.fileEntityList = JSON.parse(files.replaceAll("filePath", "url").replaceAll("fileName", "name"));
this.fileEntityList.map(item => {
if (item.url.indexOf(".jpg") > -1 || item.url.indexOf(".png") > -1 || item.url.indexOf(".jpeg") > -1 || item.url.indexOf(".jpg") > -1) {
this.slide1.push(process.env.VUE_APP_BASE_API + item.url);
}
if (item.url.indexOf(".mp4") > -1 || item.url.indexOf(".avi") > -1) {
this.videoSrc.push(process.env.VUE_APP_BASE_API + item.url);
}
})
});
listReplyApprovalProcess({tableName: "violation_warning" + ":" + id}).then(response => {
let array = response.rows;
historyFromData("violation_warning" + ":" + id).then(response => {
let newRep = [];
let obj = response.data[0];
if(obj){
let data = {
reply:obj.controlValue,
replyPeople:obj.createBy,
replyTime:obj.createTime
};
newRep.push(data);
}
for(let j in array){
newRep.push(array[j]);
}
if(response.data.length - array.length == 2){
let obj = response.data[response.data.length -1];
let data = {
reply:obj.controlValue,
replyPeople:obj.createBy,
replyTime:obj.createTime
};
newRep.push(data);
}
this.replyApprovalProcessList = newRep;
this.$forceUpdate();
});
});
},
/** 文件下载 */
downloadFA(row) {
let name = row.name;
let url = row.url;
const a = document.createElement('a')
a.setAttribute('download', name)
a.setAttribute('target', '_blank')
a.setAttribute('href', process.env.VUE_APP_BASE_API + url);
a.click()
},
openImage(path) {
this.img = [];
this.openImg = true;
let files = path.split(",");
for(let i=0;i<files.length;i++){
this.img.push(files[i]);
}
},
downloadFile(path) {
window.location.href = process.env.VUE_APP_BASE_API + "/business/threestep/download?path=" + encodeURI(path);
},
showFile(path) {
return process.env.VUE_APP_BASE_API + path;
},
}
}