Jelajahi Sumber

成本大屏修改

ellisran 2 bulan lalu
induk
melakukan
fbef5467e2
1 mengubah file dengan 4 tambahan dan 2 penghapusan
  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();
                 option4_data.yearmonth = [...monthSet].sort();
                 chart_option4_data.forEach(tender => {
                 chart_option4_data.forEach(tender => {
                     const data = [];
                     const data = [];
+                    let total = 0; // 当前标段累计
 
 
                     option4_data.yearmonth.forEach(month => {
                     option4_data.yearmonth.forEach(month => {
 
 
@@ -1007,9 +1008,10 @@
 
 
                         const value = item ? ZhCalc.round(ZhCalc.div(item.end_tp, 10000), 0) : 0;
                         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({
                     option4_data.series.push({