editIsManage.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. }
  38. },
  39. onShow() {
  40. this.getRow(1)
  41. },
  42. computed:{
  43. userInfo(){
  44. return this.$store.state.vuex_userInfo
  45. },
  46. },
  47. methods:{
  48. // 查询列表
  49. getRow (pageNo) {
  50. let _this = this
  51. if (pageNo) {
  52. this.pageNo = pageNo
  53. }
  54. let params = {
  55. pageNo:this.pageNo,
  56. pageSize:this.pageSize,
  57. isManager: 0
  58. }
  59. this.status = "loading"
  60. searchEmployee(params).then(res => {
  61. if (res.code == 200 || res.status == 204 || res.status == 200) {
  62. if(_this.pageNo>1){
  63. _this.list = _this.list.concat(res.data.list || [])
  64. }else{
  65. _this.list = res.data.list || []
  66. }
  67. _this.total = res.data.count || 0
  68. } else {
  69. _this.list = []
  70. _this.total = 0
  71. _this.noDataText = res.message
  72. }
  73. _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
  74. })
  75. },
  76. // scroll-view到底部加载更多
  77. onreachBottom() {
  78. if(this.list.length < this.total){
  79. this.pageNo += 1
  80. this.getRow()
  81. }else{
  82. this.status = "nomore"
  83. }
  84. },
  85. // 设为负责人
  86. setNewAdmin(row){
  87. this.$store.state.vuex_nowStaffData = row
  88. uni.navigateTo({
  89. url: "/pages/storeManage/editAdminAuth"
  90. })
  91. },
  92. }
  93. }
  94. </script>
  95. <style lang="less">
  96. .page-body{
  97. height: 100vh;
  98. padding:0;
  99. .scroll-list{
  100. flex-grow: 1;
  101. .check-order-list{
  102. padding: 10upx 20upx;
  103. u-radio{
  104. > view{
  105. background: #ffffff;
  106. border-radius: 20upx;
  107. box-shadow: 1px 1px 3px #EEEEEE;
  108. margin: 10rpx 0;
  109. padding: 20rpx;
  110. >view:last-child{
  111. flex-grow: 1;
  112. }
  113. }
  114. }
  115. }
  116. }
  117. }
  118. </style>