reportProficientList.vue
6.12 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
<template>
<div class="report-proficient-container">
<!-- 查询条件 -->
<el-card class="search-wrapper">
<div slot="header" class="flex justify-between">
<span>{{ $t('reportProficient.search.title') }}</span>
<div class="header-tools">
<el-button type="primary" size="small" @click="_exportFee">
<i class="el-icon-upload"></i>
{{ $t('reportProficient.export') }}
</el-button>
</div>
</div>
<el-row :gutter="20">
<el-col :span="6">
<el-select v-model="reportProficientInfo.conditions.feeTypeCd" @change="_changeReporficientFeeTypeCd"
placeholder="请选择收费类型" style="width:100%">
<el-option v-for="(item, index) in reportProficientInfo.feeTypeCds" :key="index" :label="item.name"
:value="item.statusCd">
</el-option>
</el-select>
</el-col>
<el-col :span="6">
<el-select v-model="reportProficientInfo.conditions.configId" placeholder="请选择收费项" style="width:100%">
<el-option v-for="(item, index) in reportProficientInfo.feeConfigDtos" :key="index" :label="item.feeName"
:value="item.configId">
</el-option>
</el-select>
</el-col>
<el-col :span="6">
<el-input :placeholder="_getReportProficientRoomName()" v-model="reportProficientInfo.conditions.objName">
</el-input>
</el-col>
<el-col :span="6">
<el-button type="primary" @click="_queryMethod">
<i class="el-icon-search"></i>
{{ $t('common.search') }}
</el-button>
<el-button @click="_resetMethod" style="margin-left: 10px;">
<i class="el-icon-refresh"></i>
{{ $t('common.reset') }}
</el-button>
</el-col>
</el-row>
</el-card>
<!-- 内容区域 -->
<el-card class="content-wrapper">
<el-tabs v-model="reportProficientInfo._currentTab" @tab-click="changeTab(reportProficientInfo._currentTab)">
<el-tab-pane :label="$t('reportProficient.roomFee')" name="reportProficientRoomFee">
<report-proficient-room-fee ref="reportProficientRoomFee" v-if="reportProficientInfo._currentTab === 'reportProficientRoomFee'"
:conditions="reportProficientInfo.conditions">
</report-proficient-room-fee>
</el-tab-pane>
<el-tab-pane :label="$t('reportProficient.carFee')" name="reportProficientCarFee">
<report-proficient-car-fee ref="reportProficientCarFee" v-if="reportProficientInfo._currentTab === 'reportProficientCarFee'"
:conditions="reportProficientInfo.conditions">
</report-proficient-car-fee>
</el-tab-pane>
</el-tabs>
</el-card>
<!-- 费用详情弹窗 -->
<view-fee-detail ref="viewFeeDetail"></view-fee-detail>
</div>
</template>
<script>
import { getDict } from '@/api/community/communityApi'
import { getFeeConfigList, exportReportFee } from '@/api/report/reportProficientApi'
import ReportProficientRoomFee from '@/components/report/reportProficientRoomFee'
import ReportProficientCarFee from '@/components/report/reportProficientCarFee'
import ViewFeeDetail from '@/components/report/viewFeeDetail'
export default {
name: 'ReportProficientList',
components: {
ReportProficientRoomFee,
ReportProficientCarFee,
ViewFeeDetail
},
data() {
return {
reportProficientInfo: {
_currentTab: 'reportProficientRoomFee',
feeTypeCds: [],
feeConfigDtos: [],
conditions: {
configId: '',
feeTypeCd: '',
objName: '',
objType: ''
}
}
}
},
created() {
this._initData()
this.changeTab(this.reportProficientInfo._currentTab)
},
methods: {
async _initData() {
// 获取费用类型字典
try {
const data = await getDict('pay_fee_config', 'fee_type_cd')
this.reportProficientInfo.feeTypeCds = data
} catch (error) {
console.error('获取费用类型失败:', error)
}
},
async _changeReporficientFeeTypeCd() {
try {
const params = {
page: 1,
row: 50,
feeTypeCd: this.reportProficientInfo.conditions.feeTypeCd,
valid: '1'
}
const { feeConfigs } = await getFeeConfigList(params)
this.reportProficientInfo.feeConfigDtos = feeConfigs
} catch (error) {
console.error('获取收费项失败:', error)
}
},
changeTab(tab) {
this.reportProficientInfo._currentTab = tab
setTimeout(() => {
this.$refs[`${this.reportProficientInfo._currentTab}`].open(this.reportProficientInfo.conditions)
},500)
},
_queryMethod() {
setTimeout(() => {
this.$refs[`${this.reportProficientInfo._currentTab}`].open(this.reportProficientInfo.conditions)
},500)
},
_resetMethod() {
this.reportProficientInfo.conditions = {
configId: '',
feeTypeCd: '',
objName: '',
objType: ''
}
this._queryMethod()
},
_getReportProficientRoomName() {
if (this.reportProficientInfo._currentTab === 'reportProficientRoomFee') {
return this.$t('reportProficient.search.roomPlaceholder')
}
return this.$t('reportProficient.search.carPlaceholder')
},
async _exportFee() {
try {
const objType = this.reportProficientInfo._currentTab === 'reportProficientRoomFee' ? '3333' : '6666'
const params = {
...this.reportProficientInfo.conditions,
objType,
pagePath: 'reportProficient'
}
const res = await exportReportFee(params)
this.$message.success(res.msg)
if (res.code === 0) {
this.$router.push('/pages/property/downloadTempFile?tab=下载中心')
}
} catch (error) {
console.error('导出失败:', error)
}
}
}
}
</script>
<style lang="scss" scoped>
.report-proficient-container {
padding: 20px;
.search-wrapper {
margin-bottom: 20px;
.header-tools {
float: right;
}
}
.content-wrapper {
margin-top: 20px;
}
}
</style>