Преглед на файлове

Merge remote-tracking branch 'origin/master'

vian преди 6 години
родител
ревизия
e922454998

+ 2 - 1
modules/reports/util/rpt_yanghu_data_util.js

@@ -597,7 +597,8 @@ function filterData(sourceData, handleCfg, prjData) {
         let rst = false;
         if (arr.length > 0) {
             for (let arrItem of arr) {
-                if (arrItem[key]) {
+                if (arrItem[key] !== undefined) {
+                    // 可以为null值去判断
                     rst = private_chkVal(arrItem[key], compVal, compStr);
                 }
                 if (rst) {

+ 31 - 10
modules/users/models/user_model.js

@@ -319,19 +319,40 @@ class UserModel extends BaseModel {
      * @return {version}
      */
     async getVersionFromUpgrade(ssoId, compilationId){
-        let version = '纵横公路养护造价(云版)';//'纵横公路养护造价(免费云版)'; 2019-03-28 需求修改,听说不知道多久的以后还会改回来--勿删!!!!!
-        /*let userData = await this.findDataBySsoId(ssoId);
-         if (userData.upgrade_list !== undefined) {
-         let compilationInfo = userData.upgrade_list.find(function (item) {
-         return item.compilationID === compilationId;
-         });
-         if (compilationInfo !== undefined && compilationInfo.isUpgrade === true) {
-         version = '纵横公路养护造价(专业版)';
-         }
-         }*/
+        let version = '纵横公路养护云造价(免费公用版)';//'纵横公路养护造价(免费云版)'; 2019-03-28 需求修改,听说不知道多久的以后还会改回来--勿删!!!!!
+        let userData = await this.findDataBySsoId(ssoId);
+        if (userData.upgrade_list !== undefined) {
+            let compilationInfo = userData.upgrade_list.find(function (item) {
+                return item.compilationID === compilationId;
+            });
+            if (compilationInfo !== undefined && compilationInfo.isUpgrade === true) {
+                version = '纵横公路养护造价(专业版)';
+            }
+        }
         return version;
     }
 
+    /**
+     * 判断用户是免费版还是专业版用户
+     */
+    async isFree(ssoId, compilationId) {
+        const userData = await this.findDataBySsoId(ssoId);
+        if (!userData) {
+            throw '不存在此用户';
+        }
+        const upgrade_list = userData.upgrade_list;
+        let free = true;
+        if (upgrade_list && upgrade_list.length > 0) {
+            const upgrade = upgrade_list.find(function (item) {
+                return item.compilationID === compilationId && item.isUpgrade === true;
+            });
+            if (upgrade) {
+                free = false;
+            }
+        }
+        return free
+    }
+
 }
 
 export default UserModel;

+ 3 - 3
web/building_saas/main/html/main.html

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title><%= projectData.name !== undefined ? projectData.name : '造价书' %>-纵横公路养护造价</title>
+    <title><%= projectData.name !== undefined ? projectData.name : '造价书' %>-纵横公路养护造价</title>
 
 
     <link rel="stylesheet" href="/lib/jquery-ui/jquery-ui.css" type="text/css">
@@ -25,7 +25,7 @@
     <link rel="stylesheet" href="/lib/spreadjs/views/gc.spread.views.dataview.10.0.0.css">
     <!-- jquery.contextmenu -->
    <!-- <link rel="stylesheet" href="/lib/jquery-contextmenu/jquery.contextMenu.css" type="text/css">-->
-   
+
     <link rel="shortcut icon" href="/web/building_saas/css/favicon.ico">
     <link rel="icon" type="image/gif" href="/web/building_saas/css/animated_favicon1.gif">
     <style type="text/css">
@@ -1031,7 +1031,7 @@
                 </div>
             </div>
         </div>
-    </div>    
+    </div>
     <!--弹出列设置-->
   <!--  <div class="modal fade" id="column" data-backdrop="static">
         <div class="modal-dialog modal-lg" role="document" style="width: 350px;">

+ 1 - 1
web/users/html/login-infoinput.html

@@ -5,7 +5,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>用户信息填写-纵横公路养护造价</title>
+    <title>用户信息填写-纵横公路养护造价</title>
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css">
     <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">

+ 2 - 2
web/users/html/login-sms.html

@@ -4,7 +4,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>用户登录-纵横建筑计价</title>
+    <title>用户登录-纵横公路养护云造价</title>
     <!-- inject:css -->
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css">
@@ -17,7 +17,7 @@
     <div class="login-bg"></div>
     <div class="container login-panel">
         <form class="form-signin">
-            <h1 class="d-flex justify-content-center mb-5"><img src="/web/building_saas/img/building.png" width="40" height="40" class="mr-3" style="margin-top: 5px"> 纵横公路养护云</h1>
+            <h1 class="d-flex justify-content-center mb-5"><img src="/web/building_saas/img/building.png" width="40" height="40" class="mr-3" style="margin-top: 5px"> 纵横公路养护云造价</h1>
             <p class="mb-1">您关闭了「账号登录」,请通过手机验证码登录。</p>
             <p class="">请点击“获取验证码”,验证码将发送至手机 <%= mobile.substr(0, 3) + '****' + mobile.substr(7, 11) %>,注意查收。</p>
             <div class="form-row sms-login-modal">

+ 2 - 2
web/users/html/login-ver.html

@@ -4,7 +4,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>用户登录-纵横公路养护云</title>
+    <title>用户登录-纵横公路养护云造价</title>
     <!-- inject:css -->
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css">
@@ -17,7 +17,7 @@
     <div class="login-bg"></div>
     <div class="container login-panel ver-panel">
             <h1 class="d-flex justify-content-center mb-5">
-                <img src="/web/building_saas/img/building.png" width="40" height="40" class="mr-3" style="margin-top: 5px"> 纵横公路养护云</h1>
+                <img src="/web/building_saas/img/building.png" width="40" height="40" class="mr-3" style="margin-top: 5px"> 纵横公路养护云造价</h1>
             <div class="d-flex justify-content-between">
                 <h5 class="modal-title">选择费用定额</h5>
                 <p class=" text-warning"><i class="fa fa-exclamation-triangle"></i> <b>登录设置</b> 中可以修改您的登录习惯。</p>

+ 2 - 2
web/users/html/login.html

@@ -4,7 +4,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>用户登录-纵横公路养护造价</title>
+    <title>用户登录-纵横公路养护造价</title>
     <!-- inject:css -->
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css">
@@ -19,7 +19,7 @@
         <form class="form-signin" method="post" onsubmit="return false">
             <h1 class="d-flex justify-content-center mb-5">
                 <img src="/web/building_saas/img/building.png" width="40" height="40" class="mr-3" style="margin-top: 5px">
-                纵横公路养护云
+                纵横公路养护云造价
             </h1>
             <div class="form-group user-login-modal">
                 <input id="inputEmail" class="form-control " name="inputEmail" placeholder="通行账号 邮箱/手机" autofocus="" />