editIsManage.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <view class="page-body flex flex_column">
  3. <swiper class="scroll-list" :current="swiperCurrent">
  4. <swiper-item class="swiper-item" style="height: 100%;width: 100%;overflow: hidden;">
  5. <scroll-view scroll-y style="height: 100%;width: 100%;overflow: auto;" @scrolltolower="onreachBottom">
  6. <view style="height: 20rpx;" ></view>
  7. <view class="check-order-list">
  8. <u-cell-group>
  9. <u-cell-item v-for="(item, index) in list" :key="item.userId" @click="setNewAdmin(item)" :title="item.name+'/'+item.mobile"></u-cell-item>
  10. </u-cell-group>
  11. </view>
  12. <view style="padding:0 30upx 30upx;">
  13. <u-empty :src="`/static/nodata.png`" icon-size="180" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
  14. <u-loadmore v-if="(total>=list.length&&list.length)||status=='loading'" :status="status" />
  15. </view>
  16. </scroll-view>
  17. </swiper-item>
  18. </swiper>
  19. </view>
  20. </template>
  21. <script>
  22. import {searchEmployee} from '@/api/employee'
  23. import moment from 'moment'
  24. export default{
  25. name:'personnel',
  26. data(){
  27. return{
  28. status: 'loading',
  29. noDataText: '暂无数据',
  30. current: 0,
  31. swiperCurrent: 0,
  32. // 查询条件
  33. pageNo: 1,
  34. pageSize: 20,
  35. list: [],
  36. total: 0,
  37. adminId: null
  38. }
  39. },
  40. onShow() {
  41. this.getRow(1)
  42. },
  43. onLoad(opts) {
  44. this.adminId = opts.adminId
  45. },
  46. computed:{
  47. userInfo(){
  48. return this.$store.state.vuex_userInfo
  49. },
  50. },
  51. methods:{
  52. // 查询列表
  53. getRow (pageNo) {
  54. let _this = this
  55. if (pageNo) {
  56. this.pageNo = pageNo
  57. }
  58. let params = {
  59. pageNo:this.pageNo,
  60. pageSize:this.pageSize,
  61. isManager: 0
  62. }
  63. this.status = "loading"
  64. searchEmployee(params).then(res => {
  65. if (res.code == 200 || res.status == 204 || res.status == 200) {
  66. if(_this.pageNo>1){
  67. _this.list = _this.list.concat(res.data.list || [])
  68. }else{
  69. _this.list = res.data.list || []
  70. }
  71. _this.total = res.data.count || 0
  72. } else {
  73. _this.list = []
  74. _this.total = 0
  75. _this.noDataText = res.message
  76. }
  77. _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
  78. })
  79. },
  80. // scroll-view到底部加载更多
  81. onreachBottom() {
  82. if(this.list.length < this.total){
  83. this.pageNo += 1
  84. this.getRow()
  85. }else{
  86. this.status = "nomore"
  87. }
  88. },
  89. // 设为负责人
  90. setNewAdmin(row){
  91. this.$store.state.vuex_nowStaffData = row
  92. uni.navigateTo({
  93. url: "/pages/storeManage/editAdminAuth?adminId="+this.adminId
  94. })
  95. },
  96. }
  97. }
  98. </script>
  99. <style lang="less">
  100. .page-body{
  101. height: 100vh;
  102. padding:0;
  103. .scroll-list{
  104. flex-grow: 1;
  105. .check-order-list{
  106. padding: 10upx 20upx;
  107. u-radio{
  108. > view{
  109. background: #ffffff;
  110. border-radius: 20upx;
  111. box-shadow: 1px 1px 3px #EEEEEE;
  112. margin: 10rpx 0;
  113. padding: 20rpx;
  114. >view:last-child{
  115. flex-grow: 1;
  116. }
  117. }
  118. }
  119. }
  120. }
  121. }
  122. </style>