浏览代码

关联台账计算调整

MaiXinRong 3 年之前
父节点
当前提交
18bcf54f28
共有 2 个文件被更改,包括 9 次插入9 次删除
  1. 7 9
      app/service/stage.js
  2. 2 0
      builder_report_index_define.js

+ 7 - 9
app/service/stage.js

@@ -224,9 +224,8 @@ module.exports = app => {
                 await this.doCheckStage(stage);
                 if (!stage.readOnly && stage.check_calc) {
                     const tpData = await this.ctx.service.stageBills.getSumTotalPrice(stage);
-                    const srCache = await this.ctx.service.stageRela.getSumCacheTp(stage.id);
-                    stage.contract_tp = this.ctx.helper.add(tpData.contract_tp, srCache.contract_tp);
-                    stage.qc_tp = this.ctx.helper.add(tpData.qc_tp, srCache.qc_tp);
+                    stage.contract_tp = tpData.contract_tp;
+                    stage.qc_tp = tpData.qc_tp;
                     const tp = await this.ctx.service.stagePay.getSpecialTotalPrice(stage);
                     stage.yf_tp = tp.yf;
                     stage.sf_tp = tp.sf;
@@ -447,7 +446,6 @@ module.exports = app => {
             for (const cb of calcBase) {
                 const sum = await this.ctx.service.stageBills.getSumTotalPrice(stage);
                 const bg = await this.ctx.service.stageChange.getQualityTotalPrice(stage);
-                const srCache = await this.ctx.service.stageRela.getSumCacheTp(stage.id);
                 switch (cb.code) {
                     case 'htj':
                         cb.value = param.contractPrice;
@@ -465,7 +463,7 @@ module.exports = app => {
                         cb.value = param.materialAdvance;
                         break;
                     case 'bqwc':
-                        cb.value = this.ctx.helper.sum([sum.contract_tp, sum.qc_tp, srCache.gather_tp]);
+                        cb.value = this.ctx.helper.add(sum.contract_tp, sum.qc_tp);
                         break;
                     case 'bqht':
                         cb.value = sum.contract_tp;
@@ -475,16 +473,16 @@ module.exports = app => {
                         break;
                     case 'ybbqwc':
                         const sumGcl = await this.ctx.service.stageBills.getSumTotalPriceGcl(stage, '^[^0-9]*1[0-9]{2}(-|$)');
-                        cb.value = this.ctx.helper.sum([sumGcl.contract_tp, sumGcl.qc_tp, srCache.gather_tp_100]);
+                        cb.value = this.ctx.helper.add(sumGcl.contract_tp, sumGcl.qc_tp);
                         break;
                     case 'ybbqbg':
-                        cb.value = this.ctx.helper.add(bg.common, srCache.bg_common);
+                        cb.value = bg.common;
                         break;
                     case 'jdbqbg':
-                        cb.value = this.ctx.helper.add(bg.more, srCache.bg_more);
+                        cb.value = bg.more;
                         break;
                     case 'zdbqbg':
-                        cb.value = this.ctx.helper.add(bg.great, srCache.bg_great);
+                        cb.value = bg.great;
                         break;
                     default:
                         cb.value = 0;

+ 2 - 0
builder_report_index_define.js

@@ -507,6 +507,8 @@ const stage_pos = {
         { name: '备注1', field: 'ex_memo1', type: dataType.str },
         { name: '备注2', field: 'ex_memo2', type: dataType.str },
         { name: '备注3', field: 'ex_memo3', type: dataType.str },
+
+        { name: '现场实际数量', field: 'real_qty', type: dataType.currency },
     ],
 };
 const stage_pos_compare = {