浏览代码

删除期报错

MaiXinRong 3 周之前
父节点
当前提交
510cba4d75
共有 3 个文件被更改,包括 5 次插入5 次删除
  1. 1 1
      app/controller/stage_extra_controller.js
  2. 1 1
      app/service/stage.js
  3. 3 3
      app/service/stage_bonus.js

+ 1 - 1
app/controller/stage_extra_controller.js

@@ -157,7 +157,7 @@ module.exports = app => {
          */
         async loadBonus (ctx) {
             try {
-                const data = await ctx.service.stageBonus.getStageData(ctx.stage.id);
+                const data = await ctx.service.stageBonus.getStageData(ctx.stage);
                 for (const d of data) {
                     for (const pf of d.proof_file) {
                         delete pf.filepath;

+ 1 - 1
app/service/stage.js

@@ -807,7 +807,7 @@ module.exports = app => {
                 await transaction.delete(this.ctx.service.stageAtt.tableName, { tid: stageInfo.tid, sid: stageInfo.order });
                 // 其他台账
                 await transaction.delete(this.ctx.service.stageJgcl.tableName, { sid: id });
-                const bonus = await this.ctx.service.stageBonus.getStageData(id);
+                const bonus = await this.ctx.service.stageBonus.getStageData(stageInfo);
                 if (bonus && bonus.length > 0) {
                     for (const b of bonus) {
                         for (const f of b.proof_file) {

+ 3 - 3
app/service/stage_bonus.js

@@ -40,8 +40,8 @@ module.exports = app => {
             }
         }
 
-        async getStageData(sid, cancel = false) {
-            const data = await this.getAllDataByCondition({where: { sid: sid }});
+        async getStageData(stage, cancel = false) {
+            const data = await this.getAllDataByCondition({where: { sid: stage.id }});
             this._parseData(data);
             if (!stage || cancel || !stage.readOnly || this.ctx.tender.isTourist || stage.status === auditConst.status.checked
                 || (stage.flowAuditorIds && stage.flowAuditorIds.indexOf(this.ctx.session.sessionUser.accountId) > 0)) return data;
@@ -177,7 +177,7 @@ module.exports = app => {
         }
 
         async updateHistory4TimesOrder(stage, times, order, transaction) {
-            const datas = await this.getStageData(stage.id);
+            const datas = await this.getStageData(stage);
             if (datas.length === 0) return;
 
             const updateDatas = [];