checkApplications.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <div class="main-card__body" v-loading="pageLoading">
  3. <h1 class="main-card__title">
  4. 认证审核
  5. </h1>
  6. <el-table
  7. :data="applications"
  8. stripe
  9. class="main-card__table"
  10. >
  11. <el-table-column
  12. fixed
  13. type="index"
  14. width="50">
  15. </el-table-column>
  16. <el-table-column
  17. prop="realName"
  18. label="姓名"
  19. fixed
  20. width="120">
  21. </el-table-column>
  22. <el-table-column
  23. prop="organization"
  24. label="所属单位"
  25. width="120">
  26. </el-table-column>
  27. <el-table-column
  28. prop="jobNumber"
  29. label="工号"
  30. width="120">
  31. </el-table-column>
  32. <el-table-column
  33. prop="phone"
  34. label="手机"
  35. width="120">
  36. </el-table-column>
  37. <el-table-column
  38. prop="email"
  39. label="邮箱"
  40. width="200">
  41. </el-table-column>
  42. <el-table-column
  43. fixed="right"
  44. label="操作"
  45. width="100">
  46. <template slot-scope="scope">
  47. <el-button @click="pass(scope.row)" type="text" size="small">通过</el-button>
  48. <el-button @click="reject(scope.row)" type="text" size="small">否决</el-button>
  49. </template>
  50. </el-table-column>
  51. </el-table>
  52. </div>
  53. </template>
  54. <script>
  55. export default {
  56. name: "checkApplications",
  57. layout: 'admin',
  58. data(){
  59. return{
  60. applications: [],
  61. pageLoading: true
  62. }
  63. },
  64. mounted(){
  65. this.getApplications();
  66. this.pageLoading = false;
  67. },
  68. methods: {
  69. getApplications(){
  70. this.$api.$get('/admin/getApplications').then((res) =>
  71. {
  72. if(res.code === 0){
  73. this.applications = res.data;
  74. }else{
  75. this.$message({
  76. showClose: true,
  77. message: res.message,
  78. type: 'error'
  79. });
  80. }
  81. }
  82. ).catch((e)=>{
  83. console.log(e);
  84. });
  85. },
  86. pass(row){
  87. this.$api.$post('/admin/passApplication', {id: row.id, uid: row.uid}).then((res) =>
  88. {
  89. if(res.code === 0){
  90. this.$message({
  91. showClose: true,
  92. message: "已通过" + row.realName + "的认证",
  93. type: 'success'
  94. });
  95. this.applications.splice(this.applications.indexOf(row), 1);
  96. }else{
  97. this.$message({
  98. showClose: true,
  99. message: res.message,
  100. type: 'error'
  101. });
  102. }
  103. }
  104. ).catch((e)=>{
  105. console.log(e);
  106. });
  107. },
  108. reject(row){
  109. this.$api.$post('/admin/rejectApplication', {id: row.id}).then((res) =>
  110. {
  111. if(res.code === 0){
  112. this.$message({
  113. showClose: true,
  114. message: "已否决" + row.realName + "的认证",
  115. type: 'success'
  116. });
  117. this.applications.splice(this.applications.indexOf(row), 1);
  118. }else{
  119. this.$message({
  120. showClose: true,
  121. message: res.message,
  122. type: 'error'
  123. });
  124. }
  125. }
  126. ).catch((e)=>{
  127. console.log(e);
  128. });
  129. }
  130. }
  131. };
  132. </script>
  133. <style lang="scss" scoped>
  134. @import '~/assets/css/person.scss';
  135. </style>