the_clock_record.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view>
  3. <!-- <d-rili></d-rili> -->
  4. <calendar showDot='true' :extraData='extraData' bgColor='#22C572' @monthTap='monthTap'></calendar>
  5. <view class="uni-container">
  6. <!-- <view class="top">
  7. <view class="center">月份</view>
  8. <view @click='show=true'>{{createDate}}</view>
  9. <u-picker v-model="show" mode="time" @confirm='dateChange($event)' :params="params"></u-picker>
  10. </view> -->
  11. <uni-table border stripe emptyText="暂无更多数据">
  12. <!-- 表头行 -->
  13. <uni-tr>
  14. <uni-th align="center" width="50">日期</uni-th>
  15. <uni-th align="center" width="50">上班时间</uni-th>
  16. <uni-th align="center" width="50">下班时间</uni-th>
  17. </uni-tr>
  18. <!-- 表格数据行 -->
  19. <uni-tr v-for="(item, index) in tableData" :key="index">
  20. <uni-td align="center" style="height: 30px;">{{ item.createDate.split(" ")[0] }}</uni-td>
  21. <uni-td align="center">
  22. <view class="toClockDate" v-if="item.toClockDate">{{ item.toClockDate.split(" ")[1] }}</view>
  23. <view class="toClockDate" v-else-if="!item.toClockDate">
  24. <button v-if='item.approveStatus ==null && item.status == null' @click='supp(item)' class="uni-button" size="mini"
  25. type="primary" align="center" style="height: 30px;">补卡</button>
  26. <button v-if='item.approveStatus=="待人事审核"' class='listitemStatus audit Regular' size="mini"
  27. type="primary" align="center" style="height: 30px;">审核中</button>
  28. <button v-if='item.status=="补卡失败"' class='listitemStatus notPass Regular' size="mini"
  29. type="primary" align="center" style="height: 30px;">补卡失败</button>
  30. <button v-if='item.status=="补卡成功"' class='listitemStatus pass Regular' size="mini"
  31. type="primary" align="center" style="height: 30px;">补卡成功</button>
  32. </view>
  33. </uni-td>
  34. <uni-td align="center">
  35. <view class="offClockDate" v-if="item.offClockDate">{{ item.offClockDate.split(" ")[1] }}</view>
  36. <view class="offClockDate" v-else-if="!item.offClockDate">
  37. <button v-if='item.approveStatus ==null && item.status == null' @click='supp(item)' class="uni-button" size="mini"
  38. type="primary" align="center" style="height: 30px;">补卡</button>
  39. <button v-if='item.approveStatus=="待人事审核"' class='listitemStatus audit Regular' size="mini"
  40. type="primary" align="center" style="height: 30px;">审核中</button>
  41. <button v-if='item.status=="补卡失败"' class='listitemStatus notPass Regular' size="mini"
  42. type="primary" align="center" style="height: 30px;">补卡失败</button>
  43. <button v-if='item.status=="补卡成功"' class='listitemStatus pass Regular' size="mini"
  44. type="primary" align="center" style="height: 30px;">补卡成功</button>
  45. </view>
  46. </uni-td>
  47. </uni-tr>
  48. </uni-table>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import dRili from '@/components/d-rili/d-rili.vue';
  54. import calendar from '@/components/tale-calendar/calendar.vue';
  55. export default {
  56. components:{
  57. dRili,
  58. calendar
  59. },
  60. data() {
  61. return {
  62. extraData:[{date: '2022-10-10', value: '签到', dot: true, active: true}],
  63. isSHowBtn: true,
  64. show: false,
  65. tableData: [],
  66. pageSize: 10,
  67. currentPage: 1,
  68. params: {
  69. year: true,
  70. month: true
  71. },
  72. isLoadMore: false,
  73. createDate:'',
  74. createDate1:'',
  75. }
  76. },
  77. onPullDownRefresh() {
  78. this.getList()
  79. setTimeout(function() {
  80. uni.stopPullDownRefresh(); //关闭下拉刷新
  81. }, 1000);
  82. },
  83. onShow() {
  84. this.getList()
  85. },
  86. onLoad(options) {
  87. let _day = new Date();
  88. _day.setTime(_day.getTime());
  89. this.createDate = _day.getFullYear() + "." + (_day.getMonth() + 1);
  90. this.createDate1 = _day.getFullYear() + "-" + (_day.getMonth() + 1);
  91. },
  92. onReachBottom() { //上拉触底函数
  93. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  94. this.currentPage += 1
  95. }
  96. this.getData()
  97. },
  98. methods: {
  99. monthTap(e){
  100. this.createDate1 = e.year + "-" + e.month
  101. console.log(e)
  102. },
  103. dateChange(e) {
  104. console.log(e)
  105. this.createDate = e.year + "." + e.month
  106. this.createDate1 = e.year + "-" + e.month
  107. this.getList()
  108. },
  109. getData() {
  110. this.isLoadMore = true
  111. this.$api.doRequest('get', '/clockInfo/selectClockInfo', {
  112. pageSize: this.pageSize,
  113. currentPage: this.currentPage,
  114. pcFlag: 0,
  115. compId: uni.getStorageSync('pcUserInfo').compId,
  116. commonId: uni.getStorageSync('pcUserInfo').userId,
  117. }).then(res => {
  118. if (res.data.code == 200) {
  119. this.isLoadMore = false
  120. this.tableData = this.tableData.concat(res.data.data.records)
  121. }
  122. })
  123. },
  124. getList() {
  125. this.isLoadMore = true
  126. this.$api.doRequest('get', '/clockInfo/selectClockInfo', {
  127. pageSize: this.pageSize,
  128. currentPage: this.currentPage,
  129. pcFlag: 0,
  130. yearMonth: this.createDate1,
  131. compId: uni.getStorageSync('pcUserInfo').compId,
  132. commonId: uni.getStorageSync('pcUserInfo').userId,
  133. }).then(res => {
  134. if (res.data.code == 200) {
  135. this.isLoadMore = false
  136. this.tableData = res.data.data.records
  137. }
  138. })
  139. },
  140. supp(item) {
  141. uni.navigateTo({
  142. url: '/pages/clock/supp_clock' + `?id=${item.id}`,
  143. })
  144. },
  145. }
  146. }
  147. </script>
  148. <style scoped lang="scss">
  149. uni-page-body {
  150. overflow: hidden;
  151. }
  152. .uni-container {
  153. margin: 10rpx;
  154. padding: 10rpx 10rpx 300rpx 10rpx;
  155. .top {
  156. border-radius: 20rpx;
  157. background: white;
  158. padding: 20rpx;
  159. display: flex;
  160. margin-bottom: 20rpx;
  161. align-items: center;
  162. .center {
  163. margin-right: 50rpx;
  164. }
  165. }
  166. }
  167. .listitemStatus.audit {
  168. color: #ffffff;
  169. margin-top: 6rpx;
  170. }
  171. .listitemStatus.notPass {
  172. color: #ffffff;
  173. margin-top: 6rpx;
  174. }
  175. .listitemStatus.pass {
  176. color: #ffffff;
  177. margin-top: 6rpx;
  178. }
  179. .row {
  180. display: flex;
  181. justify-content: space-between;
  182. border-bottom: 1px solid #EEEEEE;
  183. padding: 21rpx 0;
  184. .right,
  185. input {
  186. font-size: 28rpx;
  187. color: #333333;
  188. }
  189. }
  190. .uni-button {
  191. margin-top: 6rpx;
  192. }
  193. </style>