Browse Source

不允许添加重复的审批人

MaiXinRong 1 year ago
parent
commit
12452e618b
1 changed files with 4 additions and 0 deletions
  1. 4 0
      app/service/stage_audit.js

+ 4 - 0
app/service/stage_audit.js

@@ -1931,6 +1931,10 @@ module.exports = app => {
             try {
                 const auditors = await this.getAuditGroupByList(stageId, times);
                 const now_audit = this._.find(auditors, { aid: data.old_aid });
+                if (data.operate !== 'del') {
+                    const exist = await this.getDataByCondition({ sid: stageId, times, aid: data.new_aid });
+                    if (exist) throw '该审核人已存在,请勿重复添加';
+                }
                 if (data.operate === 'add') {
                     if (now_audit.status !== auditConst.status.uncheck && now_audit.status !== auditConst.status.checking) {
                         throw '当前人下无法操作新增';