Browse Source

Merge branch '1.0.0_online' of http://smartcost.f3322.net:3000/SmartCost/ConstructionCost into 1.0.0_online

zhongzewei 7 years ago
parent
commit
1544f18380

+ 1 - 1
Dockerfile

@@ -2,7 +2,7 @@ FROM costbase:latest
 
 
 WORKDIR /home/ConstructionCost
 WORKDIR /home/ConstructionCost
 
 
-RUN git pull http://192.168.1.12:3000/SmartCost/ConstructionCost master
+RUN git pull http://192.168.1.12:3000/SmartCost/ConstructionCost 1.0.0_online
 
 
 RUN cnpm install
 RUN cnpm install
 
 

+ 1 - 1
Dockerfile_pp

@@ -2,7 +2,7 @@ FROM costbase:latest
 
 
 WORKDIR /home/ConstructionCost
 WORKDIR /home/ConstructionCost
 
 
-RUN git pull http://192.168.1.12:3000/SmartCost/ConstructionCost master
+RUN git pull http://192.168.1.12:3000/SmartCost/ConstructionCost 1.0.0_online
 
 
 RUN cnpm install
 RUN cnpm install
 
 

+ 1 - 1
Dockerfile_qa

@@ -2,7 +2,7 @@ FROM costbase:latest
 
 
 WORKDIR /home/ConstructionCost
 WORKDIR /home/ConstructionCost
 
 
-RUN git pull http://192.168.1.12:3000/SmartCost/ConstructionCost master
+RUN git pull http://192.168.1.12:3000/SmartCost/ConstructionCost 1.0.0_online
 
 
 RUN cnpm install
 RUN cnpm install
 
 

+ 3 - 1
config/db/db_manager.js

@@ -49,7 +49,9 @@ module.exports = {
     connect:function (env="local") {
     connect:function (env="local") {
         var config = require("../config.js");
         var config = require("../config.js");
         var dbURL = 'mongodb://' + config[env].server + ":" + config[env].port + '/scConstruct';
         var dbURL = 'mongodb://' + config[env].server + ":" + config[env].port + '/scConstruct';
-        if(config[env].options){
+        if(config[env].dbURL){
+            mg.connect(config[env].dbURL,{connectTimeoutMS: 20000,useMongoClient: true});
+        } else if(config[env].options){
             mg.connect(dbURL,config[env].options);
             mg.connect(dbURL,config[env].options);
         }else {
         }else {
             mg.connect(dbURL,{connectTimeoutMS: 20000,useMongoClient: true});//useMongoClient': true*! //报 DeprecationWarning: `open()` is deprecated in mongoose这个错
             mg.connect(dbURL,{connectTimeoutMS: 20000,useMongoClient: true});//useMongoClient': true*! //报 DeprecationWarning: `open()` is deprecated in mongoose这个错

+ 6 - 5
public/web/gljUtil.js

@@ -205,8 +205,9 @@ let gljUtil = {
             }
             }
             return scMathUtil.roundForObj(p,price_hasM_decimal);
             return scMathUtil.roundForObj(p,price_hasM_decimal);
         }else {
         }else {
-            let tem_decimal = isRadio==true?process_decimal:price_decimal;
-            return scMathUtil.roundForObj(parseFloat(glj.unit_price.market_price)*priceCoe,tem_decimal);
+            let tem_decimal =price_decimal; //isRadio==true?process_decimal:price_decimal;
+            let tem_price = scMathUtil.roundForObj(glj.unit_price.market_price,price_decimal);
+            return scMathUtil.roundForObj(tem_price*priceCoe,tem_decimal);
         }
         }
     },
     },
     getBasePrice:function (glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil) {
     getBasePrice:function (glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil) {
@@ -232,7 +233,7 @@ let gljUtil = {
             }
             }
             return scMathUtil.roundForObj(p,price_hasM_decimal);
             return scMathUtil.roundForObj(p,price_hasM_decimal);
         }else {
         }else {
-            let tem_decimal = isRadio==true?process_decimal:price_decimal;
+            let tem_decimal =price_decimal; //isRadio==true?process_decimal:price_decimal;
             return scMathUtil.roundForObj(glj.unit_price.base_price,tem_decimal);
             return scMathUtil.roundForObj(glj.unit_price.base_price,tem_decimal);
         }
         }
     },
     },
@@ -245,7 +246,7 @@ let gljUtil = {
         if (glj.unit_price.type == this.gljType.LABOUR || glj.unit_price.type == this.gljType.MACHINE_LABOUR) {//人工、机上人工,调整价根据定额价*调整系数计算得出。
         if (glj.unit_price.type == this.gljType.LABOUR || glj.unit_price.type == this.gljType.MACHINE_LABOUR) {//人工、机上人工,调整价根据定额价*调整系数计算得出。
             let labour = _.find(labourCoeDatas.coes,{'ID':glj.adjCoe});
             let labour = _.find(labourCoeDatas.coes,{'ID':glj.adjCoe});
             let coe = labour && labour.coe ? labour.coe : 1;
             let coe = labour && labour.coe ? labour.coe : 1;
-            return scMathUtil.roundTo(parseFloat(coe * scMathUtil.roundForObj(glj.unit_price.base_price,tem_decimal)), -tem_decimal);
+            return scMathUtil.roundTo(parseFloat(coe * scMathUtil.roundForObj(glj.unit_price.base_price,decimal)), -decimal);
         } else if (notEditType.indexOf(glj.unit_price.type)!=-1&&glj.ratio_data.length>0) {//对于混凝土、配合比、砂浆、机械台班,调整价根据组成物计算得出。
         } else if (notEditType.indexOf(glj.unit_price.type)!=-1&&glj.ratio_data.length>0) {//对于混凝土、配合比、砂浆、机械台班,调整价根据组成物计算得出。
             let p =0;
             let p =0;
             for(let ratio of glj.ratio_data){
             for(let ratio of glj.ratio_data){
@@ -264,7 +265,7 @@ let gljUtil = {
             }
             }
             return scMathUtil.roundForObj(p,price_hasM_decimal);
             return scMathUtil.roundForObj(p,price_hasM_decimal);
         } else {//对于其他普通材料等,无调整系数,调整价=定额价。
         } else {//对于其他普通材料等,无调整系数,调整价=定额价。
-            return  scMathUtil.roundForObj(glj.unit_price.base_price,tem_decimal)
+            return  scMathUtil.roundForObj(glj.unit_price.base_price,decimal)
         }
         }
     },
     },
     calcPriceDiff:function (glj,calcOptions) {
     calcPriceDiff:function (glj,calcOptions) {

+ 9 - 5
web/building_saas/main/js/views/project_view.js

@@ -546,11 +546,15 @@ var projectObj = {
             }
             }
         }
         }
     },
     },
-    onColumnWidthChanged: function (sender, info) {
-        projectObj.mainSpread.getActiveSheet().setColumnVisible(4, false);
-        projectObj.mainSpread.getActiveSheet().setColumnVisible(4, true);
-        projectObj.mainSpread.refresh();
-        projectObj.mainSpread.repaint();
+    onColumnWidthChanged: function (sender, info) {         // CSL,2018.07.25
+        if (info.colList.includes(4) || info.colList.includes(5)){
+            let items = projectObj.project.mainTree.items;
+            let sheet = projectObj.mainSpread.getActiveSheet();
+            for (let i = 0; i < items.length; i++) {
+                if ((info.colList.includes(4) && items[i].data.itemCharacterText) || (info.colList.includes(5) && items[i].data.jobContentText))
+                    sheet.autoFitRow(i);
+            }
+        }
     },
     },
     mainSpreadEditEnded: function (sender, info) {
     mainSpreadEditEnded: function (sender, info) {
         console.log('enterEDEnd');
         console.log('enterEDEnd');