| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- <template>
- <view class="">
- <HeadData :money-data="moneyData"></HeadData>
- <stat_finance_chart :money-data="moneyData"></stat_finance_chart>
- <stat-finance :date-type-obj="dateTypeObj"></stat-finance>
- <view class="sys-background-fff r-30">
- <StatCapital :leftColor="0" :rightColor="1" :leftText="'任务资金汇总'" :tabulate-data="sysPassageData"></StatCapital>
- <view class="view_line"></view>
- <StatCapital :leftColor="1" :rightColor="2" :leftText="'在途资金汇总'" :tabulate-data="sysCapitalMoney"></StatCapital>
- </view>
- <stat-industry></stat-industry>
- <stat-age-chart></stat-age-chart>
- </view>
- </template>
- <script>
- import StatLoanChart from "../module/stat_loan_chart.vue"
- import StatRanking from "../module/stat_ranking.vue"
- import StatCapital from "../module/stat_capital.vue"
- import StatSituation from "../module/stat_situation.vue"
- import HeadData from "@/pages/statistics/module/head_data.vue";
- import {getSysCashier,getSysPassage,getCapitalMoney,getSysIndustry,getSysAge} from "@/api/statistics";
- import Stat_finance_chart from "@/pages/statistics/module/stat_finance_chart.vue";
- import StatFinance from "@/pages/statistics/module/stat_finance.vue";
- import md5 from 'js-md5'
- import StatIndustry from "@/pages/statistics/module/stat_industry.vue";
- import StatAgeChart from "@/pages/statistics/module/stat_age_chart.vue";
- export default {
- props:{
- 'dateTypeObj':{
- default:()=>{
- return {
- dateType:4,
- selectDate:'2023-02-25',
- money_type:1,
- censusUserType:0,
- product_id:5,
- }
- }
- }
- },
- components: {
- StatAgeChart,
- StatIndustry,
- StatFinance,
- Stat_finance_chart,
- HeadData,
- StatLoanChart,
- StatRanking,
- StatCapital,
- StatSituation
- },
- watch:{
- 'dateTypeObj':function () {
- this.initData()
- }
- },
- mounted() {
- this.initData()
- },
- data() {
- return {
- moneyData:{
- out_money: 0,
- out_num: 0,
- put_money: 0,
- put_num: 0,
- },
- sysPassageData:{
- consume_money: 0,
- consume_num: "0",
- consume_ratio: 0,
- pledge_money: 0,
- pledge_num: "0",
- pledge_ratio: 0,
- list:[{name: "", ratio: 0, value: 0, labelText: ""},{name: "", ratio: 0, value: 0, labelText: ""}]
- },
- sysCapitalMoney:{
- consume_money: 0,
- consume_num: "0",
- consume_ratio: 0,
- pledge_money: 0,
- pledge_num: "0",
- pledge_ratio: 0,
- list:[{name: "", ratio: 0, value: 0, labelText: ""},{name: "", ratio: 0, value: 0, labelText: ""}]
- },
- industryList:{},
- ageList:{},
- sendMd5:''
- };
- },
- methods: {
- setSendMd5(){
- let str=JSON.stringify(this.dateTypeObj)
- return md5(str)
- },
- initData(){
- if(this.dateTypeObj.censusUserType>0){
- let sendMd5=this.setSendMd5()
- if(sendMd5 !== this.sendMd5){
- this.sendMd5=sendMd5
- this.getSysCashier()
- this.getSysPassage()
- this.getCapitalMoney()
- this.getSysIndustry()
- this.getSysAge()
- }
- }
- },
- getSysCashier(){
- getSysCashier(this.dateTypeObj).then((res)=>{
- if(res.code===1){
- this.moneyData=res.data
- }
- })
- },
- //管理员-任务资金汇总
- getSysPassage(){
- getSysPassage(this.dateTypeObj).then((res)=>{
- if(res.code === 1){
- this.sysPassageData = res.data
- }else{
- // this.$refs.chartsPieView.setNoList()
- }
- })
- },
- //管理员-在途资金汇总
- getCapitalMoney(){
- getCapitalMoney(this.dateTypeObj).then((res)=>{
- if(res.code===1 && res.data.items.length>0){
- let totalMoney=res.data.items[0].value+res.data.items[1].value
- this.sysCapitalMoney.consume_money=res.data.items[0].value
- this.sysCapitalMoney.consume_num=res.data.items[0].total_num
- this.sysCapitalMoney.consume_ratio=(res.data.items[0].value/totalMoney*100).toFixed(2)
- this.sysCapitalMoney.pledge_money=res.data.items[1].value
- this.sysCapitalMoney.pledge_num=res.data.items[1].total_num
- this.sysCapitalMoney.pledge_ratio=(res.data.items[1].value/totalMoney*100).toFixed(2)
- this.sysCapitalMoney.list[0]={name: res.data.items[0].name, ratio: this.sysCapitalMoney.consume_ratio, value: this.sysCapitalMoney.consume_money, labelText: ""}
- this.sysCapitalMoney.list[1]={name: res.data.items[1].name, ratio: this.sysCapitalMoney.pledge_ratio, value: this.sysCapitalMoney.pledge_money, labelText: ""}
- }
- })
- },
- // //管理员-行业统计
- getSysIndustry(){
- getSysIndustry(this.dateTypeObj).then((res)=>{
- if(res.code === 1){
- this.industryList=res.data
- // let ret = {
- // series:[{data:res.data.roseData}]
- // }
- // this.$refs.chartsRose.show = true
- // this.$refs.chartsRose.chartData2 = JSON.parse(JSON.stringify(ret))
- }else{
- // this.$refs.chartsRose.setNoList()
- }
- })
- },
- //管理员-年龄区域统计
- getSysAge(){
- getSysAge(this.dateTypeObj).then((res)=>{
- if(res.code === 1){
- this.ageList=res.data
- // this.$refs.chartsAdminThree.show = true
- // this.$refs.chartsAdminThree.chartData4 = JSON.parse(JSON.stringify(ret));
- }else{
- // this.$refs.chartsAdminThree.setNoList()
- }
- })
- },
- },
- }
- </script>
- <style>
- </style>
|