chenshilong 7 years ago
parent
commit
ecae8fcb51

+ 13 - 1
web/building_saas/main/js/models/calc_program.js

@@ -601,6 +601,18 @@ class CalcProgram {
         return me.isLeafBill(treeNode) && (treeNode.children.length ===0) && (!treeNode.data.calcBase);
     };
 
+    isRation(treeNode){
+        return treeNode.sourceType === ModuleNames.ration && treeNode.data.type === rationType.ration;
+    };
+
+    isVolumePrice(treeNode){
+        return treeNode.sourceType === ModuleNames.ration && treeNode.data.type === rationType.volumePrice;
+    };
+
+    isGljRation(treeNode){
+        return treeNode.sourceType === ModuleNames.ration && treeNode.data.type === rationType.gljRation;
+    };
+
     initFeeField(treeNode, fieldName){
         if (!treeNode.data.fees) {
             treeNode.data.fees = [];
@@ -915,7 +927,7 @@ class CalcProgram {
                     feeRate: node.data.feeRate,
                     feeRateID: node.data.feeRateID
                 };
-                if(node.sourceType==ModuleNames.ration&&node.data.type==rationType.gljRation){//定额类型的工料机做特殊处理
+                if(node.sourceType==ModuleNames.ration && node.data.type==rationType.gljRation){//定额类型的工料机做特殊处理
                     data.code=node.data.code;
                     data.projectGLJID = node.data.projectGLJID;
                     delete data.marketUnitFee;

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

@@ -59,7 +59,7 @@ let labourCoeView = {
         let value = args.newValue;
         let oValue = args.oldValue;
         if (number_util.isNumber(value)) {
-            value = value.toDecimal(3);
+            value = value.toDecimal(2);
             me.sheet.suspendEvent();
             cell.value(value);
             me.sheet.resumeEvent();

+ 8 - 7
web/building_saas/main/js/views/project_view.js

@@ -271,7 +271,7 @@ var projectObj = {
         }if(node.sourceType==ModuleNames.ration&&node.data.type==rationType.gljRation){
             gljOprObj.updateRationTypeGLJ(value,node,fieldName);
         } else if (value !== calcFees.getFee(node.data, fieldName)) {
-            if (fieldName === 'code') {
+            if (fieldName === 'code' && !project.calcProgram.isVolumePrice(node)) {
                 projectObj.updateCode(node, value);
             }
             else if(fieldName ==='feeRate'){
@@ -807,20 +807,21 @@ $('#property_ok').click(function () {
         };
     };
 
-    console.log(mixDatas);
-    // return;   // for test.
+    // for test.
+/*    console.log(mixDatas);
+    return; */
     function hasMixData() {
         return Object.keys(mixDatas.properties).length > 0 ||
             mixDatas.labourCoes.updateData || mixDatas.rations.length > 0 || mixDatas.bills.length > 0;
     }
 
-/*    if(hasMixData()){
+    if(hasMixData()){
         CommonAjax.post('/pm/api/updateMixDatas', {user_id: userID, mixDataArr: mixDatas}, function (rstData) {
-/!*            if (changedNodes.length > 0) {
+/*            if (changedNodes.length > 0) {
                 for (let node of changedNodes){delete node.changed};
             };
-            if (mixDatas.labourCoes.updateData) labourCoeView.refresh();*!/
+            if (mixDatas.labourCoes.updateData) labourCoeView.refresh();*/
             window.location.href = '/main?project=' + projectID;
         });
-    }*/
+    }
 });