statistics.vue 7.2 KB

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