|
@@ -822,10 +822,16 @@ module.exports = app => {
|
|
|
const lastUidList = ctx.helper._.map(lastUserList, 'uid');
|
|
|
// 判断上一次审批是否为非原报为审批人
|
|
|
const nowUidList = ctx.helper._.map(ctx.change.auditors, 'uid');
|
|
|
- // 上一次审批人列表包含原报且不止只有原报并且新的审批人只有原报审批时
|
|
|
+ // 判断条件修订可上报条件
|
|
|
+ // 1.有原报,有其他人 可以添加原报作为审核人,但是不能只原报上报
|
|
|
+ // 2.有原报,无其他人 可以添加原报作为审核人,可以只原报上报
|
|
|
+ // 3.无原报,有其他人 不可以添加原报
|
|
|
if (!ctx.helper._.isEqual(lastUidList, nowUidList) && ctx.helper._.includes(ctx.helper._.tail(lastUidList), lastUidList[0]) && nowUidList.length === 2 && nowUidList[0] === nowUidList[1]) {
|
|
|
throw '该变更令不能指定原报人为单独审批人';
|
|
|
}
|
|
|
+ if (!ctx.helper._.includes(ctx.helper._.tail(lastUidList), lastUidList[0]) && ctx.helper._.includes(ctx.helper._.tail(nowUidList), nowUidList[0])) {
|
|
|
+ throw '该变更令不能指定原报为审批人,请移除';
|
|
|
+ }
|
|
|
}
|
|
|
await ctx.service.changeAudit.start(ctx.change.cid, ctx.change.times);
|
|
|
ctx.redirect(ctx.request.header.referer);
|