statistics.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <view class="total-page page_env page-box container">
  3. <Nav :title="'2024-3.12-3.18'+ statType" :back="false" is_icons is_fixed :bgHeight="bgHeight"
  4. :navsHeight="navsHeight" :opacity="scrollTop" :justify="'left'" :color="'#fff'" :fixedHeight="160">
  5. <view class="task-tabs m-t20" :style="{top:`${$tools.topHeight()}px`}">
  6. <HeadFilter @onTopSelect="onTopSelect" :user-status-list="userStatusList"></HeadFilter>
  7. <view class="m-lr30 m-tb30 bor-255 r-100" v-if="statType === 3">
  8. <uv-subsection :list="list" :bgColor="'rgba(255,255,255,0.1)'" :activeColor="'#0FB160'"
  9. :inactiveColor="'#004615'" :fontSize="14" custom-style="height: 70rpx;border-radius: 30rpx;"
  10. custom-item-style="border-radius: 30rpx;" :current="current" @change="onChange"></uv-subsection>
  11. </view>
  12. </view>
  13. </Nav>
  14. <view class="statistics_content" :style="[{top:`${$tools.topHeight() + positionHeight}px`}]">
  15. <view class="">
  16. <HeadData v-if="statType === 0 || statType === 1"></HeadData>
  17. <view class="tabs page-box-bg-fff m-lr30 r-30" v-if="statType === 2 || statType === 3"
  18. :style="[{position:is_fixed?'absolute':''},{top:`${$tools.topHeight() + 85}px`}]"
  19. style="height: 100rpx;">
  20. <z-tabs ref="tabs" :list="tabsList"
  21. :active-style="{color:'#10B261',fontWeight:'bold',fontSize:'30rpx'}"
  22. :bar-style="{background:'#10B261'}" :inactive-style="{fontWeight:'bold',fontSize:'28rpx'}"
  23. :current="current" :bar-animate-mode="'worm'" @change="tabsChange" />
  24. </view>
  25. <!-- 顶部单行统计 -->
  26. <StatSingleData :is_fixed="is_tabs_fixed" v-if="is_single_data"></StatSingleData>
  27. <view class="sys-list-background-color p-lr30">
  28. <!-- 汇总统计-公司 -->
  29. <GeneralStat v-if="statType === 0"></GeneralStat>
  30. <!-- 资金统计-部门 -->
  31. <CapitalStat v-if="statType === 1"></CapitalStat>
  32. <!-- 提放统计-部门 -->
  33. <DrawingsStat v-if="statType === 2"></DrawingsStat>
  34. <!-- 消金统计-部门 -->
  35. <ConsumeStat v-if="statType === 3"></ConsumeStat>
  36. <!-- 任务统计-个人 -->
  37. <TaskStat v-if="statType === 4"></TaskStat>
  38. <!-- 业绩统计-个人 -->
  39. <PerformanceStat v-if="statType === 5"></PerformanceStat>
  40. <view class="bottom_view"></view>
  41. </view>
  42. </view>
  43. </view>
  44. <Tab :tab-index="3"></Tab>
  45. </view>
  46. </template>
  47. <!--
  48. 财务汇总占比 stat_finance_chart
  49. 放款汇总占比 stat_loan_chart
  50. 财务汇总明细 stat_finance
  51. 任务资金汇总 stat_capital
  52. 行业占比 stat_industry
  53. 年龄分布 stat_age_chart
  54. 情况说明 stat_situation
  55. 排名 stat_rankin
  56. -->
  57. <script>
  58. // 顶部筛选
  59. import HeadFilter from "./module/head_filter.vue"
  60. // 顶部左右统计数据
  61. import HeadData from "./module/head_data.vue"
  62. // 顶部单统计数据
  63. import StatSingleData from "./module/stat_single_data.vue"
  64. // 汇总统计
  65. import GeneralStat from "./components/general_stat.vue"
  66. // 资金统计
  67. import CapitalStat from "./components/capital_stat.vue"
  68. // 提放统计
  69. import DrawingsStat from "./components/drawings_stat.vue"
  70. // 消金统计
  71. import ConsumeStat from "./components/consume_stat.vue"
  72. // 任务统计
  73. import TaskStat from "./components/task_stat.vue"
  74. // 业绩统计
  75. import PerformanceStat from "./components/performance_stat.vue"
  76. import {
  77. getUserType
  78. } from "@/api/statistics";
  79. export default {
  80. components: {
  81. HeadFilter,
  82. HeadData,
  83. StatSingleData,
  84. CapitalStat,
  85. GeneralStat,
  86. ConsumeStat,
  87. DrawingsStat,
  88. PerformanceStat,
  89. TaskStat
  90. },
  91. data() {
  92. return {
  93. is_single_data: false, // 顶部单行统计是否显示
  94. is_tabs_fixed: false, // tabs是否固定
  95. scrollTop: 0,
  96. statType: 0,
  97. current: 0,
  98. tabsList: [{
  99. name: '汇总',
  100. dot_color: 'red',
  101. disabled: false
  102. }, {
  103. name: '银行',
  104. dot_color: 'yellow',
  105. disabled: false
  106. }],
  107. bgHeight: 140,
  108. navsHeight: 65,
  109. positionHeight: 50,
  110. list: ['中银消费', '中邮消费', '新网车抵'],
  111. userStatusList: []
  112. }
  113. },
  114. onLoad() {
  115. uni.hideTabBar()
  116. },
  117. onPageScroll(res) {
  118. this.scrollTop = res.scrollTop / 120
  119. },
  120. mounted() {
  121. // this.getUserType()
  122. },
  123. computed: {
  124. // getBgHeight() {
  125. // switch (this.statType) {
  126. // case 0:
  127. // case 1:
  128. // this.statType = 0
  129. // return 48;
  130. // case 0:
  131. // case 1:
  132. // return 140;
  133. // default:
  134. // break;
  135. // }
  136. // },
  137. },
  138. methods: {
  139. getUserType() {
  140. getUserType().then((res) => {
  141. if (res.code === 1) {
  142. this.userStatusList = res.data
  143. this.statType = this.userStatusList[0].id
  144. console.log(this.statType)
  145. }
  146. })
  147. },
  148. onChange(e) {
  149. this.current = e
  150. },
  151. onTopSelect(type) {
  152. uni.pageScrollTo({
  153. scrollTop: 0,
  154. duration: 0
  155. });
  156. this.statType = type
  157. this.is_single_data = type == 0 || type == 1 ? false : true
  158. this.is_tabs_fixed = type === 2 ? true : false
  159. if (type == 0 || type == 1) {
  160. this.bgHeight = 140
  161. this.positionHeight = 50
  162. }
  163. if (type == 2) {
  164. this.bgHeight = 65
  165. this.positionHeight = 80
  166. }
  167. if (type == 3) {
  168. this.bgHeight = 120
  169. this.navsHeight = 120
  170. this.positionHeight = 135
  171. }
  172. if (type == 4 || type == 5) {
  173. this.bgHeight = 105
  174. this.navsHeight = 65
  175. this.positionHeight = 55
  176. }
  177. this.$forceUpdate()
  178. },
  179. },
  180. }
  181. </script>
  182. <style lang="scss" scoped>
  183. .statistics_content {
  184. width: 100%;
  185. position: absolute;
  186. }
  187. .stat_blank {
  188. // height: 100vh;
  189. background: red;
  190. // flex: 1;
  191. }
  192. .bottom_view {
  193. height: calc(160rpx + env(safe-area-inset-bottom));
  194. }
  195. .container {
  196. display: flex;
  197. flex-direction: column;
  198. height: 100%;
  199. /* 高度占满整个屏幕 */
  200. }
  201. .content {
  202. flex: 1;
  203. /* 充满剩余空间 */
  204. background-color: #ffffff;
  205. /* 内容区域的背景颜色 */
  206. /* 其他样式按需添加 */
  207. }
  208. </style>