瀏覽代碼

金额概况,统计预付款数据

MaiXinRong 5 年之前
父節點
當前提交
076b6f4ddd
共有 3 個文件被更改,包括 13 次插入0 次删除
  1. 2 0
      app/controller/tender_controller.js
  2. 5 0
      app/public/js/tender_list_info.js
  3. 6 0
      app/service/advance.js

+ 2 - 0
app/controller/tender_controller.js

@@ -75,6 +75,8 @@ module.exports = app => {
                 //     }
                 // }
                 tenderList.forEach(async t => {
+                    t.advance_tp = await this.ctx.service.advance.getSumAdvance(t.id);
+
                     if (t.ledger_status === auditConst.ledger.status.checked) {
                         t.lastStage = await this.ctx.service.stage.getLastestStage(t.id, true);
                         t.completeStage = await this.ctx.service.stage.getLastestCompleteStage(t.id);

+ 5 - 0
app/public/js/tender_list_info.js

@@ -347,6 +347,10 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
     html.push('<td style="width: 7%" class="text-right">');
     html.push(node.pre_gather_tp);
     html.push('</td>');
+    // 预付款
+    html.push('<td style="width: 7%" class="text-right">');
+    html.push(node.advance_tp);
+    html.push('</td>');
     // 本期应付
     html.push('<td style="width: 7%" class="text-right">');
     html.push(node.yf_tp);
@@ -379,6 +383,7 @@ function getTenderTreeHtml () {
         html.push('<th class="text-center" style="width: 7%">', '截止本期变更', '</th>');
         html.push('<th class="text-center" style="width: 7%">', '截止本期完成', '</th>');
         html.push('<th class="text-center" style="width: 7%">', '截止上期完成', '</th>');
+        html.push('<th class="text-center" style="width: 7%">', '预付款', '<i class="fa fa-question-circle text-primary" data-placement="bottom" data-toggle="tooltip" data-original-title="预付款流程中截止本期金额"></i>', '</th>');
         html.push('<th class="text-center" style="width: 7%">', '本期应付', '</th>');
         html.push('<th class="text-center" style="width: 7%">', '截止本期应付', '</th>');
         html.push('</tr>', '</thead>');

+ 6 - 0
app/service/advance.js

@@ -71,6 +71,12 @@ module.exports = app => {
             return advance;
         }
 
+        async getSumAdvance(tid) {
+            const sql = 'Select sum(cur_amount) as tp From ' + this.tableName + ' where tid = ?';
+            const result = await this.db.queryOne(sql, [tid]);
+            return result ? result.tp : 0;
+        }
+
         /**
          * 创建一条新的记录
          * @param {String} type 类型: 开工预付款|材料预付款 (start|material)