general_stat.vue 5.7 KB

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