accountManage.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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">
  23. <uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total"
  24. @change="change" />
  25. </view>
  26. <button class="bg-blue round " @click="goAddPer()">新 增</button>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. getData: [],
  35. // 每页数据量
  36. pageSize: 100,
  37. // 当前页
  38. pageCurrent: 1,
  39. // 数据总量
  40. total: '',
  41. loading: false
  42. }
  43. },
  44. onShow: function(option) {
  45. this.getDataList({
  46. 'company_code': uni.getStorageSync('selectedCode'),
  47. 'page': this.pageCurrent,
  48. "number": this.pageSize
  49. })
  50. },
  51. onLoad: function(option) {
  52. this.getDataList({
  53. 'company_code': uni.getStorageSync('selectedCode'),
  54. 'page': this.pageCurrent,
  55. "number": this.pageSize
  56. })
  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({
  78. 'company_code': uni.getStorageSync('selectedCode'),
  79. 'page': e.current,
  80. "number": this.pageSize
  81. })
  82. // this.getDataList(e.current)
  83. },
  84. goAddPer() {
  85. uni.navigateTo({
  86. url: '/pages/accountManage/perAdd/perAdd',
  87. });
  88. },
  89. }
  90. }
  91. </script>
  92. <style lang="scss">
  93. /deep/ .uni-pagination__btn {
  94. background-color: rgba(0, 0, 0, 0) !important
  95. }
  96. /deep/ .uni-pagination-box {
  97. background: #fff;
  98. border-top: 1px solid #ddd
  99. }
  100. .submitBottomBtn {
  101. padding: 0px 32rpx 32rpx 32rpx
  102. }
  103. /deep/ .uni-pagination__num {
  104. height: 80rpx
  105. }
  106. </style>