accountManage.vue 2.6 KB

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