accountManage.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="padding">
  3. <view style="width:100%;overflow:auto; height: calc(100vh - 156px);" >
  4. <!-- <table style="width:200%;text-align:center" >
  5. <tr>
  6. <th>人员名称</th>
  7. <th>联系方式</th>
  8. <th>所在单位</th>
  9. <th>角色权限</th>
  10. </tr>
  11. <tr v-for="(item,index) in getData" :key="index">
  12. <td>{{item.username}}</td>
  13. <td>{{item.phone}}</td>
  14. <td>{{item.owner_name}}</td>
  15. <td>{{item.statusid}}</td>
  16. </tr>
  17. </table> -->
  18. <view class="uni-pagination-box"><uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total" @change="change" /></view>
  19. <uni-table border stripe emptyText="暂无更多数据" >
  20. <!-- 表头行 -->
  21. <uni-tr>
  22. <uni-th align="center">人员名称</uni-th>
  23. <uni-th align="center">联系方式</uni-th>
  24. <uni-th align="center">所在单位</uni-th>
  25. <uni-th align="center" width="100">角色权限</uni-th>
  26. </uni-tr>
  27. <!-- 表格数据行 -->
  28. <uni-tr v-for="(item,index) in getData" :key="index">
  29. <uni-td align="center">{{item.username}}</uni-td>
  30. <uni-td align="center">{{item.phone}}</uni-td>
  31. <uni-td align="center">{{item.owner_name}}</uni-td>
  32. <uni-td align="center">{{item.statusid}}</uni-td>
  33. </uni-tr>
  34. </uni-table>
  35. </view>
  36. <view class="btn-area submitBottomBtn padding-lr-sm">
  37. <button class="bg-blue round margin-top" @click="goAddPer()">新 增</button>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. getData:[],
  46. // 每页数据量
  47. pageSize: 100,
  48. // 当前页
  49. pageCurrent: 1,
  50. // 数据总量
  51. total: '',
  52. loading: false
  53. }
  54. },
  55. onLoad:function(option){
  56. this.getDataList({'company_code':uni.getStorageSync('selectedCode'),'page':this.pageCurrent,"number":this.pageSize})
  57. },
  58. methods: {
  59. // 列表数据请求
  60. async getDataList(params = {}) {
  61. const res = await this.$myRequest({
  62. url: 'PermissionBinding/getPermissionBindingList',
  63. data:params,
  64. showLoading: true
  65. })
  66. this.getData=res.data.data;
  67. console.log(res.data.data[0])
  68. console.log(res.data.data.length)
  69. console.log(this.getData.length);
  70. this.total=res.data.total;
  71. },
  72. // 分页触发
  73. change(e) {
  74. console.log(e)
  75. // this.$refs.table.clearSelection()
  76. // this.selectedIndexs.length = 0
  77. this.getDataList({'company_code':uni.getStorageSync('selectedCode'),'page':e.current,"number":this.pageSize})
  78. // this.getDataList(e.current)
  79. },
  80. goAddPer() {
  81. uni.navigateTo({
  82. url: '/pages/accountManage/perAdd/perAdd',
  83. });
  84. },
  85. }
  86. }
  87. </script>
  88. <style>
  89. </style>