Browse Source

取消手工综合单价计算模式,全部清空。

chenshilong 7 years ago
parent
commit
73ab00a8d9

+ 8 - 14
web/building_saas/main/js/models/calc_program.js

@@ -507,7 +507,7 @@ let treeNodeTools = {
             return treeNodeCalcType.ctRationCalcProgram;
         }
         else if (this.isNullBill(treeNode)){
-            return treeNodeCalcType.ctCommonUnitFee;
+            return treeNodeCalcType.ctNull;
         }
         else if (this.isLeafBill(treeNode)) {
             if (treeNode.children && treeNode.children.length > 0){
@@ -827,7 +827,6 @@ class CalcProgram {
                 for (let glj of treeNode.data.gljList) {
                     if (eTypes.indexOf(glj.type) >= 0) {
                         if (glj.isEstimate){
-                            'code','name','specs','unit','type'
                             GLJObjs.push({code: glj.code, name: glj.name, specs: glj.specs, unit: glj.unit, type: glj.type,
                                 quantity: glj.quantity, marketPrice: glj.marketPrice});
                         }
@@ -976,22 +975,17 @@ class CalcProgram {
             };
             treeNode.data.calcTemplate = {"calcItems": rst};
         }
-        // 叶子清单的手工综合单价计算
-        else if (treeNode.calcType == treeNodeCalcType.ctCommonUnitFee){
+        // 叶子清单无子结点、无公式计算(啥都没有时)
+        else if (treeNode.calcType == treeNodeCalcType.ctNull){
             delete treeNode.data.gljList;
             if (treeNode.data.calcBase) treeNode.data.calcBase = null;  // 不能直接删除该属性,否则无法冲掉库中已存储的值
             if (treeNode.data.calcBaseValue) treeNode.data.calcBaseValue = null;  // 不能直接删除该属性,否则无法冲掉库中已存储的值
             if (treeNode.data.programID) treeNode.data.programID = null;
-
-            let uf = (treeNode.data.feesIndex && treeNode.data.feesIndex.common && treeNode.data.feesIndex.common.unitFee) ? treeNode.data.feesIndex.common.unitFee : 0;
-            uf = uf.toDecimal(decimalObj.bills.unitPrice);
-            let tuf = (treeNode.data.feesIndex && treeNode.data.feesIndex.common && treeNode.data.feesIndex.common.tenderUnitFee) ? treeNode.data.feesIndex.common.tenderUnitFee : 0;
-            tuf = tuf.toDecimal(decimalObj.bills.unitPrice);
-            let q = treeNode.data.quantity ? treeNode.data.quantity : 0;
-            let tf = (uf * q).toDecimal(decimalObj.bills.totalPrice);
-            let ttf = (tuf * q).toDecimal(decimalObj.bills.totalPrice);
-            deleteUselessFees(treeNode);
-            treeNodeTools.checkFeeField(treeNode, {'fieldName': 'common', 'unitFee': uf, 'totalFee': tf});
+            if (treeNode.data.fees && treeNode.data.fees.length > 0){
+                treeNode.data.fees = null;
+                treeNode.data.feesIndex = null;
+                treeNode.changed = true;
+            }
             treeNode.data.calcTemplate = {"calcItems": []};
         }
         // 叶子清单公式计算

+ 2 - 1
web/building_saas/main/js/models/main_consts.js

@@ -75,7 +75,8 @@ const treeNodeCalcType = {
     ctGatherRationsFees: 3,     // 汇总定额的各个费
     ctGatherBillsFees: 4,       // 汇总清单的各个费
     ctCalcBaseValue: 5,
-    ctCommonUnitFee: 6
+    ctNull: 6
+    // ctCommonUnitFee: 6       // 树结点的手工输入综合单价的方式已废弃,现综合单价只读,引入市场单价。
 };
 
 const calcAllType = {