Browse Source

关联台账,截止本期数据计算问题

MaiXinRong 3 years ago
parent
commit
b6f366160e
2 changed files with 2 additions and 3 deletions
  1. 0 1
      app/controller/stage_rela_controller.js
  2. 2 2
      app/service/stage_rela.js

+ 0 - 1
app/controller/stage_rela_controller.js

@@ -35,7 +35,6 @@ module.exports = app => {
             try {
                 const renderData = await this._getDefaultRenderData(ctx);
                 renderData.auditConst = auditConst;
-                console.log(auditConst);
                 renderData.jsFiles = this.app.jsFiles.common.concat(this.app.jsFiles.stageRela.info);
                 renderData.History = await ctx.service.stageRela.getHistoryStageRela(this.ctx.stage.tid, this.ctx.stage.sorder);
                 await this.layout('stage_rela/index.ejs', renderData, 'stage_rela/modal.ejs');

+ 2 - 2
app/service/stage_rela.js

@@ -34,7 +34,7 @@ class srCache {
         const ledger = await this.ctx.service.ledger.getData(this.stage.tid);
         const curBillsData = await this.ctx.service.stageBills.getLastestStageData(this.stage.tid, this.stage.id);
         const preStageBills = this.preRelaStage
-            ? this.ctx.service.stageRelaBillsFinal.getAllDataByCondition({ where: { sid: this.preRelaStage.sid, rela_tid: this.preRelaStage.rela_tid } })
+            ? await this.ctx.service.stageRelaBillsFinal.getAllDataByCondition({ where: { sid: this.preRelaStage.sid, rela_tid: this.preRelaStage.rela_tid } })
             : [];
         this.ctx.helper.assignRelaData(ledger, [
             { data: curBillsData, fields: ['contract_qty', 'qc_qty', 'postil'], prefix: '', relaId: 'lid' },
@@ -76,7 +76,7 @@ class srCache {
         const pos = await this.ctx.service.pos.getPosData({tid: this.stage.tid});
         const curPosData = await this.ctx.service.stagePos.getLastestStageData2(this.stage.tid, this.stage.id);
         const preStagePos = this.preRelaStage
-            ? this.ctx.service.stageRelaPosFinal.getAllDataByCondition({ where: { sid: this.preRelaStage.sid, rela_tid: this.preRelaStage.rela_tid } })
+            ? await this.ctx.service.stageRelaPosFinal.getAllDataByCondition({ where: { sid: this.preRelaStage.sid, rela_tid: this.preRelaStage.rela_tid } })
             : [];
         this.ctx.helper.assignRelaData(pos, [
             { data: curPosData, fields: ['contract_qty', 'qc_qty', 'postil', 'pid'], prefix: '', relaId: 'pid' },