Parcourir la source

造价书和费用汇总两个地方的计算基数没统一,造价书缺少定额价主材费、定额价设备费,计算不了

chenshilong il y a 4 ans
Parent
commit
be27a7a425

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

@@ -1578,7 +1578,9 @@ let executeObj = {
     }
 };
 
-let budgetFields = ['rationLabour', 'rationMaterial', 'rationMachine', 'marketMainMaterial', 'marketEquipment', 'common'];
+// 概算版本,定额计算不走计算程序,只用以下五大项简单的相加
+let budgetFields = ['rationLabour', 'rationMaterial', 'rationMachine', 'rationMainMaterial', 'rationEquipment', 'common'];
+let budgetBaseNames = ['定额人工费', '定额材料费', '定额施工机具使用费', '定额主材费', '定额设备费'];
 
 class CalcProgram {
     constructor(project){
@@ -2026,16 +2028,16 @@ class CalcProgram {
 
       calcTools.initFees(treeNode);
       // 只有人、材、机、主、设。
-      let funcNames = ['定额人工费','定额材料费','定额施工机具使用费','市场价主材费','市场价设备费'];
+
       let sum = 0;
       for (let i = 0; i < 5; i++) {
-        if (!rationCalcBases[funcNames[i]]){
+        if (!rationCalcBases[budgetBaseNames[i]]){
           hintBox.infoBox('错误提示', `定额基数${hintBox.font('[' +funcNames[i] + ']')}未定义!`, 1);
           return;
         }
         let obj = {};
         obj.fieldName = budgetFields[i];
-        obj.unitFee = (rationCalcBases[funcNames[i]](treeNode)).toDecimal(decimalObj.decimal('unitPrice', treeNode));
+        obj.unitFee = (rationCalcBases[budgetBaseNames[i]](treeNode)).toDecimal(decimalObj.decimal('unitPrice', treeNode));
         obj.totalFee = (obj.unitFee * nQ).toDecimal(decimalObj.decimal('totalPrice', treeNode));
         obj.tenderUnitFee = obj.unitFee;
         obj.tenderTotalFee = obj.totalFee;

+ 6 - 0
web/over_write/js/chongqing_2018.js

@@ -83,6 +83,12 @@ function overwriteRationCalcBases (taxType){
         rationCalcBases['定额施工机具使用费'] = function (node, isTender) {
             return calcTools.rationBaseFee(node, [gljType.GENERAL_MACHINE, gljType.INSTRUMENT, gljType.OTHER_MACHINE_USED], priceTypes.ptBasePrice, isTender);
         };
+        rationCalcBases['定额主材费'] = function (node, isTender) {
+            return calcTools.rationBaseFee(node, [gljType.MAIN_MATERIAL], 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.MAIN_MATERIAL], priceTypes.ptMarketPrice, isTender);
         };