statistics.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <view class="total-page page_env page-box container">
  3. <Nav :title="timeData[0]+'--'+timeData[1]" :back="false" is_icons is_fixed :bgHeight="bgHeight"
  4. :navsHeight="navsHeight" :opacity="scrollTop" :justify="'left'" :color="'#fff'" :fixedHeight="160">
  5. <view class="task-tabs m-t20" :style="{top:`${$tools.topHeight()}px`}">
  6. <HeadFilter v-model="dateTypeObj" @onTopSelect="onTopSelect" :user-status-list="userStatusList" @setTimeDate="setTimeDate"></HeadFilter>
  7. <view class="m-lr30 m-tb30 bor-255 r-100" v-if="statType === 7">
  8. <uv-subsection :list="list" :bgColor="'rgba(255,255,255,0.1)'" :activeColor="'#0FB160'"
  9. :inactiveColor="'#004615'" :fontSize="14" custom-style="height: 70rpx;border-radius: 30rpx;"
  10. custom-item-style="border-radius: 30rpx;" :current="current" @change="onChange"></uv-subsection>
  11. </view>
  12. </view>
  13. </Nav>
  14. <view class="statistics_content" :style="[{top:`${$tools.topHeight() + positionHeight}px`}]">
  15. <view class="">
  16. <!-- <HeadData v-if="statType === 3 || statType === 4" :date-type-obj="dateTypeObj"></HeadData>-->
  17. <view class="tabs page-box-bg-fff m-lr30 r-30" v-if="statType === 6 || statType === 7"
  18. :style="[{position:is_fixed?'absolute':''},{top:`${$tools.topHeight() + 85}px`}]"
  19. style="height: 100rpx;">
  20. <z-tabs ref="tabs" :list="tabsList"
  21. :active-style="{color:'#10B261',fontWeight:'bold',fontSize:'30rpx'}"
  22. :bar-style="{background:'#10B261'}" :inactive-style="{fontWeight:'bold',fontSize:'28rpx'}"
  23. :current="current" :bar-animate-mode="'worm'" @change="tabsChange" />
  24. </view>
  25. <!-- 顶部单行统计 -->
  26. <StatSingleData :is_fixed="is_tabs_fixed" v-if="is_single_data"></StatSingleData>
  27. <view class="sys-list-background-color p-lr30">
  28. <!-- 汇总统计-公司 -->
  29. <GeneralStat :date-type-obj="dateTypeObj" v-if="statType === 3"></GeneralStat>
  30. <!-- 资金统计-部门 -->
  31. <CapitalStat v-if="statType === 4"></CapitalStat>
  32. <!-- 提放统计-部门 -->
  33. <DrawingsStat v-if="statType === 6"></DrawingsStat>
  34. <!-- 消金统计-部门 -->
  35. <ConsumeStat v-if="statType === 7"></ConsumeStat>
  36. <!-- 任务统计-个人 -->
  37. <TaskStat v-if="statType === 1"></TaskStat>
  38. <!-- 业绩统计-个人 -->
  39. <PerformanceStat v-if="statType === 2"></PerformanceStat>
  40. <view class="bottom_view"></view>
  41. </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: 140,
  109. navsHeight: 65,
  110. positionHeight: 50,
  111. list: ['中银消费', '中邮消费', '新网车抵'],
  112. userStatusList: [],
  113. dateTypeObj:{
  114. dateType:4,//时间类型
  115. selectDate:'2023-02-25',//自定义的时候传数组,其它传开始日期
  116. money_type:1,
  117. censusUserType:0,
  118. product_id:5,
  119. },
  120. }
  121. },
  122. onLoad() {
  123. uni.hideTabBar()
  124. },
  125. onPageScroll(res) {
  126. this.scrollTop = res.scrollTop / 120
  127. },
  128. mounted() {
  129. this.getUserType()
  130. },
  131. computed: {
  132. // getBgHeight() {
  133. // switch (this.statType) {
  134. // case 0:
  135. // case 1:
  136. // this.statType = 0
  137. // return 48;
  138. // case 0:
  139. // case 1:
  140. // return 140;
  141. // default:
  142. // break;
  143. // }
  144. // },
  145. },
  146. methods: {
  147. setTimeDate(timeDate){
  148. this.timeData=timeDate
  149. },
  150. getUserType() {
  151. getUserType().then((res) => {
  152. if (res.code === 1) {
  153. this.userStatusList = res.data
  154. this.statType = this.userStatusList[0].id
  155. console.log(this.statType)
  156. }
  157. })
  158. },
  159. onChange(e) {
  160. this.current = e
  161. },
  162. onTopSelect(type) {
  163. uni.pageScrollTo({
  164. scrollTop: 0,
  165. duration: 0
  166. });
  167. this.statType = type
  168. this.is_single_data = type == 0 || type == 1 ? false : true
  169. this.is_tabs_fixed = type === 2 ? true : false
  170. if (type == 0 || type == 1) {
  171. this.bgHeight = 140
  172. this.positionHeight = 50
  173. }
  174. if (type == 2) {
  175. this.bgHeight = 65
  176. this.positionHeight = 80
  177. }
  178. if (type == 3) {
  179. this.bgHeight = 120
  180. this.navsHeight = 120
  181. this.positionHeight = 135
  182. }
  183. if (type == 4 || type == 5) {
  184. this.bgHeight = 105
  185. this.navsHeight = 65
  186. this.positionHeight = 55
  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. height: 100%;
  210. /* 高度占满整个屏幕 */
  211. }
  212. .content {
  213. flex: 1;
  214. /* 充满剩余空间 */
  215. background-color: #ffffff;
  216. /* 内容区域的背景颜色 */
  217. /* 其他样式按需添加 */
  218. }
  219. </style>