| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092 |
- <template>
- <basic-container>
- <el-dialog :modal-append-to-body="false" :visible.sync="editBussinessVisible" title="编辑资料" width="80%">
- <avue-form v-if="editBussinessVisible" :table-loading="loading" v-model="bussiness" :option="bussinessOption" @reset-change="emptytChange" @submit="submitBussiness()">
- </avue-form>
- </el-dialog>
- <el-dialog :modal-append-to-body="false" :visible.sync="chongzhiVisible" title="网银支付" width="30%">
- ,<div align="center" style="font-size: 20px;color: #0099FF;margin-bottom: 20px;">充值金额</div>
- <div align="center">
- <span>
- <!-- <el-input-number size="large" placeholder="请输入充值金额" v-model="money" min="1">
- </el-input-number> -->
- <el-input placeholder="请输入内容" v-model="money" type="number" :min="1">
- <template slot="prepend">RMB</template>
- </el-input>
- </span>
- <div align="left" style="margin: 10px;">充值金额(大写):{{moneyChina}}</div>
- <div align="center" style="margin: 20px;">
- <el-button type="success" size="mini" @click="chongzhiConfirm"> 去充值</el-button>
- </div>
- <el-divider></el-divider>
- <div>说明:充值后账户余额 = 本次充值金额 - 技术服务费 - 手续费
- <div>
- <table style="width: 100%;" border="1" class="myTable">
- <tr v-for="(item,i) in statDatas" :key="i">
- <td class="column">{{ item.key }}</td>
- <td class="column">{{ item.value }}</td>
- </tr>
- </table>
- </div>
- </div>
- </div>
- </el-dialog>
- <el-card>
- <el-row :gutter="50">
- <el-col :span="24">
- <!-- <el-card>
- {{userInfo.userName}} 欢迎回来
- </el-card> -->
- <el-card header="音乐之声-基础数据统计" v-if="permission.basic_static">
- <avue-data-rotate :option="optionMusic"></avue-data-rotate>
- </el-card>
- <br>
- <el-card header="音乐之声-财务账本" v-if="permission.account_static">
- <avue-data-display :option="option"></avue-data-display>
- <el-row>
- <el-col :span="6">
- <div align="center" id="todayOut" style="width: 100%;height: 300px;"></div>
- </el-col>
- <el-col :span="6">
- <div align="center" id="historyOut" style="width: 100%;height: 300px;"></div>
- </el-col>
- <el-col :span="6">
- <div align="center" id="todayIn" style="width: 100%;height: 300px;"></div>
- </el-col>
- <el-col :span="6">
- <div align="center" id="historyIn" style="width: 100%;height: 300px;"></div>
- </el-col>
- </el-row>
- </el-card>
- <el-card header="音乐之声-佣金结算统计" v-if="permission.ordercommission_static">
- <el-button-group>
- <el-col :span="12">
- <el-button size="small" :type="buttonDay" icon="el-icon-document" @click="handleDay">按日
- </el-button>
- </el-col>
- <el-col :span="12">
- <el-button size="small" :type="buttonMonth" icon="el-icon-data-line" @click="handleMonth">按月
- </el-button>
- </el-col>
- </el-button-group>
- <el-date-picker value-format="yyyy-MM-dd" size="small" v-model="selectDate" :type="dateType" :placeholder="dataPlace">
- </el-date-picker>
- <el-button-group>
- <el-col :span="12">
- <el-button size="small" :type="buttonChart" icon="el-icon-data-line" @click="handleStatic">统计
- </el-button>
- </el-col>
- </el-button-group>
- <el-row>
- <el-col :span="24">
- <div id="orderStatistics" style="width: 100%;height: 600px;">
- </div>
- </el-col>
- </el-row>
- <!-- 图形 -->
- </el-card>
- </el-col>
- </el-row>
- </el-card>
- <el-card v-if="permission.bussiness_screen" :span="24">
- <el-row>
- <div>
- <el-row :gutter="50">
- <el-col span="12">
- <div style="background-color: #4d4dff;border-radius: 30px;">
- <avue-avatar style="margin:20px;" :size="128" :src="bussiness.icon"></avue-avatar>
- <span style="color: white;">{{bussiness.name}}</span>
- <span style="color: white;margin-left: 40px;">API密钥:</span> <span style="color: white;margin-left:10px">******</span>
- <span style="margin-left: 10px;">
- <el-tooltip content="API密钥用于接口对接,请谨慎保存" placement="bottom" effect="dark">
- <el-button type="primary" size="mini" @click="doCopy()">
- 复制
- </el-button>
- </el-tooltip>
- </span>
- <span style="margin-left: 30px;background-color: #4d4dff;">
- <el-link target="_blank" type="success" :href="bussiness.apiFilePath">Api文档下载(打开需输入密钥)</el-link>
- </span>
- <div>
- <el-button style="margin-left:50px;" type="primary" class="button" @click="editBussiness">编辑资料</el-button>
- <span style="color: white;margin-left: 40px;">服务费率(千分比):{{bussiness.serviceRate}}</span>
- </div>
- <div style="margin-left: 20px;margin-top:30px;">
- <span style="color: white;">账户余额</span>
- </div>
- <div style="margin-left: 20px;margin-top:10px;padding-bottom: 20px;">
- <span>
- <avue-avatar style="margin-bottom: 30px;" src="/img/bg/rmb.png"></avue-avatar>
- </span>
- <span style="font-size:60px;margin-left:20px;margin-bottom: 20px;color:white;">
- {{bussiness.remain}}
- </span>
- </div>
- </div>
- </el-col>
- <el-col span="12" height="400px">
- <el-row :gutter="50">
- <el-col span="12">
- <div style="background-color: #4d4dff;border-radius: 30px;" align="center" @click="chongzhi">
- <img style="margin:10px;" float="center" :size="30" src="/img/bg/qb.png" />
- <div style="color: white;padding-bottom: 10px;">
- 账户充值
- </div>
- </div>
- </el-col>
- <el-col span="12">
- <div style="background-color: #ff5050;border-radius: 30px;" align="center" @click="toMyOrder">
- <img style="margin:10px;" float="center" :size="30" src="/img/bg/zd.png" />
- <div style="color: white;padding-bottom: 10px;">
- 我的账单
- </div>
- </div>
- </el-col>
- </el-row>
- <el-row :gutter="50">
- <el-col span="12">
- <div style="background-color: #d633ff;border-radius: 30px;" align="center" @click="toMyDebit">
- <img style="margin:10px;" float="center" :size="30" src="/img/bg/fxfr.png" />
- <div style="color: white;padding-bottom: 10px;">
- 分销分润
- </div>
- </div>
- </el-col>
- <el-col span="12">
- <div style="background-color: #8080ff;border-radius: 30px;" align="center">
- <img style="margin:10px;" float="center" :size="30" src="/img/bg/sm.png" />
- <div style="color: white;padding-bottom: 10px;">
- 计费说明
- </div>
- </div>
- </el-col>
- </el-row>
- </el-col>
- </el-row>
- </div>
- </el-row>
- <el-row :gutter="50">
- <el-col span="12">
- <el-card style="background-color: #f2f2f2;border-radius: 30px;">
- <div slot="header">
- <span>推广数据</span>
- </div>
- <avue-data-display :option="tgOption"></avue-data-display>
- </el-card>
- </el-col>
- <el-col span="12">
- <el-card style="background-color: #f2f2f2;border-radius: 30px;">
- <div slot="header">
- <span>产品销量</span>
- </div>
- <avue-data-display :option="tgOption"></avue-data-display>
- </el-card>
- </el-col>
- </el-row>
- </el-card>
- </basic-container>
- </template>
- <script>
- import request from '@/router/axios';
- import echarts from "echarts";
- import {
- getList as getParams
- } from "@/api/system/param";
- import {
- add as addBillrecord,
- chongzhi,
- } from "@/api/billrecord/billrecord";
- import {
- getByAccount,
- update
- } from "@/api/guosen/bussiness"
- import {
- mapGetters
- } from "vuex";
- export default {
- data() {
- return {
- loading: true,
- editBussinessVisible: false,
- moneyChina: "壹拾万元整",
- bussiness: {},
- statDatas: [{
- key: "技术服务费率",
- value: 0
- },
- {
- key: "技术服务费",
- value: 0
- },
- {
- key: "充值金额",
- value: 0
- },
- {
- key: "可用余额",
- value: 0
- }
- ],
- yibaoOrder: {
- },
- billrecord: {
- payStatus: 0,
- type: 5
- },
- money: 100000,
- serviceRate: 0.005,
- chongzhiVisible: false,
- buttonDay: "primary",
- buttonMonth: "",
- selectDate: [],
- dateType: "daterange",
- dataPlace: "选择日期",
- query: {
- staticType: 1
- },
- tgOption: {
- span: 8,
- data: [{
- count: "66.6万",
- title: '总曝光量',
- },
- {
- count: '88.8万',
- title: '总点击率',
- },
- {
- count: '688万',
- title: '总访问量',
- },
- {
- count: '6666',
- title: '今日曝光量',
- },
- {
- count: '6666',
- title: '今日点击率',
- },
- {
- count: '6666',
- title: '今日访问量',
- }
- ]
- },
- bussiness_option2: {
- span: 12,
- data: [{
- click: function(item) {
- alert(JSON.stringify(item));
- },
- count: '150',
- title: '充值',
- icon: 'el-icon-warning',
- color: 'rgb(49, 180, 141)'
- }, {
- click: function(item) {
- alert(JSON.stringify(item));
- },
- count: '53%',
- title: '跳出率',
- icon: 'el-icon-view',
- color: '#00a65a'
- }, {
- click: function(item) {
- alert(JSON.stringify(item));
- },
- count: '44',
- title: '用户注册数',
- icon: 'el-icon-setting',
- color: '#f39c12'
- }]
- },
- bussinessOption: {
- height: 'auto',
- calcHeight: 30,
- tip: false,
- searchShow: true,
- searchMenuSpan: 6,
- border: true,
- index: true,
- viewBtn: true,
- selection: true,
- dialogClickModal: false,
- dialogWidth: "30%",
- column: [{
- label: "商户号名称",
- labelWidth: 130,
- prop: "name",
- span: 24,
- rules: [{
- required: true,
- message: "请输入商户号名称",
- trigger: "blur"
- }]
- },
- {
- label: "api回调地址",
- prop: "recallUrl",
- labelWidth: 130,
- span: 24,
- hide: true,
- rules: [{
- required: false,
- message: "请输入关联账号的密码",
- trigger: "blur"
- }]
- },
- {
- label: "广告图",
- prop: "icon",
- labelWidth: 130,
- span: 12,
- type: "upload",
- listType: "picture-img",
- action: '/api/putObject',
- propsHttp: {
- url: 'data'
- },
- rules: [{
- required: false,
- message: "请输入营业执照",
- trigger: "blur"
- }]
- },
- {
- label: "营业执照",
- prop: "businessLicense",
- labelWidth: 130,
- span: 12,
- type: "upload",
- listType: "picture-img",
- action: '/api/putObject',
- propsHttp: {
- url: 'data'
- },
- rules: [{
- required: false,
- message: "请输入营业执照",
- trigger: "blur"
- }]
- },
- {
- label: "税务登记证",
- prop: "taxAffairsLicense",
- labelWidth: 130,
- type: "upload",
- listType: "picture-img",
- action: '/api/putObject',
- propsHttp: {
- url: 'data'
- },
- span: 12,
- rules: [{
- required: false,
- message: "请输入税务登记证",
- trigger: "blur"
- }]
- },
- {
- label: "组织机构代码证",
- prop: "organizationCodeLicense",
- labelWidth: 130,
- span: 12,
- type: "upload",
- listType: "picture-img",
- action: '/api/putObject',
- propsHttp: {
- url: 'data'
- },
- rules: [{
- required: false,
- message: "请输入关联账号的密码",
- trigger: "blur"
- }]
- },
- {
- label: "关联账号的id",
- prop: "accountId",
- hide: true,
- display: false,
- rules: [{
- required: true,
- message: "请输入关联账号的id",
- trigger: "blur"
- }]
- },
- ]
- },
- bussiness_option1: {
- height: "500px",
- span: 24,
- data: [{
- click: function(item) {
- alert(JSON.stringify(item));
- },
- title: '分类统计',
- subtitle: '实时',
- count: 7993,
- allcount: 10222,
- text: '当前分类总记录数',
- color: 'rgb(27, 201, 142)',
- key: '类'
- },
- ]
- },
- option: {
- span: 6,
- data: [{
- click: function() {
- },
- count: 100,
- decimals: 2,
- title: '今日提现',
- },
- {
- click: function() {
- },
- count: 100,
- decimals: 2,
- title: '历史提现',
- },
- {
- click: function() {
- },
- count: 100,
- decimals: 2,
- title: '今日收入',
- },
- {
- click: function() {},
- count: 100,
- decimals: 2,
- title: '历史收入',
- }
- ]
- },
- optionMusic: {
- span: 6,
- data: [{
- title: '用户总数',
- count: 0,
- icon: 'el-icon-user',
- color: 'rgb(56, 161, 242)',
- click: () => {
- this.$router.push("/loginuser/loginuser");
- },
- },
- {
- click: () => {
- this.$router.push("/guosen/agenter");
- },
- title: '代理总数',
- count: 0,
- icon: 'el-icon-s-custom',
- color: 'rgb(3,180,144)',
- },
- {
- title: '活动总数',
- count: 0,
- icon: 'el-icon-s-flag',
- color: 'rgb(105,184,242)',
- click: () => {
- this.$router.push("/activity/activity");
- },
- },
- {
- title: '商品总数',
- count: 0,
- icon: 'el-icon-shopping-cart-full',
- color: 'rgb(49, 180, 141)',
- click: () => {
- this.$router.push("/userpointsgoods/userpointsgoods");
- },
- },
- ]
- },
- optionTodayOut: {
- title: {
- text: '今日提现去向',
- left: 'center'
- },
- tooltip: {
- trigger: 'item'
- },
- series: [{
- name: '今日提现去向',
- type: 'pie',
- radius: '70%',
- data: [{
- value: 0,
- name: '用户'
- },
- {
- value: 0,
- name: '代理'
- },
- {
- value: 0,
- name: '广告商'
- },
- {
- value: 0,
- name: '运营商'
- },
- {
- value: 0,
- name: '主办方'
- },
- ],
- emphasis: {
- itemStyle: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- }
- }]
- },
- optionHistoryOut: {
- title: {
- text: '历史提现去向',
- left: 'center'
- },
- tooltip: {
- trigger: 'item'
- },
- series: [{
- name: '历史提现去向',
- type: 'pie',
- radius: '70%',
- data: [{
- value: 0,
- name: '用户'
- },
- {
- value: 0,
- name: '代理'
- },
- {
- value: 0,
- name: '广告商'
- },
- {
- value: 0,
- name: '运营商'
- },
- {
- value: 0,
- name: '主办方'
- },
- ],
- emphasis: {
- itemStyle: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- }
- }]
- },
- optionTodayIn: {
- title: {
- text: '今日收入来源',
- left: 'center'
- },
- tooltip: {
- trigger: 'item'
- },
- series: [{
- name: '今日收入来源',
- type: 'pie',
- radius: '70%',
- data: [{
- value: 0,
- name: '用户'
- },
- {
- value: 0,
- name: '代理'
- },
- {
- value: 0,
- name: '广告商'
- },
- ],
- emphasis: {
- itemStyle: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- }
- }]
- },
- optionHistoryIn: {
- title: {
- text: '历史收入来源',
- left: 'center'
- },
- tooltip: {
- trigger: 'item'
- },
- series: [{
- name: '历史收入来源',
- type: 'pie',
- radius: '70%',
- data: [{
- value: 40.06,
- name: '用户'
- },
- {
- value: 0,
- name: '代理'
- },
- {
- value: 0,
- name: '广告商'
- },
- ],
- emphasis: {
- itemStyle: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- }
- }]
- },
- }
- },
- computed: {
- ...mapGetters(["permission", "userInfo"])
- },
- watch: {
- "money"() {
- if (this.money < 0) {
- this.money = 1;
- }
- this.moneyChina = this.convertCurrency(this.money)
- this.statDatas[0].value = this.bussiness.serviceRate /1000
- this.statDatas[1].value = this.money * this.bussiness.serviceRate /1000
- this.statDatas[2].value = parseFloat(this.money)
- this.statDatas[3].value = parseFloat(this.statDatas[2].value) - parseFloat(this.statDatas[1].value)
- },
- },
- mounted() {
- var _that = this;
- // this.type = this.tabsOption.column[0];
- let befDate = new Date();
- let byear = befDate.getFullYear();
- let bmonth = befDate.getMonth() + 1;
- let bday = befDate.getDate();
- let startTime = `${byear}-${bmonth}-${bday}`;
- this.selectDate = [startTime, startTime];
- this.getData();
- this.getOrderCommissionData();
- this.getAccoutStatic()
- getByAccount().then(res => {
- _that.bussiness = res.data.data
- _that.statDatas[0].value = res.data.data.serviceRate / 1000
- _that.statDatas[1].value = _that.money * _that.statDatas[0].value
- _that.statDatas[2].value = _that.money
- _that.statDatas[3].value = _that.statDatas[2].value - _that.statDatas[1].value
- console.log("buss" + JSON.stringify(_that.bussiness))
- })
- },
- methods: {
- submitBussiness(){
- update(this.bussiness).then(res=>{
- this.$message({
- type: "success",
- message: res.data.msg
- });
- this.editBussinessVisible = false;
- })
- },
- convertCurrency(money) {
- debugger
- //汉字的数字
- var cnNums = new Array('零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖');
- //基本单位
- var cnIntRadice = new Array('', '拾', '佰', '仟');
- //对应整数部分扩展单位
- var cnIntUnits = new Array('', '万', '亿', '兆');
- //对应小数部分单位
- var cnDecUnits = new Array('角', '分', '毫', '厘');
- //整数金额时后面跟的字符
- var cnInteger = '整';
- //整型完以后的单位
- var cnIntLast = '元';
- //最大处理的数字
- var maxNum = 999999999999999.9999;
- //金额整数部分
- var integerNum;
- //金额小数部分
- var decimalNum;
- //输出的中文金额字符串
- var chineseStr = '';
- //分离金额后用的数组,预定义
- var parts;
- if (money == '') {
- return '';
- }
- money = parseFloat(money);
- if (money >= maxNum) {
- //超出最大处理数字
- return '';
- }
- if (money == 0) {
- chineseStr = cnNums[0] + cnIntLast + cnInteger;
- return chineseStr;
- }
- //转换为字符串
- money = money.toString();
- if (money.indexOf('.') == -1) {
- integerNum = money;
- decimalNum = '';
- } else {
- parts = money.split('.');
- integerNum = parts[0];
- decimalNum = parts[1].substr(0, 4);
- }
- //获取整型部分转换
- if (parseInt(integerNum, 10) > 0) {
- var zeroCount = 0;
- var IntLen = integerNum.length;
- for (var i = 0; i < IntLen; i++) {
- var n = integerNum.substr(i, 1);
- var p = IntLen - i - 1;
- var q = p / 4;
- var m = p % 4;
- if (n == '0') {
- zeroCount++;
- } else {
- if (zeroCount > 0) {
- chineseStr += cnNums[0];
- }
- //归零
- zeroCount = 0;
- chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
- }
- if (m == 0 && zeroCount < 4) {
- chineseStr += cnIntUnits[q];
- }
- }
- chineseStr += cnIntLast;
- }
- //小数部分
- if (decimalNum != '') {
- var decLen = decimalNum.length;
- for (var i = 0; i < decLen; i++) {
- var n = decimalNum.substr(i, 1);
- if (n != '0') {
- chineseStr += cnNums[Number(n)] + cnDecUnits[i];
- }
- }
- }
- if (chineseStr == '') {
- chineseStr += cnNums[0] + cnIntLast + cnInteger;
- } else if (decimalNum == '') {
- chineseStr += cnInteger;
- }
- return chineseStr;
- },
- editBussiness() {
- this.editBussinessVisible = true;
- },
- doCopy() {
- this.$copyText(this.bussiness.secret)
- this.$message.success("复制成功")
- },
- toMyDebit() {
- this.$router.push('/guosen/bussinessdebitrequest');
- },
- toMyOrder() {
- this.$router.push('/bussiness/order');
- },
- guid() {
- var str = "abcdefghijklmnopqrstuvwxyz0123456789"; // 可以作为常量放到random外面
- var result = "";
- for (var i = 0; i < 32; i++) {
- result += str[parseInt(Math.random() * str.length)];
- }
- return result;
- },
- chongzhi() {
- this.chongzhiVisible = true;
- },
- chongzhiConfirm() {
- this.billrecord.price = this.money;
- this.billrecord.orderId = this.guid();
- this.billrecord.bussinessFee = this.statDatas[1].value
- //易宝订单
- this.yibaoOrder.orderId = this.billrecord.orderId; //商户请求号
- debugger
- this.yibaoOrder.orderAmount = this.money; //充值金额
- // this.yibaoOrder.payType = "B2B"; //"B2C:个人网银" "B2B:企业网银
- this.yibaoOrder.goodsName = "充值"
- this.yibaoOrder.notifyUrl = ",,,"
- // this.yibaoOrder.bankCode = "ABC,ICBC,BOC,CMBCHINA,SZPA,CCB"; //银行编码
- this.yibaoOrder.redirectUrl = "https://music.nanyue6688.com/test/#/wel/index";
- addBillrecord(this.billrecord).then(res => {
- chongzhi(this.yibaoOrder).then(res => {
- location.href = res.data.data.payUrl;
- console.log(JSON.stringify(res))
- })
- })
- },
- //按日
- handleDay() {
- this.buttonDay = "primary";
- this.buttonMonth = "";
- this.query.staticType = 1;
- this.dateType = "daterange";
- this.dataPlace = "选择日期";
- },
- //按月
- handleMonth() {
- this.buttonDay = "";
- this.buttonMonth = "primary";
- this.query.staticType = 2;
- this.dateType = "monthrange";
- this.dataPlace = "选择月份";
- },
- getAccoutStatic() {
- request({
- url: '/api/cyzh-static/staticAccountStatic',
- method: "get",
- }).then(res => {
- //今日提现
- let todayOut = res.data.data.todayOut;
- this.optionTodayOut.series[0].data[0].value = todayOut.userOut;
- this.optionTodayOut.series[0].data[1].value = todayOut.proxyOut;
- this.optionTodayOut.series[0].data[2].value = todayOut.adsOut;
- this.optionTodayOut.series[0].data[3].value = todayOut.operationOut;
- this.optionTodayOut.series[0].data[4].value = todayOut.sponsorOut;
- this.option.data[0].count = todayOut.total;
- //历史提现
- let historyOut = res.data.data.totalOut;
- this.optionHistoryOut.series[0].data[0].value = historyOut.userOut;
- this.optionHistoryOut.series[0].data[1].value = historyOut.proxyOut;
- this.optionHistoryOut.series[0].data[2].value = historyOut.adsOut;
- this.optionHistoryOut.series[0].data[3].value = historyOut.operationOut;
- this.optionHistoryOut.series[0].data[4].value = historyOut.sponsorOut;
- this.option.data[1].count = historyOut.total;
- //今日收入
- let todayIn = res.data.data.todayIn;
- this.optionTodayIn.series[0].data[0].value = todayIn.userIn;
- this.optionTodayIn.series[0].data[1].value = todayIn.proxyIn;
- this.optionTodayIn.series[0].data[2].value = todayIn.adsIn;
- this.option.data[2].count = todayIn.total;
- //历史收入
- let historyIn = res.data.data.totalIn;
- this.optionHistoryIn.series[0].data[0].value = historyIn.userIn;
- this.optionHistoryIn.series[0].data[1].value = historyIn.proxyIn;
- this.optionHistoryIn.series[0].data[2].value = historyIn.adsIn;
- this.option.data[3].count = historyIn.total;
- this.drawPie();
- })
- },
- getOrderCommissionData() {
- this.query.beginDate = this.selectDate[0];
- this.query.endDate = this.selectDate[1];
- request({
- url: '/api/cyzh-static/staticOrderCommission',
- method: "post",
- data: this.query
- }).then(res => {
- this.drawRealDemandLine(res.data.data.dateList, res.data.data.unClearList, res.data.data.clearedList)
- })
- },
- getData() {
- request({
- url: '/api/cyzh-static/static',
- method: "get"
- }).then(res => {
- const resData = res.data.data;
- this.optionMusic.data[0].count = resData.userCount;
- this.optionMusic.data[1].count = resData.agenterCount;
- this.optionMusic.data[2].count = resData.activityCount;
- this.optionMusic.data[3].count = resData.shopCount;
- })
- },
- handleStatic() {
- this.getOrderCommissionData();
- },
- drawPie() {
- let todayOutChart = echarts.init(document.getElementById('todayOut'));
- todayOutChart.setOption(this.optionTodayOut);
- let histroyOuntChart = echarts.init(document.getElementById('historyOut'));
- histroyOuntChart.setOption(this.optionHistoryOut);
- let todayInChart = echarts.init(document.getElementById('todayIn'));
- todayInChart.setOption(this.optionTodayIn);
- let historyInChart = echarts.init(document.getElementById('historyIn'));
- historyInChart.setOption(this.optionHistoryIn);
- },
- //柱形图
- drawRealDemandLine(dateList, unclearDataList, clearedDataList) {
- // 基于准备好的dom,初始化echarts实例
- let myChart = echarts.init(document.getElementById('orderStatistics'))
- // 基于准备好的dom,初始化echarts实例
- // 绘制图表
- myChart.setOption({
- title: {
- text: ''
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow'
- }
- },
- grid: { //直角坐标系内绘图网格
- show: true, //是否显示直角坐标系网格。[ default: false ]
- left: "10%", //grid 组件离容器左侧的距离。
- right: "30px",
- borderColor: "#c45455", //网格的边框颜色
- bottom: "20%" //
- },
- legend: {
- data: ['待结算', '已结算'],
- show: true,
- },
- // x轴拖动
- dataZoom: [{
- type: "slider",
- realtime: true, //拖动滚动条时是否动态的更新图表数据
- height: 25, //滚动条高度
- start: 0, //滚动条开始位置(共100等份)
- end: 100 //结束位置(共100等份)
- }],
- xAxis: {
- data: dateList,
- axisLabel: { //坐标轴刻度标签的相关设置。
- interval: 0,
- rotate: "45"
- }
- },
- yAxis: {},
- series: [{
- name: '待结算',
- type: 'bar',
- stack: '佣金',
- data: unclearDataList
- }, {
- name: '已结算',
- type: 'bar',
- stack: '佣金',
- data: clearedDataList
- }]
- });
- }
- }
- }
- </script>
- <style>
- .button {
- padding: 10;
- float: center;
- }
- .image {
- width: 35%;
- display: block;
- border-radius: 65px;
- }
- .myTable {
- border-collapse: collapse;
- margin: 0 auto;
- text-align: center;
- }
- </style>
|