Browse Source

汇总砍掉总工程量,去掉总工程量计算值

laiguoran 4 years ago
parent
commit
219aa1f0e8
3 changed files with 6 additions and 124 deletions
  1. 1 1
      app/public/js/schedule_plan.js
  2. 1 4
      app/service/schedule_ledger.js
  3. 4 119
      app/view/schedule/index.ejs

+ 1 - 1
app/public/js/schedule_plan.js

@@ -51,7 +51,7 @@ $(function () {
         }
     };
     const monthsCols = [];
-    const calcCols = [];
+    const calcCols = ['total_price'];
     if(scheduleMonth.length > 0) {
         for (const sm of scheduleMonth) {
             const readOnly = sm.stage_used !== 0;

+ 1 - 4
app/service/schedule_ledger.js

@@ -36,7 +36,6 @@ module.exports = app => {
                 await transaction.update(this.tableName, { gcl: null, tp: null }, { where: { tid: this.ctx.tender.id } });
                 const updateOptions = [];
                 let total_tp = 0;
-                let total_gcl = 0;
                 // 更新最底层和总设计值
                 for (const u of datas.under_ledger) {
                     updateOptions.push({
@@ -49,7 +48,6 @@ module.exports = app => {
                             tid: this.ctx.tender.id,
                         },
                     });
-                    total_gcl = this.ctx.helper.add(total_gcl, u.gcl);
                     total_tp = this.ctx.helper.add(total_tp, u.tp);
                 }
                 if (updateOptions.length > 0) await transaction.updateRows(this.tableName, updateOptions);
@@ -59,11 +57,10 @@ module.exports = app => {
                     const newSchedule = {
                         tid: this.ctx.tender.id,
                         total_tp,
-                        total_gcl,
                     };
                     await transaction.insert(this.ctx.service.schedule.tableName, newSchedule);
                 } else {
-                    await transaction.update(this.ctx.service.schedule.tableName, { id: scheduleInfo.id, total_gcl, total_tp });
+                    await transaction.update(this.ctx.service.schedule.tableName, { id: scheduleInfo.id, total_tp });
                 }
                 await transaction.commit();
                 return true;

+ 4 - 119
app/view/schedule/index.ejs

@@ -21,9 +21,9 @@
                             <li class="nav-item">
                                 <a class="nav-link px-5 py-2 active" href="#tp" id="tp-tab" data-toggle="tab" role="tab" aria-controls="tp" aria-selected="true">金额模式</a>
                             </li>
-                            <li class="nav-item">
-                                <a class="nav-link px-5 py-2" href="#gcl" id="gcl-tab" data-toggle="tab" role="tab" aria-controls="gcl" aria-selected="false">工程量模式</a>
-                            </li>
+                            <!--<li class="nav-item">-->
+                                <!--<a class="nav-link px-5 py-2" href="#gcl" id="gcl-tab" data-toggle="tab" role="tab" aria-controls="gcl" aria-selected="false">工程量模式</a>-->
+                            <!--</li>-->
                         </ul>
                     </div>
                     <!--金额概况-->
@@ -78,30 +78,6 @@
                                 </div>
                             </div>
                         </div>
-                        <div id="gcl" class="tab-pane fade" role="tabpanel" aria-labelledby="gcl-tab">
-                            <div class="mb-3">
-                                <% if (scheduleInfo && scheduleInfo.total_gcl !== 0) { %>
-                                计划工程量进度
-                                <div class="progress">
-                                    <div class="progress-bar bg-info" style="width:<%- ctx.helper.round(ctx.helper.div(scheduleInfo.plan_gcl, scheduleInfo.total_gcl)*100, 0) %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="计划完成工程量:¥<%- ctx.helper.formatNum(scheduleInfo.plan_gcl, '#,##0.######') %>"><%- ctx.helper.round(ctx.helper.div(scheduleInfo.plan_gcl, scheduleInfo.total_gcl)*100, 0) %>%</div>
-                                    <div class="progress-bar bg-gray" style="width:<%- 100 - ctx.helper.round(ctx.helper.div(scheduleInfo.plan_gcl, scheduleInfo.total_gcl)*100, 0) %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="合同未计划:¥<%- ctx.helper.formatNum(ctx.helper.sub(scheduleInfo.total_gcl, scheduleInfo.plan_gcl), '#,##0.######') %>"><%- 100 - ctx.helper.round(ctx.helper.div(scheduleInfo.plan_gcl, scheduleInfo.total_gcl)*100, 0) %>%</div>
-                                </div>
-                                <p class="mt-2 mb-0">实际工程量进度</p>
-                                <div class="progress">
-                                    <div class="progress-bar bg-info" style="width:<%- ctx.helper.round(ctx.helper.div(scheduleInfo.sj_gcl, scheduleInfo.total_gcl)*100, 0) %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="实际完成工程量:¥<%- ctx.helper.formatNum(scheduleInfo.sj_gcl, '#,##0.######') %>"><%- ctx.helper.round(ctx.helper.div(scheduleInfo.sj_gcl, scheduleInfo.total_gcl)*100, 0) %>%</div>
-                                    <div class="progress-bar bg-gray" style="width:<%- 100 - ctx.helper.round(ctx.helper.div(scheduleInfo.sj_gcl, scheduleInfo.total_gcl)*100, 0) %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="合同未完成:¥<%- ctx.helper.formatNum(ctx.helper.sub(scheduleInfo.total_gcl, scheduleInfo.sj_gcl), '#,##0.######') %>"><%- 100 - ctx.helper.round(ctx.helper.div(scheduleInfo.sj_gcl, scheduleInfo.total_gcl)*100, 0) %>%</div>
-                                </div>
-                                <% } %>
-                            </div>
-                            <!--图表-->
-                            <div class="card mb-3">
-                                <div class="card-body">
-                                    <h5 class="card-title">工程量进度表</h5>
-                                    <div id="chartContainer3" style="height: 300px; width: 100%;">
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
                     </div>
                 </div>
             </div>
@@ -109,100 +85,9 @@
     </div>
 </div>
 <script src="/public/js/echarts/echarts.min.js"></script>
-<% if (scheduleInfo && scheduleInfo.total_tp !== 0 && scheduleInfo.total_gcl !== 0) { %>
+<% if (scheduleInfo && scheduleInfo.total_tp !== 0) { %>
 <script type="text/javascript">
     var charts = new Array();
-    //计划进度//
-    // 基于准备好的dom,初始化echarts图表
-    var myChart2 = echarts.init(document.getElementById('chartContainer3'));
-    var option2 = {
-        color: ['#d38b70','#8fb7cf','#cd5c5c','#ffa500','#40e0d0',
-            '#17a2b8','#28a745','#e4575a','#959eac','#6699FF',
-            '#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700',
-            '#5c616b','#ff6666','#3cb371','#b8860b','#30e0e0'],
-        title : {
-            text: ''
-        },
-        tooltip : {
-            trigger: 'axis'
-        },
-        calculable : true,
-        legend: {
-            data:['计划完成工程量','实际完成工程量','实际占设计比例']
-        },
-        dataZoom: [
-            {show: true,start: 0, end: 100}
-        ],
-        xAxis : [
-            {
-                type : 'category',
-                splitLine : {show : true},
-                data : [<% if (scheduleMonth.length > 0) { %>
-                    <% for (const sm of scheduleMonth) { %>
-                        '<%- sm.yearmonth.split('-')[0] %>年<%- parseInt(sm.yearmonth.split('-')[1]) %>月',
-                    <% } %>
-                <% } %>],
-            }
-        ],
-        yAxis : [
-            {
-                type : 'value',
-                name : '工程量',
-                position:'left',
-                axisLabel : {
-                    formatter: '{value}'
-                },
-                splitArea : {show : true}
-            },
-            {
-                type : 'value',
-                name:'完成度',
-                axisLabel : {
-                    formatter: '{value} %'
-                },
-                position: 'right',
-                splitArea : {show : true}
-            }
-        ],
-        series : [
-            {
-                name:'计划完成工程量',
-                type:'bar',
-                tooltip : {trigger: 'item',formatter: "{b}<br/>{a}:{c}"},
-                stack: '计划',
-                data:[<% if (scheduleMonth.length > 0) { %>
-                    <% for (const sm of scheduleMonth) { %>
-                    '<%- sm.plan_gcl  %>',
-                    <% } %>
-                    <% } %>]
-            },
-            {
-                name:'实际完成工程量',
-                type:'bar',
-                tooltip : {trigger: 'item',formatter: "{b}<br/>{a}:{c}"},
-                stack: '实际',
-                data:[<% if (scheduleMonth.length > 0) { %>
-                    <% for (const sm of scheduleMonth) { %>
-                    '<%- sm.sj_gcl  %>',
-                    <% } %>
-                    <% } %>]
-            },
-            {
-                name:'实际占设计比例',
-                type:'line',
-                tooltip : {trigger: 'axis',formatter: "{b}占合同比例<br/>{a}:{c} %"},
-                yAxisIndex: 1,
-                data:[<% if (scheduleMonth.length > 0) { %>
-                    <% for (const sm of scheduleMonth) { %>
-                    '<%- ctx.helper.round(ctx.helper.div(sm.sj_gcl, scheduleInfo.total_gcl)*100, 2)  %>',
-                    <% } %>
-                    <% } %>]
-            },
-        ]
-    };
-    // 为echarts对象加载数据
-    myChart2.setOption(option2);
-    charts.push(myChart2);
     //4 完成金额进度进度//
     var myChart = echarts.init(document.getElementById('chartContainer4'));
     var option = {