24d3590f
wuxw
房屋收费页面开发完成
|
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
|
<template>
<el-card v-if="payFeeUserAccountInfo.accountList.length > 0" class="account-card">
<div slot="header" class="flex justify-between">
<span>{{ $t('payFeeUserAccount.title') }}</span>
<el-button type="primary" size="small" class="float-right" @click="_queryPayFeeUserAccount">
<i class="el-icon-refresh"></i>
{{ $t('common.refresh') }}
</el-button>
</div>
<el-table :data="payFeeUserAccountInfo.accountList" border style="width: 100%" v-loading="loading">
<el-table-column width="55" align="center">
<template slot-scope="scope">
<el-radio v-model="payFeeUserAccountInfo.selectAccountIds" :label="scope.row.acctId"
@change="_computeFeeUserAmount(scope.row)"></el-radio>
</template>
</el-table-column>
<el-table-column prop="acctTypeName" :label="$t('payFeeUserAccount.accountType')"
align="center"></el-table-column>
<el-table-column prop="acctName" :label="$t('payFeeUserAccount.accountName')" align="center"></el-table-column>
<el-table-column :label="$t('payFeeUserAccount.accountAmount')" align="center">
<template slot-scope="scope">
{{ scope.row.amount }} {{ $t('payFeeUserAccount.yuan') }}
</template>
</el-table-column>
<el-table-column :label="$t('common.operation')" align="center" width="150">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="_openAddUserAmountModal(scope.row)">
<i class="el-icon-plus"></i>
{{ $t('payFeeUserAccount.preSave') }}
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
<script>
import { getCommunityId } from '@/api/community/communityApi'
import { queryCommunityOwnerAccount } from '@/api/fee/batchPayFeeOrderApi'
export default {
name: 'PayFeeUserAccount',
data() {
return {
loading: false,
payFeeUserAccountInfo: {
accountList: [],
feeId: '',
ownerId: '',
communityId: '',
quanAccount: false,
selectAccountIds: [],
integralAmount: '',
cashAmount: '',
couponAmount: ''
}
}
},
created() {
this.payFeeUserAccountInfo.communityId = getCommunityId()
},
methods: {
async _listUserAccount(page = 1, rows = 20) {
this.loading = true
try {
const params = {
page,
row: rows,
feeId: this.payFeeUserAccountInfo.feeId,
ownerId: this.payFeeUserAccountInfo.ownerId,
communityId: this.payFeeUserAccountInfo.communityId
}
const res = await queryCommunityOwnerAccount(params)
if (res.code === 0) {
this.payFeeUserAccountInfo.accountList = res.data || []
}
} catch (error) {
console.error('请求失败:', error)
} finally {
this.loading = false
}
},
_queryPayFeeUserAccount() {
this._listUserAccount()
},
_openAddUserAmountModal(userAccount) {
window.open(`/#/pages/owner/ownerDetail?ownerId=${userAccount.objId}¤tTab=ownerDetailAccount`)
},
_computeFeeUserAmount(acct) {
let _totalUserAmount = 0.0
let _selectAccount = []
this.payFeeUserAccountInfo.accountList.forEach(item => {
if (acct.acctId === item.acctId && item.amount != 0) {
_totalUserAmount += parseFloat(item.amount)
_selectAccount.push(item)
this.payFeeUserAccountInfo.cashAmount = item.amount
}
})
this.$emit('changeUserAmountPrice', {
totalUserAmount: _totalUserAmount,
accountList: this.payFeeUserAccountInfo.accountList,
integralAmount: 0,
cashAmount: this.payFeeUserAccountInfo.cashAmount,
couponAmount: 0,
selectAccount: _selectAccount
})
},
open(params) {
this.payFeeUserAccountInfo = {
...this.payFeeUserAccountInfo,
...params
}
this._listUserAccount()
},
refresh() {
this._listUserAccount()
},
refreshAndChoose() {
this.payFeeUserAccountInfo.accountList = []
this.payFeeUserAccountInfo.selectAccountIds = []
this._listUserAccount()
setTimeout(() => {
this.payFeeUserAccountInfo.accountList.forEach(item => {
if (item.acctType === '2003') {
this.payFeeUserAccountInfo.selectAccountIds.push(item.acctId)
}
})
}, 2000)
},
clear() {
this.payFeeUserAccountInfo.accountList = []
this.payFeeUserAccountInfo.selectAccountIds = []
}
}
}
</script>
<style lang="scss" scoped>
.account-card {
margin-bottom: 20px;
}
</style>
|