Sfoglia il codice sorgente

Merge branch 'master' of http://smartcost.f3322.net:3000/SmartCost/ConstructionCost

Conflicts:
	web/building_saas/main/js/models/project.js
chenshilong 7 anni fa
parent
commit
bddf19e9d1

+ 6 - 4
web/building_saas/main/js/main.js

@@ -7,7 +7,7 @@ $(function () {
     loadSize("main", function() {
         refreshSubSpread();
     });
-
+    $("#header-menu").removeAttr('style');
     projectInfoObj.showProjectInfo();
     projectObj.checkMainSpread();
     projectObj.loadProjectData();
@@ -79,12 +79,12 @@ function slideResize(rootElement, callback) {
             // 判断拖动范围不能超出
             topChangeHeight = topContentHeight + moveHeight;
             topChangeHeight = topChangeHeight < 170 ? 170 : topChangeHeight;
-            topChangeHeight = topChangeHeight > 700 ? 700 : topChangeHeight;
+            topChangeHeight = topChangeHeight > 700 ? 709 : topChangeHeight;
             topContentEle.children(".main-data-top").height(topChangeHeight);
 
             bottomChangeHeight = bottomContentHeight - moveHeight;
             bottomChangeHeight = bottomChangeHeight < 170 ? 170 : bottomChangeHeight;
-            bottomChangeHeight = bottomChangeHeight > 700 ? 700 : bottomChangeHeight;
+            bottomChangeHeight = bottomChangeHeight > 700 ? 709 : bottomChangeHeight;
             bottomContentEle.children().find(".main-data-bottom").height(bottomChangeHeight - navHeight);
         }
     });
@@ -96,6 +96,8 @@ function slideResize(rootElement, callback) {
             drag = false;
             // 存入本地缓存
             const id = rootElement.attr('id');
+            topChangeHeight = topChangeHeight >= 700 ? 709 : topChangeHeight;
+            bottomChangeHeight = bottomChangeHeight >= 700 ? 709 : bottomChangeHeight;
             setLocalCache('topHeight:' + id, topChangeHeight);
             setLocalCache('bottomHeight:' + id, bottomChangeHeight);
         }
@@ -123,6 +125,6 @@ function loadSize(tag, callback) {
     bottomHeight = parseFloat(bottomHeight);
     $("#"+ tag +" .main-data-top").height(topHeight);
     $("#"+ tag +" .main-data-bottom").height(bottomHeight - navHeight);
-    $("#"+ tag +" .bottom-content").height(bottomHeight);
+    // $("#"+ tag +" .bottom-content").height(bottomHeight);
     callback();
 }

+ 6 - 3
web/building_saas/main/js/models/calc_base.js

@@ -277,7 +277,7 @@ let baseFigureTemplate = {
         return 0;
     },
     'FBFXGCLQDJJZJGCF': function () {
-        return this['FBFXDEJJRGF']() + this['FBFXDEJJCLF']() + this['FBFXDEJJJXF']();
+        return (this['FBFXDEJJRGF']() + this['FBFXDEJJCLF']() + this['FBFXDEJJJXF']()).toDecimal(decimalObj.bills.totalPrice);
     },
     'CSXMF': function () {
         let bill = calcBase.fixedBills[calcBase.fixedFlag.MEASURE]['bill'];
@@ -292,7 +292,7 @@ let baseFigureTemplate = {
         return bill.feesIndex.common.totalFee || 0;
     },
     'ZZCSXMDEJJZJGCF': function () {
-        return this['ZZCSXMDEJJRGF']() + this['ZZCSXMDEJJCLF']() + this['ZZCSXMDEJJJXF']()
+        return (this['ZZCSXMDEJJRGF']() + this['ZZCSXMDEJJCLF']() + this['ZZCSXMDEJJJXF']()).toDecimal(decimalObj.bills.totalPrice);
     },
     'ZZCSXMDEJJRGF': function () {
         let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_ORGANIZATION]['bill'];
@@ -364,7 +364,7 @@ let baseFigureTemplate = {
         return 0;
     },
     'JSCSXMQDDEJJZJGCF': function () {
-        return this['JSCSXMDEJJRGF']() + this['JSCSXMDEJJCLF']() + this['JSCSXMDEJJJXF']();
+        return (this['JSCSXMDEJJRGF']() + this['JSCSXMDEJJCLF']() + this['JSCSXMDEJJJXF']()).toDecimal(decimalObj.bills.totalPrice);
     },
     'QTXMF': function () {
         let bill = calcBase.fixedBills[calcBase.fixedFlag.OTHER]['bill'];
@@ -579,6 +579,9 @@ let calcBase = {
     getBaseByClass: function (node) {
         return cbTools.getFigure(node);
     },
+    getBaseBill: function (node) {
+        return cbTools.getBaseBill(node);
+    },
     calculate: function (node) {
         let me = calcBase,
             $CBA = cbAnalyzer,

+ 2 - 1
web/building_saas/main/js/models/project.js

@@ -142,7 +142,8 @@ var PROJECT = {
                     newNode.source = br[i];
                     newNode.sourceType = that.Ration.getSourceType();
                     newNode.data = br[i];
-                    if(projectInfoObj.projectInfo.property.displaySetting.disPlayMainMaterial==true){
+                    if(projectInfoObj.projectInfo.property.displaySetting !== undefined &&
+                        projectInfoObj.projectInfo.property.displaySetting.disPlayMainMaterial==true){
                         loadRationGLJNode(newNode);
                     }
                 }

+ 16 - 8
web/building_saas/main/js/views/project_property_decimal_view.js

@@ -178,20 +178,28 @@ function v_initPanel(data){
 function e_validIn(inputs){
     for(let i = 0, len = inputs.length; i < len; i++){
         let orgV = $(inputs[i]).val();
-        $(inputs[i]).keydown(function () {
-            let v = $(this).val();
-            if(v.trim().length > 0 && isValidDigit(v)){
-                orgV = v;
-            }
-        });
-        $(inputs[i]).keyup(function () {
+        $(inputs[i]).bind('input', function () {
             let v = $(this).val();
+            let inputName = $(this).attr('name');
             if(v.trim().length === 0 || !isValidDigit(v)){
                 alert('小数位数范围在0-6!');
                 $(this).val(orgV);
             }
             else{
-                //let newV = parseInt(v);
+                orgV = v;
+                //清单单价、合价 与定额单价、合价同步
+                if(inputName === 'bills-unitPrice'){
+                    $("input[name='ration-unitPrice']").val(v);
+                }
+                else if(inputName === 'bills-totalPrice'){
+                    $("input[name='ration-totalPrice']").val(v);
+                }
+                else if(inputName === 'ration-unitPrice'){
+                    $("input[name='bills-unitPrice']").val(v);
+                }
+                else if(inputName === 'ration-totalPrice'){
+                    $("input[name='bills-totalPrice']").val(v);
+                }
             }
         });
     }

+ 2 - 1
web/building_saas/main/js/views/project_view.js

@@ -399,7 +399,8 @@ var projectObj = {
                 that.project.projSetting.mainGridSetting = JSON.parse(str);
                 that.project.projSetting.mainGridSetting.frozenCols = 4;
                 TREE_SHEET_HELPER.initSetting($('#billsSpread')[0], that.project.projSetting.mainGridSetting);
-                const autoHeight = that.project.property.displaySetting.autoHeight;
+                const autoHeight = that.project.property.displaySetting !== undefined ?
+                    that.project.property.displaySetting.autoHeight : false;
                 that.project.projSetting.mainGridSetting.cols.forEach(function (col) {
                     // for test.  后端没有绑定,暂时写死用于测试。
 /*                    if (col.data.field == '' && col.head.titleNames[0] == "取费专业") {

+ 12 - 0
web/building_saas/main/js/views/sub_view.js

@@ -115,7 +115,11 @@ $("#linkTZJNR").click(function () {
 });
 
 // 应用到选中清单
+let isSaving = false;
 $("#use-to-current").click(function() {
+    if (isSaving) {
+        return false;
+    }
     // 添加位置
     const position = $("#add-position").val();
     // 添加内容
@@ -134,8 +138,16 @@ $("#use-to-current").click(function() {
         position,
         displayFormat,
     };
+    isSaving = true;
+    const self = $(this);
+    self.attr('disabled', 'disabled');
     let selectedNode = projectObj.mainController.tree.selected;
     pageCCOprObj.setCharacterBySetting(selectedNode, setting);
+    // 防止连续点击1秒后才能再次发起请求
+    setTimeout(function() {
+        isSaving = false;
+        self.removeAttr('disabled');
+    }, 1000);
 });
 // 添加位置选择
 $("#add-position").change(function() {

+ 0 - 3
web/building_saas/pm/html/project-management.html

@@ -26,9 +26,6 @@
         #summary-engineering,#summary-project{
             display: none;
         }
-        #header-menu{
-            display: none;
-        }
     </style>
 </head>
 

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

@@ -1,6 +1,6 @@
 <nav class="navbar navbar-expand-lg p-0 d-flex">
     <a class="header-logo px-2" href="/pm" style="text-decoration: none;">纵横云造价</a>
-    <ul class="nav navbar-nav px-1" id="header-menu">
+    <ul class="nav navbar-nav px-1" id="header-menu" style="display: none;">
         <li class="nav-item">
             <a class="nav-link" href="#" aria-expanded="false" data-toggle="modal" data-target="#poj-set"><i class="fa fa-cube"></i> 项目属性</a>
         </li>