the_leave_record.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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 class="bottom-btn">
  24. <view>
  25. <view style='width:100%;' class='flex flex-space-between'>
  26. <view @click='clocksubmit' style='width:50%;text-align:center;'>
  27. <image v-if='value==0' class="u-page__item__slot-icon"
  28. src="../../static/img/oa_office/leave/qingjia-check.png"></image>
  29. <image v-else class="u-page__item__slot-icon"
  30. src="../../static/img/oa_office/leave/qingjia.png"></image>
  31. <view :style='{"color":value==0?"#22C572":"#000"}'>请假</view>
  32. </view>
  33. <view @click='clockRecord' style='width:50%;text-align:center;'>
  34. <image v-if='value==1' class="u-page__item__slot-icon"
  35. src="../../static/img/oa_office/leave/jilu-check.png"></image>
  36. <image v-else class="u-page__item__slot-icon" src="../../static/img/oa_office/leave/jilu.png">
  37. </image>
  38. <view :style='{"color":value==1?"#22C572":"#000"}'>记录</view>
  39. </view>
  40. </view>
  41. </view>
  42. <!-- <u-button type="primary" class="submit" hover-class="none" @click="clockRecord">记录</u-button> -->
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import dRili from '@/components/d-rili/d-rili.vue';
  49. export default {
  50. components: {
  51. dRili
  52. },
  53. data() {
  54. return {
  55. pageSize: 10,
  56. currentPage: 1,
  57. tableData: [],
  58. value: 1,
  59. isLoadMore: false, //是否加载中
  60. loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
  61. }
  62. },
  63. onShow() {
  64. this.getList()
  65. },
  66. //下拉刷新
  67. onPullDownRefresh() {
  68. this.currentPage = 1
  69. this.isLoadMore = false
  70. this.loadStatus = 'loading'
  71. this.getList()
  72. setTimeout(function() {
  73. uni.stopPullDownRefresh();
  74. }, 1000);
  75. },
  76. onReachBottom() { //上拉触底函数
  77. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  78. this.isLoadMore = true
  79. this.currentPage += 1
  80. this.getList()
  81. }
  82. },
  83. methods: {
  84. getList() {
  85. this.$api.doRequest('get', '/leaveInfo/selectLeaveInfo', {
  86. pageSize: this.pageSize,
  87. currentPage: this.currentPage,
  88. pcFlag: 0,
  89. compId: uni.getStorageSync('pcUserInfo').compId,
  90. commonId: uni.getStorageSync('pcUserInfo').userId,
  91. }).then(res => {
  92. // if (res.data.code == 200) {
  93. // this.tableData = res.data.data.records
  94. // }
  95. if (res.data.code == 200) {
  96. if (res.data.data.records.length > 0) {
  97. this.isLoadMore = false
  98. this.loadStatus = 'loading'
  99. } else {
  100. this.isLoadMore = true
  101. this.loadStatus = 'nomore'
  102. }
  103. if (this.currentPage == 1) {
  104. this.tableData = res.data.data.records
  105. } else {
  106. this.tableData = this.tableData.concat(res.data.data.records)
  107. }
  108. }
  109. })
  110. },
  111. clockRecord() {
  112. uni.navigateTo({
  113. url: '/pages/leave/the_leave_record'
  114. })
  115. },
  116. clocksubmit() {
  117. uni.navigateTo({
  118. url: '/pages/leave/the_leave'
  119. })
  120. },
  121. }
  122. }
  123. </script>
  124. <style lang='scss' scoped>
  125. page {
  126. background: #F5F6FA;
  127. }
  128. .wrap {
  129. padding-top: 15px;
  130. padding-bottom: 20px;
  131. font-size: 14px;
  132. background: #fff;
  133. margin: 10px;
  134. border-radius: 10px;
  135. input {
  136. font-size: 14px;
  137. }
  138. >.title {
  139. padding: 10px 16px;
  140. }
  141. .wenzi {
  142. text-align: right;
  143. border-radius: 10rpx;
  144. margin-right: 30rpx;
  145. height: 10rpx;
  146. }
  147. .audit1 {
  148. color: red;
  149. }
  150. .audit2 {
  151. color: #afafe6;
  152. }
  153. .audit3 {
  154. color: red;
  155. }
  156. .c-row {
  157. display: -webkit-box;
  158. display: -webkit-flex;
  159. display: flex;
  160. -webkit-box-align: center;
  161. -webkit-align-items: center;
  162. align-items: center;
  163. padding: 5rpx 30rpx;
  164. position: relative;
  165. }
  166. }
  167. .submit {
  168. width: 40%;
  169. background: #22C572;
  170. border-radius: 10rpx;
  171. }
  172. .bottom-btn {
  173. padding: 30rpx;
  174. background: #FFFFFF;
  175. width: 100%;
  176. position: fixed;
  177. bottom: 0rpx;
  178. z-index: 9999;
  179. }
  180. .buns_item {
  181. display: flex;
  182. padding: 80rpx 0 50rpx 0;
  183. justify-content: space-around;
  184. }
  185. .but_css {
  186. background: #22C572;
  187. width: 40%;
  188. padding: 20rpx;
  189. color: #fff;
  190. text-align: center;
  191. border-radius: 20rpx;
  192. }
  193. /deep/.u-radio-group {
  194. flex-direction: row-reverse;
  195. }
  196. .no-boder {
  197. border: 0;
  198. }
  199. .textarea {
  200. background: #F9F9FA;
  201. border: 1px solid #EEEEEE;
  202. }
  203. .u-page__item__slot-icon {
  204. width: 20px;
  205. height: 20px;
  206. }
  207. </style>