general_stat.vue 6.9 KB

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