index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='员工管理'></cus-header>
  4. <div class="boxs" v-if="list.length">
  5. <div class="box" v-for="(item,index) in list" :key="index" @tap="toDetail(item)">
  6. <div class="top">
  7. <div class="left">
  8. <text>{{item.name||''}}</text>
  9. <image :src="imgBase+'home/staff_man.png'" v-if="item.gender==1"></image>
  10. <image :src="imgBase+'home/staff_women.png'" v-else-if="item.gender==2"></image>
  11. </div>
  12. <div class="right">{{item.entryDate||''}}入职</div>
  13. </div>
  14. <div class="bottom">
  15. <div class="left">手机号:{{item.mobile||''}}</div>
  16. <div class="right">工号:{{item.jobNumber||''}}</div>
  17. </div>
  18. </div>
  19. </div>
  20. <template v-else>
  21. <page-empty :height="'calc(100vh - 100px)'"></page-empty>
  22. </template>
  23. </view>
  24. </template>
  25. <script>
  26. import pageEmpty from '@/components/pageEmpty/index.vue'
  27. export default {
  28. components:{
  29. pageEmpty
  30. },
  31. data(){
  32. return {
  33. isOver:false,
  34. params:{
  35. page:1,
  36. limit:10
  37. },
  38. list:[]
  39. }
  40. },
  41. onReachBottom() {
  42. if(this.isOver) return
  43. this.getList();
  44. },
  45. onLoad() {
  46. this.getList();
  47. },
  48. methods:{
  49. getList(){
  50. this.$api.get('/staff/info/page',this.params).then(res=>{
  51. if(res.data.code===0){
  52. if(this.list.length<res.data.data.total){
  53. this.params.page++;
  54. this.list = [...this.list,...res.data.data.list];
  55. }else this.isOver = true
  56. }else this.$showModal(res.data.msg)
  57. });
  58. },
  59. toDetail(item){
  60. uni.navigateTo({
  61. url:'/pagesHome/employee/detail?id='+item.id
  62. })
  63. }
  64. }
  65. }
  66. </script>
  67. <style scoped lang="less">
  68. .page{
  69. padding: 0 24rpx 20rpx;
  70. background: #F4F8FB;
  71. box-sizing: border-box;
  72. .boxs{
  73. width: 100%;
  74. .box{
  75. width: 100%;
  76. background: #FFFFFF;
  77. border-radius: 16rpx;
  78. padding: 36rpx 24rpx;
  79. box-sizing: border-box;
  80. margin-top: 20rpx;
  81. &>div{
  82. display: flex;
  83. align-items: center;
  84. justify-content: space-between;
  85. }
  86. .top{
  87. .left{
  88. display: flex;
  89. align-items: center;
  90. text{
  91. font-family: PingFang-SC, PingFang-SC;
  92. font-weight: bold;
  93. font-size: 32rpx;
  94. color: #1D2129;
  95. line-height: 36rpx;
  96. }
  97. image{
  98. width: 26rpx;
  99. height: 26rpx;
  100. margin-left: 23rpx;
  101. }
  102. }
  103. .right{
  104. font-family: PingFangSC, PingFang SC;
  105. font-weight: 400;
  106. font-size: 24rpx;
  107. color: #4E5969;
  108. line-height: 36rpx;
  109. text-align: right;
  110. }
  111. }
  112. .bottom{
  113. margin-top: 20rpx;
  114. &>div{
  115. font-family: PingFangSC, PingFang SC;
  116. font-weight: 400;
  117. font-size: 24rpx;
  118. color: #4E5969;
  119. line-height: 36rpx;
  120. &.right{
  121. text-align: right;
  122. }
  123. }
  124. }
  125. }
  126. }
  127. }
  128. </style>