performance.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <view>
  3. <view class="info-wrap">
  4. <u-navbar
  5. title="我的业绩"
  6. title-color="#fff"
  7. :custom-back="customBack"
  8. :border-bottom="false"
  9. back-icon-color="#CCE8FF"
  10. :background="{background: 'none' }"></u-navbar>
  11. <view class="info">
  12. <view class="payee-no">工号:{{vuexUser.payeeNo}}</view>
  13. <!-- <view class="current-time">{{$u.timeFormat(currentTime, 'yyyy年mm月dd日 hh:MM:ss')}}</view> -->
  14. </view>
  15. </view>
  16. <!-- <view class="calendar-wrap">
  17. <u-calendar v-model="calendarShow" mode="date" @change="calendarChange"></u-calendar>
  18. </view> -->
  19. <view class="statistics">
  20. <view class="statistics-title">实收数(聚合)</view>
  21. <view class="statistics-total">
  22. <span class="number">{{resdata.actualAmount||'0'}}</span>
  23. </view>
  24. <view class="statistics-item u-flex">
  25. <view class="statistics-item-cell">
  26. <view class="til">入场数</view>
  27. <view class="con">{{resdata.parkInNum||'0'}}</view>
  28. </view>
  29. <view class="statistics-item-cell">
  30. <view class="til">出场数</view>
  31. <view class="con">{{resdata.parkLeaveNum||'0'}}</view>
  32. </view>
  33. <view class="statistics-item-cell">
  34. <view class="til">应收数</view>
  35. <view class="con">{{resdata.mustAmount||'0'}}</view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="time" @click="selectTime">
  40. {{pickerYear}}年{{pickerMonth}}月<span class="dd">{{pickerDay}}</span>日
  41. <u-icon name="arrow-down-fill" color="#3D3D3D" size="28"></u-icon>
  42. </view>
  43. <u-picker v-model="pickerShow" mode="time" :params="pickerParams" @confirm="confirmTime"></u-picker>
  44. <u-toast ref="uToast" />
  45. </view>
  46. </template>
  47. <script>
  48. export default{
  49. data(){
  50. return{
  51. vuexUser:'',
  52. currentTime: new Date().getTime(),
  53. calendarShow:true,
  54. pickerShow:false,
  55. pickerParams: {
  56. year: true,
  57. month: true,
  58. day: true,
  59. hour: false,
  60. minute: false,
  61. second: false
  62. },
  63. pickerYear:'',
  64. pickerMonth:'',
  65. pickerDay:'',
  66. achievementData:'',
  67. resdata:[]
  68. }
  69. },
  70. onLoad(){
  71. this.vuexUser = this.$store.state.vuex_user;
  72. let date = new Date().getTime();
  73. this.pickerYear = this.$u.timeFormat(date, 'yyyy');
  74. this.pickerMonth = this.$u.timeFormat(date, 'mm');
  75. this.pickerDay = this.$u.timeFormat(date, 'dd');
  76. this.handleAchievement();
  77. },
  78. onShow(){
  79. },
  80. methods:{
  81. customBack(){
  82. this.$u.route({
  83. // type:'switchTab',
  84. url: 'pages/index/index'
  85. });
  86. },
  87. calendarChange(e){
  88. console.log('e',e);
  89. this.calendarShow = true;
  90. },
  91. selectTime(){
  92. this.pickerShow = true;
  93. },
  94. confirmTime(e){
  95. console.log('confirmTime e',e);
  96. this.pickerYear = e.year;
  97. this.pickerMonth = e.month;
  98. this.pickerDay = e.day;
  99. this.handleAchievement();
  100. },
  101. handleAchievement(){
  102. this.$u.api.achievement({startDate:this.theTime,endDate:this.theTime})
  103. .then(res=>{
  104. // this.$refs.uToast.show({
  105. // title: res.msg,
  106. // type: 'success',
  107. // });
  108. this.resdata = res.data;
  109. console.log('achievement',res)
  110. }).catch(err=>{
  111. this.$refs.uToast.show({
  112. title: err,
  113. type: 'error',
  114. });
  115. console.log('achievement ',err)
  116. });
  117. }
  118. },
  119. computed:{
  120. theTime(){
  121. return this.pickerYear+this.pickerMonth+this.pickerDay
  122. }
  123. }
  124. }
  125. </script>
  126. <style lang="scss">
  127. @import './performance.scss'
  128. </style>