浏览代码

Merge branch '3.0.4_online' of http://192.168.1.41:3000/SmartCost/ConstructionCost into 3.0.4_online

TonyKang 4 年之前
父节点
当前提交
33d8c04cbb

+ 6 - 5
modules/main/facade/ration_facade.js

@@ -78,11 +78,12 @@ async function addNewRation(data,compilation) {
 }
 
 async function addMultiRation(datas,compilation) {
-    const task = [];
-    for (const data of datas) {
-        task.push(addNewRation(data, compilation));
-    }
-    return await Promise.all(task);
+  let rst = [];
+  for(let data of datas){
+      let r = await addNewRation(data,compilation);
+      rst.push(r);
+  }
+  return rst;
 }
 
 async function deleteMultiRation(rations) {//这里是只有删除的情况,删除定额的同时删除定额下挂的其它子项目

+ 4 - 1
modules/users/controllers/cld_controller.js

@@ -263,7 +263,10 @@ class CLDController {
             //设置搜索普通用户:
             condition.user_type = 'normal';
             //设置剔除CLD用户列表不显示
-            condition.is_cld = {$in: [null, 0]};
+            let keyword = request.query.keyword;
+            if(keyword === undefined || keyword === '') {
+                condition.is_cld = {$in: [null, 0]};
+            }
 
             //获取注册时间
             let regtime = request.query.regtime;

+ 6 - 0
public/web/gljUtil.js

@@ -583,6 +583,12 @@ let gljUtil = {
                 quantity = scMathUtil.roundForObj(quantity +  i.quantity,decimal.process);
             }
             data.quantity = gljUtil.calUnitWidthCoe(quantity,false,engineerFeatures,_,scMathUtil);
+            //主要工程量指标另外加了一个系数
+            let f = _.find(engineerFeatures,{index:true});
+            if(f){
+                let quantityCoe = gljUtil.isDef(f.quantityCoe)?f.quantityCoe:1;
+                data.quantity = scMathUtil.roundForObj(data.quantity*quantityCoe,3);
+            }  
         }
 
         return datas;

+ 33 - 36
public/web/sheet/sheet_common.js

@@ -686,41 +686,6 @@ var sheetCommonObj = {
         //sheet.setCellType(row, col,this.getSelectButton(header.headerWidth),GC.Spread.Sheets.SheetArea.viewport);
     },
 
-    paintCusButtonImage:function(ctx, value, x, y, w, h, style, options){
-        if (options.sheet.getActiveRowIndex() == options.row && options.sheet.getActiveColumnIndex() == options.col) {
-            var image = document.getElementById('f_btn'), imageMagin = 3;
-            var imageHeight = 15;
-            var imageWidth = 25;
-            var imageX = x + w - imageWidth - imageMagin, imageY = y + h / 2 - imageHeight / 2;
-            ctx.save();
-           /* 2020-12-16 这里原先是还原背景色的,发现不需要了,先观察 
-            if (style.backColor) {
-                ctx.fillStyle = style.backColor;
-                ctx.fillRect(x, y, w, h);
-            } 
-            */
-            ctx.drawImage(image, imageX, imageY, imageWidth, imageHeight);
-            ctx.beginPath();
-            ctx.arc(imageX + imageWidth / 2, imageY + imageHeight / 2, 1, 0, 360, false);
-            ctx.arc(imageX + imageWidth / 2 - 4, imageY + imageHeight / 2, 1, 0, 360, false);
-            ctx.arc(imageX + imageWidth / 2 + 4, imageY + imageHeight / 2, 1, 0, 360, false);
-            ctx.fillStyle = "black";//填充颜色,默认是黑色
-            ctx.fill();//画实心圆
-            ctx.closePath();
-            ctx.restore();
-            w = w - imageWidth - imageMagin;
-            //这里的左对齐的,当显示的字长度超过空白地方时,要改成右对齐
-            if (style.hAlign == 0) {
-                if (value) {
-                    let textWidth = ctx.measureText(value).width;
-                    let spaceWidth = w;
-                    if (spaceWidth < textWidth) {
-                        style.hAlign = 2;
-                    }
-                }
-            }
-        }
-    },
     getCusButtonCellType: function (callback, readOnly = false, ostyle) {
         var ns = GC.Spread.Sheets;
 
@@ -730,7 +695,39 @@ var sheetCommonObj = {
         CusButtonCellType.prototype = new ns.CellTypes.Text();
         CusButtonCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
             if (!readOnly) {
-                sheetCommonObj.paintCusButtonImage(ctx, value, x, y, w, h, style, options);
+                if (options.sheet.getActiveRowIndex() == options.row && options.sheet.getActiveColumnIndex() == options.col) {
+                    var image = document.getElementById('f_btn'), imageMagin = 3;
+                    var imageHeight = 15;
+                    var imageWidth = 25;
+                    var imageX = x + w - imageWidth - imageMagin, imageY = y + h / 2 - imageHeight / 2;
+                    ctx.save();
+                   /* 2020-12-16 这里原先是还原背景色的,发现不需要了,先观察 
+                    if (style.backColor) {
+                        ctx.fillStyle = style.backColor;
+                        ctx.fillRect(x, y, w, h);
+                    } 
+                    */
+                    ctx.drawImage(image, imageX, imageY, imageWidth, imageHeight);
+                    ctx.beginPath();
+                    ctx.arc(imageX + imageWidth / 2, imageY + imageHeight / 2, 1, 0, 360, false);
+                    ctx.arc(imageX + imageWidth / 2 - 4, imageY + imageHeight / 2, 1, 0, 360, false);
+                    ctx.arc(imageX + imageWidth / 2 + 4, imageY + imageHeight / 2, 1, 0, 360, false);
+                    ctx.fillStyle = "black";//填充颜色,默认是黑色
+                    ctx.fill();//画实心圆
+                    ctx.closePath();
+                    ctx.restore();
+                    w = w - imageWidth - imageMagin;
+                    //这里的左对齐的,当显示的字长度超过空白地方时,要改成右对齐
+                    if (style.hAlign == 0) {
+                        if (value) {
+                            let textWidth = ctx.measureText(value).width;
+                            let spaceWidth = w;
+                            if (spaceWidth < textWidth) {
+                                style.hAlign = 2;
+                            }
+                        }
+                    }
+                }
             }
             if (ostyle) gljUtil.setProperty(style, ostyle);
             GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);

+ 13 - 0
web/building_saas/main/js/views/index_view.js

@@ -634,9 +634,22 @@ let indexObj= {
         }
         return null;
     },
+    getQuantityUnit:function () {
+        let features  = projectObj.project.property.engineerFeatures;
+        if(features){
+            for(let f of features){
+                if(f.index == true && f.quantityUnit && f.quantityUnit!="") return f.quantityUnit;
+            }
+        }
+        return null;
+    },
     setHeaderUnit:function (setting,dataCode) {
       let header = _.find(setting.header,{dataCode:dataCode});
       let unit = this.getIndexUnit();
+      if(dataCode === 'quantity'){
+        let qunit = this.getQuantityUnit();
+        if(qunit) unit = qunit
+      }
       if(!unit || !header )return;
       header.headerName +=`(${unit})`
     }