Browse Source

症状带尾巴标签组添加时没有明细保存传了6个空数据处理

luolei 5 years ago
parent
commit
a6ddf29d19
1 changed files with 8 additions and 6 deletions
  1. 8 6
      src/api/utils.js

+ 8 - 6
src/api/utils.js

@@ -138,14 +138,16 @@ export default {
         mapping.formPosition = 0;
         mapping.exclusionType = 0;
         mapping.symptomType = dataArr[i].symptomType
-        if(dataArr[i].type === 'input') {
-          if(dataArr[i].text) { //过滤掉输入框未输入内容项
-            mapping.text = dataArr[i].text
+        if(dataArr[i].type){
+          if(dataArr[i].type === 'input') {
+            if(dataArr[i].text) { //过滤掉输入框未输入内容项
+              mapping.text = dataArr[i].text
+              tmpArr.push(mapping)
+            }
+          } else {
+            mapping.sonQuestion = dataArr[i].id
             tmpArr.push(mapping)
           }
-        } else {
-          mapping.sonQuestion = dataArr[i].id
-          tmpArr.push(mapping)
         }
       } else if(type == 11) {    //推送症状类型(添加症状)
         mapping.formPosition = 0;