general_stat.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <view class="">
  3. <HeadData :money-data="moneyData"></HeadData>
  4. <stat_finance_chart :money-data="moneyData"></stat_finance_chart>
  5. <stat-finance ref="financeObj" :date-type-obj="dateTypeObj"></stat-finance>
  6. <view class="sys-background-fff r-30">
  7. <StatCapital :leftColor="0" ref="passageObj" :rightColor="1" :leftText="'任务资金汇总'" :tabulate-data="sysPassageData"></StatCapital>
  8. <view class="view_line"></view>
  9. <StatCapital :leftColor="1" ref="capitalObj" :rightColor="2" :bgChartColor="['#2B7DFA','#ED9A2C']" :leftText="'在途资金汇总'" :tabulate-data="sysCapitalMoney"></StatCapital>
  10. </view>
  11. <stat-industry ref="industryRef" :industry-list="industryList"></stat-industry>
  12. <stat-age-chart ref="ageRef"></stat-age-chart>
  13. </view>
  14. </template>
  15. <script>
  16. import StatLoanChart from "../module/stat_loan_chart.vue"
  17. import StatRanking from "../module/stat_ranking.vue"
  18. import StatCapital from "../module/stat_capital.vue"
  19. import StatSituation from "../module/stat_situation.vue"
  20. import HeadData from "@/pages/statistics/module/head_data.vue";
  21. import {
  22. getSysCashier,
  23. getSysPassage,
  24. getCapitalMoney,
  25. getSysIndustry,
  26. getSysAge
  27. } from "@/api/statistics";
  28. import Stat_finance_chart from "@/pages/statistics/module/stat_finance_chart.vue";
  29. import StatFinance from "@/pages/statistics/module/stat_finance.vue";
  30. import md5 from 'js-md5'
  31. import StatIndustry from "@/pages/statistics/module/stat_industry.vue";
  32. import StatAgeChart from "@/pages/statistics/module/stat_age_chart.vue";
  33. export default {
  34. props: {
  35. 'dateTypeObj': {
  36. default: () => {
  37. return {
  38. dateType: 4,
  39. selectDate: '2023-02-25',
  40. money_type: 1,
  41. censusUserType: 0,
  42. product_id: 5,
  43. }
  44. }
  45. }
  46. },
  47. components: {
  48. StatAgeChart,
  49. StatIndustry,
  50. StatFinance,
  51. Stat_finance_chart,
  52. HeadData,
  53. StatLoanChart,
  54. StatRanking,
  55. StatCapital,
  56. StatSituation
  57. },
  58. watch: {
  59. 'dateTypeObj': function() {
  60. this.initData()
  61. }
  62. },
  63. mounted() {
  64. this.initData()
  65. },
  66. data() {
  67. return {
  68. moneyData: {
  69. out_money: 0,
  70. out_num: 0,
  71. put_money: 0,
  72. put_num: 0,
  73. },
  74. sysPassageData: {
  75. consume_money: 0,
  76. consume_num: "0",
  77. consume_ratio: 0,
  78. pledge_money: 0,
  79. pledge_num: "0",
  80. pledge_ratio: 0,
  81. list: [{
  82. name: "",
  83. ratio: 0,
  84. value: 0,
  85. labelText: ""
  86. }, {
  87. name: "",
  88. ratio: 0,
  89. value: 0,
  90. labelText: ""
  91. }]
  92. },
  93. sysCapitalMoney: {
  94. consume_money: 0,
  95. consume_num: "0",
  96. consume_ratio: 0,
  97. pledge_money: 0,
  98. pledge_num: "0",
  99. pledge_ratio: 0,
  100. list: [{
  101. name: "",
  102. ratio: 0,
  103. value: 0,
  104. labelText: ""
  105. }, {
  106. name: "",
  107. ratio: 0,
  108. value: 0,
  109. labelText: ""
  110. }]
  111. },
  112. industryList: {},
  113. ageList: {},
  114. sendMd5: ''
  115. };
  116. },
  117. methods: {
  118. setSendMd5() {
  119. let str = JSON.stringify(this.dateTypeObj)
  120. return md5(str)
  121. },
  122. initData() {
  123. if (this.dateTypeObj.censusUserType > 0) {
  124. let sendMd5 = this.setSendMd5()
  125. if (sendMd5 !== this.sendMd5) {
  126. this.sendMd5 = sendMd5
  127. this.getSysCashier()
  128. this.getSysPassage()
  129. this.getCapitalMoney()
  130. this.getSysIndustry()
  131. this.getSysAge()
  132. this.$refs.financeObj.startList()
  133. }
  134. }
  135. },
  136. getSysCashier() {
  137. getSysCashier(this.dateTypeObj).then((res) => {
  138. if (res.code === 1) {
  139. this.moneyData = res.data
  140. }
  141. })
  142. },
  143. //管理员-任务资金汇总
  144. getSysPassage() {
  145. getSysPassage(this.dateTypeObj).then((res) => {
  146. if (res.code === 1) {
  147. this.sysPassageData = res.data
  148. } else {
  149. // this.$refs.chartsPieView.setNoList()
  150. }
  151. })
  152. },
  153. //管理员-在途资金汇总
  154. getCapitalMoney() {
  155. getCapitalMoney(this.dateTypeObj).then((res) => {
  156. if (res.code === 1 && res.data.items.length > 0) {
  157. let totalMoney = res.data.items[0].value + res.data.items[1].value
  158. this.sysCapitalMoney.consume_money = res.data.items[0].value
  159. this.sysCapitalMoney.consume_num = res.data.items[0].total_num
  160. this.sysCapitalMoney.consume_ratio = (res.data.items[0].value / totalMoney * 100).toFixed(
  161. 2)
  162. this.sysCapitalMoney.pledge_money = res.data.items[1].value
  163. this.sysCapitalMoney.pledge_num = res.data.items[1].total_num
  164. this.sysCapitalMoney.pledge_ratio = (res.data.items[1].value / totalMoney * 100).toFixed(2)
  165. this.sysCapitalMoney.list[0] = {
  166. name: res.data.items[0].name,
  167. ratio: this.sysCapitalMoney.consume_ratio,
  168. value: this.sysCapitalMoney.consume_money,
  169. labelText: ""
  170. }
  171. this.sysCapitalMoney.list[1] = {
  172. name: res.data.items[1].name,
  173. ratio: this.sysCapitalMoney.pledge_ratio,
  174. value: this.sysCapitalMoney.pledge_money,
  175. labelText: ""
  176. }
  177. }
  178. })
  179. },
  180. // //管理员-行业统计
  181. getSysIndustry() {
  182. getSysIndustry(this.dateTypeObj).then((res) => {
  183. if (res.code === 1) {
  184. this.industryList = res.data
  185. this.$refs.industryRef.setData(res.data)
  186. // let ret = {
  187. // series:[{data:res.data.roseData}]
  188. // }
  189. // this.$refs.chartsRose.show = true
  190. // this.$refs.chartsRose.chartData2 = JSON.parse(JSON.stringify(ret))
  191. } else {
  192. // this.$refs.chartsRose.setNoList()
  193. }
  194. })
  195. },
  196. //管理员-年龄区域统计
  197. getSysAge() {
  198. getSysAge(this.dateTypeObj).then((res) => {
  199. if (res.code === 1) {
  200. this.ageList = res.data
  201. this.$refs.ageRef.setData( res.data)
  202. // this.$refs.chartsAdminThree.show = true
  203. // this.$refs.chartsAdminThree.chartData4 = JSON.parse(JSON.stringify(ret));
  204. } else {
  205. // this.$refs.chartsAdminThree.setNoList()
  206. }
  207. })
  208. },
  209. },
  210. }
  211. </script>
  212. <style>
  213. </style>