Browse Source

修复合同树升降级bug

ellisran 3 months ago
parent
commit
1bf87187ab
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/service/contract_tree.js

+ 2 - 2
app/service/contract_tree.js

@@ -707,8 +707,8 @@ module.exports = app => {
             }
             const contractSelects = selects.filter(x => x.c_code);
             const treeSelects = selects.filter(x => !x.c_code);
-            updateData = updateData.concat(await this.getDataById(treeSelects.map(x => { return x.id; })));
-            updateData = updateData.concat(await this.ctx.service.contract.getDataById(contractSelects.map(x => { return x.id; })));
+            if (treeSelects.length > 0) updateData = updateData.concat(await this.getDataById(treeSelects.map(x => { return x.id; })));
+            if (contractSelects.length > 0) updateData = updateData.concat(await this.ctx.service.contract.getDataById(contractSelects.map(x => { return x.id; })));
             // 选中节点--原前兄弟节点&全部后兄弟节点
             return { update: updateData };
         }