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.

181 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. this.getSettlementStatisticsFn()
  89. this.settle_listFn()
  90. this.getDaySettlement()
  91. },
  92. onLoad() {
  93. },
  94. mounted() {
  95. },
  96. methods: {
  97. // 结算统计按月查询
  98. async getDaySettlement() {
  99. let obj = {
  100. // startDate: 20240406,
  101. // endDate: 20240605,
  102. // coachId: this.vuex_coachId,
  103. schoolId: this.vuex_schoolId
  104. }
  105. let data = {}
  106. let categories = []
  107. if(this.currentTab==1) {
  108. data = await getDaySettlement(obj)
  109. categories = data.data.map(item=> {
  110. let str = item.refreshDate.slice(2,8)
  111. return str.slice(0, 2) + '-' + str.slice(2, 4) + '-' + str.slice(4, 6)
  112. })
  113. }else {
  114. data = await getMonthSettlement(obj)
  115. categories = data.data.map(item=> {
  116. return item.refreshDate.slice(0, 4) + '-' + item.refreshDate.slice(4)
  117. })
  118. }
  119. let res = data.data
  120. let amount = res.map(item=>item.amount)
  121. let chartData = {
  122. categories: categories,
  123. series: [
  124. {
  125. name: "目标值",
  126. data: amount
  127. }
  128. ]
  129. };
  130. this.chartData = chartData
  131. },
  132. tabClick(num) {
  133. if(num==this.currentTab) return
  134. this.currentTab = num
  135. this.getDaySettlement()
  136. },
  137. async getSettlementStatisticsFn() {
  138. let obj = {
  139. searchDateType: uni.$u.timeFormat(Date.now(), 'yyyymm'),
  140. // coachId: this.vuex_coachId || ''
  141. }
  142. const {
  143. data: res
  144. } = await getSettlementStatistics(obj)
  145. this.statistics = res
  146. console.log(res)
  147. },
  148. async settle_listFn() {
  149. let obj = {
  150. "pageNo": 1,
  151. "pageSize": 10,
  152. }
  153. const {
  154. data: res
  155. } = await settle_list(obj)
  156. this.list = res.list || []
  157. }
  158. }
  159. }
  160. </script>
  161. <style lang="scss" scoped>
  162. @import './comp/comp.scss';
  163. .main {
  164. background: url('../../../static/images/bigImg/indexTopBanner.png') #f6f6f6 no-repeat;
  165. background-size: 100% 492rpx;
  166. }
  167. </style>