monthlyStatementList.vue
8.62 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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<template>
<div class="">
<el-dialog
v-model="showOpen" title="月结缴费" :close-on-click-modal="true" width="80%"
align-center @close="close"
>
<!-- 搜索区域 -->
<div class="from-Card">
<el-form ref="queryRef" size="small" :model="queryParams" :inline="true" label-position="top">
<!-- <el-row style="width: 100%;">-->
<!-- <!– <el-col :span="8">–>-->
<!-- <!– <el-form-item label="结算日期" prop="newTime">–>-->
<!-- <!– <el-date-picker–>-->
<!-- <!– v-model="newTime"–>-->
<!-- <!– :disabled-date="disablesDate"–>-->
<!-- <!– type="daterange"–>-->
<!-- <!– value-format="YYYY-MM-DD"–>-->
<!-- <!– range-separator="至"–>-->
<!-- <!– start-placeholder="开始时间"–>-->
<!-- <!– end-placeholder="结束时间"–>-->
<!-- <!– style="width: 100%;"–>-->
<!-- <!– :clearable="false"–>-->
<!-- <!– @change="searchFN"–>-->
<!-- <!– />–>-->
<!-- <!– </el-form-item>–>-->
<!-- <!– </el-col>–>-->
<!-- <div class="po-r-btns">-->
<!-- <el-button size="small" type="primary" icon="Search" @click="searchFN">查询</el-button>-->
<!-- <el-button size="small" icon="Refresh" @click="resetQuery">重置</el-button>-->
<!-- </div>-->
<!-- </el-row>-->
</el-form>
<el-row justify="space-between">
<div>
<el-button
color="#13B5B1" style="--el-color-black:#fff;" :disabled="show" type="warning"
:icon="DocumentChecked" @click="batchSubmit"
>生成月结</el-button>
</div>
</el-row>
</div>
<div class="table">
<el-table
v-loading="loading" :data="list" border style="width: 100%" :row-class-name="tableRowClassName"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column
label="结算编号" align="center" prop="content.wfCode" min-width="100"
:show-overflow-tooltip="true"
/>
<el-table-column label="缴费名称" align="center" prop="content.name" min-width="140" :show-overflow-tooltip="true" />
<el-table-column
label="缴费单位" align="center" prop="content.memberName" min-width="300"
:show-overflow-tooltip="true"
/>
<el-table-column
label="人数合计" align="center" prop="content.personCount" min-width="90"
:show-overflow-tooltip="true"
/>
<el-table-column
label="新会员" align="center" prop="content.newPersonCount" min-width="80"
:show-overflow-tooltip="true"
/>
<el-table-column
label="续费" align="center" prop="content.oldPersonCount" min-width="80"
:show-overflow-tooltip="true"
/>
<el-table-column
label="年限" align="center" prop="content.totalYear" min-width="80"
:show-overflow-tooltip="true"
/>
<el-table-column label="费用合计" align="center" prop="content.allFee" min-width="80" :show-overflow-tooltip="true" />
<el-table-column label="提交日期" align="center" prop="content.commitTime" min-width="100">
<template #default="scope">
<span>{{ parseTime(scope.row.content.commitTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="审核日期" align="center" prop="content.commitTime" min-width="100">
<template #default="scope">
<span>{{ parseTime(scope.row.overDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="审核状态" align="center" prop="auditStatus" min-width="90">
<template #default="props">
<div v-if="props.row.auditStatus == 0">
审核中
</div>
<div v-if="props.row.auditStatus == 1" class="text-success">
审核通过
</div>
<div v-if="props.row.auditStatus == 2" class="text-danger">
审核拒绝
</div>
<div v-if="props.row.auditStatus == 3" class="text-warning">
已撤回
</div>
</template>
</el-table-column>
</el-table>
<div v-show="!show" class="totalCost">
人数合计:<span>{{ statistical.personCount }} 人</span>
年限合计:<span>{{ statistical.totalYear }} 年</span>
费用合计:<span>{{ statistical.totalCost?.toFixed(2) }} 元</span>
</div>
<pagination
v-show="total > 0"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
:total="total"
@pagination="initData"
/>
</div>
</el-dialog>
</div>
</template>
<script setup>
import { getCurrentInstance, toRefs, ref } from 'vue'
import { reactive } from '@vue/runtime-core'
import { getWaitYueJieInfoListPage, addYueJie, addYueJie2, getWaitYueJieInfoListMinePage, addToYueJie } from '@/api/member/monthlyFeeBill'
import { DocumentChecked } from '@element-plus/icons-vue'
const { proxy } = getCurrentInstance()
const showOpen = ref(false)
const total = ref(0)
const list = ref([])
const batch = ref([])
const batchList = ref([])
const show = ref(true)
const statistical = ref({})
const loading = ref(false)
const olTime = ref([])
const newTime = ref([])
const emit = defineEmits(['backInfo'])
const data = reactive({
queryParams: {
pageNum: 1,
pageSize: 9999
}
})
const { queryParams } = toRefs(data)
const yjId = ref()
function searchFN() {
queryParams.value.pageNum = 1
initData()
}
function open(row) {
yjId.value = row.yjId
showOpen.value = true
initData()
}
async function batchSubmit() {
const res = await addToYueJie({
recordIds: batch.value.join(','),
yjId: yjId.value
})
if (res.code == 200) {
proxy.$message.success('操作成功!')
close()
}
}
function close() {
showOpen.value = false
emit('backInfo')
}
// 获取赛会列表
async function initData() {
loading.value = true
// if (newTime.value && newTime.value.length > 0) {
// queryParams.value.beginTime = newTime.value[0]
// queryParams.value.endTime = newTime.value[1]
// } else {
// queryParams.value.beginTime = olTime.value[0]
// queryParams.value.endTime = olTime.value[1]
// }
const res = await getWaitYueJieInfoListMinePage(yjId.value)
list.value = res.rows || []
list.value.forEach(item => {
item.content = JSON.parse(item.content)
})
total.value = res.total
loading.value = false
}
// 多选
function handleSelectionChange(e) {
batch.value = e.map(item => item.recordId)
batchList.value = e
statistical.value = {
totalCost: 0,
personCount: 0,
newPersonCount: 0,
oldPersonCount: 0,
totalYear: 0
}
batchList.value.forEach(item => {
statistical.value.totalCost += (item.content.allFee * 1)
statistical.value.personCount += (item.content.personCount * 1)
statistical.value.newPersonCount += (item.content.newPersonCount * 1)
statistical.value.oldPersonCount += (item.content.oldPersonCount * 1)
statistical.value.totalYear += (item.content.totalYear * 1)
})
show.value = !batch.value.length
}
// 重置
function resetQuery() {
queryParams.value = {
pageNum: 1,
pageSize: 10
}
newTime.value = olTime.value
initData()
}
// // 背景色
const tableRowClassName = ({
row,
rowIndex
}) => {
if (row.auditStatus == 1) {
return 'success-row'
}
}
defineExpose({
open
})
</script>
<style lang="scss" scoped>
.router {
margin-right: 20px;
}
</style>