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

公路云造价不需要显示停止学习版提示

Tony Kang пре 3 година
родитељ
комит
2eee772bbc

+ 89 - 75
modules/pm/controllers/pm_controller.js

@@ -335,83 +335,97 @@ module.exports = {
         if (sessionCompilation === undefined || sessionCompilation === null) {
             return response.redirect('/logout');
         }
-        let compilationModel = new CompilationModel();
-        //更新编办信息
-        let compilationData = await compilationModel.getCompilationById(sessionCompilation._id);
-        request.session.sessionCompilation = compilationData;
-        sessionCompilation = request.session.sessionCompilation;
-        //更新用户的使用过的费用定额列表
-        let isFirst = await pm_facade.isFirst(request.session.sessionUser.id, compilationData._id.toString());
-        
-        let engineeringLibModel = new EngineeringLibModel();
-
-        // 建议估算
-        let suggestionValuation = sessionCompilation.suggestion_valuation !== undefined ?
-            sessionCompilation.suggestion_valuation : [];
-        suggestionValuation = await engineeringLibModel.getLib(suggestionValuation);
-
-        // 可行性估算
-        let feasibilityValuation = sessionCompilation.feasibility_valuation !== undefined ?
-            sessionCompilation.feasibility_valuation : [];
-        feasibilityValuation = await engineeringLibModel.getLib(feasibilityValuation);
-
-        // 估算
-        let estimationValuation = sessionCompilation.estimation_valuation !== undefined ?
-            sessionCompilation.estimation_valuation : [];
-            estimationValuation = await engineeringLibModel.getLib(estimationValuation);
-
-        // 概算
-        let roughValuation = sessionCompilation.rough_valuation !== undefined ?
-            sessionCompilation.rough_valuation : [];
-        roughValuation = await engineeringLibModel.getLib(roughValuation);
-        
-        // 清单计价
-        let billValuation = sessionCompilation.bill_valuation !== undefined ?
-            sessionCompilation.bill_valuation : [];
-        billValuation = await engineeringLibModel.getLib(billValuation);
-
-        // 定额计价
-        let rationValuation = sessionCompilation.ration_valuation !== undefined ?
-            sessionCompilation.ration_valuation : [];
-        rationValuation = await engineeringLibModel.getLib(rationValuation);
-
-        if (sessionCompilation.name === '四川养护(2013)' || sessionCompilation.name === '部颁2018计价标准') {
-            billValuation = rationValuation;
-        }
-
-        let absoluteUrl = compilationData.overWriteUrl ? request.app.locals.rootDir + compilationData.overWriteUrl : request.app.locals.rootDir;
-        let overWriteUrl = fs.existsSync(absoluteUrl) && fs.statSync(absoluteUrl).isFile() ? compilationData.overWriteUrl : null;
-        //欢迎页显示控制
-        let [isShow,context,showTime] = await pm_facade.getWelcomeInfo(sessionCompilation._id,request.session.sessionUser,request.session.compilationVersion.includes('学习'));
-        const unreadShareList = await pm_facade.getUnreadShareListByCompilation(request.session.sessionUser.id, sessionCompilation._id);
         const isFree = userModelObj.isFreeFromSession(request.session.compilationVersion);
-        let renderData = {
-            unreadShareList: JSON.stringify(unreadShareList),
-            isFirst: isFirst,
-            isShow:isShow,
-            context:context,
-            showTime:showTime,
-            userAccount: request.session.userAccount,
-            userID: request.session.sessionUser.id,
-            isFree,
-            compilationData: JSON.stringify(sessionCompilation),
-            overWriteUrl: overWriteUrl,
-            suggestionValuation: JSON.stringify(suggestionValuation),
-            feasibilityValuation: JSON.stringify(feasibilityValuation),
-            estimationValuation: JSON.stringify(estimationValuation),
-            roughValuation: JSON.stringify(roughValuation),
-            billValuation: JSON.stringify(billValuation),
-            rationValuation: JSON.stringify(rationValuation),
-            engineeringList: JSON.stringify(engineering.List),
-            adminLevelType: JSON.stringify(AdminLevelType),
-            compilationName: sessionCompilation.name,
-            versionName: request.session.compilationVersion,
-            socketPort:config[process.env.NODE_ENV].socketPort?config[process.env.NODE_ENV].socketPort:5500,
-            LicenseKey:config.getLicenseKey(process.env.NODE_ENV),
-            title:getTitle(request.headers.host) 
-        };
+        if (false && isFree && config.prod_sc.title !== '纵横公路云造价') {
+            let renderData = {
+                userAccount: request.session.userAccount,
+                userID: request.session.sessionUser.id,
+                compilationName: sessionCompilation.name,
+                versionName: request.session.compilationVersion,
 
-        response.render('building_saas/pm/html/project-management.html', renderData);
+                title:getTitle(request.headers.host) 
+            };
+    
+            response.render('building_saas/pm/html/blank-project.html', renderData);
+        } else {
+            let compilationModel = new CompilationModel();
+            //更新编办信息
+            let compilationData = await compilationModel.getCompilationById(sessionCompilation._id);
+            request.session.sessionCompilation = compilationData;
+            sessionCompilation = request.session.sessionCompilation;
+            //更新用户的使用过的费用定额列表
+            let isFirst = await pm_facade.isFirst(request.session.sessionUser.id, compilationData._id.toString());
+            
+            let engineeringLibModel = new EngineeringLibModel();
+    
+            // 建议估算
+            let suggestionValuation = sessionCompilation.suggestion_valuation !== undefined ?
+                sessionCompilation.suggestion_valuation : [];
+            suggestionValuation = await engineeringLibModel.getLib(suggestionValuation);
+    
+            // 可行性估算
+            let feasibilityValuation = sessionCompilation.feasibility_valuation !== undefined ?
+                sessionCompilation.feasibility_valuation : [];
+            feasibilityValuation = await engineeringLibModel.getLib(feasibilityValuation);
+    
+            // 估算
+            let estimationValuation = sessionCompilation.estimation_valuation !== undefined ?
+                sessionCompilation.estimation_valuation : [];
+                estimationValuation = await engineeringLibModel.getLib(estimationValuation);
+    
+            // 概算
+            let roughValuation = sessionCompilation.rough_valuation !== undefined ?
+                sessionCompilation.rough_valuation : [];
+            roughValuation = await engineeringLibModel.getLib(roughValuation);
+            
+            // 清单计价
+            let billValuation = sessionCompilation.bill_valuation !== undefined ?
+                sessionCompilation.bill_valuation : [];
+            billValuation = await engineeringLibModel.getLib(billValuation);
+    
+            // 定额计价
+            let rationValuation = sessionCompilation.ration_valuation !== undefined ?
+                sessionCompilation.ration_valuation : [];
+            rationValuation = await engineeringLibModel.getLib(rationValuation);
+    
+            if (sessionCompilation.name === '四川养护(2013)' || sessionCompilation.name === '部颁2018计价标准') {
+                billValuation = rationValuation;
+            }
+    
+            let absoluteUrl = compilationData.overWriteUrl ? request.app.locals.rootDir + compilationData.overWriteUrl : request.app.locals.rootDir;
+            let overWriteUrl = fs.existsSync(absoluteUrl) && fs.statSync(absoluteUrl).isFile() ? compilationData.overWriteUrl : null;
+            //欢迎页显示控制
+            let [isShow,context,showTime] = await pm_facade.getWelcomeInfo(sessionCompilation._id,request.session.sessionUser,request.session.compilationVersion.includes('学习'));
+            const unreadShareList = await pm_facade.getUnreadShareListByCompilation(request.session.sessionUser.id, sessionCompilation._id);
+            let renderData = {
+                unreadShareList: JSON.stringify(unreadShareList),
+                isFirst: isFirst,
+                isShow:isShow,
+                context:context,
+                showTime:showTime,
+                userAccount: request.session.userAccount,
+                userID: request.session.sessionUser.id,
+                isFree,
+                compilationData: JSON.stringify(sessionCompilation),
+                overWriteUrl: overWriteUrl,
+                suggestionValuation: JSON.stringify(suggestionValuation),
+                feasibilityValuation: JSON.stringify(feasibilityValuation),
+                estimationValuation: JSON.stringify(estimationValuation),
+                roughValuation: JSON.stringify(roughValuation),
+                billValuation: JSON.stringify(billValuation),
+                rationValuation: JSON.stringify(rationValuation),
+                engineeringList: JSON.stringify(engineering.List),
+                adminLevelType: JSON.stringify(AdminLevelType),
+                compilationName: sessionCompilation.name,
+                versionName: request.session.compilationVersion,
+                socketPort:config[process.env.NODE_ENV].socketPort?config[process.env.NODE_ENV].socketPort:5500,
+                LicenseKey:config.getLicenseKey(process.env.NODE_ENV),
+                cloudTitle: config.prod_sc.title,
+                title:getTitle(request.headers.host) 
+            };
+    
+            response.render('building_saas/pm/html/project-management.html', renderData);
+        }
     },
     //第一次进入该费用定额时准备的初始数据
     prepareInitialData: async function (request, response) {

+ 149 - 0
web/building_saas/pm/html/blank-project.html

@@ -0,0 +1,149 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+
+<head>
+    <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>
+    <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
+    <link rel="stylesheet" href="/web/building_saas/css/main.css">
+    <link rel="stylesheet" href="/web/building_saas/css/custom.css">
+    <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">
+    <link rel="stylesheet" href="/lib/spreadjs/sheets/css/gc.spread.sheets.sc.css">
+    <!--zTree-->
+    <link rel="stylesheet" href="/lib/ztree/css/zTreeStyle.css" type="text/css">
+    <link rel="stylesheet" href="/lib/jquery-contextmenu/jquery.contextMenu.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">
+    <script>
+        // 这里的变量供页面调用
+        var userAccount = '<%- userAccount %>';
+        var userID = '<%- userID %>';
+    </script>
+    <style type="text/css">
+        .hidden-area{
+            display: none;
+        }
+        #summary-engineering,#summary-project{
+            display: none;
+        }
+        #shareToInfo {
+            display:block;
+            height:200px;
+            overflow-y:auto;
+            -webkit-overflow-scrolling: touch;
+        }
+    </style>
+</head>
+
+<body oncontextmenu="return false;">  <!--屏蔽input鼠标右键-->
+    <img src="/web/dest/css/img/folder_open.png" id="folder_open_pic" style="display: none">
+    <img src="/web/dest/css/img/folder_close.png" id="folder_close_pic" style="display: none">
+    <img src="/web/dest/css/img/project.png" id="proj_pic" style="display: none">
+    <img src="/web/dest/css/img/engineering.png" id="eng_pic" style="display: none">
+    <img src="/web/dest/css/img/tender.png" id="tender_pic" style="display: none">
+    <img src="/web/dest/css/img/refresh.png" id="refresh_pic" style="display: none">
+    <img src="/web/dest/css/img/share.png" id="share_pic" style="display: none">
+    <img src="/web/dest/css/img/copy.png" id="copy_pic" style="display: none">
+    <img src="/web/dest/css/img/edit.png" id="edit_pic" style="display: none">
+<div class="header">
+    <input type="hidden" id="projectTitle" value="<%= title%>">
+    <div class="top-msg clearfix">
+        <div class="alert alert-warning mb-0 py-0" role="alert" style="display: none;">
+            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
+                <span aria-hidden="true">&times;</span>
+            </button>
+            <strong>注意!</strong> 这是一条消息通知 <a href="#">链接</a>
+        </div>
+    </div>
+    <%include ../../../common/html/header.html %>
+</div>
+<div class="main">
+    <a id="autoOpenTender" style="display: none;"></a>
+    <div class="poj-manage container-fluid p-0">
+            <div class="pm-side">
+                <div class="poj-cate">
+                    <div class="dropdown" style="height: 38px">
+                    </div>
+                    <ul class="nav nav-pills flex-column" id="sideTab">
+                        <li class="nav-item" data-original-title="项目管理" data-placement="right" data-toggle="tooltip">
+                            <a class="nav-link active" href="#pm_all" role="tab" id="tab_pm_all" data-toggle="tab"><i class="fa fa-bars"></i></a>
+                        </li>
+                        <li class="nav-item" data-original-title="分享" data-placement="right" data-toggle="tooltip">
+                            <a class="nav-link" href="#pm_share" id="tab_pm_share" data-toggle="tab"><i class="fa fa-share-alt"></i></a>
+                        </li>
+                        <li class="nav-item" data-original-title="回收站" data-placement="right" data-toggle="tooltip">
+                            <a class="nav-link" href="#pm_gc" id="tab_pm_gc" data-toggle="tab"><i class="fa fa-trash"></i></a>
+                        </li>
+                    </ul>
+                </div>
+            </div>
+            <div class="pm-content">
+                <div class="tab-content">
+                    <div class="tab-pane active" id="pm_all" role="tabpanel">
+                        <div class="toolsbar">
+                            <legend class="m-0 px-4">项目管理
+                                <div class="tools-btn btn-group align-top btn-group-sm my-1 ml-3">
+                                    <a id="addMenuBtn" href="javascript:;" data-toggle="modal" data-target="#add-tender-dialog" class="btn btn-primary px-5 border-radius"><i class="fa fa-plus"></i> 新建</a>
+                                </div>
+                                <div class="tools-btn btn-group align-top px-3 my-1">
+                                    <a id="upLevel" href="javascript:void(0);" class="btn btn-light btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="升级"><i class="fa fa-arrow-left" aria-hidden="true"></i></a>
+                                    <a id="downLevel" href="javascript:void(0);" class="btn btn-light btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="降级"><i class="fa fa-arrow-right" aria-hidden="true"></i></a>
+                                    <a id="upMove" href="javascript:void(0);" class="btn btn-light btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
+                                    <a id="downMove" href="javascript:void(0);" class="btn btn-light btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
+                                </div>
+                            </legend>
+                        </div>
+                        <div class="poj-list" id="projSpread">
+                        </div>
+                    </div>
+                </div>
+            </div>
+    </div>
+    <div class="slide-sidebar">
+        <div class="side-content">
+            <!--建设项目汇总-->
+            <div class="p-3" id="summary-project">
+                <legend>单价文件</legend>
+                <table class="table table-bordered table-hover table-sm table-sc" id="summary-project-unit-price-table">
+                    <thead>
+                        <th style="width: 25px;" class="text-center"></th>
+                        <th style="width: 330px;" class="text-center">名称</th>
+                        <th style="width: 55px;" class="text-center">使用</th>
+                    </thead>
+                    <tbody>
+                    </tbody>
+                </table>
+
+
+                <legend>费率文件</legend>
+                <table class="table table-bordered table-hover table-sm table-sc" id="summary-project-fee-table">
+                    <thead>
+                        <th style="width: 25px;" class="text-center"></th>
+                        <th style="width: 330px;" class="text-center">名称</th>
+                        <th style="width: 55px;" class="text-center">使用</th>
+                    </thead>
+                    <tbody>
+                    </tbody>
+                </table>
+            </div>
+        </div>
+    </div>
+</div>
+
+
+</body>
+<script type="text/javascript">
+    autoFlashHeight();
+    function _showFreeUserInfo() {
+        const showFreeUserInfo = `尊敬的用户:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;养护云计价学习版已停用,请升级专业版,即可继续使用。<br>如有疑问,请联系:<br>纵横全国服务热线:0756-3850888,企业QQ:800003850`;
+        hintBox.infoBox('温馨提示', showFreeUserInfo, 1, 
+            ()=>{
+                CommonHeader.getCategoryList();
+            }, null, ['联系当地客服'], false
+        );
+    }
+    $(document).ready(setTimeout(_showFreeUserInfo, 20));
+</script>
+</html>

+ 6 - 1
web/building_saas/pm/html/project-management.html

@@ -23,10 +23,15 @@
         let isFirst = JSON.parse('<%- isFirst %>');
         let isShow = JSON.parse('<%- isShow %>');
         let unreadShareList = JSON.parse('<%- unreadShareList %>');
+        const cloudTitle = '<%- cloudTitle %>';
         const isFree = JSON.parse('<%- isFree %>');
         function _showFreeUserInfo() {
             const showFreeUserInfo = `尊敬的用户:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;养护云计价学习版,将于2022年5月8日停用。请在之前升级专业版,以便继续使用。如有疑问,请联系:<br>纵横全国服务热线:0756-3850888,企业QQ:800003850`;
-            if (isFree) hintBox.infoBox('温馨提示', showFreeUserInfo);
+            if (isFree && cloudTitle !== '纵横公路云造价') {
+                setTimeout(()=> {
+                    hintBox.infoBox('温馨提示', showFreeUserInfo);
+                }, 100);
+            }
         }
     </script>
     <style type="text/css">