Przeglądaj źródła

1.TASK #3052 分享建设项目,仅提供给专业版用户。
2.BUG #2838 “管理相关文件”窗口,调整“使用列”的列宽为55,字体与项目管理界面的表头字体一致。
3.BUG #? 广东建筑套用部颁的定额库,报错

vian 5 lat temu
rodzic
commit
f847d9956f

+ 1 - 1
modules/glj/models/glj_list_model.js

@@ -586,7 +586,7 @@ class GLJListModel extends BaseModel {
             }
             let basePrice = tmp.basePrice;
             //多单价、多组成物消耗量的情况 fromTable
-            if(ext && ext.priceField &&( tmp.priceProperty[ext.priceField]!= undefined && tmp.priceProperty[ext.priceField]!=null)){
+            if(ext && ext.priceField &&(tmp.priceProperty && tmp.priceProperty[ext.priceField]!= undefined && tmp.priceProperty[ext.priceField]!=null)){
                 basePrice = tmp.priceProperty[ext.priceField];
             }
             basePrice = scMathUtil.roundTo(basePrice,-6);

+ 2 - 1
modules/main/facade/ration_facade.js

@@ -860,7 +860,8 @@ function getProjectGLJNewData(tmp,projectId,ext){
       market_price: tmp.basePrice,
       from:tmp.from?tmp.from:"std"
   };
-  if(gljData.from == 'std' && ext && ext.priceField &&( tmp.priceProperty[ext.priceField]!= undefined && tmp.priceProperty[ext.priceField]!=null)){
+  // 现在定额库可以引用其他费用定额的,比如广东可能套用部颁的定额,因此就算广东费用定额是多单价的,也可能会引用单个单价的人材机
+  if(gljData.from == 'std' && ext && ext.priceField &&( tmp.priceProperty && tmp.priceProperty[ext.priceField]!= undefined && tmp.priceProperty[ext.priceField]!=null)){
     const basePrice = scMathUtil.roundTo(tmp.priceProperty[ext.priceField],-6);
     gljData.base_price = basePrice;
     gljData.market_price = basePrice;

+ 9 - 0
modules/pm/controllers/pm_controller.js

@@ -610,6 +610,15 @@ module.exports = {
     getInitialShareData: async function (req, res) {
         try {
             const { count, projectID } = JSON.parse(req.body.data);
+            // 分享建设项目,仅提供给专业版用户
+            const project = await projectModel.findOne({ ID: projectID }, 'projType');
+            if (project && project.projType === projType.project) {
+                const isFree = userModelObj.isFreeFromSession(req.session.compilationVersion);
+                if (isFree) {
+                    callback(req, res, 0, 'success', { isFree });
+                    return;
+                }
+            }
             const userID = req.session.sessionUser.id;
             // 最近分享
             const recentUsers = await pm_facade.getRecentShareList(userID, count);

+ 1 - 1
modules/unit_price_file/facade/unit_price_facade.js

@@ -46,7 +46,7 @@ function getProjectGLJNewData(tmp,projectId,ext){
       market_price: tmp.basePrice,
       from:tmp.from?tmp.from:"std"
   };
-  if(gljData.from == 'std' && ext && ext.priceField &&( tmp.priceProperty[ext.priceField]!= undefined && tmp.priceProperty[ext.priceField]!=null)){
+  if(gljData.from == 'std' && ext && ext.priceField &&(tmp.priceProperty && tmp.priceProperty[ext.priceField]!= undefined && tmp.priceProperty[ext.priceField]!=null)){
     basePrice = scMathUtil.roundTo(tmp.priceProperty[ext.priceField],-6);
     gljData.base_price = basePrice;
     gljData.market_price = basePrice;

+ 11 - 0
modules/users/controllers/user_controller.js

@@ -384,6 +384,17 @@ class UserController extends BaseController {
         }
     }
 
+    async isFree(req, res) {
+        try {
+            const sessionVersion = req.session.compilationVersion;
+            const userModel = new UserModel();
+            const isFree = userModel.isFreeFromSession(sessionVersion);
+            res.json({ error: 0, msg: 'success', data: { isFree } });
+        } catch (err) {
+            res.json({ error: 1, msg: String(err), data: null });
+        }
+    }
+
     // /**
     //  * 是否时免费版用户
     //  */

+ 12 - 0
modules/users/models/user_model.js

@@ -366,6 +366,18 @@ class UserModel extends BaseModel {
         return free
     }
 
+    /**
+     * 从session中判断用户是否是免费版
+     * @param {String} sessionVersion
+     * @return {Boolean} 
+     */
+    isFreeFromSession(sessionVersion) {
+        if (!sessionVersion) {
+            return true;
+        }
+        return sessionVersion.indexOf('免费') >= 0;
+    }
+
     /*
     * 添加联系人,互相添加
     */

+ 1 - 0
modules/users/routes/user_route.js

@@ -22,6 +22,7 @@ module.exports = function (app) {
     router.post('/info', userController.init, userController.saveData);
     router.post('/getUserByMobile', userController.init, userController.getUserByMobile);
     router.post('/getUsers', userController.init, userController.getUsers);
+    router.post('/isFree', userController.init, userController.isFree);
 
     router.post('/getVersionInfo', userController.init, userController.getVersionInfo);
     router.post('/change/isSmsLogin', userController.init, userController.changeIsSmsLogin);

+ 11 - 0
public/scHintBox.html

@@ -176,6 +176,17 @@
         },
         unWaitBox: function () {
             $('#waitBox_form').modal('hide');
+        },
+        versionBox: function (caption) {
+            const title = '提示';
+            const btnType = hintBox.btnType.yesNo;
+            const doYes = () => {
+                $("#hintBox_form").modal('hide');
+                CommonHeader.getCategoryList();
+            };
+            const doNo = () => $("#hintBox_form").modal('hide');
+            const btnTextArr = ['联系客服', '关闭'];
+            this.infoBox(title, caption, btnType, doYes, doNo, btnTextArr);
         }
     };
 

+ 3 - 0
web/building_saas/css/custom.css

@@ -481,4 +481,7 @@ input.text-right{
 padding-top:6px;
 margin-left: 50px;
 margin-right: 100px !important;
+}
+.table-sc th{
+  font-weight: normal;
 }

+ 2 - 2
web/building_saas/pm/html/project-management.html

@@ -145,7 +145,7 @@
                             <thead>
                                 <th style="width: 25px;" class="text-center"></th>
                                 <th style="width: 330px;" class="text-center">名称</th>
-                                <th style="width:40px;" class="text-center">使用</th>
+                                <th style="width: 55px;" class="text-center">使用</th>
                             </thead>
                             <tbody>
                             </tbody>
@@ -157,7 +157,7 @@
                             <thead>
                                 <th style="width: 25px;" class="text-center"></th>
                                 <th style="width: 330px;" class="text-center">名称</th>
-                                <th style="width:40px;" class="text-center">使用</th>
+                                <th style="width: 55px;" class="text-center">使用</th>
                             </thead>
                             <tbody>
                             </tbody>

+ 12 - 8
web/common/components/share/index.js

@@ -319,17 +319,21 @@ const SHARE_TO = (() => {
             $('#share-phone').val('');
             initSearchResultView();
             $('#share-hint').text('');
-            const { sharedUsers, recentUsers, contacts } = await getInitalData(projectID);
-            curSharedUsers = sharedUsers;
-            initSharedView(sharedUsers);
-            initRecentView(recentUsers);
-            initContactsView(contacts);
-            $.bootstrapLoading.end();
-            setTimeout(() => $('#sharePhone').focus(), 200);
-            $('#share').modal('show');
+            const { isFree, sharedUsers, recentUsers, contacts } = await getInitalData(projectID);
+            if (isFree) {
+                hintBox.versionBox('此功能仅在专业版中提供,免费公用版可选择单个分段进行分享。');
+            } else {
+                curSharedUsers = sharedUsers;
+                initSharedView(sharedUsers);
+                initRecentView(recentUsers);
+                initContactsView(contacts);
+                setTimeout(() => $('#share-phone').focus(), 200);
+                $('#share').modal('show');
+            }
         } catch (err) {
             console.log(err);
             alert(err);
+        } finally {
             $.bootstrapLoading.end();
         }
     }

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

@@ -192,7 +192,7 @@
 </div>
 <!--激活产品 & 售后服务 & 联系客服-->
 <!--办事处客服列表-->
-<div class="modal fade z-index-3000" id="activ" data-backdrop="static" style="display: none;" aria-hidden="true">
+<div class="modal fade z-index-3000" id="activ" data-backdrop="static" style="display: none; overflow: auto;" aria-hidden="true">
     <div class="modal-dialog modal-lg" role="document">
         <div class="modal-content">
             <div class="modal-header">