general_stat.vue 6.9 KB

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