statistics.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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="dateTypeObj.censusUserType === 7">
  10. <uv-subsection :list="list" :bgColor="'rgba(255,255,255,0.1)'" :activeColor="'#0FB160'" key-name="product_name"
  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. getConsumeType,
  68. getUserType
  69. } from "@/api/statistics";
  70. export default {
  71. components: {
  72. HeadFilter,
  73. HeadData,
  74. StatSingleData,
  75. CapitalStat,
  76. GeneralStat,
  77. ConsumeStat,
  78. DrawingsStat,
  79. PerformanceStat,
  80. TaskStat
  81. },
  82. data() {
  83. return {
  84. timeData: ['', ''],
  85. scrollTop: 0,
  86. statType: 0,
  87. current: 0,
  88. bgHeight: 50,
  89. navsHeight: 65,
  90. positionHeight: 50,
  91. bgSize: 150,
  92. bg_path: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/statistics/statistics-bg.png',
  93. list: [],
  94. userStatusList: [],
  95. dateTypeObj: {
  96. dateType: 4, //时间类型
  97. selectDate: '2023-02-25', //自定义的时候传数组,其它传开始日期
  98. money_type: 1,
  99. censusUserType: 0,
  100. product_id: 0,
  101. },
  102. }
  103. },
  104. onLoad() {
  105. uni.hideTabBar()
  106. },
  107. onPageScroll(res) {
  108. this.scrollTop = res.scrollTop / 120
  109. },
  110. mounted() {
  111. this.getUserType()
  112. this.getConsumeType()
  113. },
  114. computed: {
  115. // getBgHeight() {
  116. // switch (this.statType) {
  117. // case 0:
  118. // case 1:
  119. // this.statType = 0
  120. // return 48;
  121. // case 0:
  122. // case 1:
  123. // return 140;
  124. // default:
  125. // break;
  126. // }
  127. // },
  128. },
  129. methods: {
  130. onChange(e){
  131. this.current=e
  132. this.dateTypeObj.product_id=this.list[e].id
  133. },
  134. getConsumeType(){
  135. getConsumeType().then((res)=>{
  136. if(res.code === 1){
  137. this.list = res.data
  138. }
  139. })
  140. },
  141. setTimeDate(timeDate) {
  142. this.timeData = timeDate
  143. },
  144. getUserType() {
  145. getUserType().then((res) => {
  146. if (res.code === 1) {
  147. this.userStatusList = res.data
  148. this.statType = this.userStatusList[0].id
  149. console.log(this.statType)
  150. }
  151. })
  152. },
  153. onTopSelect(type) {
  154. uni.pageScrollTo({
  155. scrollTop: 0,
  156. duration: 0
  157. });
  158. this.statType = type
  159. this.is_single_data = this.dateTypeObj.censusUserType == 3 || type == 4 ? false : true
  160. console.log(type);
  161. if (type == 3 || type == 4) {
  162. this.bgSize = 150
  163. this.bgHeight = 50
  164. this.navsHeight = 65
  165. }
  166. if (type == 1 || type == 2) {
  167. this.bgSize = 125
  168. this.bgHeight = 55
  169. this.navsHeight = 65
  170. }
  171. if (type == 6 || type == 7) {
  172. this.bg_path =
  173. 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/statistics/statistics-bg2.png'
  174. } else {
  175. this.bg_path =
  176. 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/statistics/statistics-bg.png'
  177. }
  178. if (type == 6) {
  179. this.bgSize = 65
  180. this.bgHeight = 65
  181. this.navsHeight = 65
  182. }
  183. if (type == 7) {
  184. this.bgSize = 120
  185. this.bgHeight = 120
  186. this.navsHeight = 120
  187. }
  188. this.$forceUpdate()
  189. },
  190. },
  191. }
  192. </script>
  193. <style lang="scss" scoped>
  194. .statistics_content {
  195. width: 100%;
  196. position: absolute;
  197. }
  198. .stat_blank {
  199. // height: 100vh;
  200. background: red;
  201. // flex: 1;
  202. }
  203. .bottom_view {
  204. height: calc(160rpx + env(safe-area-inset-bottom));
  205. }
  206. .container {
  207. display: flex;
  208. flex-direction: column;
  209. min-height: 100%;
  210. /* 高度占满整个屏幕 */
  211. background-image: url('https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/statistics/statistics-bg.png');
  212. background-repeat: no-repeat;
  213. background-size: 100% 240px;
  214. }
  215. .content {
  216. flex: 1;
  217. /* 充满剩余空间 */
  218. background-color: #ffffff;
  219. /* 内容区域的背景颜色 */
  220. /* 其他样式按需添加 */
  221. }
  222. </style>