MaiXinRong 5 years ago
parent
commit
8b0da7d774
3 changed files with 11 additions and 0 deletions
  1. 8 0
      app/service/deal_bills.js
  2. 1 0
      app/service/rpt_gather_memory.js
  3. 2 0
      builder_report_index_define.js

+ 8 - 0
app/service/deal_bills.js

@@ -20,6 +20,14 @@ module.exports = app => {
             this.tableName = 'deal_bills';
         }
 
+        async getSum(tenderId) {
+            const sql = 'SELECT Sum(`total_price`) As `total_price` ' +
+                '  From ' + this.tableName +
+                '  WHERE `tender_id` = ? ';
+            const sqlParam = [tenderId];
+            return await this.db.query(sql, sqlParam);
+        }
+
         /**
          * 导入Excel数据(node-xlsx)
          *

+ 1 - 0
app/service/rpt_gather_memory.js

@@ -408,6 +408,7 @@ module.exports = app => {
                 deal_tp: tender.deal_tp,
                 tp: tender.total_price
             };
+            info.deal_bills_tp = await this.ctx.service.dealBills.getSum(tender.id);
             if (tender.ledger_status === auditConst.ledger.status.uncheck || tender.ledger_status === auditConst.ledger.status.checkNo) {
                 const sum = await this.ctx.service.ledger.addUp({tender_id: tender.id/*, is_leaf: true*/});
                 info.tp = sum.total_price;

+ 2 - 0
builder_report_index_define.js

@@ -529,6 +529,8 @@ const gather_tender_info = {
         { name: '截止上期-应付', field: 'pre_yf', type: dataType.currency },
         { name: '本期-应付', field: 'yf', type: dataType.currency },
         { name: '截止本期-应付', field: 'end_yf', type: dataType.currency },
+
+        { name: '签约清单-金额', field: 'deal_bills_tp', type: dataType.currency },
     ],
 };
 const gather_stage_pay = {