Browse Source

查体血压类型拼接文本

liucf 5 years ago
parent
commit
8b64ad3eb7
2 changed files with 32 additions and 7 deletions
  1. 31 6
      src/store/actions/checkBody.js
  2. 1 1
      src/utils/tools.js

+ 31 - 6
src/store/actions/checkBody.js

@@ -77,7 +77,8 @@ export function setNumberValue(state,action){
   const param = action.params;
   const ikey = param.ikey;
   let labelInx = getLabelIndex(ikey);
-  const subInx = ikey.substr(ikey.length-1);
+  // const subInx = ikey.substr(ikey.length-1);
+  const subInx = ikey.split("-")[2];
   let item = res.data[labelInx];
   if(+item.tagType===1){
     item.value = param.text;
@@ -89,7 +90,12 @@ export function setNumberValue(state,action){
       if(it.value){     //至少有一个子值才黑显
         hasValue = true;
       }
-      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      if(it.tagType===8){
+        return it.name;
+      }else{
+        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      }
+      
     });
     res.saveText[labelInx] = hasValue?sub.join(''):'';
   }
@@ -140,7 +146,12 @@ export function setRadioValue(state,action){
       if(it.value){     //至少有一个子值才黑显
         hasValue = true;
       }
-      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      if(it.tagType===8){
+        return it.name;
+      }else {
+        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      }
+      
     });
     res.saveText[labelInx] = hasValue?sub.join(''):'';
   }
@@ -172,7 +183,11 @@ export const setRadioInputValue = (state,action)=>{
         if(it.value){     //至少有一个子值才黑显
           hasValue = true;
         }
-        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+        if(it.tagType===8){
+          return it.name;
+        }else {
+          return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+        }
       });
       res.saveText[index] = hasValue?sub.join(''):'';
     }else{
@@ -204,7 +219,12 @@ export const setRadioInputValue = (state,action)=>{
   if(res.data[index].tagType!=1){
     let hasValue = false;
     const sub = res.data[index].questionMapping.map((it)=>{
-      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      if(it.tagType===8){
+        return it.name;
+      }else {
+        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      }
+      
     });
     res.saveText[index] = sub.join('');
   }else {
@@ -434,7 +454,12 @@ export function setInputLabel(state,action){
   if(+item.tagType===3){      //multSpred标签
     item.questionMapping[subIndex].value = text;
     let texts = item.questionMapping.map((it)=>{
-      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      if(it.tagType===8){
+        return it.name;
+      }else{
+        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      }
+      
     });
     res.saveText[i] = texts.join('');
     res.update = Math.random();

+ 1 - 1
src/utils/tools.js

@@ -288,7 +288,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
        // Notify.success('页面已清空')
     }else{
         //回读/引用设置回读模式值(主诉-其他史使用)
-        store.dispatch({type: SET_READ_MODE, readMode: whichSign});
+        store.dispatch({type: SET_READ_MODE, readMode: whichSign});console.log(999,whichSign)
         if (whichSign == 0) {
           let dataJson = JSON.parse(reData.dataJson);
           //其他史data