浏览代码

湖南养护2020相关

zhangweicheng 5 年之前
父节点
当前提交
c641320935

+ 5 - 7
public/web/scMathUtil.js

@@ -174,20 +174,18 @@ let scMathUtil = {
         let me = this;
         let value;
         if(me.isNumber(obj)){
-            value = me.roundTo(obj,-decimal)
+          value = Math.round(obj * n) / n;
+          //value = me.roundTo(obj,-decimal)
         }else {
-            value = me.roundTo(Number(obj),-decimal);
+          value = Math.round(Number(obj) * n) / n;
+          //value = me.roundTo(Number(obj),-decimal);
         }
         return value
     },
     roundToString:function(obj,decimal){
         let me = this;
         let value;
-        if(me.isNumber(obj)){
-            value = me.roundTo(obj,-decimal)
-        }else {
-            value = me.roundTo(Number(obj),-decimal);
-        }
+        let value = me.roundForObj(obj,decimal);
         return value.toFixed(decimal);
     },
     isNumOrFormula:function (text) {

+ 8 - 0
web/building_saas/main/js/models/bills.js

@@ -550,6 +550,14 @@ var Bills = {
                 return false;
             }
         };
+        bills.prototype.isConstructionInstall = function (node) {//判读是否属于第一部分建筑安装工程费CONSTRUCTION_INSTALL_FEE
+          let rootNode = this.getRootNode(node);
+           if(this.flagEquals(rootNode,fixedFlag.CONSTRUCTION_INSTALL_FEE)){
+               return true;
+           }else {
+               return false;
+           }
+       };
         bills.prototype.isFXorBX=function (node) {//是分项或者补项
             if(node.sourceType == projectObj.project.Bills.getSourceType()){
                 return   node.data.type == billType.FX || node.data.type == billType.BX;

+ 4 - 0
web/building_saas/main/js/views/glj_view.js

@@ -632,6 +632,8 @@ var gljOprObj = {
         return codeMap;
     },
     initRationTree: function (init,codeMap) {
+        this.sheet.suspendPaint();
+        this.sheet.suspendEvent();
         this.sheet.setRowCount(this.sheetData.length >30?this.sheetData.length:30);
         for (var i = 0; i < this.sheetData.length; i++) {
             let options = this.getCodeOptions(this.sheetData[i],codeMap);
@@ -643,6 +645,8 @@ var gljOprObj = {
                 }
             }
         }
+        this.sheet.resumeEvent();
+        this.sheet.resumePaint(); 
     },
     getCodeOptions:function (recode,codeMap) {
         let options = [];

+ 22 - 17
web/building_saas/main/js/views/project_glj_view.js

@@ -662,6 +662,7 @@ projectGljObject={
 
     },
     showProjectGljData:function () {
+        let me = this;
         this.projectGljSpread.setActiveSheetIndex(0);
         let sel = this.projectGljSheet.getSelections()[0];
         let oldData = sel.row<this.projectGljSheetData.length?this.projectGljSheetData[sel.row]:"";
@@ -674,10 +675,12 @@ projectGljObject={
         }
         this.projectGljSheetData = projectGljSheetData;
         this.projectGljSheet.setRowCount(this.projectGljSheetData.length);
-        sheetCommonObj.showData(this.projectGljSheet, this.projectGljSetting,this.projectGljSheetData);
-        //this.projectGljSheet.setRowCount(this.projectGljSheetData.length);
-        sel.row = oldData?_.findIndex(this.projectGljSheetData,{'id':oldData.id}):0;
-        this.projectGljSheet.setSelection(sel.row==-1?0:sel.row,sel.col,sel.rowCount,sel.colCount);
+        sheetCommonObj.showData(this.projectGljSheet, this.projectGljSetting,this.projectGljSheetData,null,function(){
+          //this.projectGljSheet.setRowCount(this.projectGljSheetData.length);
+          sel.row = oldData?_.findIndex(me.projectGljSheetData,{'id':oldData.id}):0;
+          me.projectGljSheet.setSelection(sel.row==-1?0:sel.row,sel.col,sel.rowCount,sel.colCount);
+        });
+        
     },
     showMaterialTreeData:function () {
         this.projectGljSpread.setActiveSheetIndex(1);
@@ -692,22 +695,24 @@ projectGljObject={
         this.materialTreeSheet.setSelection(sel.row==-1?0:sel.row,sel.col,sel.rowCount,sel.colCount);
         this.materialTreeController.setTreeSelected(this.materialTree.items[sel.row==-1?0:sel.row]);
     },
-    refreshDataSheet:function () {
+    refreshDataSheet:function (refresh) {//refresh = true 的时候不用更新表头信息
         let me = projectGljObject;
         if(!me.projectGljSpread)  return;
-        let quantityCol = _.findIndex(me.projectGljSetting.header,function (header) {
+        if(!refresh){
+          let quantityCol = _.findIndex(me.projectGljSetting.header,function (header) {
             return header.dataCode ==  'quantity'|| header.dataCode == 'techQuantity' || header.dataCode =='subdivisionQuantity';
-        });
-        if(me.displayType == filterType.FBFX){//分部分项人材机,将“总消耗量”替换显示为“分部分项总消耗量”。
-            me.projectGljSetting.header[quantityCol].dataCode = 'subdivisionQuantity';
-            if(me.projectGljSheet) me.projectGljSheet.setValue(0, quantityCol, "分部分项总消耗量", GC.Spread.Sheets.SheetArea.colHeader);
-        }else if(me.displayType == filterType.TECH) {//措施项目人材机,将“总消耗量”替换显示为“措施项目总消耗量”。
-            me.projectGljSetting.header[quantityCol].dataCode = 'techQuantity';
-            if(me.projectGljSheet) me.projectGljSheet.setValue(0, quantityCol, "措施项目总消耗量", GC.Spread.Sheets.SheetArea.colHeader);
-        }else {
-            me.projectGljSetting.header[quantityCol].dataCode = 'quantity';
-            if(me.projectGljSheet) me.projectGljSheet.setValue(0, quantityCol, "总消耗量", GC.Spread.Sheets.SheetArea.colHeader);
-        }
+          });
+          if(me.displayType == filterType.FBFX){//分部分项人材机,将“总消耗量”替换显示为“分部分项总消耗量”。
+              me.projectGljSetting.header[quantityCol].dataCode = 'subdivisionQuantity';
+              if(me.projectGljSheet) me.projectGljSheet.setValue(0, quantityCol, "分部分项总消耗量", GC.Spread.Sheets.SheetArea.colHeader);
+          }else if(me.displayType == filterType.TECH) {//措施项目人材机,将“总消耗量”替换显示为“措施项目总消耗量”。
+              me.projectGljSetting.header[quantityCol].dataCode = 'techQuantity';
+              if(me.projectGljSheet) me.projectGljSheet.setValue(0, quantityCol, "措施项目总消耗量", GC.Spread.Sheets.SheetArea.colHeader);
+          }else {
+              me.projectGljSetting.header[quantityCol].dataCode = 'quantity';
+              if(me.projectGljSheet) me.projectGljSheet.setValue(0, quantityCol, "总消耗量", GC.Spread.Sheets.SheetArea.colHeader);
+          }
+        } 
         if(me.displayType == filterType.SCHZ){//三材汇总树节点
             me.showMaterialTreeData();
         }else {

+ 25 - 1
web/over_write/js/hunan_2020.js

@@ -406,10 +406,34 @@ if (typeof baseFigureTemplate !== 'undefined') {
 
 if (typeof projectObj !== 'undefined') {
   projectObj.isInsertEquipmentVisable = function (selected) {
-      return true;   //湖南不管是预算或者工程量清单,都显示   
+    if(projectObj.project.property.valuationType =='bill' ){//预算项目中,右键“插入设备”,仅在第一部分中显示。
+      return projectObj.project.Bills.isConstructionInstall(selected); 
+    }
+    return true;   //湖南不管是预算或者工程量清单,都显示   
+  }
+}
+
+//湖南工地转移费率值修改特殊处理
+if (typeof feeRateObject !== 'undefined') {
+  feeRateObject.feeRateSpecialHandle = function (subRate, value) {
+      let result = {};
+      if (subRate.name == "工地转移(km)" && value && value < 50) {//工地转移50km以内按50km算
+          result.valueKey = "50";
+          result.value = scMathUtil.roundForObj(value, getDecimal("feeRate"));//设置显示的节点值
+      }
+      return result;
   }
 }
 
+if (typeof electrovalenceObj !== 'undefined') {
+  electrovalenceObj.options = [
+      { code: "3005003",name:"电网电",specs:"",unit:"kW·h",type:"201"},
+      { code: "8017001", name: "15kW以内柴油发电机组", specs: "12GF1", unit: "台班", type: "301" },
+      { code: "8017002", name: "30kW以内柴油发电机组", specs: "30GFY-2", unit: "台班", type: "301" },
+      { code: "8017003", name: "50kW以内柴油发电机组", specs: "50GFY-2", unit: "台班", type: "301" }
+  ]
+}
+
 // CommonJS module
 if (typeof module !== 'undefined' && !module.nodeType) { // 防止module是前端的一个html标签
     module.exports = {