performance.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. uni.reLaunch({
  83. url: '/pages/index/index'
  84. });
  85. },
  86. calendarChange(e){
  87. console.log('e',e);
  88. this.calendarShow = true;
  89. },
  90. selectTime(){
  91. this.pickerShow = true;
  92. },
  93. confirmTime(e){
  94. console.log('confirmTime e',e);
  95. this.pickerYear = e.year;
  96. this.pickerMonth = e.month;
  97. this.pickerDay = e.day;
  98. this.handleAchievement();
  99. },
  100. handleAchievement(){
  101. this.$u.api.achievement({startDate:this.theTime,endDate:this.theTime})
  102. .then(res=>{
  103. // this.$refs.uToast.show({
  104. // title: res.msg,
  105. // type: 'success',
  106. // });
  107. this.resdata = res.data;
  108. console.log('achievement',res)
  109. }).catch(err=>{
  110. this.$refs.uToast.show({
  111. title: err,
  112. type: 'error',
  113. });
  114. console.log('achievement ',err)
  115. });
  116. }
  117. },
  118. computed:{
  119. theTime(){
  120. return this.pickerYear+this.pickerMonth+this.pickerDay
  121. }
  122. }
  123. }
  124. </script>
  125. <style lang="scss">
  126. @import './performance.scss'
  127. </style>