the_leave_record.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <view>
  3. <view class='wrap' v-for="(item, index) in tableData" :key="index">
  4. <view class="wenzi audit1" v-if="item.approveStatus == '待人事审核' || item.approveStatus == '待主管审核' ">审核中</view>
  5. <view class="wenzi audit2" v-if="item.status == '已通过'">已通过</view>
  6. <view class="wenzi audit3" v-if="item.status == '未通过'" >未通过</view>
  7. <view class="c-row">
  8. <view class="title">请假类型 : {{item.leaveType}}</view>
  9. </view>
  10. <view class="c-row">
  11. <view class="title">请假事由 : {{item.reasonForLeave}}</view>
  12. </view>
  13. <view class="c-row">
  14. <view class="title">开始时间 : {{item.startDate}}</view>
  15. </view>
  16. <view class="c-row">
  17. <view class="title">结束时间 : {{item.endDate}}</view>
  18. </view>
  19. </view>
  20. <view v-show="isLoadMore">
  21. <uni-load-more :status="loadStatus"></uni-load-more>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. pageSize: 10,
  30. currentPage: 1,
  31. tableData: [],
  32. isLoadMore: false, //是否加载中
  33. loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
  34. }
  35. },
  36. onShow() {
  37. this.getList()
  38. },
  39. //下拉刷新
  40. onPullDownRefresh() {
  41. this.currentPage = 1
  42. this.isLoadMore = false
  43. this.loadStatus = 'loading'
  44. this.getList()
  45. setTimeout(function() {
  46. uni.stopPullDownRefresh();
  47. }, 1000);
  48. },
  49. onReachBottom() { //上拉触底函数
  50. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  51. this.isLoadMore = true
  52. this.currentPage += 1
  53. this.getList()
  54. }
  55. },
  56. methods: {
  57. getList() {
  58. this.$api.doRequest('get', '/leaveInfo/selectLeaveInfo', {
  59. pageSize: this.pageSize,
  60. currentPage: this.currentPage,
  61. pcFlag: 0,
  62. compId: uni.getStorageSync('pcUserInfo').compId,
  63. commonId: uni.getStorageSync('pcUserInfo').userId,
  64. }).then(res => {
  65. // if (res.data.code == 200) {
  66. // this.tableData = res.data.data.records
  67. // }
  68. if (res.data.code == 200) {
  69. if(res.data.data.records.length > 0){
  70. this.isLoadMore = false
  71. this.loadStatus = 'loading'
  72. }else{
  73. this.isLoadMore = true
  74. this.loadStatus = 'nomore'
  75. }
  76. if(this.currentPage == 1){
  77. this.tableData = res.data.data.records
  78. }else{
  79. this.tableData =this.tableData.concat(res.data.data.records)
  80. }
  81. }
  82. })
  83. },
  84. }
  85. }
  86. </script>
  87. <style lang='scss' scoped>
  88. page {
  89. background: #F5F6FA;
  90. }
  91. .wrap {
  92. padding-top: 15px;
  93. padding-bottom: 20px;
  94. font-size: 14px;
  95. background: #fff;
  96. margin: 10px;
  97. border-radius: 10px;
  98. input {
  99. font-size: 14px;
  100. }
  101. >.title {
  102. padding: 10px 16px;
  103. }
  104. }
  105. .wenzi {
  106. text-align: right;
  107. border-radius: 10rpx;
  108. margin-right: 30rpx;
  109. height: 10rpx;
  110. }
  111. .audit1{
  112. color: red;
  113. }
  114. .audit2{
  115. color: #afafe6;
  116. }
  117. .audit3{
  118. color: red;
  119. }
  120. .c-row {
  121. display: -webkit-box;
  122. display: -webkit-flex;
  123. display: flex;
  124. -webkit-box-align: center;
  125. -webkit-align-items: center;
  126. align-items: center;
  127. padding: 5rpx 30rpx;
  128. position: relative;
  129. }
  130. </style>