|
@@ -298,27 +298,35 @@ $(document).ready(() => {
|
|
|
const huishouInfo = _.find(tree.children, function (item) {
|
|
|
return item.name.indexOf('回收金额') !== -1 && (item.gu_tp || item.gai_tp || (item.final_tp !== undefined && item.final_tp) || item.yu_tp || (item.total_price !== undefined && item.total_price))
|
|
|
});
|
|
|
- let total_rate = 0, total_gai_tp = 0, total_gu_tp = 0, total_yu_tp = 0, total_price = 0, total_final_tp = 0;
|
|
|
+ let total_rate = 0, total_gai_tp = 0, total_gu_tp = 0, total_yu_tp = 0, total_zb_tp = 0, total_price = 0, total_final_tp = 0;
|
|
|
if (level1List.length > 0) {
|
|
|
if (huishouInfo) {
|
|
|
total_gai_tp = ZhCalc.sub(ZhCalc.sum(_.map(level1List, 'gai_tp')), huishouInfo.gai_tp);
|
|
|
total_final_tp = ZhCalc.sub(ZhCalc.sum(_.map(level1List, 'final_tp')), huishouInfo.final_tp);
|
|
|
total_gu_tp = ZhCalc.sub(ZhCalc.sum(_.map(level1List, 'gu_tp')), huishouInfo.gu_tp);
|
|
|
total_yu_tp = ZhCalc.sub(ZhCalc.sum(_.map(level1List, 'yu_tp')), huishouInfo.yu_tp);
|
|
|
+ total_zb_tp = ZhCalc.sub(ZhCalc.sum(_.map(level1List, 'zb_tp')), huishouInfo.zb_tp);
|
|
|
total_price = ZhCalc.sub(ZhCalc.sum(_.map(level1List, 'total_price')), huishouInfo.total_price);
|
|
|
total_rate = ZhCalc.div(ZhCalc.sub(total_final_tp, total_gai_tp), total_gai_tp);
|
|
|
$('#total_gai_tp').text(total_gai_tp ? ZhCalc.div(total_gai_tp, 10000) : 0);
|
|
|
$('#total_final_tp').text(total_final_tp ? ZhCalc.div(total_final_tp, 10000) : 0);
|
|
|
+ $('#total_gu_tp').text(total_gu_tp ? ZhCalc.div(total_gu_tp, 10000) : 0);
|
|
|
+ $('#total_yu_tp').text(total_yu_tp ? ZhCalc.div(total_yu_tp, 10000) : 0);
|
|
|
+ $('#total_zb_tp').text(total_zb_tp ? ZhCalc.div(total_zb_tp, 10000) : 0);
|
|
|
// level1List.push(huishouInfo);
|
|
|
} else {
|
|
|
total_gai_tp = ZhCalc.sum(_.map(level1List, 'gai_tp'));
|
|
|
total_final_tp = ZhCalc.sum(_.map(level1List, 'final_tp'));
|
|
|
total_gu_tp = ZhCalc.sum(_.map(level1List, 'gu_tp'));
|
|
|
total_yu_tp = ZhCalc.sum(_.map(level1List, 'yu_tp'));
|
|
|
+ total_zb_tp = ZhCalc.sum(_.map(level1List, 'zb_tp'));
|
|
|
total_price = ZhCalc.sum(_.map(level1List, 'total_price'));
|
|
|
total_rate = ZhCalc.div(ZhCalc.sub(total_final_tp, total_gai_tp), total_gai_tp);
|
|
|
$('#total_gai_tp').text(total_gai_tp ? ZhCalc.div(total_gai_tp, 10000) : 0);
|
|
|
$('#total_final_tp').text(total_final_tp ? ZhCalc.div(total_final_tp, 10000) : 0);
|
|
|
+ $('#total_gu_tp').text(total_gu_tp ? ZhCalc.div(total_gu_tp, 10000) : 0);
|
|
|
+ $('#total_yu_tp').text(total_yu_tp ? ZhCalc.div(total_yu_tp, 10000) : 0);
|
|
|
+ $('#total_zb_tp').text(total_zb_tp ? ZhCalc.div(total_zb_tp, 10000) : 0);
|
|
|
}
|
|
|
}
|
|
|
$('#total_rate').text((total_rate ? ZhCalc.round(ZhCalc.mul(total_rate,100), 2) : 0) + '%');
|