the_leave_record.vue 5.1 KB

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