瀏覽代碼

合同支付,明细

MaiXinRong 3 年之前
父節點
當前提交
544be8c888
共有 3 個文件被更改,包括 10 次插入6 次删除
  1. 2 0
      app/const/deal_pay.js
  2. 4 3
      app/controller/stage_controller.js
  3. 4 3
      app/service/stage_bills_final.js

+ 2 - 0
app/const/deal_pay.js

@@ -68,6 +68,8 @@ const chapterDetail = [
     {name: '清单 第500章 隧道', cType: 1, serialNo: 5, filter: '^[^0-9]*5[0-9]{2}(-|$)'},
     {name: '清单 第600章 安全设施及预埋管线', cType: 1, serialNo: 6, filter: '^[^0-9]*6[0-9]{2}(-|$)'},
     {name: '清单 第700章 绿化及环境保护', cType: 1, serialNo: 7, filter: '^[^0-9]*7[0-9]{2}(-|$)'},
+    {name: '清单 第800章 机电工程', cType: 1, serialNo: 6, filter: '^[^0-9]*8[0-9]{2}(-|$)'},
+    {name: '清单 第900章 房建工程', cType: 1, serialNo: 7, filter: '^[^0-9]*9[0-9]{2}(-|$)'},
     {name: '未计入章节清单合计', cType: 21, serialNo: 8},
     {name: '清单小计(A)', cType: 11, serialNo: 9},
     {name: '非清单项费用(B)', cType: 31, serialNo: 10},

+ 4 - 3
app/controller/stage_controller.js

@@ -1000,10 +1000,11 @@ module.exports = app => {
                     switch (cd.cType) {
                         case 1:
                             const tp = await ctx.service.stageBills.getSumTotalPriceGcl(ctx.stage, cd.filter);
-                            assignStageData(cd, tp);
+                            const preTp = await ctx.service.stageBillsFinal.getSumTotalPriceGcl(ctx.stage.tid, ctx.stage.order - 1, cd.filter);
+                            assignStageData(cd, tp, preTp);
                             break;
                         case 11:
-                            assignStageData(cd, await ctx.service.stageBills.getSumTotalPriceGcl(ctx.stage));
+                            assignStageData(cd, await ctx.service.stageBills.getSumTotalPriceGcl(ctx.stage), await ctx.service.stageBillsFinal.getSumTotalPriceGcl(ctx.stage.tid, ctx.stage.order - 1));
                             break;
                         case 21:
                             const sum = _.find(calcDetail, { cType: 11 });
@@ -1013,7 +1014,7 @@ module.exports = app => {
                             }
                             break;
                         case 31:
-                            assignStageData(cd, await ctx.service.stageBills.getSumTotalPriceNotGcl(ctx.stage));
+                            assignStageData(cd, await ctx.service.stageBills.getSumTotalPriceNotGcl(ctx.stage), await ctx.service.stageBillsFinal.getSumTotalPriceNotGcl(ctx.stage.tid, ctx.stage.order - 1));
                             break;
                         case 41:
                             const sum1 = _.find(calcDetail, { cType: 11 });

+ 4 - 3
app/service/stage_bills_final.js

@@ -149,10 +149,11 @@ module.exports = app => {
 
         async getSumTotalPriceFilter(tenderId, stageOrder, operate, filter) {
             const sql = 'SELECT Sum(`contract_tp`) As `contract_tp`, Sum(`qc_tp`) As `qc_tp`' +
-                '  FROM ' + this.tableName + ' As Bills ' +
+                '  FROM (SELECT * FROM ' + this.tableName + ' WHERE tid = ? And sorder = ?) As Bills ' +
                 '  LEFT JOIN ' + this.ctx.service.ledger.tableName + ' As Ledger ' +
-                '  ON Bills.lid = Ledger.id And Bills.sorder = ? And Bills.tid = ? And Ledger.b_code ' + operate + ' ?';
-            const sqlParam = [stageOrder, tenderId, filter];
+                '  ON Bills.lid = Ledger.id ' +
+                '  WHERE Ledger.b_code ' + operate + ' ?';
+            const sqlParam = [tenderId, stageOrder, tenderId, filter];
             const result = await this.db.queryOne(sql, sqlParam);
             return result;
         }