Commit 853e24e4 authored by 张恒's avatar 张恒

已开票已收款图表增加tooltip

parent f1529c01
......@@ -5,6 +5,7 @@
<script>
import * as echarts from "echarts";
import {arCompanyBar} from "../../../api/apiList";
import {convert_num_unit} from "../../../utils/numUtil";
export default {
name: "ArCompanyBar",
......@@ -12,6 +13,10 @@ export default {
return {
arCompanyBar: null,
barChart: {
tooltip: {
trigger: 'axis',
formatter: (params) => params[0].name + "<br>" + params[0].marker + "\t\t" + this.convert_num_unit(params[0]),
},
title: {
show: true,
text: "已开票未收款(结算单位)",
......@@ -80,6 +85,7 @@ export default {
show: true,
position: 'top',
color: "#FFFFFF",
formatter: this.convert_num_unit
},
emphasis: {
focus: 'self',
......@@ -90,6 +96,7 @@ export default {
}
},
methods: {
convert_num_unit,
// 绘制图表
drawArCompanyBar() {
if (!this.arCompanyBar) {
......
......@@ -5,6 +5,7 @@
<script>
import * as echarts from "echarts";
import {arCompanyMonthlyBar} from "../../../api/apiList";
import {convert_num_unit} from "../../../utils/numUtil";
export default {
name: "ArCompanyMonthlyBar",
......@@ -12,6 +13,10 @@ export default {
return {
arCompanyMonthlyBar: null,
barChart: {
tooltip: {
trigger: 'axis',
formatter: (params) => params[0].name + "<br>" + params[0].marker + "\t" + this.convert_num_unit(params[0]) + "<br>" + params[1].marker + "\t" + params[1].data + "%",
},
title: {
show: true,
text: "XXXXXX股份有限公司 已开票未收款(开票月份)",
......@@ -55,7 +60,7 @@ export default {
type: "value",
position: "left",
show: false,
max: 1
max: 100
}],
series: [
{
......@@ -82,19 +87,26 @@ export default {
show: true,
position: 'top',
color: "#FFFFFF",
formatter: this.convert_num_unit
},
},
{
type: "line",
barWidth: "40%",
yAxisIndex: 1,
data: [0, 0, 0, 0, 0, 0, 0, 0]
data: [0, 0, 0, 0, 0, 0, 0, 0],
label: {
show: true,
color: "#FFFFFF",
formatter: (params) => params.data + "%"
}
}
]
},
}
},
methods: {
convert_num_unit,
// 绘制图表
drawArCompanyMonthlyBar() {
if (!this.arCompanyMonthlyBar) {
......
......@@ -5,12 +5,17 @@
<script>
import * as echarts from "echarts";
import {arMonthlyBar} from "../../../api/apiList";
import {convert_num_unit} from "../../../utils/numUtil";
export default {
name: "ArMonthlyBar",
data() {
return {
barChart: {
tooltip: {
trigger: 'axis',
formatter: (params) => params[0].name + "<br>" + params[0].marker + "\t\t" + this.convert_num_unit(params[0]),
},
title: {
show: true,
text: "已开票未收款(开票月份)",
......@@ -74,6 +79,7 @@ export default {
show: true,
position: 'top',
color: "#FFFFFF",
formatter: this.convert_num_unit
},
emphasis: {
focus: 'self',
......@@ -85,6 +91,7 @@ export default {
}
},
methods: {
convert_num_unit,
// 绘制图表
drawArMonthlyBar() {
if (!this.arMonthlyBar) {
......
......@@ -5,6 +5,7 @@
<script>
import * as echarts from "echarts";
import {arMonthlyCompanyBar} from "../../../api/apiList";
import {convert_num_unit} from "../../../utils/numUtil";
export default {
name: "ArMonthlyCompanyBar",
......@@ -12,6 +13,10 @@ export default {
return {
arMonthlyCompanyBar: null,
barChart: {
tooltip: {
trigger: 'axis',
formatter: (params) => params[0].name + "<br>" + params[0].marker + "\t\t" + this.convert_num_unit(params[0]),
},
title: {
show: true,
text: "XXXX-XX 已开票未收款(结算单位)",
......@@ -75,12 +80,14 @@ export default {
show: true,
position: 'top',
color: "#FFFFFF",
formatter: this.convert_num_unit
},
}
},
}
},
methods: {
convert_num_unit,
// 绘制图表
drawArMonthlyCompanyBar() {
if (!this.arMonthlyCompanyBar) {
......
......@@ -4,6 +4,7 @@
<script>
import * as echarts from "echarts";
import {convert_num_unit} from "../../../utils/numUtil";
export default {
name: "ArSummaryBar",
......@@ -11,6 +12,10 @@ export default {
return {
arSummaryBar: null,
barChart: {
tooltip: {
trigger: 'axis',
formatter: (params) => params[0].name + "<br>" + params[0].marker + "\t\t" + this.convert_num_unit(params[0]),
},
textStyle: {
color: "#FFFFFF",
fontSize: "12"
......@@ -66,12 +71,14 @@ export default {
show: true,
position: 'top',
color: "#FFFFFF",
formatter: this.convert_num_unit
},
}
},
}
},
methods: {
convert_num_unit,
drawArSummaryBar(seriesData) {
if (!this.arSummaryBar) {
this.arSummaryBar = echarts.init(document.getElementById('ar_summary_bar'))
......
......@@ -473,11 +473,11 @@ export default {
arSummaryBar().then(res => {
let data = res.data
let seriesData = []
seriesData.push(conver_num_retain(data.unsettled_amount))
seriesData.push(conver_num_retain(data.settled_amount))
seriesData.push(conver_num_retain(data.unregister_amount))
seriesData.push(conver_num_retain(data.receivable_amount))
seriesData.push(conver_num_retain(data.cancelled_amount))
seriesData.push(data.unsettled_amount)
seriesData.push(data.settled_amount)
seriesData.push(data.unregister_amount)
seriesData.push(data.receivable_amount)
seriesData.push(data.cancelled_amount)
this.arSummary[0].value = conver_num_retain(data.total_amount)
this.arSummary[1].value = conver_num_retain(data.unregister_amount)
this.arSummary[2].value = conver_num_retain(data.receivable_amount)
......
......@@ -43,6 +43,9 @@ export const conver_num_retain = function (amont) {
return formater(amont)
}
export const convert_num_unit = function (params) {
return formater(params.data) + "万元"
}
//数字金额显示
function formater(data) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment