瀏覽代碼

删除诊断bug

luolei 4 年之前
父節點
當前提交
ae794293b5
共有 1 個文件被更改,包括 3 次插入3 次删除
  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){
-        tmpLis[0].hasTreat = 1
+        tmpLis[0]['hasTreat'] = 1
         let obj = {
             "dateValue": '',
             "name": tmpLis[0].name,
@@ -50,8 +50,8 @@ export const delDiagnostic = (state, action) => {
             ++num
         }
     }
-    if(num == tmpLis.length){
-        tmpLis[0].hasTreat = 1
+    if(tmpLis.length>0&&num == tmpLis.length){
+        tmpLis[0]['hasTreat'] = 1
         let obj = {
             "dateValue": '',
             "name": tmpLis[0].name,