provinceMerge.vue
8.51 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
<template>
<div class="">
<div class="from-Card">
<el-form
v-show="showSearch" ref="queryRef" size="small" :model="queryParams" :inline="true"
label-position="top"
>
<el-row style="width: 100%;">
<el-col :span="4">
<el-form-item label="结算编号" prop="flowCode">
<el-input
v-model="queryParams.flowCode"
placeholder="请输入结算编号"
clearable
style="width: 214px;"
@keyup.enter="handleQuery"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="缴费编号" prop="examCode">
<el-input
v-model="queryParams.examCode"
placeholder="请输入缴费编号"
clearable
style="width: 214px;"
@keyup.enter="handleQuery"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="名称" prop="mergeName">
<el-input
v-model="queryParams.mergeName"
placeholder="请输入名称"
clearable
style="width: 214px;"
@keyup.enter="handleQuery"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" clearable style="width: 214px;" @change="handleQuery">
<el-option label="全部" value="" />
<el-option label="待提交" value="100" />
<el-option label="审批中" value="0" />
<el-option label="审批通过" value="1" />
<el-option label="审批拒绝" value="2" />
</el-select>
</el-form-item>
</el-col>
<div class="po-r-btns">
<el-button size="small" type="primary" @click="handleQuery">搜索</el-button>
<el-button size="small" @click="resetQuery">重置</el-button>
</div>
</el-row>
</el-form>
<el-row justify="space-between">
<div>
<el-button v-hasPermi="['exam:*']" :icon="Download" type="warning" @click="handleExport">导出</el-button>
</div>
</el-row>
</div>
<div class="table">
<el-table v-loading="loading" :row-class-name="tableRowClassName" border :data="infoList">
<el-table-column type="index" width="55" align="center" label="序号" />
<el-table-column label="结算编号" align="center" prop="flowCode" min-width="140" :show-overflow-tooltip="true" />
<el-table-column label="名称" align="center" prop="mergeName" min-width="180" :show-overflow-tooltip="true" />
<el-table-column label="考试人数" align="center" prop="totalNum" width="90" />
<el-table-column label="总金额" align="center" prop="totalAmount" min-width="120" />
<el-table-column label="合并日期" align="center" prop="mergeTime" min-width="140">
<template #default="scope">
<span>{{ parseTime(scope.row.mergeTime, '{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="审核状态" align="center" prop="statusStr" min-width="100">
<template #default="scope">
<span
:class="{
'text-success':scope.row.status=='1',
'text-danger':scope.row.status=='2',
'text-warning':scope.row.status=='3'
}"
>{{ scope.row.auditStatus=='100'?'待提交':statusArr[scope.row.status] }}</span>
</template>
</el-table-column>
<el-table-column
label="审核进度"
align="center"
prop=""
min-width="120"
>
<template #default="scope">
<schedule v-if="scope.row.auditStatus == 100||scope.row.status == 0||scope.row.status == 1" :audit-process="scope.row.auditProcess" />
</template>
</el-table-column>
<!-- <el-table-column label="原因" align="center" prop="reason" width="200" :show-overflow-tooltip="true" />-->
<el-table-column width="260" label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button type="primary" @click="handleView(scope.row)">查看</el-button>
<el-button :disabled="!(scope.row.auditStatus=='100')" type="warning" @click="handleSubmit(scope.row)">提交</el-button>
<el-dropdown class="poptdmore">
<el-button type="primary" plain>更多
<el-icon class="el-icon--right">
<arrow-down />
</el-icon>
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item>
<el-button :disabled="!(scope.row.auditStatus=='100')" color="#13B5B1" style="--el-color-black:#fff;" @click="handleCancel(scope.row)">取消合并</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button :disabled="!(scope.row.isView=='1' && scope.row.auditStatus=='1') || scope.row.payStatus=='3'" type="danger" @click="handleBack(scope.row)">撤 回</el-button>
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</div>
</div>
</template>
<script setup>
import { cancelMerge, doMergeFlows, getVerityMergeList } from '@/api/exam/info'
import { getCurrentInstance, reactive } from '@vue/runtime-core'
import { ref, toRefs } from 'vue'
import { parseTime } from '@/utils/ruoyi'
import _ from 'lodash'
import jsonlint from '@/utils/jsonlint/jsonlint'
import { Download } from '@element-plus/icons-vue'
import Schedule from '@/views/member/components/schedule.vue'
const { proxy } = getCurrentInstance()
const emit = defineEmits(['doBack', 'viewMerge'])
const infoList = ref([])
const loading = ref(true)
const showSearch = ref(true)
const total = ref(0)
const data = reactive({
queryParams: {
pageNum: 1,
pageSize: 10,
flowCode: undefined,
mergeName: undefined,
status: '',
examCode: undefined,
type: '1'
}
})
const { queryParams } = toRefs(data)
const statusArr = ['审批中', '审批通过', '审批拒绝', '审批撤回']
/** 查询考级信息列表 */
function getList() {
loading.value = true
getVerityMergeList(queryParams.value).then(response => {
const list = []
_.each(response.rows, r => {
const item = jsonlint.parse(r.remark)
item.recordId = r.recordId
item.auditStatus = r.auditStatus
item.status = r.status
item.isView = r.isView
item.payStatus = r.payStatus
item.sourceData = r
item.auditProcess = r.auditProcess
list.push(item)
})
infoList.value = list
total.value = response.total
loading.value = false
})
}
// // 背景色
const tableRowClassName = ({
row,
rowIndex
}) => {
if (row.status == 1) {
return 'success-row'
}
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1
getList()
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm('queryRef')
handleQuery()
}
function handleView(row) {
emit('viewMerge', row)
}
function handleCancel(row) {
proxy.$modal.confirm(`确定取消编号为 '${row.flowCode}' 的数据?`)
.then(() => {
return cancelMerge(row.recordId).then(() => {
proxy.$modal.msgSuccess('操作成功')
})
})
.then(getList)
}
function handleSubmit(row) {
proxy.$modal.confirm(`确定提交结算编号为 '${row.flowCode}' 的数据?`)
.then(() => {
return doMergeFlows({
id: row.recordId,
flag: '1',
type: queryParams.value.type
})
})
.then(() => {
proxy.$modal.msgSuccess('操作成功')
getList()
})
}
function handleBack(row) {
emit('doBack', row)
}
function handleExport() {
proxy.download('/exam/info/export/verityMergeList', {
...queryParams.value
}, `级位考试审核_${new Date().getTime()}.xlsx`)
}
getList()
defineExpose({
getList
})
</script>