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.6 KiB

9 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
9 months ago
6 months ago
9 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" :style="{ background: `url(${imgUrl}) #f6f6f6 no-repeat`, backgroundSize: backgroundSize }">
  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 { imgUrl } from '@/config/site.config'
  65. import {
  66. getSettlementStatistics,
  67. settle_list,
  68. getDaySettlement,
  69. getMonthSettlement
  70. } from '@/config/api.js'
  71. export default {
  72. components: {
  73. stage,
  74. columnChart,
  75. tabDate
  76. },
  77. data() {
  78. return {
  79. value1: '',
  80. currentTab: 1,
  81. statistics: {},
  82. list: [],
  83. imgUrl: imgUrl+'indexTopBanner.png',
  84. backgroundSize: '100% 492rpx',
  85. show: false,
  86. chartData: []
  87. }
  88. },
  89. onShow() {
  90. uni.hideTabBar();
  91. this.getSettlementStatisticsFn()
  92. this.settle_listFn()
  93. this.getDaySettlement()
  94. },
  95. onLoad() {
  96. },
  97. mounted() {
  98. },
  99. methods: {
  100. // 结算统计按月查询
  101. async getDaySettlement() {
  102. let obj = {
  103. // startDate: 20240406,
  104. // endDate: 20240605,
  105. // coachId: this.vuex_coachId,
  106. schoolId: this.vuex_schoolId
  107. }
  108. let data = {}
  109. let categories = []
  110. if(this.currentTab==1) {
  111. data = await getDaySettlement(obj)
  112. categories = data.data.map(item=> {
  113. let str = item.refreshDate.slice(2,8)
  114. return str.slice(0, 2) + '-' + str.slice(2, 4) + '-' + str.slice(4, 6)
  115. })
  116. }else {
  117. data = await getMonthSettlement(obj)
  118. categories = data.data.map(item=> {
  119. return item.refreshDate.slice(0, 4) + '-' + item.refreshDate.slice(4)
  120. })
  121. }
  122. let res = data.data
  123. let amount = res.map(item=>item.amount)
  124. let chartData = {
  125. categories: categories,
  126. series: [
  127. {
  128. name: "目标值",
  129. data: amount
  130. }
  131. ]
  132. };
  133. this.chartData = chartData
  134. },
  135. tabClick(num) {
  136. if(num==this.currentTab) return
  137. this.currentTab = num
  138. this.getDaySettlement()
  139. },
  140. async getSettlementStatisticsFn() {
  141. let obj = {
  142. searchDateType: uni.$u.timeFormat(Date.now(), 'yyyymm'),
  143. // coachId: this.vuex_coachId || ''
  144. }
  145. const {
  146. data: res
  147. } = await getSettlementStatistics(obj)
  148. this.statistics = res
  149. console.log(res)
  150. },
  151. async settle_listFn() {
  152. let obj = {
  153. "pageNo": 1,
  154. "pageSize": 10,
  155. }
  156. const {
  157. data: res
  158. } = await settle_list(obj)
  159. this.list = res.list || []
  160. }
  161. }
  162. }
  163. </script>
  164. <style lang="scss" scoped>
  165. @import './comp/comp.scss';
  166. </style>