a42b3256
wuxw
HC小区管理系统前段vue版正在开发中
|
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
|
<template>
<div class="room-fee-container">
<el-row :gutter="20">
<el-col :span="6" class="text-left">
<el-select v-model="state" @change="changeState">
<el-option label="请选择状态" value="" />
<el-option label="有效" value="2008001" />
<el-option label="收费结束" value="2009001" />
</el-select>
</el-col>
</el-row>
<el-table :data="fees" class="margin-top" border>
<el-table-column label="房屋" prop="payerObjName" align="center" />
<el-table-column label="费用项目" prop="feeName" align="center" />
<el-table-column label="费用标识" prop="feeFlagName" align="center" />
<el-table-column label="费用类型" prop="feeTypeCdName" align="center" />
<el-table-column label="应收金额" prop="amountOwed" align="center" />
<el-table-column label="建账时间" prop="startTime" align="center" />
<el-table-column label="应收时间段" align="center">
<template slot-scope="scope">
{{ getRoomEndTime(scope.row) }}~<br />
{{ getRoomDeadlineTime(scope.row) }}
</template>
</el-table-column>
<el-table-column label="说明" align="center" width="150">
<template slot-scope="scope">
<div v-if="scope.row.computingFormula === '5005' || scope.row.computingFormula === '9009'">
<div>上期度数:{{ scope.row.preDegrees }}</div>
<div>本期度数:{{ scope.row.curDegrees }}</div>
<div>单价:{{ scope.row.mwPrice || scope.row.squarePrice }}</div>
<div>附加费:{{ scope.row.additionalAmount }}</div>
</div>
<div v-else-if="scope.row.computingFormula === '6006'">
<div>用量:{{ getRoomAttrValue(scope.row.feeAttrs, '390006') }}</div>
<div>单价:{{ scope.row.squarePrice }}</div>
<div>附加费:{{ scope.row.additionalAmount }}</div>
</div>
<div v-else-if="scope.row.feeTypeCd === '888800010017'">
<div>算法:{{ getRoomAttrValue(scope.row.feeAttrs, '390005') }}</div>
<div>用量:{{ getRoomAttrValue(scope.row.feeAttrs, '390003') }}</div>
</div>
<div v-else-if="scope.row.computingFormula === '4004'">
<div>费用根据实际情况而定</div>
</div>
<div v-else>
<div>单价:{{ scope.row.squarePrice }}</div>
<div v-if="scope.row.feeFlag === '1003006'">附加费:{{ scope.row.additionalAmount }}</div>
<div v-else>固定费:{{ scope.row.additionalAmount }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="状态" prop="stateName" align="center" />
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button size="mini" @click="toAdminFeeDetail(scope.row)">详情</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="margin-top">
<el-col :span="12" class="text-left">
<div>注意:应收结束时间 "-" 表示未到应收时间 或 收费已结束</div>
<div>应收金额为-1 一般为费用项公式设置出错请检查</div>
</el-col>
<el-col :span="4">
欠费小计:{{ totalAmount }}
</el-col>
<el-col :span="8">
<el-pagination :current-page="page.current" :page-size="page.size" :total="page.total"
layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
@current-change="handleCurrentChange" />
</el-col>
</el-row>
</div>
</template>
<script>
import { listAdminFee } from '@/api/fee/adminRoomFeeApi'
import {dateFormat} from '@/utils/dateUtil'
export default {
name: 'ARoomDetailRoomFee',
props: {
roomId: {
type: String,
default: ''
}
},
data() {
return {
fees: [],
state: '2008001',
totalAmount: 0,
page: {
current: 1,
size: 30,
total: 0
}
}
},
methods: {
open(ownerId, roomId) {
console.log(ownerId, roomId)
this.loadData()
},
async loadData() {
const params = {
page: this.page.current,
row: this.page.size,
payerObjId: this.roomId,
state: this.state
}
const res = await listAdminFee(params);
this.fees = res.fees
this.page.total = res.total
this.totalAmount = res.fees.reduce((sum, fee) => {
return sum + parseFloat(fee.amountOwed || 0)
}, 0).toFixed(2)
},
getRoomAttrValue(attrs, specCd) {
const attr = attrs.find(item => item.specCd === specCd)
return attr ? attr.value : ''
},
getRoomDeadlineTime(fee) {
if (fee.amountOwed == 0 && fee.endTime == fee.deadlineTime) {
return "-"
}
if (fee.state == '2009001') {
return "-"
}
return dateFormat(fee.deadlineTime)
},
getRoomEndTime(fee) {
if (fee.state == '2009001') {
return "-"
}
return dateFormat(fee.endTime)
},
changeState() {
this.loadData()
},
toAdminFeeDetail(fee) {
this.$router.push(`/pages/fee/adminFeeDetail?feeId=${fee.feeId}`)
},
handleSizeChange(val) {
this.page.size = val
this.loadData()
},
handleCurrentChange(val) {
this.page.current = val
this.loadData()
}
}
}
</script>
|