statistics.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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="tabs page-box-bg-fff m-lr30 r-30 m-t30"
  18. v-if="dateTypeObj.censusUserType === 6 || dateTypeObj.censusUserType === 7"
  19. :style="[{position:is_fixed?'absolute':''}]" style="height: 100rpx;">
  20. <z-tabs ref="tabs" :list="tabsList" :active-style="{color:'#10B261',fontWeight:'bold',fontSize:'30rpx'}"
  21. :bar-style="{background:'#10B261'}" :inactive-style="{fontWeight:'bold',fontSize:'28rpx'}"
  22. :current="current" :bar-animate-mode="'worm'" @change="tabsChange" />
  23. </view>
  24. <!-- 顶部单行统计 -->
  25. <StatSingleData :genre="dateTypeObj.censusUserType" :is_fixed="is_tabs_fixed" v-if="is_single_data">
  26. </StatSingleData>
  27. <view class=" p-lr30">
  28. <!-- 汇总统计-公司 -->
  29. <GeneralStat :date-type-obj="dateTypeObj" v-if="dateTypeObj.censusUserType === 3"></GeneralStat>
  30. <!-- 资金统计-部门 -->
  31. <CapitalStat :date-type-obj="dateTypeObj" v-if="dateTypeObj.censusUserType === 4"></CapitalStat>
  32. <!-- 提放统计-部门 -->
  33. <DrawingsStat :date-type-obj="dateTypeObj" v-if="dateTypeObj.censusUserType === 6"></DrawingsStat>
  34. <!-- 消金统计-部门 -->
  35. <ConsumeStat :date-type-obj="dateTypeObj" v-if="dateTypeObj.censusUserType === 7"></ConsumeStat>
  36. <!-- 任务统计-个人 -->
  37. <TaskStat :date-type-obj="dateTypeObj" v-if="dateTypeObj.censusUserType === 1"></TaskStat>
  38. <!-- 业绩统计-个人 -->
  39. <PerformanceStat :date-type-obj="dateTypeObj" v-if="dateTypeObj.censusUserType === 2">
  40. </PerformanceStat>
  41. <view class="bottom_view"></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. timeData: ['', ''],
  94. is_single_data: false, // 顶部单行统计是否显示
  95. is_tabs_fixed: false, // tabs是否固定
  96. scrollTop: 0,
  97. statType: 0,
  98. current: 0,
  99. tabsList: [{
  100. name: '汇总',
  101. dot_color: 'red',
  102. disabled: false
  103. }, {
  104. name: '银行',
  105. dot_color: 'yellow',
  106. disabled: false
  107. }],
  108. bgHeight: 50,
  109. navsHeight: 65,
  110. positionHeight: 50,
  111. bgSize: 150,
  112. bg_path: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/statistics/statistics-bg.png',
  113. list: ['中银消费', '中邮消费', '新网车抵'],
  114. userStatusList: [],
  115. dateTypeObj: {
  116. dateType: 4, //时间类型
  117. selectDate: '2023-02-25', //自定义的时候传数组,其它传开始日期
  118. money_type: 1,
  119. censusUserType: 0,
  120. product_id: 5,
  121. },
  122. }
  123. },
  124. onLoad() {
  125. uni.hideTabBar()
  126. },
  127. onPageScroll(res) {
  128. this.scrollTop = res.scrollTop / 120
  129. },
  130. mounted() {
  131. this.getUserType()
  132. },
  133. computed: {
  134. // getBgHeight() {
  135. // switch (this.statType) {
  136. // case 0:
  137. // case 1:
  138. // this.statType = 0
  139. // return 48;
  140. // case 0:
  141. // case 1:
  142. // return 140;
  143. // default:
  144. // break;
  145. // }
  146. // },
  147. },
  148. methods: {
  149. setTimeDate(timeDate) {
  150. this.timeData = timeDate
  151. },
  152. getUserType() {
  153. getUserType().then((res) => {
  154. if (res.code === 1) {
  155. this.userStatusList = res.data
  156. this.statType = this.userStatusList[0].id
  157. console.log(this.statType)
  158. }
  159. })
  160. },
  161. onChange(e) {
  162. this.current = e
  163. },
  164. onTopSelect(type) {
  165. uni.pageScrollTo({
  166. scrollTop: 0,
  167. duration: 0
  168. });
  169. this.statType = type
  170. this.is_single_data = this.dateTypeObj.censusUserType == 3 || type == 4 ? false : true
  171. console.log(type);
  172. if (type == 3 || type == 4) {
  173. this.bgSize = 150
  174. this.bgHeight = 50
  175. this.navsHeight = 65
  176. }
  177. if (type == 1 || type == 2) {
  178. this.bgSize = 125
  179. this.bgHeight = 55
  180. this.navsHeight = 65
  181. }
  182. if (type == 6 || type == 7) {
  183. this.bg_path =
  184. 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/statistics/statistics-bg2.png'
  185. } else {
  186. this.bg_path =
  187. 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/statistics/statistics-bg.png'
  188. }
  189. if (type == 6) {
  190. this.bgSize = 65
  191. this.bgHeight = 65
  192. this.navsHeight = 65
  193. }
  194. if (type == 7) {
  195. this.bgSize = 120
  196. this.bgHeight = 120
  197. this.navsHeight = 120
  198. }
  199. this.$forceUpdate()
  200. },
  201. },
  202. }
  203. </script>
  204. <style lang="scss" scoped>
  205. .statistics_content {
  206. width: 100%;
  207. position: absolute;
  208. }
  209. .stat_blank {
  210. // height: 100vh;
  211. background: red;
  212. // flex: 1;
  213. }
  214. .bottom_view {
  215. height: calc(160rpx + env(safe-area-inset-bottom));
  216. }
  217. .container {
  218. display: flex;
  219. flex-direction: column;
  220. min-height: 100%;
  221. /* 高度占满整个屏幕 */
  222. background-image: url('https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/statistics/statistics-bg.png');
  223. background-repeat: no-repeat;
  224. background-size: 100% 240px;
  225. }
  226. .content {
  227. flex: 1;
  228. /* 充满剩余空间 */
  229. background-color: #ffffff;
  230. /* 内容区域的背景颜色 */
  231. /* 其他样式按需添加 */
  232. }
  233. </style>