Преглед на файлове

解决国贸对于空化学成分的数据,不能添加的问题

QuietShadow преди 3 години
родител
ревизия
cab5ef1db7
променени са 1 файла, в които са добавени 9 реда и са изтрити 1 реда
  1. 9 1
      src/views/energyPlan/components/supplyAndDemand/planProjectCBD.vue

+ 9 - 1
src/views/energyPlan/components/supplyAndDemand/planProjectCBD.vue

@@ -1536,8 +1536,10 @@ export default {
         gethxcfDate1 (row) {
           let that = this;
           let arr = [];
+          try{
           that.gridDataLoading = true;
-          for (let i = 0; i < row.dataByGmid.length; i++) {
+          if(row.dataByGmid) {
+            for (let i = 0; i < row.dataByGmid.length; i++) {
               let item = row.dataByGmid[i];
               arr.push({
                   seq: i,
@@ -1546,9 +1548,15 @@ export default {
                   nkstdmin: item.nkStdMin,
                   nkstdmax: item.nkStdMax
               })
+            }
           }
           that.gridData = arr;
           that.gridDataLoading = false;
+          }catch(e){
+            that.gridData = arr;
+            //TODO handle the exception
+            that.gridDataLoading = false;
+          }
         },
          gethxcfDate (row) {
          let that = this;