Browse Source

报表,审批人选择相关

MaiXinRong 3 years ago
parent
commit
e4e9bf040b
2 changed files with 11 additions and 1 deletions
  1. 10 0
      app/controller/report_controller.js
  2. 1 1
      app/public/report/js/rpt_custom.js

+ 10 - 0
app/controller/report_controller.js

@@ -191,6 +191,11 @@ module.exports = app => {
                         reportConst.rptCustomType[JV.NODE_CUS_AUDIT_SELECT], ctx.tender.id, ctx.stage.id);
                     customSelects.stageFlow = await ctx.service.stageAudit.getAuditGroupByListWithOwner(
                         ctx.stage.stage_id, ctx.stage.stage_times);
+                    stageFlow.forEach(x => {
+                        if (!x) return;
+                        x.visible = (!ctx.session.sessionUser.is_admin && ctx.session.sessionProject.page_show.individualSign === 1)
+                            ? x.aid === ctx.session.sessionUser.accountId : true
+                    });
                 } else {
                     customSelects.audit_select = [];
                 }
@@ -417,6 +422,11 @@ module.exports = app => {
                 await encodeDummySignatureDataUri(pageRst, this.app.baseDir); // 注意草图数据量问题!
             }
             const stageFlow = await ctx.service.stageAudit.getAuditGroupByListWithOwner(params.stage_id, params.stage_times);
+            stageFlow.forEach(x => {
+                if (!x) return;
+                x.visible = (!ctx.session.sessionUser.is_admin && ctx.session.sessionProject.page_show.individualSign === 1)
+                    ? x.aid === ctx.session.sessionUser.accountId : true
+            });
 
             // console.log('encodeSignatureDataUri!');
             return {

+ 1 - 1
app/public/report/js/rpt_custom.js

@@ -220,7 +220,7 @@ const rptCustomObj = (function () {
         const html = [];
         html.push('<select style="width: 80%" id="' + id + '" sf-title="' + select.title + '">');
         for (const sf of stageFlow) {
-            html.push('<option>' + sf.name + '-' + sf.role +'</option>');
+            html.push(`<option ${sf.visible ? '' : 'style="display: none"'}>${sf.name}-${sf.role}</option>`);
         }
         html.push('</select>');
         return html.join('');