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

已开票已收款图表增加tooltip

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