1.31 财务分析,财务数据模块完善,产业链桑基图展示
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
const utils_util = require("../../utils/util.js");
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const echarts = require("../../uni_modules/lime-echart/static/echarts.min.js");
|
||||
const _sfc_main = {
|
||||
name: "cwsj-view",
|
||||
data() {
|
||||
@@ -12,7 +13,7 @@ const _sfc_main = {
|
||||
option1: {
|
||||
legend: {
|
||||
show: true,
|
||||
data: ["期间费用", "同比(右)"]
|
||||
data: ["货币资金", "同比(右)"]
|
||||
},
|
||||
grid: {
|
||||
left: "2%",
|
||||
@@ -88,7 +89,7 @@ const _sfc_main = {
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
name: "(%)",
|
||||
name: "(亿)",
|
||||
position: "left",
|
||||
alignTicks: true,
|
||||
axisLine: {
|
||||
@@ -111,7 +112,7 @@ const _sfc_main = {
|
||||
series: [
|
||||
{
|
||||
type: "bar",
|
||||
name: "ROE",
|
||||
name: "经营现金流",
|
||||
data: [],
|
||||
yAxisIndex: 0
|
||||
},
|
||||
@@ -126,7 +127,7 @@ const _sfc_main = {
|
||||
option3: {
|
||||
legend: {
|
||||
show: true,
|
||||
data: ["期间费用", "同比(右)"]
|
||||
data: ["净利润", "同比(右)"]
|
||||
},
|
||||
grid: {
|
||||
left: "2%",
|
||||
@@ -145,7 +146,7 @@ const _sfc_main = {
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
name: "(%)",
|
||||
name: "(亿)",
|
||||
position: "left",
|
||||
alignTicks: true,
|
||||
axisLine: {
|
||||
@@ -168,7 +169,7 @@ const _sfc_main = {
|
||||
series: [
|
||||
{
|
||||
type: "bar",
|
||||
name: "ROE",
|
||||
name: "净利润",
|
||||
data: [],
|
||||
yAxisIndex: 0
|
||||
},
|
||||
@@ -180,7 +181,10 @@ const _sfc_main = {
|
||||
}
|
||||
]
|
||||
},
|
||||
getNumStr: utils_util.getNumStr
|
||||
getNumStr: utils_util.getNumStr,
|
||||
accDiv: utils_util.accDiv,
|
||||
accSub: utils_util.accSub,
|
||||
accMul: utils_util.accMul
|
||||
};
|
||||
},
|
||||
props: {
|
||||
@@ -191,8 +195,85 @@ const _sfc_main = {
|
||||
incomeStatementList: Array
|
||||
//利润表
|
||||
},
|
||||
watch: {},
|
||||
watch: {
|
||||
financialBalanceList(newValue) {
|
||||
let category = [];
|
||||
let data = [];
|
||||
for (let item of newValue) {
|
||||
category.push(item.report_type);
|
||||
if (item.assets.current_assets.cash) {
|
||||
data.push(utils_util.accDiv(item.assets.current_assets.cash, 1e8).toFixed(2));
|
||||
} else
|
||||
data.push(0);
|
||||
}
|
||||
this.option1.xAxis.data = category;
|
||||
this.option1.series[0].data = data;
|
||||
this.profitabilityInit();
|
||||
},
|
||||
cashFlowList(newValue) {
|
||||
let category = [];
|
||||
let data = [];
|
||||
for (let item of newValue) {
|
||||
category.push(item.report_type);
|
||||
if (item.operating_activities.net_flow) {
|
||||
data.push(utils_util.accDiv(item.operating_activities.net_flow, 1e8).toFixed(2));
|
||||
} else
|
||||
data.push(0);
|
||||
}
|
||||
this.option2.xAxis.data = category;
|
||||
this.option2.series[0].data = data;
|
||||
this.cashFlowInit();
|
||||
},
|
||||
incomeStatementList(newValue) {
|
||||
let category = [];
|
||||
let data = [];
|
||||
for (let item of newValue) {
|
||||
category.push(item.report_type);
|
||||
if (item.profit.net_profit) {
|
||||
data.push(utils_util.accDiv(item.profit.net_profit, 1e9).toFixed(2));
|
||||
} else
|
||||
data1.push(0);
|
||||
}
|
||||
this.option3.xAxis.data = category;
|
||||
this.option3.series[0].data = data;
|
||||
this.incomeStatementInit();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async profitabilityInit() {
|
||||
const chart = await this.$refs.chartRef1.init(echarts);
|
||||
chart.setOption(this.option1);
|
||||
},
|
||||
async cashFlowInit() {
|
||||
const chart = await this.$refs.chartRef2.init(echarts);
|
||||
chart.setOption(this.option2);
|
||||
},
|
||||
async incomeStatementInit() {
|
||||
const chart = await this.$refs.chartRef3.init(echarts);
|
||||
chart.setOption(this.option3);
|
||||
},
|
||||
/**
|
||||
* 计算经营性现金流增长率
|
||||
*/
|
||||
caculateOperatingFlowRatio() {
|
||||
let flow1 = this.cashFlowList[0].operating_activities.net_flow;
|
||||
let flow2 = this.cashFlowList[4].operating_activities.net_flow;
|
||||
return utils_util.accMul(utils_util.accDiv(utils_util.accSub(flow1, flow2), flow2), 100).toFixed(2);
|
||||
},
|
||||
/**
|
||||
* 计算合计现金流增长率
|
||||
*/
|
||||
caculateNetIncreaseRatio() {
|
||||
let flow1 = this.cashFlowList[0].cash_changes.net_increase;
|
||||
let flow2 = this.cashFlowList[4].cash_changes.net_increase;
|
||||
return utils_util.accMul(utils_util.accDiv(utils_util.accSub(flow1, flow2), flow2), 100).toFixed(2);
|
||||
},
|
||||
/**
|
||||
* 获取去年
|
||||
*/
|
||||
getLastYearPeriod(list) {
|
||||
list[0].period.split("-")[0];
|
||||
},
|
||||
/**
|
||||
* 点击切换现金流量表指标
|
||||
* @param {Object} index
|
||||
@@ -200,6 +281,31 @@ const _sfc_main = {
|
||||
clickCashFlowIndicatorItem(index) {
|
||||
if (this.cashFlowIndicatorIndex != index) {
|
||||
this.cashFlowIndicatorIndex = index;
|
||||
let data = [];
|
||||
if (index == 0) {
|
||||
for (let item of this.cashFlowList) {
|
||||
if (item.operating_activities.net_flow) {
|
||||
data.push(utils_util.accDiv(item.operating_activities.net_flow, 1e8).toFixed(2));
|
||||
} else
|
||||
data.push(0);
|
||||
}
|
||||
} else if (index == 1) {
|
||||
for (let item of this.cashFlowList) {
|
||||
if (item.financing_activities.net_flow) {
|
||||
data.push(utils_util.accDiv(item.financing_activities.net_flow, 1e8).toFixed(2));
|
||||
} else
|
||||
data.push(0);
|
||||
}
|
||||
} else if (index == 2) {
|
||||
for (let item of this.cashFlowList) {
|
||||
if (item.investment_activities.net_flow) {
|
||||
data.push(utils_util.accDiv(item.investment_activities.net_flow, 1e8).toFixed(2));
|
||||
} else
|
||||
data.push(0);
|
||||
}
|
||||
}
|
||||
this.option2.series[0].data = data;
|
||||
this.cashFlowInit();
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -245,10 +351,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
m: common_vendor.t($data.getNumStr($props.financialBalanceList[0].equity.surplus_reserve)),
|
||||
n: common_vendor.t($data.getNumStr($props.financialBalanceList[0].equity.undistributed_profit))
|
||||
} : {}, {
|
||||
o: common_vendor.o(($event) => _ctx.itemClick(0)),
|
||||
p: common_assets._imports_0$8,
|
||||
q: common_assets._imports_1$2,
|
||||
r: common_vendor.f(["经营现金流", "筹资现金流", "投资现金流"], (item, index, i0) => {
|
||||
o: common_assets._imports_0$8,
|
||||
p: common_assets._imports_1$2,
|
||||
q: common_vendor.f(["经营现金流", "筹资现金流", "投资现金流"], (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item),
|
||||
b: common_vendor.n("item flexCenter " + ($data.cashFlowIndicatorIndex == index ? "select" : "")),
|
||||
@@ -256,12 +361,21 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
d: common_vendor.o(($event) => $options.clickCashFlowIndicatorItem(index), index)
|
||||
};
|
||||
}),
|
||||
s: common_assets._imports_2$14,
|
||||
t: common_assets._imports_3$13,
|
||||
v: common_vendor.sr("chartRef2", "63ca7cac-1"),
|
||||
w: common_assets._imports_0$8,
|
||||
x: common_assets._imports_1$2,
|
||||
y: common_vendor.f(["净利润", "营业收入", "期间费用"], (item, index, i0) => {
|
||||
r: common_assets._imports_2$14,
|
||||
s: common_assets._imports_3$13,
|
||||
t: common_vendor.sr("chartRef2", "63ca7cac-1"),
|
||||
v: $props.cashFlowList.length > 0
|
||||
}, $props.cashFlowList.length > 0 ? {
|
||||
w: common_vendor.t($data.getNumStr($props.cashFlowList[0].operating_activities.net_flow)),
|
||||
x: common_vendor.t($options.caculateOperatingFlowRatio()),
|
||||
y: common_vendor.t($data.getNumStr($props.cashFlowList[0].investment_activities.net_flow)),
|
||||
z: common_vendor.t($data.getNumStr($props.cashFlowList[0].financing_activities.net_flow)),
|
||||
A: common_vendor.t($data.getNumStr($props.cashFlowList[0].cash_changes.net_increase)),
|
||||
B: common_vendor.t($options.caculateNetIncreaseRatio())
|
||||
} : {}, {
|
||||
C: common_assets._imports_0$8,
|
||||
D: common_assets._imports_1$2,
|
||||
E: common_vendor.f(["净利润", "营业收入", "期间费用"], (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item),
|
||||
b: common_vendor.n("item flexCenter " + ($data.profitIndicatorIndex == index ? "select" : "")),
|
||||
@@ -269,12 +383,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
d: common_vendor.o(($event) => $options.clickProfitIndicatorItem(index), index)
|
||||
};
|
||||
}),
|
||||
z: common_assets._imports_2$14,
|
||||
A: common_assets._imports_3$13,
|
||||
B: common_assets._imports_2$14,
|
||||
C: common_assets._imports_3$13,
|
||||
D: common_vendor.sr("chartRef3", "63ca7cac-2")
|
||||
});
|
||||
F: common_assets._imports_2$14,
|
||||
G: common_assets._imports_3$13,
|
||||
H: common_assets._imports_2$14,
|
||||
I: common_assets._imports_3$13,
|
||||
J: common_vendor.sr("chartRef3", "63ca7cac-2"),
|
||||
K: $props.incomeStatementList.length > 0
|
||||
}, $props.incomeStatementList.length > 0 ? {
|
||||
L: common_vendor.t($data.getNumStr($props.incomeStatementList[0].comprehensive_income.total_comprehensive_income)),
|
||||
M: common_vendor.t($data.getNumStr($props.incomeStatementList[0].revenue.total_operating_revenue)),
|
||||
N: common_vendor.t($data.getNumStr($props.incomeStatementList[0].profit.operating_profit))
|
||||
} : {});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createComponent(Component);
|
||||
|
||||
Reference in New Issue
Block a user