| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- <template>
- <view class="">
- <HeadData :money-data="moneyData"></HeadData>
- <StatLoanChart ref="outObj" :genre="1" :leftText="'放款汇总占比'"></StatLoanChart>
- <StatLoanChart ref="putObj" :genre="2" :leftText="'回款汇总占比'"></StatLoanChart>
- <stat_gather is_group :leftText="'汇总明细'" :out-list="outList" :put-list="putList"></stat_gather>
- <view class="sys-background-fff r-30">
- <StatCapital :leftColor="0" :rightColor="1" :leftText="'任务资金汇总'">
- </StatCapital>
- <view class="view_line"></view>
- <StatRanking :is_margin_top="false" :leftText="'个人业绩排行'"></StatRanking>
- </view>
- <StatSituation :type="1"></StatSituation>
- </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 { getDepartmentMoney} from "@/api/statistics";
- import md5 from "js-md5";
- import Stat_gather from "@/pages/statistics/module/stat_gather.vue";
- export default {
- props:{
- 'dateTypeObj':{
- default:()=>{
- return {
- dateType:4,
- selectDate:'2023-02-25',
- money_type:1,
- censusUserType:0,
- product_id:5,
- }
- }
- }
- },
- components: {
- Stat_gather,
- 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,
- },
- outList:[],
- putList:[],
- 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.getDepartmentMoney(1)
- this.getDepartmentMoney(2)
- }
- }
- },
- getDepartmentMoney(money_type){
- let selectData=this.dateTypeObj
- selectData.money_type=money_type
- getDepartmentMoney(selectData).then((res)=>{
- if(res.code === 1){
- if(money_type===1){
- this.moneyData.out_money=res.data.moneyData.loanMoney
- this.moneyData.out_num=res.data.moneyData.loanNum
- this.outList=res.data.items
- this.$refs.outObj.setPeakChartData(this.outList)
- }else {
- this.moneyData.put_money=res.data.moneyData.loanMoney
- this.moneyData.put_num=res.data.moneyData.loanNum
- this.putList=res.data.items
- this.$refs.putObj.setPeakChartData(this.putList)
- }
- // this.list = res.data.items
- // this.userType = res.data.userType
- // let ret = {series: [{data: []}]};
- // let totalMoney=0;
- // let totalNum=0;
- // res.data.items.forEach(v=>{
- // if(v.value > 0){
- // totalMoney+=(v.value*1)
- // totalNum+=(v.total_num*1)
- // ret.series[0].data.push(v)
- // }
- // })
- // this.totalMoney=totalMoney
- // this.totalNum=totalNum
- // let moneyData={
- // censusUserType:this.selectData.censusUserType,
- // totalNum: res.data.moneyData.loanNum,
- // totalMoney: res.data.moneyData.loanMoney,
- // money_type:this.selectData.money_type,
- // }
- // this.$emit('SetTotalMoneyOrNum',moneyData)
- // this.$refs.chartsMountView.show = true
- // this.$refs.chartsMountView.chartData = JSON.parse(JSON.stringify(ret));
- }else{
- // this.lisy = []
- // let moneyData={
- // censusUserType:this.selectData.censusUserType,
- // totalNum: 0,
- // totalMoney: 0,
- // money_type:this.selectData.money_type,
- // }
- // this.$emit('SetTotalMoneyOrNum',moneyData)
- // this.$refs.chartsMountView.setNoList()
- }
- })
- }
- },
- }
- </script>
- <style>
- </style>
|