/** * 分润 */ Vue.component('admin-profit-list', { template: `
今天 昨天 上个月 前三个月
订单总金额
{{sumData.all_money}}
订单总退款金额
{{sumData.all_refund_money}}
交易笔数
{{sumData.transactions_count}}
代理商净分润(减退款)
{{sumData.agent_net_profit}}
合伙人净分润(减退款)
{{sumData.partner_net_profit}}
`, props: { 'userType': { type: Number, default: 1, },//分润类型 1合伙人 2代理商 'profitType': { type: Number, default: 1, },//分润类型 1直连 2新大陆 3云闪付 }, data() { return { sumData: { all_money: 0, transactions_count: 0, all_refund_money: 0, agent_net_profit: 0, }, search_info: { profit_type: 2, date_range: '', data_type: '', agent_id: '', merchant_id: '', }, orderList: [], len: 0, currentPage: 1, currentLimit: 10, pickerOptions: { disabledDate(time) { return time.getTime() > Date.now(); } } } }, methods: { searchData() { this.getTotal(); this.handleCurrentChange(1); }, changeRange() { this.search_info.data_type = ''; this.searchData(); }, selectType() { this.search_info.date_range = ''; this.searchData(); }, handleSizeChange(val) { this.currentLimit = val;//切换每页数量 this.currentPage = 1; this.getData(); }, handleCurrentChange(val) { this.currentPage = val; this.getData();//切换页数 }, getTotal() { this.sendRequest((this.userType == 1 ? 'Admin' : 'Agent') + '/Continentflow/profitTotal', { data: { search_info: JSON.stringify(this.search_info), }, success: (res) => { if (res.status == 1) { this.sumData = res.data; } else { this.$message.error(res.message); } } }) }, getData() { this.sendRequest((this.userType == 1 ? 'Admin' : 'Agent') + '/Continentflow/profitList', { data: { page: this.currentPage, limit: this.currentLimit, search_info: JSON.stringify(this.search_info), }, success: (res) => { if (res.status == 1) { this.orderList = []; this.orderList = res.data.list; this.len = res.data.count; } else { this.$message.error(res.message); } } }) }, }, created() { this.search_info.profit_type = this.profitType; this.searchData(); }, });