Kaynağa Gözat

财务账面,继承上期数据问题

MaiXinRong 2 hafta önce
ebeveyn
işleme
c90a25d6b8
1 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. 3 3
      app/service/cost_stage_book.js

+ 3 - 3
app/service/cost_stage_book.js

@@ -75,10 +75,10 @@ module.exports = app => {
                 where: { stage_id: preStage.id },
                 columns: costFields.editQueryFields
             });
-            if (stage.rela_stage) throw '财务账面关联的成本报审数据错误';
+            if (!stage.rela_stage) throw '财务账面关联的成本报审数据错误';
             const relaStage = JSON.parse(stage.rela_stage);
             const curLedger = await this.ctx.service.costStageLedger.getAllDataByCondition({
-                where: { stage_id: relaStage.id },
+                where: { stage_id: relaStage.sid },
                 columns: ['id', 'cost_id'],
             });
             const insertData = [];
@@ -87,7 +87,7 @@ module.exports = app => {
                 b.stage_id = stage.id;
                 delete b.postil;
                 const cl = curLedger.find(x => { return x.cost_id === b.cost_id });
-                if (!cl) throw '财务账面关联的成本报审数据错误';
+                if (!cl) throw '财务账面关联的成本报审节点错误';
                 b.ledger_id = cl.id;
                 for(const prop of costFields.curFields) {
                     b['pre_' + prop] = this.ctx.helper.add(b['pre_' + prop], b[prop]);