list.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <div class="user-list">
  3. <div class="mb-20 flex-justify-space baC-fff sys-radius-10 box-sizing-border pd-15-10">
  4. <div class="align-items-center">
  5. <el-input
  6. class="input-w-200 mr-10"
  7. placeholder="请输入查询关键词"
  8. prefix-icon="el-icon-search"
  9. v-model="fromData.search">
  10. </el-input>
  11. <el-button type="primary" icon="el-icon-search" @click="searchFun()">查询</el-button>
  12. </div>
  13. <div class="">
  14. <el-button type="success" icon="el-icon-circle-plus-outline" @click="add()">新增</el-button>
  15. </div>
  16. </div>
  17. <div class="mb-30">
  18. <el-table :data="list" stripe >
  19. <el-table-column fixed prop="id" label="ID" width="60"></el-table-column>
  20. <el-table-column fixed prop="name" label="姓名"></el-table-column>
  21. <el-table-column prop="id_number" label="身份证号" width="220"></el-table-column>
  22. <el-table-column prop="phone" label="电话"></el-table-column>
  23. <el-table-column prop="psnId" label="e签宝id" width="320"></el-table-column>
  24. <el-table-column prop="realnameStatus" label="是否实名">
  25. <template slot-scope="scope">
  26. <el-tag v-if="scope.row.realnameStatus == 1" type="success">已实名</el-tag>
  27. <el-tag v-else type="danger">未实名</el-tag>
  28. </template>
  29. </el-table-column>
  30. <el-table-column prop="authShortUrl" label="认证链接"></el-table-column>
  31. <!-- <el-table-column prop="authorizeUserInfo" label="是否授权">
  32. <template slot-scope="scope">
  33. <el-tag v-if="scope.row.authorizeUserInfo == 1" type="success">已授权</el-tag>
  34. <el-tag v-else type="danger">未授权</el-tag>
  35. </template>
  36. </el-table-column> -->
  37. <el-table-column prop="created_at" label="创建时间"></el-table-column>
  38. <el-table-column fixed='right' prop="" label="编辑" width="300">
  39. <template slot-scope="scope">
  40. <el-button type="warning" icon="el-icon-edit" @click="edit(scope.row)">编辑</el-button>
  41. <el-button v-if="scope.row.realnameStatus != 1" type="primary" icon="el-icon-edit" @click="tongzhi(scope.row)">认证</el-button>
  42. </template>
  43. </el-table-column>
  44. </el-table>
  45. </div>
  46. <div class="mb-30 flex-justify-end">
  47. <el-pagination
  48. background
  49. @current-change="handleCurrentChange"
  50. :current-page.sync="fromData.page"
  51. :page-size="10"
  52. layout="prev, pager, next"
  53. :total="total">
  54. </el-pagination>
  55. </div>
  56. </div>
  57. </template>
  58. <script>
  59. import {memberList,memberNotice} from '@/api/member.js'
  60. export default {
  61. data(){
  62. return{
  63. list:[],
  64. fromData:{
  65. page:1,
  66. search:'',
  67. },
  68. total:0,
  69. isAJAX:false,
  70. }
  71. },
  72. mounted(){
  73. this.getList();
  74. },
  75. methods:{
  76. getList(){
  77. memberList(this.fromData).then((res)=>{
  78. if(res.code == 1){
  79. this.list = res.data.items;
  80. this.total = res.data.total
  81. }
  82. })
  83. },
  84. handleCurrentChange(val){
  85. this.fromData.page = val;
  86. this.getList();
  87. },
  88. searchFun(){
  89. this.fromData.page = 1;
  90. this.getList();
  91. },
  92. add(){
  93. this.$router.push({path:'/user/add-edit'})
  94. },
  95. edit(item){
  96. this.$router.push({path:'/user/add-edit',query:{id:item.id}})
  97. },
  98. tongzhi(item,i){
  99. if(this.isAJAX){
  100. return
  101. }
  102. this.isAJAX = true;
  103. memberNotice({id:item.id}).then((res)=>{
  104. this.isAJAX = false;
  105. if(res.code == 1){
  106. this.$message.success(res.msg);
  107. }else{
  108. this.$message.error(res.msg);
  109. }
  110. })
  111. },
  112. },
  113. }
  114. </script>
  115. <style scoped lang="scss">
  116. .user-list{
  117. }
  118. </style>