index.vue
9.44 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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
<template>
<div class="app-container">
<!-- 搜索区域 -->
<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="4">
<el-form-item label="变更单号" prop="code">
<el-input
v-model.trim="queryParams.code"
placeholder="变更单号"
clearable
style="width: 100%"
@keyup.enter="searchFN"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" style="width: 100%" @change="searchFN">
<el-option label="全部" value="" />
<el-option label="待提交" value="0" />
<el-option label="审核中" value="1" />
<el-option label="审核通过" value="2" />
<el-option label="审核拒绝" value="3" />
<!-- <el-option label="已撤回" value="4" />-->
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="提交时间" prop="commitTime">
<el-date-picker
v-model="commitTime"
type="datetimerange"
value-format="YYYY-MM-DD HH:mm:ss"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
style="width: 100%"
@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="reset">重置</el-button>
</div>
</el-row>
</el-form>
<el-row justify="space-between">
<div>
<router-link class="router" to="/group/addAlteration">
<el-button type="primary" :icon="Plus">新建会员变更 </el-button>
</router-link>
</div>
</el-row>
</div>
<!-- 表格数据 -->
<div class="table">
<el-table v-loading="loading" :row-class-name="tableRowClassName" :data="list" border style="width: 100%">
<el-table-column label="序号" align="center" type="index" width="55" />
<el-table-column
label="变更单号"
align="center"
prop="code"
min-width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="省协会"
align="center"
prop="shenMemName"
min-width="140"
:show-overflow-tooltip="true"
/>
<!-- <el-table-column-->
<!-- label="道馆"-->
<!-- align="center"-->
<!-- prop="memName"-->
<!-- min-width="140"-->
<!-- :show-overflow-tooltip="true"-->
<!-- >-->
<!-- <template #default="scope">-->
<!-- <div>{{ scope.row.memName?scope.row.memName:'/' }}</div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
label="变更团体会员数"
align="center"
prop="count"
min-width="90"
>
<template #default="props">
<span>{{ props.row.count }}人</span>
</template>
</el-table-column>
<el-table-column
label="状态"
align="center"
prop="status"
min-width="100"
>
<template #default="props">
<div v-if="props.row.status==0"> 待提交</div>
<div v-if="props.row.status==1">审核中</div>
<div v-if="props.row.status==2" class="text-success"> 审核通过</div>
<div v-if="props.row.status==3" class="text-danger"> 审核拒绝</div>
<div v-if="props.row.status==4" class="text-warning">已撤回</div>
</template>
</el-table-column>
<el-table-column
label="审核进度"
align="center"
prop=""
min-width="120"
>
<template #default="props">
<el-progress v-if="props.row.status == 1||props.row.status == 0" :percentage="0" :format="format" />
<el-progress v-if="props.row.status == 2" :percentage="100" :format="format" />
</template>
</el-table-column>
<el-table-column
label="提交时间"
align="center"
prop=""
min-width="100"
>
<template #default="scope">
<span>{{ parseTime(scope.row.commitTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column
label="备注"
align="center"
prop="reason"
min-width="100"
/>
<el-table-column
label="操作"
align="center"
fixed="right"
width="260"
>
<template #default="scope">
<el-button type="primary" @click="handleInfo(scope.row)">查看</el-button>
<el-button :disabled="!(scope.row.status==0||scope.row.status==3||scope.row.status==4)" color="#13B5B1" style="--el-color-black:#fff;" @click="commitFN(scope.row)">提交审核</el-button>
<el-dropdown class="poptdmore">
<el-button type="primary" plain :disabled="!(scope.row.status==0||scope.row.status==3||scope.row.status==4)">更多
<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.status==0||scope.row.status==3||scope.row.status==4)" type="warning" @click="handleUpdate(scope.row)">编辑</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button :disabled="!(scope.row.status==0||scope.row.status==3||scope.row.status==4)" type="danger" @click="handleDelete(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="initData"
/>
</div>
<memberInfo ref="memberInfoRef" />
</div>
</template>
<script setup>
import { useRouter } from 'vue-router'
import { reactive } from '@vue/runtime-core'
import { ref, toRefs, onMounted, getCurrentInstance, computed } from 'vue'
import useUserStore from '/@/store/modules/user'
const memId = computed(() => useUserStore().memberInfo.memId)
import { meList, infoModRange, commit } from '@/api/groupMember/addAlteration'
import { Plus } from '@element-plus/icons-vue'
import memberInfo from './view.vue'
const { proxy } = getCurrentInstance()
const total = ref(0)
const list = ref([])
const loading = ref(false)
const router = useRouter()
const count = ref(0)
const data = reactive({
queryParams: {
pageNum: 1,
pageSize: 10
},
form: {}
})
const commitTime = ref([])
const { queryParams } = toRefs(data)
onMounted(() => {
initData()
})
// // 背景色
const tableRowClassName = ({
row,
rowIndex
}) => {
if (row.status == 2) {
return 'success-row'
}
}
// 审核进度
function format(percentage) {
if (percentage == 0) {
return (percentage = 0 + '/' + 1)
}
if (percentage == 100) {
return (percentage = 1 + '/' + 1)
}
}
function searchFN() {
queryParams.value.pageNum = 1
initData()
}
// 获取赛会列表
async function initData() {
loading.value = true
queryParams.value.memId = memId.value
if (commitTime.value) queryParams.value.commitTimeRange = commitTime.value.toString()
const res = await meList(queryParams.value)
list.value = res.rows
total.value = res.total
loading.value = false
}
// 编辑
function handleUpdate(row) {
router.push({
path: '/group/addAlteration',
query: {
rangeId: row.id
}
})
}
// 重置
function reset() {
queryParams.value = {
pageNum: 1,
pageSize: 10
}
commitTime.value = []
initData()
}
// 查看
function handleInfo(row) {
proxy.$refs['memberInfoRef'].open(row.id)
}
// 提交审核
async function commitFN(row) {
const res = await commit(row.id)
if (res.code == 200) {
proxy.$modal.msgSuccess('提交成功!')
} else {
proxy.$modal.msgError('提交失败!')
}
await initData()
}
/** 删除按钮操作 */
function handleDelete(row) {
proxy.$modal.confirm('是否确认变更单号为"' + row.code + '"的数据项?').then(function() {
loading.value = true
return infoModRange([row.id])
}).then(() => {
loading.value = true
if (list.value.length == 1 && queryParams.value.pageNum != 1) {
queryParams.value.pageNum--
}
initData()
proxy.$modal.msgSuccess('删除成功')
}).catch(() => {
}).finally(() => {
loading.value = false
})
}
</script>
<style lang="scss" scoped>
.router {
margin-right: 20px;
}
:deep(.el-button--info){
background-color: #920f20;
border:1px solid #920f20
}
</style>