Bläddra i källkod

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

MaiXinRong 4 år sedan
förälder
incheckning
7c3555133d
2 ändrade filer med 28 tillägg och 4 borttagningar
  1. 26 2
      app/controller/report_controller.js
  2. 2 2
      app/view/report/index.ejs

+ 26 - 2
app/controller/report_controller.js

@@ -49,6 +49,15 @@ module.exports = app => {
             }
         }
 
+        async _chkIfStageAuditor(ctx, stage) {
+            //
+        }
+
+        async _filterStageList(ctx, stageList) {
+            //
+            // throw
+        }
+
         /**
          * 报表显示页面
          *
@@ -61,8 +70,23 @@ module.exports = app => {
                 const pageShow = ctx.session.sessionProject.page_show;
                 const tender = ctx.tender;
                 const stage = ctx.stage;
-                // console.log(tender.data);
-                // console.log(tender.info);
+                // console.log('this.ctx.session.sessionUser.accountId: ' + this.ctx.session.sessionUser.accountId);
+                if (stage && stage.status === auditConst.stage.status.uncheck) {
+                    // 得判断账号是否在审核人列表中(不含原报)
+                    if (stage.auditorList === undefined || stage.auditorList === null) {
+                        stage.auditorList = await ctx.service.stageAudit.getAuditors(ctx.stage.id, ctx.stage.times);
+                    }
+                    let isAudit = false;
+                    for (const audit of stage.auditorList) {
+                        if (audit.aid === this.ctx.session.sessionUser.accountId) {
+                            isAudit = true;
+                            break;
+                        }
+                    }
+                    if (!isAudit) {
+                        // throw
+                    }
+                }
                 let stage_id = -1;
                 let stage_order = -1;
                 let sorder = -1;

+ 2 - 2
app/view/report/index.ejs

@@ -423,7 +423,7 @@
                 if (TOP_TREE_NODES[tnIdx].pid !== -1) {
                     TOP_TREE_NODES[tnIdx].isParent = true;
                     TOP_TREE_NODES[tnIdx].nodeType = 1;
-                    individualNode.items.push(TOP_TREE_NODES[tnIdx]);
+                    individualNode.items.unshift(TOP_TREE_NODES[tnIdx]);
                     TOP_TREE_NODES.splice(tnIdx, 1);
                 }
             }
@@ -437,7 +437,7 @@
                 if (ORG_TOP_TREE_NODES[tnIdx].pid !== -1) {
                     ORG_TOP_TREE_NODES[tnIdx].isParent = true;
                     ORG_TOP_TREE_NODES[tnIdx].nodeType = 1;
-                    individualNodeOrg.items.push(ORG_TOP_TREE_NODES[tnIdx]);
+                    individualNodeOrg.items.unshift(ORG_TOP_TREE_NODES[tnIdx]);
                     ORG_TOP_TREE_NODES.splice(tnIdx, 1);
                 }
             }