浏览代码

数据源相关

MaiXinRong 9 月之前
父节点
当前提交
30da898076
共有 3 个文件被更改,包括 9 次插入1 次删除
  1. 8 0
      app/const/profile.js
  2. 1 0
      app/service/tender_cert.js
  3. 0 1
      app/view/tender/shenpi.ejs

+ 8 - 0
app/const/profile.js

@@ -50,6 +50,14 @@ const cert = {
     certQual: cert_qual,
     postCertConst: post_cert_const,
     eduJsonConst: edu_json,
+    getCertName: function(iType, iCert) {
+        const cType = cert_type.find(x => { return x.value === iType; });
+        if (!cType) return ['', ''];
+        const source = this[cType.source];
+        if (!source) return [cType.name, ''];
+        const cCert = source.find(x => { return x.value === iCert; });
+        return [cType.name, cCert ? cCert.name : ''];
+    }
 };
 
 module.exports = {

+ 1 - 0
app/service/tender_cert.js

@@ -121,6 +121,7 @@ module.exports = app => {
                 for (const prop in eduInfo) {
                    x['edu_info_' + prop] = eduInfo[prop];
                 }
+                [x.ac_type_str, x.ac_name_str] = profileConst.cert.getCertName(x.type, x.ac_name);
             });
             return result;
         }

+ 0 - 1
app/view/tender/shenpi.ejs

@@ -235,7 +235,6 @@
 </div>
 <script>
     const sp_lc = JSON.parse(unescape('<%- escape(JSON.stringify(shenpi.sp_lc)) %>'));
-    console.log(sp_lc);
     const sp_type = JSON.parse('<%- JSON.stringify(shenpi.sp_type) %>');
     const sp_status = JSON.parse('<%- JSON.stringify(shenpi.sp_status) %>');
     const sp_status_list = JSON.parse('<%- JSON.stringify(shenpi.sp_status_list) %>');