| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <template>
- <div class="main-card__body" v-loading="pageLoading">
- <h1 class="main-card__title">
- 认证审核
- </h1>
- <el-table
- :data="applications"
- stripe
- class="main-card__table"
- >
- <el-table-column
- fixed
- type="index"
- width="50">
- </el-table-column>
- <el-table-column
- prop="realName"
- label="姓名"
- fixed
- width="90">
- </el-table-column>
- <el-table-column
- label="申请类型"
- width="100">
- <template slot-scope="scope" v-if="applications.length > 0">
- {{roleDic[scope.row.role]}}
- </template>
- </el-table-column>
- <el-table-column
- prop="organization"
- label="所属单位"
- width="150">
- </el-table-column>
- <el-table-column
- prop="jobNumber"
- label="工号"
- width="120">
- </el-table-column>
- <el-table-column
- prop="userDetail.phone"
- label="手机"
- width="120">
- </el-table-column>
- <el-table-column
- prop="userDetail.email"
- label="邮箱"
- width="200">
- </el-table-column>
- <el-table-column
- fixed="right"
- label="操作"
- width="100">
- <template slot-scope="scope">
- <el-button @click="pass(scope.row)" type="text" size="small">通过</el-button>
- <el-button @click="reject(scope.row)" type="text" size="small">否决</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </template>
- <script>
- export default {
- name: 'checkApplications',
- layout: 'admin',
- data () {
- return {
- applications: [],
- pageLoading: true,
- roleDic: { TEACHER: '教师', STAFF: '职员', HR: 'HR', ASSISTANT: '助教' }
- }
- },
- mounted () {
- this.getApplications()
- this.pageLoading = false
- },
- methods: {
- getApplications () {
- this.$api.$get('/admin/getApplication').then((res) => {
- if (res.code === 0) {
- this.applications = res.data
- } else {
- this.$message({
- showClose: true,
- message: res.message,
- type: 'error'
- })
- }
- }
- ).catch((e) => {
- console.log(e)
- })
- },
- pass (row) {
- this.$api.$post('/admin/passApplication', { id: row.id, uid: row.uid }).then((res) => {
- console.log(res.data)
- if (res.code === 0) {
- this.$message({
- showClose: true,
- message: '已通过' + row.realName + '的认证',
- type: 'success'
- })
- this.applications.splice(this.applications.indexOf(row), 1)
- } else {
- this.$message({
- showClose: true,
- message: res.message,
- type: 'error'
- })
- }
- }
- ).catch((e) => {
- console.log(e)
- })
- },
- reject (row) {
- this.$api.$post('/admin/rejectApplication', { id: row.id }).then((res) => {
- if (res.code === 0) {
- this.$message({
- showClose: true,
- message: '已否决' + row.realName + '的认证',
- type: 'success'
- })
- this.applications.splice(this.applications.indexOf(row), 1)
- } else {
- this.$message({
- showClose: true,
- message: res.message,
- type: 'error'
- })
- }
- }
- ).catch((e) => {
- console.log(e)
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- @import '~/assets/css/person.scss';
- </style>
|