statistics.vue 6.0 KB

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