Pārlūkot izejas kodu

部分组成物不显示问题

zhangweicheng 4 gadi atpakaļ
vecāks
revīzija
a2f3d0f469
1 mainītis faili ar 8 papildinājumiem un 2 dzēšanām
  1. 8 2
      public/web/gljUtil.js

+ 8 - 2
public/web/gljUtil.js

@@ -401,7 +401,7 @@ let gljUtil = {
         'ID': glj.adjCoe
       });
       let coe = labour && labour.coe ? labour.coe : 1;
-      return scMathUtil.roundTo(parseFloat(coe * scMathUtil.roundForObj(glj.unit_price.base_price, decimal)), -decimal);
+      return scMathUtil.roundForObj(coe * scMathUtil.roundForObj(glj.unit_price.base_price, decimal), decimal);
     } else if (this.notEditType.indexOf(glj.unit_price.type) != -1 && glj.ratio_data.length > 0) { //对于混凝土、配合比、砂浆、机械台班,调整价根据组成物计算得出。
       let p = 0;
       for (let ratio of glj.ratio_data) {
@@ -444,12 +444,18 @@ let gljUtil = {
   isDef: function (v) {
     return v !== undefined && v !== null;
   },
+
+  nullString(key){
+    return (key === undefined || key === null || key === '') ? 'null' : key
+  },
+
+
   getIndex(obj, pops) {
     let t_index = '';
     let k_arr = [];
     if(!pops) pops = this.gljKeyArray;
     if(pops.length === 5){
-        return `${obj[pops[0]]}|-|${obj[pops[1]]}|-|${obj[pops[2]]}|-|${obj[pops[3]]}|-|${obj[pops[4]]}`
+        return `${this.nullString(obj[pops[0]])}|-|${this.nullString(obj[pops[1]])}|-|${this.nullString(obj[pops[2]])}|-|${this.nullString(obj[pops[3]])}|-|${this.nullString(obj[pops[4]])}`
     }else{
         for (let p of pops) {
             let tmpK = (obj[p] == undefined || obj[p] == null || obj[p] == '') ? 'null' : obj[p];