import * as API from '@/apis/merchant.js' export default { data() { return { selectList: [{ id: '', licensePlateNumber: '全部车辆' }, ], show1: false, selectForm: { select1: '', select1Name: '全部车辆', }, revenueStatisticsDown:{}, revenueStatisticsUp:{}, } }, methods: { getMerchantVehicleList() { this.$refs.common.showLoading() API.merchantVehicleList().then(response => { var selectList1 = [{ id: '', licensePlateNumber: '全部车辆' }, ...response.data ] // selectList1 this.selectList = selectList1; this.$refs.common.showLoading(false); //this.getProfitList(); this.getRevenueStatisticsUp(); }).catch(error => { this.$refs.common.showLoading(false, error); }) }, show1confirm(op) { var i = op[0]; this.selectForm.select1Index=i; var obj = this.selectList[i] this.selectForm.select1 = obj.id; this.selectForm.select1Name = obj.licensePlateNumber; //this.getProfitList(); this.getRevenueStatisticsUp(); }, gotoUrl(){ uni.switchTab({ url: '/pages/order/index' }); }, gotoUrl2(){ uni.navigateTo({ url: '/pages/class/list' }); }, getRevenueStatisticsDown(){ this.$refs.common.showLoading() API.revenueStatisticsDown( { vehicleId:this.selectForm.select1 } ).then(response => { this.revenueStatisticsDown=response.data this.$refs.common.showLoading(false); }).catch(error => { this.$refs.common.showLoading(false,error); }) }, getRevenueStatisticsUp(){ this.$refs.common.showLoading() API.revenueStatisticsUp({ vehicleId:this.selectForm.select1 } ).then(response => { this.revenueStatisticsUp=response.data this.$refs.common.showLoading(false); this.getRevenueStatisticsDown() }).catch(error => { this.$refs.common.showLoading(false,error); }) } }, mounted() { // document.body.style.backgroundColor = '#eee'; }, destroyed() { //document.body.style.backgroundColor = ''; }, onLoad(temp) { },onReady(){ this.getMerchantVehicleList() } }