commonApprovalRecord.vue
4.11 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
<template>
<a-spin :spinning="confirmLoading">
<a-card title="审批流程" :bordered="false" class="scoped-approval">
<img style="width:100%;" :src="qrUrl" />
</a-card>
<a-card title="审批历史" :bordered="false">
<a-table ref="table" size="middle" bordered rowKey="id" :columns="historicalApprovalData" :dataSource="dataSource" :pagination="false" :loading="loading" style="padding-top:20px;">
<span slot="action" slot-scope="text, record">
<a v-show="record.approvalUploadFileUrl" @click="handleAttachmentLook(record)">查看</a>
<a v-show="record.riskFlag" @click="handleAttachmentModal(record)">查看</a>
</span>
</a-table>
</a-card>
<common-risk-modal ref="commonRiskModal" @ok="commonRiskModalOk"></common-risk-modal>
</a-spin>
</template>
<script>
import { getActionImg, queryCollResult } from '@/api/configApi'
import { queryApprovalTransDetail } from '@/api/insys'
import commonRiskModal from '@/views/modules/common/commonRiskModal'
export default {
name: 'personApprovalRecord',
props: {
userType: {
type: Number,
default: null,
},
creditApplyNo: {
type: String,
default: null,
}
},
components: {
commonRiskModal
},
data () {
return {
dataSource: [],
confirmLoading: false,
current: 3,
loading: false,
qrUrl: '',
historicalApprovalData: [
{
title: '序号',
dataIndex: '',
key: 'rowIndex',
align: 'center',
width: 60,
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{
title: '审批岗位',
align: 'center',
width: '100px',
dataIndex: 'approvalRoleCode'
},
{
title: '审批人员',
align: 'center',
width: '100px',
dataIndex: 'approvalUserName'
},
{
title: '审批结果',
align: 'center',
width: '100px',
dataIndex: 'approvalResultStr'
},
{
title: '审批意见',
align: 'center',
width: '100px',
dataIndex: 'approvalNote'
},
{
title: '审批时间',
align: 'center',
dataIndex: 'updateTime'
},
{
title: '审批报告',
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
align: 'center',
width: 100,
fixed: 'right'
}
],
}
},
created () { },
methods: {
loadData () {
// let _p = {'applyNo':'P_2020011018928JOH'} // 测试用 写死的
let _p = { 'transNo': this.creditApplyNo }
// 审批历史
queryApprovalTransDetail(_p).then(res => {
console.log(res)
if (res.status.statusCode == 0) {
this.dataSource = res.result
} else {
this.$message.warning(res.status.statusReason)
}
})
// 审批状态
let _p1 = `/approval/admin/model/getInputStreamByApplyNo/${this.creditApplyNo}`
getActionImg(_p1).then(res => {
if (res.status.statusCode == -1) {
this.$message.warning(res.status.statusReason)
} else {
const myBlob = new window.Blob([res], { type: 'image/jpeg' })
this.qrUrl = window.URL.createObjectURL(myBlob)
}
})
},
// 自定义附件信息查看 图片 文件
handleAttachmentLook (record) {
window.open(record.approvalUploadFileUrl)
},
// 自定义附件信息查看 modal
handleAttachmentModal (record) {
// let _p = { applyNo: 'HYD_CMM_ONLINE_20200331_16504111171' }
let _p = { applyNo: this.applyNo }
queryCollResult(_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)
}
})
},
commonRiskModalOk () {
}
}
}
</script>
<style>
</style>