Browse Source

标段转树结构,提供非报表使用

MaiXinRong 4 years ago
parent
commit
d899bb3d9e
1 changed files with 6 additions and 3 deletions
  1. 6 3
      app/public/js/shares/tenders2tree.js

+ 6 - 3
app/public/js/shares/tenders2tree.js

@@ -81,12 +81,15 @@ const Tender2Tree = (function () {
 
         for (const t of tenders) {
             const parent = (t.category && levelCategory.length > 0) ? loadCategoryTreeNode(t, levelCategory) : null;
-            tenderTree.addNode({
+            const node = {
                 tid: t.id,
                 name: t.name,
                 phase: t.lastStage ? '第' + t.lastStage.order + '期' : '台账',
-                status: t.lastStage ? stageAuditConst.statusString[t.lastStage.status] : ledgerAuditConst.statusString[t.ledger_status]
-            }, parent);
+            };
+            if (ledgerAuditConst && stageAuditConst) {
+                node.status = t.lastStage ? stageAuditConst.statusString[t.lastStage.status] : ledgerAuditConst.statusString[t.ledger_status];
+            }
+            tenderTree.addNode(node, parent);
         }
         tenderTree.sortTreeNode(false);
         return tenderTree;