Browse Source

工程类型显示错误

TonyKang 4 năm trước cách đây
mục cha
commit
f9ae4c1035
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      web/maintain/report/js/rpt_tpl_main.js

+ 3 - 2
web/maintain/report/js/rpt_tpl_main.js

@@ -861,6 +861,7 @@ let zTreeOprObj = {
     },
     chkAndRreshRefTpl: function(forceRefresh) {
         let me = zTreeOprObj, params = {};
+        const valuationTypes = ['suggestion', 'feasibility', 'rough', 'bill', 'ration'];
         if (me.currentNode && me.currentNode.nodeType === RT.NodeType.TEMPLATE && me.currentNode.refId > 0) {
             if (forceRefresh || !(me.currentNode.rptTpl)) {
                 params.rptTplId = me.currentNode.refId;
@@ -884,8 +885,8 @@ let zTreeOprObj = {
                             }
                             if (me.currentNode.flags.hasOwnProperty('valuationType')) {
                                 let vType = me.currentNode.flags['valuationType'];
-                                if (vType === 'bill') $("#element_prjFlags_select")[0].selectedIndex = 1
-                                else $("#element_prjFlags_select")[0].selectedIndex = 2;
+                                let vtIdx = valuationTypes.indexOf(vType);
+                                $("#element_prjFlags_select")[0].selectedIndex = vtIdx + 1;
                             } else {
                                 $("#element_prjFlags_select")[0].selectedIndex = 0;
                             }