Browse Source

计量期上传权限判断修正

laiguoran 3 years ago
parent
commit
a2a7824eb8
3 changed files with 3 additions and 2 deletions
  1. 1 1
      app/middleware/material_check.js
  2. 1 0
      app/middleware/stage_check.js
  3. 1 1
      app/view/stage/index.ejs

+ 1 - 1
app/middleware/material_check.js

@@ -80,7 +80,7 @@ module.exports = options => {
                 } else {
                     material.curOrder = material.curAuditor.order;
                 }
-                material.filePermission = this.tender.touristPermission.file;
+                material.filePermission = this.tender.touristPermission.file || auditorIds.indexOf(accountId) !== -1;
             } else if (auditorIds.indexOf(accountId) !== -1) { // 审批人
                 if (material.status === status.uncheck) {
                     throw '您无权查看该数据';

+ 1 - 0
app/middleware/stage_check.js

@@ -94,6 +94,7 @@ module.exports = options => {
                 } 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 '您无权查看该数据';

+ 1 - 1
app/view/stage/index.ejs

@@ -276,7 +276,7 @@
                                     <!-- <% if (!ctx.tender.isTourist && stage.filePermission) { %>
                                     <a href="#upload" data-toggle="modal" data-target="#upload"  class="btn btn-sm btn-outline-primary ml-3">上传</a>
                                     <% } %> -->
-                                    <% if (!ctx.tender.isTourist || (ctx.tender.isTourist && ctx.tender.touristPermission.file)) { %>
+                                    <% if (!ctx.tender.isTourist || (ctx.tender.isTourist && ctx.tender.touristPermission.file) || stage.filePermission) { %>
                                     <a href="#upload" data-toggle="modal" data-target="#upload"  class="btn btn-sm btn-outline-primary ml-3">上传</a>
                                     <% } %>
                                 </li>