Преглед изворни кода

承包人主材-供货方式

TonyKang пре 4 година
родитељ
комит
b70ec82f08
1 измењених фајлова са 19 додато и 0 уклоњено
  1. 19 0
      modules/reports/util/rpt_construct_data_util.js

+ 19 - 0
modules/reports/util/rpt_construct_data_util.js

@@ -16,6 +16,8 @@ const gljUtil = require('../../../public/gljUtil');
 const gljType = require('../../common/const/glj_type_const');
 // const pm_facade = require('../../pm/facade/pm_facade');
 const GLJID_PRE = `gljId_`, COMPONENT_GLJID_PRE = `componetGljId_`;
+//import common_const = require('../../../public/common_constants');
+const { supplyType, supplyText } = require('../../../public/common_constants');
 
 
 const GLJ_TYPE = {
@@ -121,6 +123,23 @@ class Rpt_Common{
         }
         return rst;
     };
+    getSupplyType(srcValArr) {
+        let rst = [];
+        for (const val of srcValArr) {
+            let hasKey = false;
+            for (const propKey in supplyType) {
+                if (supplyType[propKey] === val) {
+                    hasKey = true;
+                    rst.push(supplyText[propKey]);
+                    break;
+                }
+            }
+            if (!hasKey) {
+                rst.push('未知方式');
+            }
+        }
+        return rst;    
+    };
 }
 
 class Rpt_Data_Extractor {