Browse Source

合同支付,编辑名称后,刷新问题

MaiXinRong 1 month ago
parent
commit
2bfb016b8c
1 changed files with 7 additions and 1 deletions
  1. 7 1
      app/service/phase_pay_detail.js

+ 7 - 1
app/service/phase_pay_detail.js

@@ -618,13 +618,19 @@ class PhasePayDetail extends TreeService {
                 ud.update_user_id = this.ctx.session.sessionUser.accountId;
                 updateDatas.push(ud);
             }
-            if (updateDatas.length > 0) await this.db.updateRows(this.tableName, updateDatas);
+            if (updateDatas.length > 0) {
+                await this.db.updateRows(this.tableName, updateDatas);
+                return await this.getAllDataByCondition({ where: { id: data.map(d => { return d.id; }) } });
+            } else {
+                return [];
+            }
         } else {
             const node = await this.getDataById(data.id);
             if (!node || masterId !== node[this.setting.mid]) throw '提交数据错误';
             const updateData = this._filterValidField(node.id, data);
             updateData.update_user_id = this.ctx.session.sessionUser.accountId;
             await this.db.update(this.tableName, updateData);
+            return this.getDataById(data.id);
         }
     }
 }