Browse Source

修复重算bug

laiguoran 4 years ago
parent
commit
6378697394
3 changed files with 10 additions and 11 deletions
  1. 0 1
      app/controller/schedule_controller.js
  2. 2 2
      app/service/schedule_ledger.js
  3. 8 8
      app/view/revise/info.ejs

+ 0 - 1
app/controller/schedule_controller.js

@@ -307,7 +307,6 @@ module.exports = app => {
                 //     return _.find(newSS, { order: item.order });
                 // }), 'id');
                 const stageIdList = _.map(stageList, 'id');
-                console.log(stageIdList);
                 curYearStageData = await ctx.service.stageBills.getStagesData(tender.id, stageIdList.join(','));
             }
             return { slmList, nextSlmList, endSlmList, yearSlmList, curYearStageData, scheduleMonth, stageOrderList, scheduleStage, curScheduleStage };

+ 2 - 2
app/service/schedule_ledger.js

@@ -93,8 +93,8 @@ module.exports = app => {
                                             const new_sj_gcl = l.sj_tp ? this.ctx.helper.round(this.ctx.helper.div(l.sj_tp, dgn_price), 3) : null;
                                             slmUpdateOption.push({ id: l.id, plan_gcl: new_plan_gcl, sj_gcl: new_sj_gcl });
                                         } else if (mode === scheduleConst.plan_mode.gcl) {
-                                            const new_plan_tp = l.plan_gcl ? this.ctx.helper.round(this.ctx.helper.div(l.plan_gcl, dgn_price), 0) : null;
-                                            const new_sj_tp = l.sj_gcl ? this.ctx.helper.round(this.ctx.helper.div(l.sj_gcl, dgn_price), 0) : null;
+                                            const new_plan_tp = l.plan_gcl ? this.ctx.helper.round(this.ctx.helper.mul(l.plan_gcl, dgn_price), 0) : null;
+                                            const new_sj_tp = l.sj_gcl ? this.ctx.helper.round(this.ctx.helper.mul(l.sj_gcl, dgn_price), 0) : null;
                                             slmUpdateOption.push({ id: l.id, plan_tp: new_plan_tp, sj_tp: new_sj_tp });
                                         }
                                     }

+ 8 - 8
app/view/revise/info.ejs

@@ -12,13 +12,13 @@
                             <i class="fa fa-list-ol"></i> 显示层级
                         </button>
                         <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
-                            <a class="dropdown-item" name="showLevel" tag="1" href="javascirpt: void(0);">第一层</a>
-                            <a class="dropdown-item" name="showLevel" tag="2" href="javascirpt: void(0);">第二层</a>
-                            <a class="dropdown-item" name="showLevel" tag="3" href="javascirpt: void(0);">第三层</a>
-                            <a class="dropdown-item" name="showLevel" tag="4" href="javascirpt: void(0);">第四层</a>
-                            <a class="dropdown-item" name="showLevel" tag="5" href="javascirpt: void(0);">第五层</a>
-                            <a class="dropdown-item" name="showLevel" tag="last" href="javascirpt: void(0);">最底层</a>
-                            <a class="dropdown-item" name="showLevel" tag="leafXmj" href="javascirpt: void(0);">只显示项目节</a>
+                            <a class="dropdown-item" name="showLevel" tag="1" href="javascript: void(0);">第一层</a>
+                            <a class="dropdown-item" name="showLevel" tag="2" href="javascript: void(0);">第二层</a>
+                            <a class="dropdown-item" name="showLevel" tag="3" href="javascript: void(0);">第三层</a>
+                            <a class="dropdown-item" name="showLevel" tag="4" href="javascript: void(0);">第四层</a>
+                            <a class="dropdown-item" name="showLevel" tag="5" href="javascript: void(0);">第五层</a>
+                            <a class="dropdown-item" name="showLevel" tag="last" href="javascript: void(0);">最底层</a>
+                            <a class="dropdown-item" name="showLevel" tag="leafXmj" href="javascript: void(0);">只显示项目节</a>
                         </div>
                     </div>
                 </div>
@@ -118,7 +118,7 @@
                     <div id="xd-content" class="tab-pane">
                         <% if ((revise.status === audit.status.uncheck || revise.status === audit.status.checkNo) && !readOnly) { %>
                         <div class="sjs-bar">
-                            <div class="d-flex"><a href="javascirpt: void(0);" class="btn btn-sm btn-outline-success mb-1 ml-auto" id="save">保存</a></div>
+                            <div class="d-flex"><a href="javascript: void(0);" class="btn btn-sm btn-outline-success mb-1 ml-auto" id="save">保存</a></div>
                         </div>
                         <% } %>
                         <div class="sjs-sh" style="overflow:auto">