commonApprovalRecord.vue
6.22 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<template>
<a-spin :spinning="confirmLoading">
<a-card title="审批流程" :bordered="false">
<div style="width: 100%; text-align: center">
<img :src="qrUrl" :onerror="errorImg01" />
</div>
</a-card>
<a-card title="审批历史" :bordered="false">
<a-table
ref="table"
size="middle"
bordered
:rowKey="(record, index) => index"
:columns="historicalApprovalData"
:dataSource="dataSource"
:pagination="false"
:loading="loading"
style="padding-top: 20px"
>
<span slot="xiangqing" slot-scope="text, record">
<a-button
type="link"
size="small"
@click="chakan(record)"
v-if="record.approvalRecordType == 'approval'"
icon="search"
style="font-size: 12px"
>查看</a-button
>
<span v-else-if="record.approvalRecordType == 'credit'">{{ record.approvalDesc }}</span>
<span v-else>--</span>
</span>
<span slot="action" slot-scope="text, record">
<a-button
type="link"
size="small"
@click="handleAttachmentModal(record)"
v-if="record.approvalRecordType == 'risk'"
icon="search"
style="font-size: 12px"
>查看</a-button
>
<span v-else>--</span>
</span>
</a-table>
</a-card>
<!-- <common-risk-modal ref="commonRiskModal" @ok="commonRiskModalOk"></common-risk-modal> -->
<common-risk-modal v-if="userType == 1" ref="commonRiskModal" @ok="commonRiskModalOk"></common-risk-modal>
<common-risk-modal2 v-else-if="userType == 2" ref="commonRiskModal" @ok="commonRiskModalOk"></common-risk-modal2>
<shenpiModal ref="shenpi"></shenpiModal>
</a-spin>
</template>
<script>
import { queryApprovalRecords, getApprovalStatusImg, queryCollResult, getCreditRiskResult } from '@/api/configApi'
import { axios } from '@/utils/requestLocal'
// import commonRiskModal from '@/views/modules/common/commonRiskModal'
import commonRiskModal from './commonRiskModal'
import commonRiskModal2 from './commonRiskModal2'
import shenpiModal from '../../../taskList-manage/modules/shenpiModal.vue'
export default {
name: 'personApprovalRecord',
props: {
userType: {
type: Number,
default: null,
},
applyNo: {
type: String,
default: null,
},
},
rowKey: {
type: String,
default: 'id',
},
components: {
commonRiskModal,
commonRiskModal2,
shenpiModal,
},
data() {
return {
dataSource: [],
confirmLoading: false,
current: 3,
loading: false,
qrUrl: '',
thatImg: 0,
errorImg01: 'this.src="' + require('@/assets/zanwu.jpg') + '"',
historicalApprovalData: [
{
title: '序号',
dataIndex: '',
key: 'rowIndex',
align: 'center',
width: 60,
customRender: function (t, r, index) {
return parseInt(index) + 1
},
},
{
title: '审批岗位',
align: 'center',
// width: 120,
dataIndex: 'approvalDepart',
},
{
title: '审批人员',
align: 'center',
// width: 120,
dataIndex: 'approvalUser',
},
{
title: '审批结果',
align: 'center',
// width: 120,
dataIndex: 'approvalResult',
},
{
title: '审批详情',
align: 'center',
// width: 120,
dataIndex: '',
scopedSlots: { customRender: 'xiangqing' },
},
// {
// title: '审批意见',
// align: 'center',
// // width: 120,
// dataIndex: 'approvalDesc'
// },
{
title: '审批时间',
align: 'center',
// width: 120,
dataIndex: 'approvalTime',
},
{
title: '审批报告',
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
align: 'center',
width: 100,
fixed: 'right',
},
],
}
},
methods: {
loadData() {
let _p = { applyNo: this.applyNo }
// 审批历史
queryApprovalRecords(_p).then((res) => {
console.log(res)
if (res.status.statusCode == 0) {
this.dataSource = res.result
} else {
this.$message.warning(res.status.statusReason)
}
})
// 审批状态
getApprovalStatusImg(_p).then((res) => {
try {
const myBlob = new window.Blob([res], { type: 'image/jpeg' })
this.qrUrl = window.URL.createObjectURL(myBlob)
this.thatImg = 1
console.log(this.qrUrl)
} catch (error) {
this.qrUrl = ''
this.thatImg = 0
this.$message.warning('获取审批流程失败')
}
})
},
chakan(record) {
this.$refs.shenpi.look(record)
},
// 自定义附件信息查看 图片 文件
handleAttachmentLook(record) {
window.open(record.approvalUploadFileUrl)
},
// 自定义附件信息查看 modal
handleAttachmentModal(record) {
// let _p = { applyNo: 'HYD_CMM_ONLINE_20200331_16504111171' }
console.log(record)
let _p = { applyTransNo: record.approvalTransNo }
getCreditRiskResult(_p).then((res) => {
if (res.status.statusCode == 0) {
this.$refs.commonRiskModal.edit(res.result)
this.$refs.commonRiskModal.disableSubmit = false
this.$refs.commonRiskModal.onlyread = true
} else {
this.$message.warning(res.status.statusReason)
}
})
},
handleError(e) {
e.currentTarget.src = '@/assets/zanwu.jpg'
},
commonRiskModalOk() {
var arr = [
{
key: 'key1',
val: {
nodeName: '',
ruleValue: '',
},
},
{
key: 'key2',
val: {
nodeName: '',
ruleValue: '',
},
},
{
key: 'key3',
val: {
nodeName: '',
ruleValue: '',
},
},
]
},
},
}
</script>
<style>
</style>