contractDetailFile.vue
1.89 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
<template>
<div class="margin-top">
<el-row class="margin-top-lg"></el-row>
<div class="margin-top">
<el-form :model="contractDetailFileInfo" label-width="120px" class="text-left">
<el-row>
<el-col :span="10">
<el-form-item :label="$t('contractDetailFile.relatedFiles')">
<div v-for="(file, index) in contractDetailFileInfo.files" :key="index" style="margin-left: 50px;">
<el-link type="primary" @click="_viewFile(file)">
{{ file.fileRealName }}
</el-link>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
</template>
<script>
import { queryContractFile } from '@/api/contract/contractDetailFileApi'
import { getCommunityId } from '@/api/community/communityApi'
export default {
name: 'ContractDetailFile',
data() {
return {
contractDetailFileInfo: {
files: [],
contractId: '',
roomNum: '',
allOweFeeAmount: '0'
},
pagination: {
page: 1,
row: 100
},
}
},
methods: {
open(data) {
this.contractDetailFileInfo.contractId = data.contractId
this._loadContractDetailFileData(1, this.pagination.row)
},
_loadContractDetailFileData(page, row) {
const params = {
contractId: this.contractDetailFileInfo.contractId,
page: page || 1,
row: row || this.pagination.row
}
queryContractFile(params).then(response => {
this.contractDetailFileInfo.files = response.data
}).catch(error => {
console.error('请求失败:', error)
})
},
_viewFile(file) {
window.open(file.fileSaveName)
}
},
created() {
this.communityId = getCommunityId()
}
}
</script>
<style scoped>
.margin-top {
margin-top: 20px;
}
.margin-top-lg {
margin-top: 30px;
}
</style>