statistics.vue 6.3 KB

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