Преглед изворни кода

金额概况,最新一期,详细数据列计算相关

MaiXinRong пре 4 година
родитељ
комит
b5301c2c96
2 измењених фајлова са 12 додато и 1 уклоњено
  1. 11 0
      app/controller/tender_controller.js
  2. 1 1
      builder_report_index_define.js

+ 11 - 0
app/controller/tender_controller.js

@@ -75,10 +75,21 @@ module.exports = app => {
                 //     }
                 // }
                 tenderList.forEach(async t => {
+                    if (t.user_id === this.ctx.session.sessionUser.accountId && (
+                            t.ledger_status === auditConst.ledger.status.checkNo || t.ledger_status === auditConst.ledger.status.uncheck)) {
+                        const sum = await this.ctx.service.ledger.addUp({ tender_id: t.id/* , is_leaf: true*/ });
+                        t.total_price = sum.total_price;
+                        t.deal_tp = sum.deal_tp;
+                    }
                     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);
+                        if (t.lastStage.status === auditConst.stage.status.uncheck &&
+                            t.lastStage.user_id !== this.ctx.session.sessionUser.accountId) {
+                            t.lastStage = await this.ctx.service.stage.getLastestStage(t.id);
+                        }
+                        if (t.lastStage) await this.ctx.service.stage.checkStageGatherData(t.lastStage);
                         t.completeStage = await this.ctx.service.stage.getLastestCompleteStage(t.id);
                     }
                     if (t.lastStage) {

+ 1 - 1
builder_report_index_define.js

@@ -32,7 +32,7 @@ const advance_pay = {
     prefix: '预付款',
     cols: [
         { name: 'id', field: 'id', type: dataType.int },
-        { name: '创建者id', field: 'uuid', type: dataType.int },
+        { name: '创建者id', field: 'uid', type: dataType.int },
         { name: '审批次数', field: 'times', type: dataType.int },
         { name: '审批状态', field: 'status', type: dataType.int },
         { name: '期数索引', field: 'order', type: dataType.int },