commonApprovalRecord.vue
4.32 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
<template>
<a-spin :spinning="confirmLoading">
<a-card title="审批流程" :bordered="false">
<img style="width:100%;" :src="qrUrl" />
</a-card>
<a-card title="审批历史" :bordered="false">
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="false"
:loading="loading"
style="padding-top:20px;">
<span slot="action" slot-scope="text, record">
<a v-if="record.approvalUploadFileUrl " @click="handleAttachmentLook(record)">查看</a>
<a v-if="record.riskFlag && !showTask" @click="handleAttachmentModal(record)">查看</a>
</span>
</a-table>
</a-card>
<common-risk-modal ref="commonRiskModal" @ok="commonRiskModalOk"></common-risk-modal>
</a-spin>
</template>
<script>
// import { queryApprovalRecords,getApprovalStatusImg } from '@/api/configApi'
import {
// queryApprovalRecordsUseCredit,getApprovalStatusImgUseCredit,
queryTransRiskResult, queryApprovalTransDetail, getInputStreamByApplyNo } from '@/api/insys'
import { axios } from '@/utils/requestLocal'
import commonRiskModal from '@/views/modules/common/commonRiskModal'
export default {
name: 'personApprovalRecord',
props: {
strategyType: {//用户类型 1 进件 2 用信
type: Number,
default: null,
},
showTask:{
type: Boolean,
default: null,
}
},
components: {
commonRiskModal
},
data () {
return {
dataSource:[],
confirmLoading: false,
current: 3,
loading:false,
qrUrl:'',
columns: [
{
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'
}
],
}
},
methods: {
loadData(data){
if(this.strategyType == 2){
this.queryApprovalTransDetail({
applyNo: data.applyNo,
transNo: data.transNo
})
this.getInputStreamByApplyNo(data.applyNo)
}
},
// 审批历史
queryApprovalTransDetail(p) {
queryApprovalTransDetail(p).then(res => {
if(res.status.statusCode==0){
this.dataSource = res.result
}else{
this.$message.warning(res.status.statusReason)
}
})
},
// 审批流程
getInputStreamByApplyNo(p) {
getInputStreamByApplyNo(p).then(res => {
try {
const myBlob = new window.Blob([res], {type: 'image/jpeg'})
this.qrUrl = window.URL.createObjectURL(myBlob)
} catch (error) {
this.qrUrl = ''
this.$message.warning('获取审批流程失败')
}
})
},
// 自定义附件信息查看 图片 文件
handleAttachmentLook (record) {
window.open(record.approvalUploadFileUrl)
},
// 自定义附件信息查看 modal
handleAttachmentModal (record) {
let _p = { 'orderNo': this.uniqueNo }
queryTransRiskResult(_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>