浏览代码

汇总表,选择标段弹窗,初始化相关

MaiXinRong 5 年之前
父节点
当前提交
36e9b1703d
共有 1 个文件被更改,包括 5 次插入6 次删除
  1. 5 6
      app/public/report/js/rpt_custom.js

+ 5 - 6
app/public/report/js/rpt_custom.js

@@ -114,7 +114,7 @@ const rptCustomObj = (function () {
             SpreadJsObj.reLoadRowsData(info.sheet, refreshRows);
         },
         initSelectTenders: function (tenders) {
-            if (!tenders || tenders.length === 0) return;
+            if (!tenders) return;
 
             const specCol = gsObj.setting.special ? gsObj.setting.special : [];
             const select = [];
@@ -130,10 +130,10 @@ const rptCustomObj = (function () {
                     st[sc.key] = t[sc.key];
                 }
             }
-            SpreadJsObj.reLoadNodesData(gsObj.gsSheet, select);
-            if (select.length > 0) SpreadJsObj.locateTreeNode(gsObj.gsSheet, select.tmt_id);
+            SpreadJsObj.reLoadColsData(gsObj.gsSheet, [0]);
+            if (select.length > 0) SpreadJsObj.locateTreeNode(gsObj.gsSheet, select[0].tmt_id);
             this.reloadResultData();
-        }
+        },
     };
 
     const getStageFlowSelectHtml = function (select, id) {
@@ -233,9 +233,8 @@ const rptCustomObj = (function () {
             } else if (gsSelect.month) {
                 $('#gather-month').val(gsSelect.month ? gsSelect.month: '');
             }
-            gatherSelectSpreadObj.initSelectTenders(gsSelect.tenders);
         }
-        SpreadJsObj.reLoadColsData(gsObj.gsSheet, [0]);
+        gatherSelectSpreadObj.initSelectTenders(gsSelect ? gsSelect.tenders : []);
         // 初始化
         $("#gather-select").modal('show');
     };