Kaynağa Gözat

管理员,允许进入未上报期

MaiXinRong 3 yıl önce
ebeveyn
işleme
a626d6a94d
2 değiştirilmiş dosya ile 17 ekleme ve 16 silme
  1. 16 15
      app/middleware/stage_check.js
  2. 1 1
      app/service/stage.js

+ 16 - 15
app/middleware/stage_check.js

@@ -85,21 +85,6 @@ module.exports = options => {
                     stage.curOrder = stage.curAuditor.aid === accountId ? stage.curAuditor.order : stage.curAuditor.order - 1;
                 }
                 stage.filePermission = true;
-            } else if (this.tender.isTourist) {
-                if (auditorIds.indexOf(accountId) !== -1) {
-                    stage.readOnly = (stage.status !== status.checking && stage.status !== status.checkNoPre) || accountId !== stage.curAuditor.aid;
-                } else {
-                    stage.readOnly = true;
-                }
-                stage.curTimes = stage.times;
-                if (stage.status === status.uncheck || stage.status === status.checkNo) {
-                    stage.curOrder = 0;
-                } else if (stage.status === status.checked) {
-                    stage.curOrder = _.max(_.map(stage.auditors, 'order'));
-                } else {
-                    stage.curOrder = stage.curAuditor.order;
-                }
-                stage.filePermission = this.tender.touristPermission.file || auditorIds.indexOf(accountId) !== -1;
             } else if (auditorIds.indexOf(accountId) !== -1) { // 审批人
                 if (stage.status === status.uncheck) {
                     throw '您无权查看该数据';
@@ -132,6 +117,21 @@ module.exports = options => {
                     stage.curOrder = stage.status === status.checked ? _.max(_.map(stage.auditors, 'order')) : stage.curAuditor.order - 1;
                 }
                 stage.filePermission = false;
+            } else if (this.tender.isTourist || this.session.sessionUser.is_admin) {
+                if (auditorIds.indexOf(accountId) !== -1) {
+                    stage.readOnly = (stage.status !== status.checking && stage.status !== status.checkNoPre) || accountId !== stage.curAuditor.aid;
+                } else {
+                    stage.readOnly = true;
+                }
+                stage.curTimes = stage.times;
+                if (stage.status === status.uncheck || stage.status === status.checkNo) {
+                    stage.curOrder = 0;
+                } else if (stage.status === status.checked) {
+                    stage.curOrder = _.max(_.map(stage.auditors, 'order'));
+                } else {
+                    stage.curOrder = stage.curAuditor.order;
+                }
+                stage.filePermission = this.tender.touristPermission.file || auditorIds.indexOf(accountId) !== -1;
             } else { // 其他不可见
                 throw '您无权查看该数据';
             }
@@ -165,6 +165,7 @@ module.exports = options => {
             }
             yield next;
         } catch (err) {
+            console.log(err);
             this.helper.log(err);
             // 输出错误到日志
             if (err.stack) {

+ 1 - 1
app/service/stage.js

@@ -267,7 +267,7 @@ module.exports = app => {
                 s.end_tp = this.ctx.helper.add(s.pre_tp, s.tp);
                 s.tp_history = s.tp_history ? JSON.parse(s.tp_history) : [];
             }
-            if (stages.length !== 0) {
+            if (stages.length !== 0 && !this.ctx.session.sessionUser.is_admin) {
                 const lastStage = stages[0];
                 if (lastStage.status === auditConst.status.uncheck && lastStage.user_id !== this.ctx.session.sessionUser.accountId && !this.ctx.tender.isTourist) {
                     stages.splice(0, 1);