luolei před 4 roky
rodič
revize
ae794293b5
1 změnil soubory, kde provedl 3 přidání a 3 odebrání
  1. 3 3
      src/store/actions/diagnosticList.js

+ 3 - 3
src/store/actions/diagnosticList.js

@@ -29,7 +29,7 @@ export const addDiagnostic = (state, action) => {
         }
         }
     }
     }
     if(num == tmpLis.length){
     if(num == tmpLis.length){
-        tmpLis[0].hasTreat = 1
+        tmpLis[0]['hasTreat'] = 1
         let obj = {
         let obj = {
             "dateValue": '',
             "dateValue": '',
             "name": tmpLis[0].name,
             "name": tmpLis[0].name,
@@ -50,8 +50,8 @@ export const delDiagnostic = (state, action) => {
             ++num
             ++num
         }
         }
     }
     }
-    if(num == tmpLis.length){
-        tmpLis[0].hasTreat = 1
+    if(tmpLis.length>0&&num == tmpLis.length){
+        tmpLis[0]['hasTreat'] = 1
         let obj = {
         let obj = {
             "dateValue": '',
             "dateValue": '',
             "name": tmpLis[0].name,
             "name": tmpLis[0].name,