浏览代码

保存数据加伴随

luolei 5 年之前
父节点
当前提交
93cf674e73
共有 2 个文件被更改,包括 10 次插入8 次删除
  1. 2 5
      src/components/PathInfo.vue
  2. 8 3
      src/components/Preview.vue

+ 2 - 5
src/components/PathInfo.vue

@@ -131,12 +131,9 @@
       },
       getSysConfig(){
         let query = this.$route.query
-        let hasQuery = JSON.stringify(query) == '{}',code = ''
-        if(!hasQuery){
-          code = query.sonHospitalCode?query.sonHospitalCode:query.hospitalCode||''
-        }
+        let hasQuery = JSON.stringify(query) == '{}';
         const param = {
-          'hospitalCode':code,
+          'hospitalCode':!hasQuery&&query.hospitalCode||'',
         }
         api.getSysConfig(param).then((res)=>{
           const result = res.data;

+ 8 - 3
src/components/Preview.vue

@@ -292,15 +292,20 @@ export default {
     },
     saveAllDate() {
       const {pathInfo,symptom,diagnose,others,addContent} = this
+      let tmpSymptom = JSON.parse(JSON.stringify(symptom))
       let detailList = [{type:1},{type:2},{type:3},{type:4}]
       for(let i = 0;i < detailList.length;i++){
         if(i == 0){
-          detailList[0]=this.getDetailText(symptom.choose,1)
+          detailList[0]=this.getDetailText(tmpSymptom.choose,1)
         }else if(i == 1){
           let tmpArr = []
           let tmpStr = this.getDetailText(diagnose.text,2).content
-          for(let j = 0;j < symptom.text.length;j++){
-            tmpArr.push(symptom.text[j].text)
+          for(let j = 0;j < tmpSymptom.text.length;j++){
+            if(j == 1){
+              let tmpTxt = '伴'+tmpSymptom.text[1].text
+              tmpSymptom.text[1].text = tmpTxt
+            }
+            tmpArr.push(tmpSymptom.text[j].text)
           }
           tmpStr.length>0?tmpArr.push(tmpStr):null
           detailList[1].content=tmpArr.join()