|
@@ -47,9 +47,15 @@ module.exports = options => {
|
|
|
throw '您无权查看该项目';
|
|
|
} else {
|
|
|
const accountId = this.session.sessionUser.accountId;
|
|
|
+ const advanceAuditors = yield this.service.advanceAudit.getAllAuditors(tender.id);
|
|
|
+ const advanceAuditorsId = this.helper._.map(advanceAuditors, 'audit_id');
|
|
|
if (tender.data.ledger_status === auditConst.status.uncheck) {
|
|
|
- if (tender.data.user_id !== accountId) {
|
|
|
+ if (tender.data.user_id !== accountId && advanceAuditorsId.indexOf(accountId) === -1) {
|
|
|
throw '您无权查看该项目';
|
|
|
+ } else if (advanceAuditorsId.indexOf(accountId) !== -1) {
|
|
|
+ if (!(this.url === '/tender/' + this.params.id || this.url.indexOf('/advance') !== -1)) {
|
|
|
+ throw '您无权查看该内容';
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
const times = tender.data.ledger_status === auditConst.status.checkNo ? tender.data.ledger_times - 1 : tender.data.ledger_times;
|
|
@@ -63,8 +69,8 @@ module.exports = options => {
|
|
|
const reviseAuditorsId = this.helper._.map(reviseAuditors, 'audit_id');
|
|
|
const materialAuditors = yield this.service.materialAudit.getAllAuditors(tender.id);
|
|
|
const materialAuditorsId = this.helper._.map(materialAuditors, 'aid');
|
|
|
- const advanceAuditors = yield this.service.advanceAudit.getAllAuditors(tender.id);
|
|
|
- const advanceAuditorsId = this.helper._.map(advanceAuditors, 'audit_id');
|
|
|
+ // const advanceAuditors = yield this.service.advanceAudit.getAllAuditors(tender.id);
|
|
|
+ // const advanceAuditorsId = this.helper._.map(advanceAuditors, 'audit_id');
|
|
|
const tenderPermission = this.session.sessionUser.permission ? this.session.sessionUser.permission.tender : null;
|
|
|
if (auditorsId.indexOf(accountId) === -1 && tender.data.user_id !== accountId &&
|
|
|
(tenderPermission === null || tenderPermission === undefined || tenderPermission.indexOf('2') === -1) &&
|
|
@@ -102,7 +108,7 @@ module.exports = options => {
|
|
|
if (this.helper.isWap(this.request)) {
|
|
|
this.redirect('/wap/list');
|
|
|
} else {
|
|
|
- this.redirect('/list');
|
|
|
+ err === '您无权查看该内容' ? this.redirect(this.request.headers.referer) : this.redirect('/list');
|
|
|
}
|
|
|
}
|
|
|
};
|