the_leave_record.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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">审核中</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. onLoad(options) {
  67. this.getList()
  68. },
  69. //下拉刷新
  70. onPullDownRefresh() {
  71. this.currentPage = 1
  72. this.isLoadMore = false
  73. this.loadStatus = 'loading'
  74. this.getList()
  75. setTimeout(function() {
  76. uni.stopPullDownRefresh();
  77. }, 1000);
  78. },
  79. onReachBottom() { //上拉触底函数
  80. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  81. this.isLoadMore = true
  82. this.currentPage += 1
  83. this.getList()
  84. }
  85. },
  86. methods: {
  87. getList() {
  88. this.$api.doRequest('get', '/leaveInfo/selectLeaveInfo', {
  89. pageSize: this.pageSize,
  90. currentPage: this.currentPage,
  91. pcFlag: 0,
  92. compId: uni.getStorageSync('pcUserInfo').compId,
  93. commonId: uni.getStorageSync('pcUserInfo').userId,
  94. }).then(res => {
  95. // if (res.data.code == 200) {
  96. // this.tableData = res.data.data.records
  97. // }
  98. if (res.data.code == 200) {
  99. if (res.data.data.records.length > 0) {
  100. this.isLoadMore = false
  101. this.loadStatus = 'loading'
  102. } else {
  103. this.isLoadMore = true
  104. this.loadStatus = 'nomore'
  105. }
  106. if (this.currentPage == 1) {
  107. this.tableData = res.data.data.records
  108. } else {
  109. this.tableData = this.tableData.concat(res.data.data.records)
  110. }
  111. }
  112. })
  113. },
  114. clockRecord() {
  115. uni.navigateTo({
  116. url: '/pages/leave/the_leave_record'
  117. })
  118. },
  119. clocksubmit() {
  120. uni.navigateTo({
  121. url: '/pages/leave/the_leave'
  122. })
  123. },
  124. }
  125. }
  126. </script>
  127. <style lang='scss' scoped>
  128. page {
  129. background: #F5F6FA;
  130. }
  131. .wrap {
  132. padding-top: 15px;
  133. padding-bottom: 20px;
  134. font-size: 14px;
  135. background: #fff;
  136. margin: 10px;
  137. border-radius: 10px;
  138. input {
  139. font-size: 14px;
  140. }
  141. >.title {
  142. padding: 10px 16px;
  143. }
  144. .wenzi {
  145. text-align: right;
  146. border-radius: 10rpx;
  147. margin-right: 30rpx;
  148. height: 10rpx;
  149. }
  150. .audit1 {
  151. color: red;
  152. }
  153. .audit2 {
  154. color: #afafe6;
  155. }
  156. .audit3 {
  157. color: red;
  158. }
  159. .c-row {
  160. display: -webkit-box;
  161. display: -webkit-flex;
  162. display: flex;
  163. -webkit-box-align: center;
  164. -webkit-align-items: center;
  165. align-items: center;
  166. padding: 5rpx 30rpx;
  167. position: relative;
  168. }
  169. }
  170. .submit {
  171. width: 40%;
  172. background: #22C572;
  173. border-radius: 10rpx;
  174. }
  175. .bottom-btn {
  176. padding: 30rpx;
  177. background: #FFFFFF;
  178. width: 100%;
  179. position: fixed;
  180. bottom: 0rpx;
  181. z-index: 9999;
  182. }
  183. .buns_item {
  184. display: flex;
  185. padding: 80rpx 0 50rpx 0;
  186. justify-content: space-around;
  187. }
  188. .but_css {
  189. background: #22C572;
  190. width: 40%;
  191. padding: 20rpx;
  192. color: #fff;
  193. text-align: center;
  194. border-radius: 20rpx;
  195. }
  196. /deep/.u-radio-group {
  197. flex-direction: row-reverse;
  198. }
  199. .no-boder {
  200. border: 0;
  201. }
  202. .textarea {
  203. background: #F9F9FA;
  204. border: 1px solid #EEEEEE;
  205. }
  206. .u-page__item__slot-icon {
  207. width: 20px;
  208. height: 20px;
  209. }
  210. </style>