the_leave_record.vue 5.1 KB

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