Selaa lähdekoodia

决策大屏数据调整

laiguoran 3 vuotta sitten
vanhempi
commit
28700dc0c7
2 muutettua tiedostoa jossa 48 lisäystä ja 24 poistoa
  1. 2 1
      app/controller/datacollect_controller.js
  2. 46 23
      app/view/datacollect/index.ejs

+ 2 - 1
app/controller/datacollect_controller.js

@@ -126,7 +126,8 @@ module.exports = app => {
                         t.total_price = sum.total_price;
                         t.deal_tp = sum.deal_tp;
                     }
-                    t.material_tp = await ctx.service.material.getSumMaterial(t.id);
+                    t.change_tp = await ctx.service.change.getChangeTp(t.id);
+                    // t.material_tp = await ctx.service.material.getSumMaterial(t.id);
                     // 获取本标段 本月计量期审批通过数目,变更令审批通过数目,台账修订通过数目,材料调差通过数目
                     t.month_stage_num = await ctx.service.stageAudit.getNumByMonth(t.id, startMonth, endMonth);
                     t.month_change_num = await ctx.service.changeAudit.getNumByMonth(t.id, startMonth, endMonth);

+ 46 - 23
app/view/datacollect/index.ejs

@@ -93,27 +93,35 @@
                                 <div class="height-20 mb-2">
                                     <div class="card text-center bg-dark text-white ml-2 mr-2 py-2 height-100">
                                         <div class="card-body card-per-body">
-                                            <h5 class="card-title card-case-title data_total_change_price">0.00</h5>
-                                            <p class="card-text text-muted">累计变更金额</p>
+                                            <h5 class="card-title card-case-title data_total_checked_change_price">0.00</h5>
+                                            <p class="card-text text-muted">已批复变更金额</p>
                                         </div>
                                     </div>
                                 </div>
                                 <div class="height-20 mb-2">
                                     <div class="card text-center bg-dark text-white ml-2 mr-2 py-2 height-100">
                                         <div class="card-body card-per-body">
-                                            <h5 class="card-title card-case-title data_total_stage_price">0.00</h5>
-                                            <p class="card-text text-muted">累计完成金额</p>
+                                            <h5 class="card-title card-case-title data_total_after_change_price">0.00</h5>
+                                            <p class="card-text text-muted">变更后金额</p>
                                         </div>
                                     </div>
                                 </div>
-                                <div class="height-20">
-                                    <div class="card text-center bg-dark text-white ml-2 mr-2 height-100">
+                                <div class="height-20 mb-2">
+                                    <div class="card text-center bg-dark text-white ml-2 mr-2 py-2 height-100">
                                         <div class="card-body card-per-body">
-                                            <h5 class="card-title card-case-title data_total_material_price">0.00</h5>
-                                            <p class="card-text text-muted">材料调差</p>
+                                            <h5 class="card-title card-case-title data_total_stage_price">0.00</h5>
+                                            <p class="card-text text-muted">累计完成金额</p>
                                         </div>
                                     </div>
                                 </div>
+                                <!--<div class="height-20">-->
+                                    <!--<div class="card text-center bg-dark text-white ml-2 mr-2 height-100">-->
+                                        <!--<div class="card-body card-per-body">-->
+                                            <!--<h5 class="card-title card-case-title data_total_material_price">0.00</h5>-->
+                                            <!--<p class="card-text text-muted">材料调差</p>-->
+                                        <!--</div>-->
+                                    <!--</div>-->
+                                <!--</div>-->
                             </div>
                             <!--饼图-->
                             <div class="left-chart">
@@ -358,8 +366,8 @@
                                         <div class="col-4 pl-0">
                                             <div class="card text-center bg-dark text-white height-100">
                                                 <div class="card-body card-per-body">
-                                                    <h5 class="card-title card-case-title data_total_change_price">0.00</h5>
-                                                    <p class="card-text text-muted">累计变更金额</p>
+                                                    <h5 class="card-title card-case-title data_total_checked_change_price">0.00</h5>
+                                                    <p class="card-text text-muted">已批复变更金额</p>
                                                 </div>
                                             </div>
                                         </div>
@@ -397,27 +405,35 @@
                                         <div class="col-4 pl-0">
                                             <div class="card text-center bg-dark text-white mb-2 height-100">
                                                 <div class="card-body card-per-body">
-                                                    <h5 class="card-title card-case-title data_total_stage_price">0.00</h5>
-                                                    <p class="card-text card-case-text text-muted">累计完成金额</p>
+                                                    <h5 class="card-title card-case-title data_total_after_change_price">0.00</h5>
+                                                    <p class="card-text text-muted">变更后金额</p>
                                                 </div>
                                             </div>
                                         </div>
                                         <div class="col-4 pl-0">
                                             <div class="card text-center bg-dark text-white height-100">
                                                 <div class="card-body card-per-body">
-                                                    <h5 class="card-title card-case-title data_total_advance_price">0.00</h5>
-                                                    <p class="card-text card-case-text text-muted">预付款</p>
+                                                    <h5 class="card-title card-case-title data_total_stage_price">0.00</h5>
+                                                    <p class="card-text card-case-text text-muted">累计完成金额</p>
                                                 </div>
                                             </div>
                                         </div>
                                         <div class="col-4 pl-0">
                                             <div class="card text-center bg-dark text-white height-100">
                                                 <div class="card-body card-per-body">
-                                                    <h5 class="card-title card-case-title data_total_material_price">0.00</h5>
-                                                    <p class="card-text card-case-text text-muted">材料调差</p>
+                                                    <h5 class="card-title card-case-title data_total_advance_price">0.00</h5>
+                                                    <p class="card-text card-case-text text-muted">预付款</p>
                                                 </div>
                                             </div>
                                         </div>
+                                        <!--<div class="col-4 pl-0">-->
+                                            <!--<div class="card text-center bg-dark text-white height-100">-->
+                                                <!--<div class="card-body card-per-body">-->
+                                                    <!--<h5 class="card-title card-case-title data_total_material_price">0.00</h5>-->
+                                                    <!--<p class="card-text card-case-text text-muted">材料调差</p>-->
+                                                <!--</div>-->
+                                            <!--</div>-->
+                                        <!--</div>-->
                                     </div>
                                 </div>
                                 <div class="right-big-chart-content mr-3">
@@ -1331,10 +1347,12 @@
 
         function setData(tenderList, categoryIndex = 0) {
             let total_price = 0;
-            let total_change_price = 0;
+            // let total_change_price = 0;
+            let total_checked_change_price = 0;
+            let total_after_change_price = 0;
             let total_stage_price = 0;
             let total_advance_price = 0;
-            let total_material_price = 0;
+            // let total_material_price = 0;
             let month_stage_num = 0;
             let month_change_num = 0;
             let month_revise_num = 0;
@@ -1368,9 +1386,11 @@
             const chart_option4_data = [];
             for(const t of tenderList) {
                 total_price = ZhCalc.add(total_price, t.total_price);
-                total_change_price = ZhCalc.add(total_change_price, t.end_qc_tp);
+                // total_change_price = ZhCalc.add(total_change_price, t.end_qc_tp);
+                total_checked_change_price = ZhCalc.add(total_checked_change_price, t.change_tp);
+                total_after_change_price = ZhCalc.add(total_after_change_price, ZhCalc.add(t.total_price, t.change_tp));
                 total_stage_price = ZhCalc.add(total_stage_price, t.end_gather_tp);
-                total_material_price = ZhCalc.add(total_material_price, t.material_tp);
+                // total_material_price = ZhCalc.add(total_material_price, t.material_tp);
                 total_advance_price = ZhCalc.add(total_advance_price, t.advance_tp);
                 month_stage_num = ZhCalc.add(month_stage_num, t.month_stage_num);
                 month_change_num = ZhCalc.add(month_change_num, t.month_change_num);
@@ -1421,13 +1441,16 @@
             }
             // console.log(tenderList);
             $('.data_tender_num').text(tenderList.length);
-            const rate = total_price && total_change_price ? ZhCalc.round(ZhCalc.div(total_stage_price, ZhCalc.add(total_price, total_change_price)) * 100, 2) : 0;
+            // const rate = total_price && total_change_price ? ZhCalc.round(ZhCalc.div(total_stage_price, ZhCalc.add(total_price, total_change_price)) * 100, 2) : 0;
+            const rate = total_stage_price && total_after_change_price ? ZhCalc.round(ZhCalc.div(total_stage_price, total_after_change_price) * 100, 2) : 0;
             $('.data_tender_rate').text(rate ? rate + '%' : '0%');
             $('.data_total_price').text(formatMoney(total_price));
-            $('.data_total_change_price').text(formatMoney(total_change_price));
+            // $('.data_total_change_price').text(formatMoney(total_change_price));
+            $('.data_total_checked_change_price').text(formatMoney(total_checked_change_price));
+            $('.data_total_after_change_price').text(formatMoney(total_after_change_price));
             $('.data_total_stage_price').text(formatMoney(total_stage_price));
             $('.data_total_advance_price').text(formatMoney(total_advance_price));
-            $('.data_total_material_price').text(formatMoney(total_material_price));
+            // $('.data_total_material_price').text(formatMoney(total_material_price));
             $('.month_stage_num').text(month_stage_num);
             $('.month_change_num').text(month_change_num);
             $('.month_revise_num').text(month_revise_num);