list.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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" @click="searchFun()">查询</el-button>
  12. </div>
  13. <div class="">
  14. <el-button type="success" @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="authorizeUserInfo" label="是否授权">
  31. <template slot-scope="scope">
  32. <el-tag v-if="scope.row.authorizeUserInfo == 1" type="success">已授权</el-tag>
  33. <el-tag v-else type="danger">未授权</el-tag>
  34. </template>
  35. </el-table-column>
  36. <el-table-column prop="created_at" label="创建时间"></el-table-column>
  37. <el-table-column fixed='right' prop="" label="编辑">
  38. <template slot-scope="scope">
  39. <el-button type="warning" @click="edit(scope.row)">编辑</el-button>
  40. </template>
  41. </el-table-column>
  42. </el-table>
  43. </div>
  44. <div class="mb-30 flex-justify-end">
  45. <el-pagination
  46. background
  47. @current-change="handleCurrentChange"
  48. :current-page.sync="fromData.page"
  49. :page-size="10"
  50. layout="prev, pager, next"
  51. :total="total">
  52. </el-pagination>
  53. </div>
  54. </div>
  55. </template>
  56. <script>
  57. import {memberList} from '@/api/member.js'
  58. export default {
  59. data(){
  60. return{
  61. list:[],
  62. fromData:{
  63. page:1,
  64. search:'',
  65. },
  66. total:0,
  67. }
  68. },
  69. mounted(){
  70. this.getList();
  71. },
  72. methods:{
  73. getList(){
  74. memberList(this.fromData).then((res)=>{
  75. if(res.code == 1){
  76. this.list = res.data.items;
  77. this.total = res.data.total
  78. }
  79. })
  80. },
  81. handleCurrentChange(val){
  82. this.fromData.page = val;
  83. this.getList();
  84. },
  85. searchFun(){
  86. this.fromData.page = 1;
  87. this.getList();
  88. },
  89. add(){
  90. this.$router.push({path:'/user/add-edit'})
  91. },
  92. edit(item){
  93. this.$router.push({path:'/user/add-edit',query:{id:item.id}})
  94. },
  95. },
  96. }
  97. </script>
  98. <style scoped lang="scss">
  99. .user-list{
  100. }
  101. </style>