index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <view class="tabPage" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='统计' :showback="false"></cus-header>
  4. <div class="card">
  5. <div class="c_top">
  6. <div class="ct_left" @tap="show=true">{{currentDay}}</div>
  7. <div class="ct_right">统计截至{{currentTime}}</div>
  8. </div>
  9. <div class="c_nums">
  10. <div class="cn_pre">
  11. <p>{{16}}</p>
  12. <p class="text">出勤天数</p>
  13. </div>
  14. <div class="cn_pre">
  15. <p>{{416}}</p>
  16. <p class="text">总工时</p>
  17. </div>
  18. <div class="cn_pre">
  19. <p>{{46}}</p>
  20. <p class="text">餐补次数</p>
  21. </div>
  22. </div>
  23. <div class="c_calendar">
  24. <Calendar ref="calendarRef" @selectDay="selectDay"></Calendar>
  25. </div>
  26. <div class="c_tip">当日班次:{{'固定上下班'}} 班次 {{'08:30-17:30'}}</div>
  27. <div class="c_tip">出勤统计:打卡{{2}}次,工时{{10}}小时</div>
  28. <div class="c_time">
  29. <image :src="imgBase+'clockingin/time_line.png'"></image>
  30. <div class="ct_info">
  31. <div class="cti_pre">
  32. <div class="ctip_left">上班 {{'08:19'}}</div>
  33. <div class="ctip_right">
  34. <image :src="imgBase+'clockingin/location_inactive.png'"></image>
  35. <span>{{'谷锐特设备自动化有限公司'}}</span>
  36. </div>
  37. </div>
  38. <div class="cti_pre">
  39. <div class="ctip_left">下班 {{'20:30'}}</div>
  40. <div class="ctip_right">
  41. <image :src="imgBase+'clockingin/location_inactive.png'"></image>
  42. <span>{{'谷锐特设备自动化有限公司'}}</span>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <u-datetime-picker :itemHeight="88" :show="show" v-model="yearMonth" mode="year-month" @confirm="confirm" @cancel="show=false" :immediateChange="true" :minDate="minDate" :maxDate="maxDate"></u-datetime-picker>
  49. <Tabbar :tabbarIndex="1"></Tabbar>
  50. </view>
  51. </template>
  52. <script>
  53. import Calendar from '@/components/CusCalendar/index.vue'
  54. import Tabbar from '@/components/CusTabbar/clock.vue'
  55. export default {
  56. components:{ Calendar,Tabbar },
  57. data(){
  58. return {
  59. currentDay:'',
  60. currentTime:'',
  61. show:false,
  62. yearMonth:new Date().Format('yyyy-MM'),
  63. minDate:'',
  64. maxDate:'',
  65. }
  66. },
  67. onLoad() {
  68. this.currentDay = new Date().Format('yyyy MM.dd');
  69. this.currentTime = new Date().Format('yyyy-MM-dd hh:mm');
  70. },
  71. mounted() {
  72. let d = new Date();
  73. this.minDate = new Date(d.getFullYear()-1,d.getMonth()+1,d.getDate()).getTime();
  74. this.maxDate = new Date().getTime();
  75. },
  76. methods:{
  77. selectDay(obj){
  78. this.currentDay = new Date(obj.year,obj.month-1,1).Format('yyyy MM.dd');
  79. },
  80. confirm(e){
  81. this.currentDay = new Date(e.value).Format('yyyy MM.dd');
  82. let year = new Date(e.value).Format('yyyy');
  83. let month = Number(new Date(e.value).Format('MM'));
  84. this.$refs.calendarRef.year = year;
  85. this.$refs.calendarRef.month = month;
  86. this.$refs.calendarRef.getDataByMonth(year,month);
  87. this.show = false;
  88. },
  89. }
  90. }
  91. </script>
  92. <style scoped lang="less">
  93. .tabPage{
  94. padding: 0 24rpx 188rpx;
  95. background: #F4F8FB;
  96. .card{
  97. background: #FFFFFF;
  98. border-radius: 16rpx;
  99. padding: 40rpx 30rpx;
  100. margin-top: 20rpx;
  101. .c_top{
  102. display: flex;
  103. align-items: center;
  104. justify-content: space-between;
  105. .ct_left{
  106. font-family: PingFang-SC, PingFang-SC;
  107. font-weight: bold;
  108. font-size: 32rpx;
  109. color: #1D2129;
  110. line-height: 45rpx;
  111. }
  112. .ct_right{
  113. font-family: PingFangSC, PingFang SC;
  114. font-weight: 400;
  115. font-size: 24rpx;
  116. color: #86909C;
  117. line-height: 33rpx;
  118. text-align: right;
  119. }
  120. }
  121. .c_nums{
  122. display: flex;
  123. margin-top: 54rpx;
  124. .cn_pre{
  125. width: calc(100% / 3);
  126. display: flex;
  127. flex-direction: column;
  128. align-items: center;
  129. p{
  130. font-family: PingFang-SC, PingFang-SC;
  131. font-weight: bold;
  132. font-size: 36rpx;
  133. color: #1D2129;
  134. line-height: 36rpx;
  135. text-align: center;
  136. &.text{
  137. font-weight: 400;
  138. font-size: 24rpx;
  139. color: #86909C;
  140. line-height: 24rpx;
  141. margin-top: 16rpx;
  142. }
  143. }
  144. }
  145. }
  146. .c_calendar{
  147. border-top: 1rpx solid #EFEFEF;
  148. border-bottom: 1rpx solid #EFEFEF;
  149. margin-top: 36rpx;
  150. padding: 20rpx 0;
  151. }
  152. .c_tip{
  153. font-family: PingFangSC, PingFang SC;
  154. font-weight: 400;
  155. font-size: 24rpx;
  156. color: #86909C;
  157. line-height: 24rpx;
  158. text-align: left;
  159. margin-top: 24rpx;
  160. }
  161. .c_time{
  162. margin-top: 40rpx;
  163. display: flex;
  164. align-items: center;
  165. &>image{
  166. width: 10rpx;
  167. height: 82rpx;
  168. }
  169. .ct_info{
  170. margin-left: 10rpx;
  171. .cti_pre{
  172. display: flex;
  173. align-items: center;
  174. &:last-child{
  175. margin-top: 48rpx;
  176. }
  177. .ctip_left{
  178. font-family: PingFang-SC, PingFang-SC;
  179. font-weight: bold;
  180. font-size: 24rpx;
  181. color: #1D2129;
  182. line-height: 24rpx;
  183. }
  184. .ctip_right{
  185. display: flex;
  186. align-items: center;
  187. margin-left: 20rpx;
  188. image{
  189. width: 24rpx;
  190. height: 24rpx;
  191. }
  192. span{
  193. font-family: PingFangSC, PingFang SC;
  194. font-weight: 400;
  195. font-size: 24rpx;
  196. color: #86909C;
  197. line-height: 24rpx;
  198. margin-left: 8rpx;
  199. }
  200. }
  201. }
  202. }
  203. }
  204. }
  205. }
  206. </style>