Explorar o código

修复变更新建bug

ellisran hai 1 ano
pai
achega
71e46a4af0
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      app/controller/change_controller.js

+ 1 - 1
app/controller/change_controller.js

@@ -299,7 +299,7 @@ module.exports = app => {
                 // 在生成新变更令后,需要copy前一个变更令报表的签名信息
                 const lastChange = await ctx.service.change.getLastChange(tenderId);
                 const change = await ctx.service.change.add(tenderId, ctx.session.sessionUser.accountId, data.code, data.plan_code, data.name, stateInfo.value);
-                await ctx.service.roleRptRel.createRoleRelationshipFromOtherBz(tenderId, '-300', change.cid, lastChange.cid);
+                await ctx.service.roleRptRel.createRoleRelationshipFromOtherBz(tenderId, '-300', change.cid, lastChange ? lastChange.cid : null);
 
                 ctx.body = { err: 0, msg: '', data: change };
             } catch (err) {