sbd-npm 1.3.49 → 1.3.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/stock_basics.js +24 -24
- package/summary_daily.js +1 -1
- package/util.js +20 -1
package/package.json
CHANGED
package/stock_basics.js
CHANGED
@@ -28,7 +28,7 @@ let Stock = {
|
|
28
28
|
hist_start_date: "",
|
29
29
|
hist_end_date: "",
|
30
30
|
data: {},
|
31
|
-
|
31
|
+
income_statement_data: [], // 利润表数据
|
32
32
|
|
33
33
|
fetch_data: function () {
|
34
34
|
let active_div = localStorage[Stock.tab_token];
|
@@ -604,23 +604,19 @@ let Stock = {
|
|
604
604
|
Util.init_table_skeleton({
|
605
605
|
"element_id": "profit_table",
|
606
606
|
"head_cols": [
|
607
|
-
{"name": "
|
608
|
-
{"name": "ROE", "tooltip": "净资产收益率(Return On Equity)"},
|
607
|
+
{"name": "年份-季度"},
|
609
608
|
{"name": "净利率(%)"},
|
610
609
|
{"name": "毛利率"},
|
611
|
-
{"name": "净利润"},
|
612
610
|
{"name": "EPS", "tooltip": "每股收益(Earnings Per Share)"},
|
611
|
+
{"name": "ROE", "tooltip": "净资产收益率(Return On Equity)"},
|
613
612
|
{"name": "营业收入"},
|
614
|
-
{"name": "
|
613
|
+
{"name": "净利润"},
|
614
|
+
{"name": "扣非净利润"},
|
615
615
|
]
|
616
616
|
});
|
617
617
|
Util.post("/stock/" + Stock["code"], {action: "finance"}, function (j) {
|
618
|
-
//
|
619
|
-
let _html = [];
|
620
|
-
let total_ncf_from_oa = 0;
|
621
|
-
let total_cash_paid_for_assets = 0;
|
622
|
-
let total_free_cash_flow = 0;
|
623
|
-
let total_ncf_from_fa = 0;
|
618
|
+
// 现金流量表
|
619
|
+
let _html = [], total_ncf_from_oa = 0, total_cash_paid_for_assets = 0, total_free_cash_flow = 0, total_ncf_from_fa = 0;
|
624
620
|
j["cash_flow_data"].forEach(function (item) {
|
625
621
|
total_ncf_from_oa += item["ncf_from_oa"];
|
626
622
|
total_cash_paid_for_assets += item["cash_paid_for_assets"];
|
@@ -641,7 +637,7 @@ let Stock = {
|
|
641
637
|
total_ncf_from_fa = total_ncf_from_fa >= 0 ? (Util.to_hundred_million(total_ncf_from_fa) + "亿") : ("<b class='text-danger'>" + Util.to_hundred_million(total_ncf_from_fa) + "亿</b>");
|
642
638
|
_html.push("<tr><td>总计</td><td>" + total_ncf_from_oa + "</td><td>" + total_cash_paid_for_assets + "</td><td>" + total_free_cash_flow + "</td><td>" + total_ncf_from_fa + "</td></tr>");
|
643
639
|
Util.render_table_html("cash_flow_table_body", _html);
|
644
|
-
//
|
640
|
+
// 资产负债表
|
645
641
|
_html = [];
|
646
642
|
j["assets_liabilities_data"].forEach(function (item) {
|
647
643
|
let net_assets = item["total_assets"] - item["total_liabilities"];
|
@@ -675,30 +671,34 @@ let Stock = {
|
|
675
671
|
_html.push("</tr>");
|
676
672
|
});
|
677
673
|
Util.render_table_html("assets_liabilities_table_body", _html);
|
678
|
-
Stock.
|
679
|
-
Stock.
|
674
|
+
Stock.income_statement_data = j["income_statement_data"] ? j["income_statement_data"] : [];
|
675
|
+
Stock.render_income_statement_data();
|
680
676
|
$("#quarter").change(function () {
|
681
|
-
Stock.
|
677
|
+
Stock.render_income_statement_data();
|
682
678
|
});
|
683
679
|
Util.hide_tips();
|
684
680
|
});
|
685
681
|
},
|
686
682
|
|
687
|
-
|
683
|
+
/**
|
684
|
+
* 利润表
|
685
|
+
*/
|
686
|
+
render_income_statement_data: function () {
|
688
687
|
let _html = [];
|
689
688
|
let quarter = parseInt($("#quarter").val());
|
690
|
-
Stock["
|
689
|
+
Stock["income_statement_data"].forEach(function (item) {
|
690
|
+
item["quarter"] = Util.get_quarter(item["date"]);
|
691
691
|
if (quarter === 0 || quarter === item["quarter"]) {
|
692
692
|
let tr_cls = (quarter === 0 && item["quarter"] === 4) ? "success" : "";
|
693
693
|
_html.push("<tr class='", tr_cls, "'>");
|
694
|
-
_html.push("<td>", item["
|
695
|
-
_html.push("<td>", item["
|
696
|
-
_html.push("<td>", item["net_profit_ratio"], "</td>");
|
694
|
+
_html.push("<td>", Util.get_year(item["date"]), "-", item["quarter"], "</td>");
|
695
|
+
_html.push("<td>", item["net_profit_rate"], "%</td>");
|
697
696
|
_html.push("<td>", Util.to_float(item["gross_profit_rate"], 2), "%</td>");
|
698
|
-
_html.push("<td>", Util.
|
699
|
-
_html.push("<td>",
|
700
|
-
_html.push("<td>", Util.to_unit(item["
|
701
|
-
_html.push("<td>", Util.
|
697
|
+
_html.push("<td>", Util.to_float(item["eps"], 2), "元</td>");
|
698
|
+
_html.push("<td>", item["roe"], "%</td>");
|
699
|
+
_html.push("<td>", Util.to_unit(item["total_revenue"], 3), "</td>");
|
700
|
+
_html.push("<td>", Util.to_unit(item["net_profit"], 3), "</td>");
|
701
|
+
_html.push("<td>", Util.to_unit(item["adjusted_net_profit"], 3), "</td>");
|
702
702
|
_html.push("</tr>");
|
703
703
|
}
|
704
704
|
});
|
package/summary_daily.js
CHANGED
package/util.js
CHANGED
@@ -112,7 +112,8 @@ const Util = {
|
|
112
112
|
_html.push('<div class="list-group">');
|
113
113
|
if (j.data.length > 0) {
|
114
114
|
$.each(j.data, function (index, item) {
|
115
|
-
|
115
|
+
let upper_code = item["code"].toUpperCase();
|
116
|
+
_html.push('<a target="_blank" rel="noopener noreferrer nofollow" class="list-group-item" href="/stock/', upper_code, '">', (item["name"] ? item["name"] : upper_code), '(', upper_code, ')</a>');
|
116
117
|
});
|
117
118
|
} else {
|
118
119
|
_html.push('<a href="#" class="list-group-item disabled">无数据</a>');
|
@@ -1790,6 +1791,24 @@ const Util = {
|
|
1790
1791
|
return Util.format_to_second(year + "-01-01");
|
1791
1792
|
},
|
1792
1793
|
|
1794
|
+
/**
|
1795
|
+
* 获取是哪个季度
|
1796
|
+
* @param seconds
|
1797
|
+
* @returns {*|number}
|
1798
|
+
*/
|
1799
|
+
get_quarter: function(seconds = 0) {
|
1800
|
+
seconds = seconds > 0 ? seconds : Util.now();
|
1801
|
+
let month = Util.get_month(seconds);
|
1802
|
+
if (month >= 1 && month <= 3) {
|
1803
|
+
return 1;
|
1804
|
+
} else if (month >= 4 && month <= 6) {
|
1805
|
+
return 2;
|
1806
|
+
} else if (month >= 7 && month <= 9) {
|
1807
|
+
return 3;
|
1808
|
+
}
|
1809
|
+
return 4;
|
1810
|
+
},
|
1811
|
+
|
1793
1812
|
/**
|
1794
1813
|
* 一周的哪一天(1-7,星期一:1,星期二:2,...星期日:7)
|
1795
1814
|
* @returns {*|number}
|