Browse Source

1.将“免费公用版”改为“学习版”
2.导入Excel清单格式,无法识别节点为“清单 第300-1章 ”的,导致该部分无法导入
3.升级说明文件由pdf文件转换为在线文档

vian 5 years atrás
parent
commit
c3a08af9f9

+ 1 - 1
modules/main/middleware/index.js

@@ -16,7 +16,7 @@ import UserModel from '../../../modules/users/models/user_model';
 
 async function rationNumberChecking(req, res, next) {
     if (req.session.systemSetting) {
-        let type = req.session.compilationVersion.indexOf("免费") == -1 ? "professional" : "normal";
+        let type = req.session.compilationVersion.indexOf("学习") == -1 ? "professional" : "normal";
         let data = req.body.data;
         if (typeof data === 'object') {
             data = JSON.stringify(data);

+ 1 - 1
modules/pm/controllers/pm_controller.js

@@ -324,7 +324,7 @@ module.exports = {
         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('免费'));
+        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),

+ 2 - 2
modules/pm/facade/pm_facade.js

@@ -2105,13 +2105,13 @@ async function getSystemSetting() {
 async function isTenderOverrun(tenderCount, session) {
     const userID = session.sessionUser.id;
     const compilation = session.sessionCompilation._id;
-    const compilationVersion = session.compilationVersion || '免费';
+    const compilationVersion = session.compilationVersion || '学习';
     let systemSetting = session.systemSetting || (session.systemSetting = await getSystemSetting());
     // 这种情况只有在刚上线此功能时会出现,不考虑时间差
     if (!systemSetting) {
         return false;
     }
-    const type = compilationVersion.includes('免费') ? 'normal' : 'professional';
+    const type = compilationVersion.includes('学习') ? 'normal' : 'professional';
     const limit = systemSetting[type].project;
     const curTenderCount = await projectModel.count({userID, compilation, projType: 'Tender', '$or':[{deleteInfo: null}, {'deleteInfo.completeDeleted': false}]});
     return tenderCount + curTenderCount > limit;

+ 2 - 2
modules/users/models/user_model.js

@@ -347,7 +347,7 @@ class UserModel extends BaseModel {
      * @return {version}
      */
     async getVersionFromUpgrade(ssoId, compilationId) {
-        let version = '纵横公路养护云造价(免费公用版)';//'纵横公路养护造价(免费云版)'; 2019-03-28 需求修改,听说不知道多久的以后还会改回来--勿删!!!!!
+        let version = '纵横公路养护云造价(学习版)';//'纵横公路养护造价(免费云版)'; 2019-03-28 需求修改,听说不知道多久的以后还会改回来--勿删!!!!!
         let userData = await this.findDataBySsoId(ssoId);
         if (userData.upgrade_list !== undefined) {
             let compilationInfo = userData.upgrade_list.find(function (item) {
@@ -390,7 +390,7 @@ class UserModel extends BaseModel {
         if (!sessionVersion) {
             return true;
         }
-        return sessionVersion.indexOf('免费') >= 0;
+        return sessionVersion.indexOf('学习') >= 0;
     }
 
     /*

+ 30 - 28
web/building_saas/main/js/views/importBills.js

@@ -12,12 +12,12 @@
 * 清单导入模块,前端导入excel,进行数据提取,用lz-string进行压缩上传处理
 * */
 
-const importBills = (function(){
+const importBills = (function () {
     //单元格数据是否存在
-    function _isDef(data){
+    function _isDef(data) {
         return typeof data !== 'undefined' && data !== null && data !== '';
     }
-    
+
     //去除转义字符
     function _deESC(data) {
         return _isDef(data) ? data.toString().replace(/[\r,\n,\s,\t]/g, '') : data;
@@ -39,11 +39,11 @@ const importBills = (function(){
         qdsl: 1 //清单示例
     };
     //获取列字段对应
-    function getColMapping(type){
+    function getColMapping(type) {
         if (type === 0) {   //工程量清单
-            return {code: 0, name: 1, unit: 2, quantity: 4};
+            return { code: 0, name: 1, unit: 2, quantity: 4 };
         } else {    //清单示例表
-            return {code: 0, name: 1, unit: 2, quantity: 3};
+            return { code: 0, name: 1, unit: 2, quantity: 3 };
         }
     }
     function isGCLHead(dataRow) {
@@ -76,11 +76,11 @@ const importBills = (function(){
                 let existsRoot = findLast(rst, x => x.name === name && x.depth === 0);
                 if (!existsRoot) {
                     let root = {
-                        ID: uuid.v1(), 
-                        NextSiblingID: -1, 
-                        ParentID: -1, 
-                        name: name, 
-                        depth: 0, 
+                        ID: uuid.v1(),
+                        NextSiblingID: -1,
+                        ParentID: -1,
+                        name: name,
+                        depth: 0,
                         parent: null,
                         unitPriceAnalysis: 1
                     };
@@ -104,13 +104,13 @@ const importBills = (function(){
             code = String(code);
             let depth = getDepth(code);
             let data = {
-                ID: uuid.v1(), 
-                NextSiblingID: -1, 
-                ParentID: -1, 
-                code: code, 
-                name: name, 
-                unit: unit, 
-                quantity: quantity, 
+                ID: uuid.v1(),
+                NextSiblingID: -1,
+                ParentID: -1,
+                code: code,
+                name: name,
+                unit: unit,
+                quantity: quantity,
                 depth: depth,
                 unitPriceAnalysis: 1,
             };
@@ -163,7 +163,7 @@ const importBills = (function(){
 
     //提取清单示例数据
     function extractSLDatas(sheetData) {
-        let colMapping = {code: 0, name: 1, unit: 2, quantity: 3};
+        let colMapping = { code: 0, name: 1, unit: 2, quantity: 3 };
         let dataTable = sheetData.data.dataTable,
             rowCount = sheetData.rowCount;
         let rst = [];
@@ -174,13 +174,15 @@ const importBills = (function(){
                 unit = dataTable[row][colMapping.unit] ? dataTable[row][colMapping.unit].value : null,
                 quantity = dataTable[row][colMapping.quantity] ? dataTable[row][colMapping.quantity].value : null;
             if (!code) {    //没有编号的数据,名称必须为:清单 第xx章,认为新的表根节点
-                if (name && /清单 第\d+章/.test(name)) {
+                const reg = /清单\s+第[^章]+章/;
+                //if (name && /清单 第\d+章/.test(name)) {
+                if (name && reg.test(name)) {
                     curRoot = {
-                        code: null, 
-                        name: name, 
-                        ID: uuid.v1(), 
-                        ParentID: -1, 
-                        NextSiblingID: -1, 
+                        code: null,
+                        name: name,
+                        ID: uuid.v1(),
+                        ParentID: -1,
+                        NextSiblingID: -1,
                         parent: null,
                         unitPriceAnalysis: 1
                     };
@@ -224,7 +226,7 @@ const importBills = (function(){
         console.log(rst);
         return rst;
     }
-    
+
     function extactDatas(sheets) {
         let rst = [];
         let curSheetType = null;
@@ -264,10 +266,10 @@ const importBills = (function(){
         //清单 第100章 总则清单需要加上固定ID
         let oneHundredBills = rootDatas.find(data => data.name && /第100章/.test(data.name));
         if (oneHundredBills) {
-            oneHundredBills.flags = [{flag: fixedFlag.ONE_HUNDRED_BILLS, fieldName: 'fixed'}];
+            oneHundredBills.flags = [{ flag: fixedFlag.ONE_HUNDRED_BILLS, fieldName: 'fixed' }];
         }
         return rst;
     }
 
-    return {extactDatas}
+    return { extactDatas }
 })();

+ 2 - 2
web/building_saas/pm/js/pm_share.js

@@ -797,8 +797,8 @@ const pmShare = (function () {
                       return !(selected && selected.data.allowCopy && selected.data.projType === projectType.project);
                   },
                   callback: function (key, opt) {
-                      if($(".p-title").text().includes('免费')){
-                        hintBox.versionBox('此功能仅在专业版中提供,免费公用版可选择单个分段进行拷贝');
+                      if($(".p-title").text().includes('学习')){
+                        hintBox.versionBox('此功能仅在专业版中提供,学习版可选择单个分段进行拷贝');
                         return;
                       }
                       copyContructionProject(tree.selected);

+ 2 - 2
web/building_saas/report/js/rpt_main.js

@@ -938,7 +938,7 @@ let rptControlObj = {
     },
     checkAndGetExcel: function () {
         if (zTreeOprObj.isFreeUser) {
-            hintBox.versionBox('对不起,您当前使用的是免费公用版,不提供导出、打印报表功能,请联系我们的客服人员。');
+            hintBox.versionBox('对不起,您当前使用的是学习版,不提供导出、打印报表功能,请联系我们的客服人员。');
             return;
         }
         if (zTreeOprObj.treeObj) {
@@ -1040,7 +1040,7 @@ let rptControlObj = {
     getPDFPre: function () {
         let me = rptControlObj;
         if (zTreeOprObj.isFreeUser) {
-            hintBox.versionBox('对不起,您当前使用的是免费公用版,不提供导出、打印报表功能,请联系我们的客服人员。');
+            hintBox.versionBox('对不起,您当前使用的是学习公用版,不提供导出、打印报表功能,请联系我们的客服人员。');
             return;
         }
         if (rptTplObj.pdfFont['SmartSimsun'].length === 2) {

+ 1 - 1
web/building_saas/report/js/rpt_print.js

@@ -5,7 +5,7 @@
 let rptPrintHelper = {
     preview: function () {
         if (zTreeOprObj.isFreeUser) {
-            hintBox.versionBox('对不起,您当前使用的是免费公用版,不提供导出、打印报表功能,请联系我们的客服人员。');
+            hintBox.versionBox('对不起,您当前使用的是学习版,不提供导出、打印报表功能,请联系我们的客服人员。');
             return;
         }
         if (zTreeOprObj.checkedRptTplNodes && zTreeOprObj.checkedRptTplNodes.length > 0) {

+ 1 - 1
web/building_saas/unit_price_file/index.html

@@ -61,7 +61,7 @@
                 <strong id="message"></strong>-
             </div>
         </div>
-        <nav class="navbar navbar-expand-lg p-0 d-flex <%= versionName.includes('免费') ? 'free-version' : 'pro-version' %>">
+        <nav class="navbar navbar-expand-lg p-0 d-flex <%= versionName.includes('学习') ? 'free-version' : 'pro-version' %>">
           <div class="unit_price_header header-logo ">
             <h5>单价文件编辑器</h5>
           </div>

+ 1 - 1
web/common/components/share/index.js

@@ -480,7 +480,7 @@ const SHARE_TO = (() => {
             $('#share-hint').text('');
             const { isFree, sharedUsers, recentUsers, contacts } = await getInitalData(projectID);
             if (isFree) {
-                hintBox.versionBox('此功能仅在专业版中提供,免费公用版可选择单个分段进行分享。');
+                hintBox.versionBox('此功能仅在专业版中提供,学习版可选择单个分段进行分享。');
             } else {
                 curSharedUsers = sharedUsers;
                 initSharedView(sharedUsers);

+ 3 - 3
web/common/html/header.html

@@ -7,7 +7,7 @@
         <strong id="message"></strong>-
     </div>
 </div>
-<nav class="navbar navbar-expand-lg p-0 d-flex <%= versionName.includes('免费') ? 'free-version' : 'pro-version' %>">
+<nav class="navbar navbar-expand-lg p-0 d-flex <%= versionName.includes('学习') ? 'free-version' : 'pro-version' %>">
     <% if(controller === 'boot' || controller === 'pm'){ %>
     <!--<a style="text-decoration: none" href="javascript:void(0);" class="header-logo">-->
     <% }else { %>
@@ -36,7 +36,7 @@
                     <a class="dropdown-item" href="/logout">退出登录</a>
                 </div>
             </li>
-            <% if (!versionName.includes('免费')) {%>
+            <% if (!versionName.includes('学习')) {%>
             <li class="nav-item">
               <a href="user/buy" target="_blank"><img src="/web/building_saas/img/vip.png" data-toggle="tooltip" data-placement="bottom" data-original-title="专业版用户"></a>
             </li> 
@@ -59,7 +59,7 @@
                     <!--<a class="dropdown-item" href="/web/common/html/pdfViewer.html?type=userGuide" target="_blank">用户手册</a>
                     <a class="dropdown-item" href="/web/common/html/pdfViewer.html?type=upgradeGuide" target="_blank">升级说明</a>-->
                     <a class="dropdown-item" href="http://doc.zhzdwd.com/docs/yh_yhsc/yh_yhsc-1bup3dm7iacsg" target="_blank">用户手册</a>
-                    <a class="dropdown-item" href="/public/share/upgradeGuide/upgradeGuide.pdf" target="_blank">升级说明</a>
+                    <a class="dropdown-item" href="http://doc.zhzdwd.com/docs/yanghuUpdate/yanghuUpdate-1c67pn4g0dlkq" target="_blank">升级说明</a>
                     <a class="dropdown-item" href="https://smartcost.com.cn/" target="_blank">纵横官网</a>
                     <!--  <a class="dropdown-item" href="#">动画教程</a>-->
                     <a id="customerService" class="dropdown-item" href="javascript:void(0);">联系客服</a>

+ 0 - 14
web/users/html/login-sms.html

@@ -56,20 +56,6 @@
                 </div>
                 <div class="modal-body">
                     <div class="row" id="version-area">
-                        <!--<div class="col-sm-6">-->
-                        <!--<div class="card card-block">-->
-                        <!--<h3 class="card-title">重庆版免费版</h3>-->
-                        <!--<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>-->
-                        <!--<a class="btn btn-primary" href="/boot/1">开始使用</a>-->
-                        <!--</div>-->
-                        <!--</div>-->
-                        <!--<div class="col-sm-6">-->
-                        <!--<div class="card card-block">-->
-                        <!--<h3 class="card-title">广东版免费版</h3>-->
-                        <!--<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>-->
-                        <!--<a class="btn btn-primary" href="/boot/2">开始使用</a>-->
-                        <!--</div>-->
-                        <!--</div>-->
                     </div>
                 </div>
             </div>

+ 0 - 14
web/users/html/login.html

@@ -72,20 +72,6 @@
                 </div>
                 <div class="modal-body">
                     <div class="row" id="version-area">
-                        <!--<div class="col-sm-6 mb-3">-->
-                            <!--<div class="card card-block">-->
-                                <!--<h3 class="card-title">重庆版免费版</h3>-->
-                                <!--<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>-->
-                                <!--<a class="btn btn-primary" href="/boot/1">开始使用</a>-->
-                            <!--</div>-->
-                        <!--</div>-->
-                        <!--<div class="col-sm-6">-->
-                            <!--<div class="card card-block">-->
-                                <!--<h3 class="card-title">广东版免费版</h3>-->
-                                <!--<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>-->
-                                <!--<a class="btn btn-primary" href="/boot/2">开始使用</a>-->
-                            <!--</div>-->
-                        <!--</div>-->
                     </div>
                 </div>
             </div>

+ 1 - 1
web/users/html/user-buy.html

@@ -51,7 +51,7 @@
                             <div class="col-sm-4 mb-5">
                                 <div class="card free-version">
                                   <div class=" card-body">
-                                    <h3 class="card-title">免费版 </h3>
+                                    <h3 class="card-title">学习版 </h3>
                                       <p class="card-text">
                                     <!--  <ul class="pl-3">
                                           <li>只可创建 50 个单位工程</li>