You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

182 lines
4.5 KiB

9 months ago
6 months ago
8 months ago
6 months ago
6 months ago
6 months ago
8 months ago
6 months ago
9 months ago
9 months ago
6 months ago
9 months ago
9 months ago
8 months ago
6 months ago
9 months ago
6 months ago
9 months ago
8 months ago
6 months ago
8 months ago
8 months ago
6 months ago
8 months ago
6 months ago
8 months ago
6 months ago
6 months ago
8 months ago
9 months ago
8 months ago
6 months ago
6 months ago
8 months ago
  1. <template>
  2. <view class="main">
  3. <!-- <operateCoach v-if="identity=='实操教练'"/>
  4. <principal v-if="identity=='校长'||identity=='驾校财务'"/> -->
  5. <view class="content">
  6. <view class="status_bar"></view>
  7. <view class="" style="height: 30rpx;"></view>
  8. <view class="userInfo">
  9. <view class="tit">Hi,{{ vuex_userInfo.name }} {{identity}}</view>
  10. <view class="flex userRow">
  11. <view class="schoolIcon">
  12. <image src="@/static/images/index/ic_jiaxiao.png" mode=""></image>
  13. </view>
  14. <view class="schoolName oneRowText">{{ vuex_userInfo.schoolName }}</view>
  15. <!-- <view class="tag">合作教练</view> -->
  16. </view>
  17. </view>
  18. <view class="card priceBox">
  19. <view class="blueLab">今日已结算金额</view>
  20. <view class="price">{{statistics.amount}}</view>
  21. <view class="flex-b">
  22. <view class="data">截止{{statistics.refreshDate}}</view>
  23. <view class="refresh" @click="getSettlementStatisticsFn">
  24. <view class="text">刷新</view>
  25. <view class="icon">
  26. <image src="@/static/images/index/ic_shuaxin.png" mode=""></image>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="h1"> 结算统计</view>
  32. <!-- <view class="tab_box"> -->
  33. <view class="tabBox">
  34. <view class="tabs">
  35. <view class="tab" @click="tabClick(1)" :class="{active: currentTab==1}">最近五天</view>
  36. <view class="tab" @click="tabClick(2)" :class="{active: currentTab==2}">最近半年</view>
  37. </view>
  38. </view>
  39. <!-- <tabDate /> -->
  40. <!-- </view> -->
  41. <view class="card">
  42. <view class="chart">
  43. <columnChart :chartData="chartData"/>
  44. </view>
  45. </view>
  46. <view class="flex-b">
  47. <view class="h1">结算明细</view>
  48. <moreRight text="更多" @click.native="$goPage('/pages/indexEntry/settlement/settlement')"/>
  49. </view>
  50. <view class="record">
  51. <view class="card" v-for="(item,index) in list" :key="index">
  52. <stage :item="item"/>
  53. </view>
  54. </view>
  55. <view class="moreBtn" @click="$goPage('/pages/indexEntry/settlement/settlement')">查看更多</view>
  56. </view>
  57. <UserTab name ='统计'></UserTab>
  58. </view>
  59. </template>
  60. <script>
  61. import stage from './comp/stage'
  62. import columnChart from './comp/columnChart'
  63. import tabDate from './comp/tabDate'
  64. import {
  65. getSettlementStatistics,
  66. settle_list,
  67. getDaySettlement,
  68. getMonthSettlement
  69. } from '@/config/api.js'
  70. export default {
  71. components: {
  72. stage,
  73. columnChart,
  74. tabDate
  75. },
  76. data() {
  77. return {
  78. value1: '',
  79. currentTab: 1,
  80. statistics: {},
  81. list: [],
  82. show: false,
  83. chartData: []
  84. }
  85. },
  86. onShow() {
  87. uni.hideTabBar();
  88. if(!this.$store.state.user.vuex_loginInfo.accessToken) return
  89. this.getSettlementStatisticsFn()
  90. this.settle_listFn()
  91. this.getDaySettlement()
  92. },
  93. onLoad() {
  94. },
  95. mounted() {
  96. },
  97. methods: {
  98. // 结算统计按月查询
  99. async getDaySettlement() {
  100. let obj = {
  101. // startDate: 20240406,
  102. // endDate: 20240605,
  103. // coachId: this.vuex_coachId,
  104. schoolId: this.vuex_schoolId
  105. }
  106. let data = {}
  107. let categories = []
  108. if(this.currentTab==1) {
  109. data = await getDaySettlement(obj)
  110. categories = data.data.map(item=> {
  111. let str = item.refreshDate.slice(2,8)
  112. return str.slice(0, 2) + '-' + str.slice(2, 4) + '-' + str.slice(4, 6)
  113. })
  114. }else {
  115. data = await getMonthSettlement(obj)
  116. categories = data.data.map(item=> {
  117. return item.refreshDate.slice(0, 4) + '-' + item.refreshDate.slice(4)
  118. })
  119. }
  120. let res = data.data
  121. let amount = res.map(item=>item.amount)
  122. let chartData = {
  123. categories: categories,
  124. series: [
  125. {
  126. name: "目标值",
  127. data: amount
  128. }
  129. ]
  130. };
  131. this.chartData = chartData
  132. },
  133. tabClick(num) {
  134. if(num==this.currentTab) return
  135. this.currentTab = num
  136. this.getDaySettlement()
  137. },
  138. async getSettlementStatisticsFn() {
  139. let obj = {
  140. searchDateType: uni.$u.timeFormat(Date.now(), 'yyyymm'),
  141. // coachId: this.vuex_coachId || ''
  142. }
  143. const {
  144. data: res
  145. } = await getSettlementStatistics(obj)
  146. this.statistics = res
  147. console.log(res)
  148. },
  149. async settle_listFn() {
  150. let obj = {
  151. "pageNo": 1,
  152. "pageSize": 10,
  153. }
  154. const {
  155. data: res
  156. } = await settle_list(obj)
  157. this.list = res.list || []
  158. }
  159. }
  160. }
  161. </script>
  162. <style lang="scss" scoped>
  163. @import './comp/comp.scss';
  164. .main {
  165. background: url('../../../static/images/bigImg/indexTopBanner.png') #f6f6f6 no-repeat;
  166. background-size: 100% 492rpx;
  167. }
  168. </style>