shopShow.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view class="page-body scroll-list">
  3. <scroll-view scroll-y style="height: 100%;width: 100%;overflow: auto;" @scrolltolower="onreachBottom">
  4. <view style="height: 20rpx;" ></view>
  5. <view
  6. class="check-order-list"
  7. v-for="(item,index) in list"
  8. :key="item.id"
  9. >
  10. <view class="flex align_center justify_between" @click="editPerson(item)">
  11. <view class="u-name">
  12. <text style="margin-right: 0.5rem;">{{item.name}}</text>
  13. <u-icon :name="item.sex==1?'man':'woman'" size="28" :color="item.sex==1?'#00aaff':'#ffaaaa'"></u-icon>
  14. </view>
  15. <view class="u-mobile">
  16. <text v-if="item.isManager == 1">门店负责人\ </text>
  17. <text v-if="item.isManager == 0 && item.roleNames">{{item.roleNames}} / </text>
  18. {{item.mobile}}
  19. </view>
  20. </view>
  21. <view class="set-item flex align_center justify_between">
  22. 商城是否显示:
  23. <u-radio-group @change="e=>changeShow(e,item)" v-model="item.show" :width="150">
  24. <u-radio :name="1">是</u-radio>
  25. <u-radio :name="0">否</u-radio>
  26. </u-radio-group>
  27. </view>
  28. </view>
  29. <view style="padding:0 30upx 30upx;">
  30. <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>
  31. <u-loadmore v-if="(total>=list.length&&list.length)||status=='loading'" :status="status" />
  32. </view>
  33. </scroll-view>
  34. </view>
  35. </template>
  36. <script>
  37. import {searchEmployee, delEmployee } from '@/api/employee'
  38. import moment from 'moment'
  39. export default{
  40. name:'personnel',
  41. data(){
  42. return{
  43. status: 'loading',
  44. noDataText: '暂无数据',
  45. // 查询条件
  46. pageNo: 1,
  47. pageSize: 20,
  48. list: [],
  49. total: 0,
  50. }
  51. },
  52. onShow() {
  53. this.getRow(1)
  54. },
  55. computed:{
  56. userInfo(){
  57. return this.$store.state.vuex_userInfo
  58. },
  59. hasOnlyAdmin(){
  60. return this.list.length ==1 && this.list[0].isManager == 1 || this.list.length == 0
  61. }
  62. },
  63. methods:{
  64. // 查询列表
  65. getRow (pageNo) {
  66. let _this = this
  67. if (pageNo) {
  68. this.pageNo = pageNo
  69. }
  70. let params = {
  71. pageNo:this.pageNo,
  72. pageSize:this.pageSize
  73. }
  74. this.status = "loading"
  75. searchEmployee(params).then(res => {
  76. if (res.code == 200 || res.status == 204 || res.status == 200) {
  77. const list = res.data.list || []
  78. list.forEach(item=>{
  79. item.show = 0
  80. })
  81. if(_this.pageNo>1){
  82. _this.list = _this.list.concat(list)
  83. }else{
  84. _this.list = list
  85. }
  86. _this.total = res.data.count || 0
  87. } else {
  88. _this.list = []
  89. _this.total = 0
  90. _this.noDataText = res.message
  91. }
  92. _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
  93. })
  94. },
  95. // scroll-view到底部加载更多
  96. onreachBottom() {
  97. if(this.list.length < this.total){
  98. this.pageNo += 1
  99. this.getRow()
  100. }else{
  101. this.status = "nomore"
  102. }
  103. },
  104. changeShow(e,item){
  105. console.log(e,item)
  106. }
  107. }
  108. }
  109. </script>
  110. <style lang="less">
  111. .page-body{
  112. height: 100vh;
  113. padding:0;
  114. }
  115. .scroll-list{
  116. .check-order-list{
  117. background: #ffffff;
  118. padding: 10upx 20upx;
  119. margin: 0 25rpx 25rpx 25rpx;
  120. border-radius: 20upx;
  121. box-shadow: 1px 1px 3px #EEEEEE;
  122. > view{
  123. padding: 0.5rem;
  124. .u-name{
  125. font-size: 32rpx;
  126. }
  127. .u-mobile{
  128. color: #666;
  129. }
  130. }
  131. }
  132. .set-item {
  133. /deep/ .u-radio__label{
  134. flex: 1;
  135. }
  136. }
  137. }
  138. </style>