examView.vue
9.66 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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
<template>
<el-dialog
v-model="show" :close-on-click-modal="true" align-center title="查看考试信息"
width="80%"
@close="close"
>
<el-collapse v-model="activeNames" @change="handleChange">
<el-collapse-item name="1" title="考段基本信息">
<el-descriptions border>
<el-descriptions-item label="考段名称">{{ form.name }}</el-descriptions-item>
<el-descriptions-item label="申请日期">{{ parseTime(form.applyTime, '{y}-{m}-{d}') }}</el-descriptions-item>
<el-descriptions-item label="申请单位">{{ form.memberName }}</el-descriptions-item>
<el-descriptions-item label="考官">{{ form.examinerNames?.split(',').join('/') }}</el-descriptions-item>
<el-descriptions-item label="考试开始时间">{{ parseTime(form.startTime, '{y}-{m}-{d} {h}:{i}') }}
</el-descriptions-item>
<el-descriptions-item label="考试结束时间">{{ parseTime(form.endTime, '{y}-{m}-{d} {h}:{i}') }}
</el-descriptions-item>
<el-descriptions-item label="考段地点">{{ form.address || form.examLocation }}</el-descriptions-item>
<el-descriptions-item label="总金额">{{ (form.totalAmount * 1).toFixed(2) }}</el-descriptions-item>
</el-descriptions>
</el-collapse-item>
<el-collapse-item name="4" title="邮寄地址">
<el-descriptions border>
<el-descriptions-item 0 label="姓名">
{{ addressForm.name }}
</el-descriptions-item>
<el-descriptions-item label="联系方式">
{{ addressForm.phone }}
</el-descriptions-item>
<el-descriptions-item label="收件地址">
{{ addressForm.address }}
</el-descriptions-item>
</el-descriptions>
</el-collapse-item>
<el-collapse-item name="2" title="考生信息">
<div class="vipData">
<div>人数合计: <span>{{ tablePersonInfo.total }}</span>人</div>
<div v-for="l in tablePersonInfo.levelArr" :key="l.level">{{ szToHz(l.level) }}段: <span>{{ l.num }} </span>人
</div>
</div>
<el-button size="small" style="margin: 10px 0" type="warning" @click="exportFn">导出</el-button>
<br>
<el-table v-loading="loading" :data="infoList" border>
<el-table-column align="center" label="序号" type="index" width="55" />
<el-table-column align="center" label="姓名" min-width="100" prop="realName" />
<el-table-column align="center" label="证件类型" min-width="90" prop="idcTypeStr" />
<el-table-column align="center" label="证件号码" min-width="170" prop="idcCode" />
<el-table-column align="center" label="所属单位(单位会员)" min-width="160" prop="memName" />
<el-table-column align="center" label="原有段位" min-width="80" prop="levelOld">
<template #default="scope">
<span v-if="scope.row.levelOld && '0' != scope.row.levelOld">
{{ szToHz(scope.row.levelOld) }}段/品
</span>
<span v-else>--</span>
</template>
</el-table-column>
<el-table-column align="center" label="考试段位" min-width="80" prop="levelNew">
<template #default="scope">
{{ szToHz(scope.row.levelNew) }}段/品
</template>
</el-table-column>
<el-table-column align="center" label="金额" min-width="80" prop="examFee">
<!-- <template #default="scope">-->
<!-- {{ '1' == scope.row.isPass ? scope.row.examFee : '' }}-->
<!-- </template>-->
</el-table-column>
<el-table-column align="center" label="是否通过" min-width="80" prop="isPass">
<template #default="scope">
{{ '1' == scope.row.isPass ? '是' : '否' }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
v-model:limit="queryParams.pageSize"
v-model:page="queryParams.pageNum"
:total="total"
@pagination="getList()"
/>
</el-collapse-item>
<el-collapse-item
v-if="recordList.length>0 " name="3"
title="审核信息"
>
<div v-if="type==2||type==4">
<span>考段审核</span>
<el-table :data="recordList" border>
<el-table-column align="center" label="序号" type="index" width="55" />
<el-table-column align="center" label="审核协会" prop="auditDeptName" />
<el-table-column align="center" label="审核时间" prop="auditTime" />
<el-table-column align="center" label="审核状态" prop="auditStatusStr">
<template #default="scope">
<span
:class="{
'text-success':scope.row.auditResult=='1',
'text-danger':scope.row.auditResult=='0',
}"
>
<text v-if="scope.row.auditResult==9">审核中</text>
<text v-if="scope.row.auditResult==1">审核通过</text>
<text v-if="scope.row.auditResult==0">审核未通过</text>
</span>
</template>
</el-table-column>
<el-table-column align="center" label="备注" prop="reason" />
</el-table>
</div>
<div v-if="type==3||type==5">
<span>成绩审核</span>
<el-table :data="recordList" border>
<el-table-column align="center" label="序号" type="index" width="55" />
<el-table-column align="center" label="审核协会" prop="auditDeptName" />
<el-table-column align="center" label="审核时间" prop="auditTime" />
<el-table-column align="center" label="审核状态" prop="auditStatusStr">
<template #default="scope">
<span
:class="{
'text-success':scope.row.auditResult=='1',
'text-danger':scope.row.auditResult=='0',
}"
>
<text v-if="scope.row.auditResult==9">审核中</text>
<text v-if="scope.row.auditResult==1">审核通过</text>
<text v-if="scope.row.auditResult==0">审核未通过</text>
</span>
</template>
</el-table-column>
<el-table-column align="center" label="备注" prop="auditMsg" />
</el-table>
</div>
</el-collapse-item>
</el-collapse>
</el-dialog>
</template>
<script setup>
import { getCurrentInstance, toRefs, reactive, computed, ref } from 'vue'
import { getApprovalRecord, getExamPersonNum, getInfo, getLogs } from '@/api/exam/info'
import _ from 'lodash'
import { studentList } from '@/api/exam/person'
import { szToHz } from '@/utils/ruoyi'
const { proxy } = getCurrentInstance()
const data = reactive({
show: false,
loading: true,
form: {},
infoList: [],
activeNames: '1',
tablePersonInfo: {},
recordList: [],
queryParams: {
pageNum: 1,
pageSize: 10
},
total: 0
})
const { show, form, infoList, loading, tablePersonInfo, activeNames, recordList, queryParams, total } = toRefs(data)
const props = defineProps({
type: {
type: String,
default: '1'
}
})
const addressForm = ref({})
const type = computed(() => props.type)
console.log(type.value)
let examId = null
let recordId = null
function open(params, approval) {
show.value = true
activeNames.value = ['1', '2', '4']
infoList.value = []
recordList.value = []
if (approval) {
examId = params.examId
recordId = params.recordId
form.value = params
} else {
examId = params
recordId = null
getInfo(examId).then(res => {
form.value = res.data
addressForm.value = res.data.postAddress ?? {}
})
}
console.log(type.value)
handleChange(activeNames)
getLogsFn(examId)
}
async function getLogsFn(examId) {
const res = await getLogs(examId, type.value)
recordList.value = res.data
}
function getTablePersonInfo() {
const levelArr = []
let total = 0
getExamPersonNum(examId, recordId, '2').then(res => {
_.each(res.data, (val, key) => {
if (val > 0) {
levelArr.push({
level: key,
num: val
})
total += val
}
})
tablePersonInfo.value = {
total: total,
levelArr: _.sortBy(levelArr, (l) => {
return l.level
})
}
})
}
function handleChange(val) {
if (_.indexOf(val, '2') && infoList.value.length == 0) {
loading.value = true
if (examId) {
queryParams.value.examId = examId
queryParams.value.recordId = recordId
getList()
}
}
}
function getList() {
studentList(queryParams.value).then(response => {
infoList.value = response.rows
loading.value = false
total.value = response.total
}).then(getTablePersonInfo)
}
function close() {
show.value = false
total.vaue = 0
queryParams.value.pageNum = 1
queryParams.value.pageSize = 10
}
function exportFn() {
proxy.download('/exam/person/export/studentList', {
...queryParams.value
}, `考生信息_${new Date().getTime()}.xlsx`)
}
defineExpose({
open,
close: () => {
show.value = false
}
})
</script>
<style scoped>
.col-4 {
padding: 10px;
border: 1px solid #ebeef5;
font-size: 14px;
text-align: center;
}
.first {
font-weight: 600;
background-color: #f8f8f9;
}
.flex {
display: flex;
}
.flex-1 {
flex: 1;
padding: 10px;
font-size: 16px;
background-color: #f8f8f9;
border: 1px solid #ebeef5;
}
.flex-1 > span {
font-weight: 600;
margin-left: 10px;
margin-right: 10px;
}
</style>