Ver código fonte

Merge branch '1.0.0_online' of http://192.168.1.41:3000/SmartCost/ConstructionOperation into 1.0.0_online

TonyKang 6 anos atrás
pai
commit
006291168a

+ 14 - 5
modules/ration_repository/models/ration_item.js

@@ -494,13 +494,21 @@ rationItemDAO.prototype.updateRationBasePrc = function (basePrcArr, overWriteUrl
                                     }
                                     if(theGlj)
                                     if(theGlj.ID === adjGljId){
-                                        gljArr.push({gljId: theGlj.ID, basePrice: adjBasePrice, gljParentType: gljParentType});
+                                        gljArr.push({gljId: theGlj.ID, basePrice: adjBasePrice, gljParentType: gljParentType, unit: theGlj.unit});
                                     } else {
                                         if(theGlj.priceProperty && Object.keys(theGlj.priceProperty).length > 0){
                                             let priceKeys = Object.keys(theGlj.priceProperty);
-                                            gljArr.push({gljId: theGlj.ID, basePrice: parseFloat(theGlj.priceProperty[priceKeys[0]]), gljParentType: gljParentType});
+                                            gljArr.push({
+                                                gljId: theGlj.ID,
+                                                basePrice: parseFloat(theGlj.priceProperty[priceKeys[0]]),
+                                                gljParentType: gljParentType,
+                                                unit: theGlj.unit});
                                         } else {
-                                            gljArr.push({gljId: theGlj.ID, basePrice: parseFloat(theGlj.basePrice), gljParentType: gljParentType});
+                                            gljArr.push({
+                                                gljId: theGlj.ID,
+                                                basePrice: parseFloat(theGlj.basePrice),
+                                                gljParentType: gljParentType,
+                                                unit: theGlj.unit});
                                         }
                                     }
                                 }
@@ -729,10 +737,11 @@ rationItemDAO.prototype.calcForRation = function (stdGljList, ration, overWriteU
                 gljId: glj.ID,
                 basePrice: parseFloat(glj.priceProperty[priceKeys[0]]),
                 consumeAmt: rationGlj.consumeAmt,
-                gljParentType: gljPType
+                gljParentType: gljPType,
+                unit: glj.unit
             });
         } else {
-            gljArr.push({gljId: glj.ID, basePrice: parseFloat(glj.basePrice), consumeAmt: rationGlj.consumeAmt, gljParentType: gljPType});
+            gljArr.push({gljId: glj.ID, basePrice: parseFloat(glj.basePrice), consumeAmt: rationGlj.consumeAmt, gljParentType: gljPType, unit: glj.unit});
         }
         let updatePrc = null;
         let overWriteCalc = false;  //需要重写算法

+ 2 - 2
web/maintain/ration_repository/js/installation.js

@@ -473,7 +473,7 @@ let sectionObj = {
     },
     onSelectionChanged: function (sender, info) {
         let me = sectionObj;
-        if(info.oldSelections.length === 0 && info.newSelections.length > 0 || info.oldSelections[0].row !== info.newSelections[0].row){
+        if(info.oldSelections && info.oldSelections.length === 0 && info.newSelections.length > 0 || info.oldSelections[0].row !== info.newSelections[0].row){
             let row = info.newSelections[0].row;
             let section = me.cache[row];
             me.initSelection(section);
@@ -784,7 +784,7 @@ let feeRuleObj = {
     },
     onSelectionChanged: function (sender, info) {
         let me = feeRuleObj, se = sectionObj;
-        if(info.oldSelections.length === 0 && info.newSelections.length > 0 || info.oldSelections[0].row !== info.newSelections[0].row){
+        if(info.oldSelections && info.oldSelections.length === 0 && info.newSelections.length > 0 || info.oldSelections[0].row !== info.newSelections[0].row){
             if(me.isDef(me.updateObj) && !me.validRCJ(me.updateObj)){
                 $('#rcjAlert').modal('show');
                 $('#aleCanceBtn').bind('click', function () {

+ 30 - 0
web/over_write/js/guangdong_2018.js

@@ -0,0 +1,30 @@
+'use strict';
+//允许使用的工料机类型:人工、普通材料、混凝土、砂浆、配合比、商品混凝土、商品砂浆
+//机械台班、机上人工、机械组成物、主材、设备、企业管理费
+if(typeof allowGljType !== 'undefined'){
+    allowGljType = [1, 201, 202, 203, 204, 205, 206, 301, 302, 303, 4,5, 6];
+}
+if(typeof allowComponent !== 'undefined'){
+    //允许含有组成物的工料机类型:混凝土、砂浆、配合比、机械台班、主材
+    allowComponent = [202, 203, 204, 301, 4];
+}
+if(typeof componentType !== 'undefined'){
+    //可以作为组成物的工料机类型:普通材料、机械组成物、机上人工、主材
+    componentType = [201, 302, 303, 4];
+}
+if(typeof machineAllowComponent !== 'undefined'){
+    //允许含有组成物的机械工料机类型:机械台班器仪表
+    machineAllowComponent = [301];
+}
+if(typeof machineComponent !== 'undefined'){
+    //可以作为机械工料机组成物的工料机类型:机械组成物、机上人工
+    machineComponent = [302, 303];
+}
+if(typeof materialAllowComponent !== 'undefined'){
+    //允许含有组成物的材料工料机类型:混凝土、砂浆、配合比
+    materialAllowComponent = [202, 203, 204];
+}
+if(typeof materialComponent !== 'undefined'){
+    //可以作为材料工料机组成物的工料机类型:普通材料
+    materialComponent = [201];
+}

+ 15 - 8
web/over_write/js/neimenggu_2017.js

@@ -36,7 +36,7 @@ if(typeof materialComponent !== 'undefined'){
     //可以作为材料工料机组成物的工料机类型:普通材料
     materialComponent = [201];
 }
-//覆盖前端基价计算
+//覆盖前端定额基价计算
 //基价=人工费+材料费+机械费+管理费利润
 //管理费利润=Round(人工费*(管理费消耗量+利润消耗量)%,2) 注:书中管理费、利润的单位都是“%”
 if (typeof rationGLJOprObj !== 'undefined' && typeof rationGLJOprObj.rationCal !== 'undefined') {
@@ -50,12 +50,14 @@ if (typeof rationGLJOprObj !== 'undefined' && typeof rationGLJOprObj.rationCal !
             let cacheArr = me.cache['_GLJ_' + me.currentRationItem.ID];
             cacheArr.forEach(function (gljData) {
                 if(gljData.gljType && gljData.basePrice && gljData.consumeAmt){
-                    let parent = me.distTypeTree.distTypes[me.distTypeTree.prefix + gljData.gljType].parent;
-                    if(parent && parent.data.ID <= 3){
-                        price['gljType' + parent.data.ID].push(scMathUtil.roundTo(gljData.basePrice * gljData.consumeAmt, -3));//取三位
-                    }
-                    if(!parent && gljData.gljType <= 3){
-                        price['gljType' + gljData.gljType].push(scMathUtil.roundTo(gljData.basePrice * gljData.consumeAmt, -3));//取三位
+                    let parentGLJType = parseInt(String(gljData.gljType)[0]);
+                    if (parentGLJType <= 3) { // 人工、材料、机械
+                        // 单位为%,单条基价计算为定额价*消耗量*0.01
+                        if (gljData.unit === '%') {
+                            price['gljType' + parentGLJType].push(scMathUtil.roundTo(gljData.basePrice * gljData.consumeAmt * 0.01, -3));//取三位
+                        } else {
+                            price['gljType' + parentGLJType].push(scMathUtil.roundTo(gljData.basePrice * gljData.consumeAmt, -3));//取三位
+                        }
                     }
                     if([6, 7].includes(gljData.gljType)){
                         manageProfitConsume = scMathUtil.roundTo(manageProfitConsume + gljData.consumeAmt, -6);
@@ -100,6 +102,7 @@ if (typeof rationGLJOprObj !== 'undefined' && typeof rationGLJOprObj.rationCal !
 
 if (typeof module !== 'undefined') {
     module.exports = {
+        // 计算定额基价
         calcRation: function (gljArr, scMathUtil) {
             let labourPrc = [],
                 materialPrc = [],
@@ -109,7 +112,11 @@ if (typeof module !== 'undefined') {
                 updatePrc = {labourPrice: 0, materialPrice: 0, machinePrice: 0, manageProfitPrice: 0, basePrice: 0};
             gljArr.forEach(function (gljItem) {
                 if(gljItem.gljParentType !== -1){
-                    singlePrc = scMathUtil.roundTo(gljItem.basePrice * gljItem.consumeAmt, -3);
+                    if (gljItem.gljParentType <= 3 && gljItem.unit === '%') {
+                        singlePrc = scMathUtil.roundTo(gljItem.basePrice * gljItem.consumeAmt * 0.01, -3);
+                    } else {
+                        singlePrc = scMathUtil.roundTo(gljItem.basePrice * gljItem.consumeAmt, -3);
+                    }
                     if(gljItem.gljParentType === 1){
                         labourPrc.push(singlePrc);
                     } else if(gljItem.gljParentType ===2){

+ 1 - 1
web/users/js/compilation.js

@@ -859,7 +859,7 @@ function confirmUpdate(selector,engineerID) {
     let oldValue = inputDiv.prev("div").find("span").text();
     let newValue = input.val();
     let key = input.attr("name");
-    if(newValue == "" || newValue==oldValue || !engineerID){
+    if(newValue==oldValue || !engineerID){//不做非空判断
         inputDiv.prev("div").show();
         inputDiv.hide();
         return;