the_leave_record.vue 5.2 KB

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