Przeglądaj źródła

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/YangHuCost

vian 5 lat temu
rodzic
commit
f111f139b5

+ 9 - 7
modules/reports/rpt_component/helper/jpc_helper_common_output.js

@@ -1,5 +1,6 @@
 let JV = require('../jpc_value_define');
 let JpcFieldHelper = require('./jpc_helper_field');
+const OFFSET_FLOAT = 0.0000000001;
 
 let JpcCommonOutputHelper = {
     createCommonOutputWithoutDecorate: function (node, value, forceCombine) {
@@ -43,13 +44,14 @@ let JpcCommonOutputHelper = {
         }
         return rst;
     },
-    formatCell: function (formatStr, rstCell) {
+    formatCell: function(formatStr, rstCell) {
         if (formatStr) {
-            if (!(isNaN(parseFloat(rstCell[JV.PROP_VALUE])))) {
-                let dotIdx = formatStr.indexOf(".");
+            const rstCellFloatVal = parseFloat(rstCell[JV.PROP_VALUE]);
+            if (!(isNaN(rstCellFloatVal))) {
+                const dotIdx = formatStr.indexOf('.');
                 if (dotIdx >= 0) {
-                    let tmpStr = parseFloat(rstCell[JV.PROP_VALUE]).toFixed(formatStr.length - dotIdx - 1);
-                    let digStr = formatStr.substr(dotIdx + 1, formatStr.length - dotIdx);
+                    let tmpStr = (rstCellFloatVal + OFFSET_FLOAT).toFixed(formatStr.length - dotIdx - 1);
+                    const digStr = formatStr.substr(dotIdx + 1, formatStr.length - dotIdx);
                     for (let sIdx = digStr.length - 1; sIdx >= 0; sIdx--) {
                         if (digStr[sIdx] === '#') {
                             if (tmpStr.length > 0 && tmpStr[tmpStr.length - 1] === '0') {
@@ -64,9 +66,9 @@ let JpcCommonOutputHelper = {
                     if (tmpStr[tmpStr.length - 1] === '.') tmpStr = tmpStr.substr(0, tmpStr.length - 1);
                     rstCell[JV.PROP_VALUE] = tmpStr;
                 } else {
-                    rstCell[JV.PROP_VALUE] = parseFloat(rstCell[JV.PROP_VALUE]).toFixed(0);
+                    rstCell[JV.PROP_VALUE] = (rstCellFloatVal + OFFSET_FLOAT).toFixed(0);
                 }
-                let commaIdx = formatStr.indexOf(",");
+                const commaIdx = formatStr.indexOf(',');
                 if (commaIdx >= 0) {
                     rstCell[JV.PROP_VALUE] = comdify(rstCell[JV.PROP_VALUE].toString());
                 }

+ 5 - 3
modules/reports/rpt_component/jpc_rte.js

@@ -1,10 +1,12 @@
 /**
  * Created by Tony on 2016/12/28.
  */
-let strUtil = require('../../../public/stringUtil');
-let JV = require('./jpc_value_define');
-let JE = {
+const strUtil = require('../../../public/stringUtil');
+const scMathUtil = require('../../../public/scMathUtil').getUtil();
+const JV = require('./jpc_value_define');
+const JE = {
     $STR_UTIL: strUtil,
+    $SC_MATH_UTIL: scMathUtil,
     F: function(fID, $CURRENT_RPT) {
         let rst = null;
         if ($CURRENT_RPT && ($CURRENT_RPT.fields[JV.NODE_DETAIL_FIELDS][JV.PROP_ID + "_" + fID])) {

+ 2 - 1
test/unit/reports/test_rpt_test_template.js

@@ -73,6 +73,7 @@ let userId_Leng = "5c3ffa9aa0a92732f41216e0"; //小冷User Id (养护的)
 // demoPrjId = 618; //PROD:
 // demoPrjId = 2580; //PROD:
 // demoPrjId = 815; //PROD:
+// demoPrjId = 20690;
 demoPrjId = 21767;
 // demoPrjId = 738; //UAT:
 // demoPrjId = 670; //UAT: 清单项目
@@ -117,7 +118,7 @@ test('测试 - 测试模板啦: ', function (t) {
                 try {
                     let dt = new Date();
                     console.log('取完项目数据时间:' + (dt));
-                    // fsUtil.writeObjToFile(rawDataObj, "D:/GitHome/YangHuCost/tmp/rptTplRawDataObject_测试模板.jsp");
+                    fsUtil.writeObjToFile(rawDataObj, "D:/GitHome/YangHuCost/tmp/rptTplRawDataObject_测试模板.jsp");
                     let tplData = rptDataUtil.assembleData(rawDataObj);
                     // fsUtil.writeObjToFile(rawDataObj, "D:/GitHome/YangHuCost/tmp/rptTplRawDataAfterCacl_测试模板.jsp");
                     // fsUtil.writeObjToFile(tplData, "D:/GitHome/YangHuCost/tmp/rptTplAssembledData_测试模板.jsp");

+ 1 - 1
web/building_saas/main/js/views/electrovalence_view.js

@@ -113,7 +113,7 @@ let electrovalenceObj = {
             let et = scMathUtil.roundForObj(d.electPrice * d.coe,getDecimal("process"));
             total = scMathUtil.roundForObj(et + total,getDecimal("process"));
         }
-        this.total = scMathUtil.roundForObj(total,getDecimal("glj.unitPrice"));
+        this.total = scMathUtil.roundForObj(total,getDecimal("glj.unitPriceHasMix"));
         $("#electrovalenceLabel").text(`综合电价:${this.total}`);
         return this.total;
     },

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

@@ -723,6 +723,14 @@ var gljOprObj = {
                         let mixRatios = this.getMixRationShowDatas(mixRatioMap[connect_index], projectGljs);
                         ration_gljs[i].subList = mixRatios;
                     }
+                    if(needRatio == false){//不需要组成物的情况,目前应该是复制整块那里用到,这里加上毛重系数等信息,一起复制
+                      ration_gljs[i].grossWeightCoe = glj.unit_price.grossWeightCoe;
+                      ration_gljs[i].purchaseStorageRate = glj.unit_price.purchaseStorageRate;
+                      ration_gljs[i].offSiteTransportLossRate = glj.unit_price.offSiteTransportLossRate;
+                      ration_gljs[i].handlingLossRate = glj.unit_price.handlingLossRate
+                    }
+
+                    
                     if(ration) gljOprObj.getTotalQuantity(ration_gljs[i], ration);
                 }else {
                     //计算程序中量价也会放到这里进来,量价是没有对应的项目工料机的

+ 1 - 5
web/building_saas/main/js/views/main_tree_col.js

@@ -262,11 +262,7 @@ let MainTreeCol = {
             return false;
         },
         forUnit:function (node) {
-            if(MainTreeCol.readOnly.bills(node)&&(node.data.type==billType.DXFY||node.data.type==billType.FB)){//在大项费用、分部行,计量单位只读。
-                return true;
-            }else {
-                return calcTools.isRationItem(node);
-            }
+          return calcTools.isRationItem(node);
         },
         forContentCharacter: function (node) {
             return !MainTreeCol.readOnly.bills(node) || (node.data.type !== billType.BILL && node.data.type !== billType.FX);

+ 3 - 1
web/building_saas/main/js/views/material_calc_view.js

@@ -425,7 +425,9 @@ materialCalcObj = {
                 return me.showDatas();
             }
             if(dataCode != 'supplyLocation'){
-                value = value?scMathUtil.roundForObj(value,getDecimal("glj.unitPrice"))+'':'0'//4舍五入加默认为0
+               let decimal = getDecimal("glj.unitPrice");
+               if(dataCode == "grossWeightCoe_n")  decimal = 6;
+                value = value?scMathUtil.roundForObj(value,decimal)+'':'0'//4舍五入加默认为0
             }
             if(recode[dataCode] == value) continue;
             doc[dataCode] = value;

+ 19 - 19
web/over_write/js/anhui_2019.js

@@ -20,9 +20,9 @@ function overwriteRationCalcBases() {
     rationCalcBases['施工机械人工费'] = function (node, isTender) {
         return calcTools.machineDetailFee(node, node.data.gljList, [], gljType.MACHINE_LABOUR, isTender);
     };
-    /* rationCalcBases['设备购置费'] = function (node, isTender) {
-         return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptMarketPrice, isTender);
-     };*/
+    rationCalcBases['设备购置费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptMarketPrice, isTender);
+    };
 
     rationCalcBases['定额人工费'] = function (node, isTender) {
         return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptBasePrice, isTender);
@@ -33,18 +33,18 @@ function overwriteRationCalcBases() {
     rationCalcBases['定额施工机械使用费'] = function (node, isTender) {
         return calcTools.rationBaseFee(node, baseMachineTypes, priceTypes.ptBasePrice, isTender);
     };
-    /*    rationCalcBases['定额商品砼费'] = function (node, isTender) {
-            return calcTools.rationBaseFee(node, [gljType.COMMERCIAL_CONCRETE, gljType.COMMERCIAL_MORTAR], priceTypes.ptBasePrice, isTender);
-        };
-        rationCalcBases['定额设备费'] = function (node, isTender) {
-            return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptBasePrice, isTender);
-        };
-        rationCalcBases['定额外购砼构件费'] = function (node, isTender) {
-            return calcTools.rationBaseFee(node, [gljType.PURCHASE_COMPONENT], priceTypes.ptBasePrice, isTender);
-        };
-        rationCalcBases['定额绿化苗木费'] = function (node, isTender) {
-            return calcTools.rationBaseFee(node, [gljType.GREEN_SEEDLING], priceTypes.ptBasePrice, isTender);
-        };*/
+	rationCalcBases['定额商品砼费'] = function (node, isTender) {
+		return calcTools.rationBaseFee(node, [gljType.COMMERCIAL_CONCRETE, gljType.COMMERCIAL_MORTAR], priceTypes.ptBasePrice, isTender);
+	};
+    rationCalcBases['定额设备费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptBasePrice, isTender);
+    };
+    rationCalcBases['定额外购砼构件费'] = function (node, isTender) {
+		return calcTools.rationBaseFee(node, [gljType.PURCHASE_COMPONENT], priceTypes.ptBasePrice, isTender);
+	};
+	rationCalcBases['定额绿化苗木费'] = function (node, isTender) {
+		return calcTools.rationBaseFee(node, [gljType.GREEN_SEEDLING], priceTypes.ptBasePrice, isTender);
+	};
 };
 
 (function overwriteFeeTypes() {
@@ -54,13 +54,13 @@ function overwriteRationCalcBases() {
         { type: 'marketMaterial', name: '材料费' },
         { type: 'marketMachine', name: '施工机械使用费' },
         { type: 'marketMachineLabour', name: '施工机械人工费' },
-        // {type: 'marketEquipment', name: '设备购置费'},
+        {type: 'marketEquipment', name: '设备购置费'},
         { type: 'marketDirect', name: '直接费' },
 
         { type: 'labour', name: '定额人工费' },
         { type: 'material', name: '定额材料费' },
         { type: 'machine', name: '定额施工机械使用费' },
-        // {type: 'equipment', name: '定额设备购置费'},
+        {type: 'equipment', name: '定额设备费'},
         { type: 'direct', name: '定额直接费' },
 
         { type: 'measure', name: '措施费' },
@@ -68,8 +68,8 @@ function overwriteRationCalcBases() {
         { type: 'force', name: '规费' },
         { type: 'profit', name: '利润' },
         { type: 'tax', name: '税金' },
-        { type: 'common', name: '建装工程费' },
-        { type: 'rationCommon', name: '定额建装工程费' }//,
+        { type: 'common', name: '建安费' },
+        { type: 'rationCommon', name: '定额建安费' }//,
         // {type: 'safeProduce', name: '安全生产费'}
     ];
 })();

+ 1 - 1
web/over_write/js/neimeng_2019.js

@@ -4,7 +4,7 @@
 
 let isNM2019 = true;
 
-function overwriteRationCalcBases (){
+function overwriteRationCalcBases() {
     if (typeof rationCalcBases == 'undefined') return;
     for (let key in rationCalcBases) delete rationCalcBases[key];