ellisran пре 3 дана
родитељ
комит
fbef5467e2
1 измењених фајлова са 4 додато и 2 уклоњено
  1. 4 2
      app/view/datacollect/index_cost.ejs

+ 4 - 2
app/view/datacollect/index_cost.ejs

@@ -1000,6 +1000,7 @@
                 option4_data.yearmonth = [...monthSet].sort();
                 chart_option4_data.forEach(tender => {
                     const data = [];
+                    let total = 0; // 当前标段累计
 
                     option4_data.yearmonth.forEach(month => {
 
@@ -1007,9 +1008,10 @@
 
                         const value = item ? ZhCalc.round(ZhCalc.div(item.end_tp, 10000), 0) : 0;
 
-                        data.push(value);
+                        total = ZhCalc.add(total, value);   // 累计
 
-                        option4_data.totalMap[month] = ZhCalc.add((option4_data.totalMap[month] || 0), value);
+                        data.push(total);
+                        option4_data.totalMap[month] = ZhCalc.add((option4_data.totalMap[month] || 0), total);
                     });
 
                     option4_data.series.push({