소스 검색

路由跳转,样式修改

luolei 5 년 전
부모
커밋
474b23e9fe

+ 4 - 5
src/common/CheckBox.vue

@@ -18,7 +18,7 @@
   </div>
 </template>
 <script type="text/javascript">
-import {imageUrlPrefix,patt,concatVal} from '@utils/tools.js';
+import {patt,concatVal} from '@utils/tools.js';
 import icon from '../images/check-default.png';
 import checkIcon from '../images/check.png';
 import MultiLineInput from '../common/MultiLineInput.vue';
@@ -40,7 +40,6 @@ import OptionInp from '../common/OptionInp.vue';
     },
     data(){
       return{
-        imgUrl:imageUrlPrefix,
         defaultPic:icon,
         check:checkIcon,
         datas:{},
@@ -208,12 +207,12 @@ import OptionInp from '../common/OptionInp.vue';
       padding:0 .2rem;
       box-sizing: border-box;
       border-radius: .38rem;
-      border: 1px solid #DFE0E4;
+      background-color: #F1F1F1;
     }
     
     .check{
-      color: #colors[theme];
-      border: 1px solid #colors[theme];
+      color: #fff;
+      background-color: #6678FF;
     }
     .exclu{
       color:#colors[exclu];

+ 0 - 2
src/common/ComTextArea.vue

@@ -86,8 +86,6 @@ export default {
 @import '../less/base.less';
   .comArea {
     .bgques;
-    padding-top: 0;
-    padding-bottom: 0;
     textarea {
       color: #4F50FF;
       resize: none;

+ 5 - 6
src/common/Radio.vue

@@ -11,7 +11,7 @@
 <script type="text/javascript">
 import icon from '../images/radio-default.png';
 import checkIcon from '../images/radio-check.png';
-import {patt,imageUrlPrefix,concatVal} from '@utils/tools.js';
+import {patt,concatVal} from '@utils/tools.js';
 import MultiLineInput from '../common/MultiLineInput.vue';
 import OptionInp from '../common/OptionInp.vue';
   export default{
@@ -33,8 +33,7 @@ import OptionInp from '../common/OptionInp.vue';
       return{
         defaultPic:icon,
         check:checkIcon,
-        datas:{},
-        imgUrl:imageUrlPrefix,
+        datas:{}
       }
     },
     created(){
@@ -146,11 +145,11 @@ import OptionInp from '../common/OptionInp.vue';
         padding:0 .2rem;
         box-sizing: border-box;
         border-radius: .38rem;
-        border: 1px solid #DFE0E4;
+        background-color: #F1F1F1;
       }
       .check{
-        color: #colors[theme];
-        border: 1px solid #colors[theme];
+        color: #fff;
+        background-color: #6678FF;
       }
       .iptCheck {
         color: #colors[theme];

+ 1 - 2
src/common/RadioSelect.vue

@@ -22,7 +22,7 @@
 <script type="text/javascript">
 import icon from '../images/radio-default.png'
 import checkIcon from '../images/radio-check.png'
-import {patt,imageUrlPrefix,concatVal} from '@utils/tools.js'
+import {patt,concatVal} from '@utils/tools.js'
 import SymptomLis from '../common/SymptomLis.vue';
 import Submit from "../common/Submit";
 import $ from 'jquery';
@@ -49,7 +49,6 @@ import $ from 'jquery';
         defaultPic:icon,
         check:checkIcon,
         datas:{},
-        imgUrl:imageUrlPrefix,
         show:false,
         SymptomLis:[],
         flg:'', //是有还是无

+ 19 - 7
src/components/AddContent.vue

@@ -4,7 +4,7 @@
         <div class="choose">
         <ul class="addPart">
           <li v-for="(item,idx) in dataTrd">
-            <p class="question">{{idx+1 + '. ' +(item.description||item.name)}}</p>
+            <p class="question">{{idx+1 + '. ' +(item.description||item.name)}}{{item.controlType==1?'(单选)':item.controlType==2?'(多选)':''}}</p>
             <img class="questionImg" :src="item.url.replace('{imageUrlPrefix}',imgUrl)" v-if="item.url">
             <Radio v-if="item.controlType==1" 
               :item="item"
@@ -56,7 +56,7 @@
     <div class="foot">
       <!-- <span class="back" @click="back">{{'返回'+ preName}}</span> -->
       <span class="back" @click="back">上一步</span>
-      <span class="next" @click="next">预览并提交病历</span>
+      <span class="next" @click="next(4)">预览并提交病历</span>
     </div>
   </div>
 </template>
@@ -66,26 +66,30 @@ import MultiLineInput from '../common/MultiLineInput.vue';
 import Input from '../common/Input.vue';
 import Radio from '../common/Radio.vue';
 import CheckBox from '../common/CheckBox.vue';
-import {imageUrlPrefix,getAllStr,setScroll} from '@utils/tools.js';
+import {imageUrlPrefix,getAllStr,setScroll,getRouteName} from '@utils/tools.js';
 import BScroll from 'better-scroll';
 import PickTime from '../common/PickTime.vue';
 export default {
   name: 'AddContent',
-  props: ['allMoudles','preName'],
   data() {
     return {
       imgUrl:imageUrlPrefix,
       dataTrd: [],
       val: '',
       allStr:'',
-      scroll:null
+      scroll:null,
+      allMoudles:{}
     }
   },
   created(){
+    let activePart = this.$store.state.activeModule;
+    this.allMoudles = activePart.obj.replenish_show
+
     this.dataTrd = this.allMoudles && this.allMoudles.moduleDetailDTOList
     this.allStr = this.$store.state.addContent.txt
   },
   mounted() {
+    this.$store.commit('setFinish',52)
     this.$nextTick(()=>{
       let scroll = setScroll(BScroll,true,'.addper')
       this.scroll = scroll
@@ -98,12 +102,16 @@ export default {
       document.activeElement.scrollIntoViewIfNeeded(true);        
     },
     back() {
-      this.$emit("back");
+      this.$router.go(-1);
     },
     changeAreaVal(value, idx) {
       this.val = value
     },
-    next(){
+    next(flg){
+      let routeName = getRouteName(flg)
+      this.$router.push({
+        path:routeName
+      })
       this.$store.commit('setText',{data:this.dataTrd,type:this.allMoudles&&this.allMoudles.type});
       this.$emit('next','preview')
     },
@@ -181,6 +189,10 @@ export default {
       margin-bottom: 0.2rem;
       font-weight: bold;
     }
+    .comArea {
+      padding-top: 0;
+      padding-bottom: 0;
+    }
   }
 }
   .foot{

+ 90 - 64
src/components/Detail.vue

@@ -2,12 +2,17 @@
   <div class="detail-wrap btscroll">
     <!-- <div v-for="(item,index) in datas"> -->
     <div class="head">
+      <span @click="handleClear" :class="{'check':checkF}"></span>
+      <span class="name">{{(checkDatas.description||checkDatas.name)+'详情'}}</span>
       <span class="icon" @click="close">
         <img src="../images/small-close.png">
       </span>
-      <span class="name">{{(checkDatas.description||checkDatas.name)+'详情'}}</span>
-      <span @click="handleClear" :class="{'check':checkF}">清空</span>
-      <i>{{tips}}</i>
+      <div class="stepWrap">
+        <div class="stepLine">
+          <div class="lineBlue" :style="{width:(current/checkDatas.questionMapping.length)*100+'%'}"></div>
+        </div>
+        <i>进度: {{current}}/{{checkDatas.questionMapping.length}}</i>
+      </div>
     </div>
     <div class="viewPrew">
       <div class="content">
@@ -26,7 +31,7 @@
                 :slide="!!item.slide"
                 :detail="1"
                 @updata="updataData"/>
-          <radioSelect                
+          <radioSelect
                 v-if="item.controlType==8" 
                 :item="item"
                 :slide="!!item.slide"
@@ -97,10 +102,12 @@ import $ from 'jquery';
         showCheckDatas:[],
         imgUrl:imageUrlPrefix,
         age: pathInfo.patientAge,
-        scroll:''
+        // tips:"温馨提示:请完成病情预问诊可让医生提前了解病情",
+        scroll:'',
+        current:0
       }
     },
-    props:['datas','data','checkF','tips','sex','flags'],
+    props:['datas','data','checkF','sex','flags'],
     created(){
       let tmpData = JSON.parse(JSON.stringify(this.datas));
       if(tmpData.questionMapping&&tmpData.questionMapping.length>0){
@@ -132,15 +139,6 @@ import $ from 'jquery';
           }
       })
     },
-    components:{
-      Radio,
-      CheckBox,
-      Input,
-      ComTextArea,
-      MultiLineInput,
-      RadioSelect,
-      PickTime
-    },
     methods:{
       onScroll(data) {
         this.$store.commit('setScroll', data)
@@ -223,8 +221,16 @@ import $ from 'jquery';
               mapping.splice(i,1,data)
             }
           }
-          
         }
+        let num = 0;
+        for(let i = 0;i < mapping.length;i++){
+          let tmpMap = mapping[i];
+            console.log(tmpMap)
+          if(tmpMap.value || tmpMap.valueP){
+            ++num
+          }
+        }
+        this.current = num
         // 实时更新清空样式
         if(data.value){
           this.$emit('check',true)
@@ -326,48 +332,48 @@ import $ from 'jquery';
         // 关闭详情
         this.$store.commit('setDetail',{detail:{}})
       },
-      clearData(){//清空
-        // const datas = this.checkDatas.questionMapping;
-        const datas = JSON.parse(JSON.stringify(this.checkDatas.questionMapping))
-        let chooseSymp = this.$store.state.symptom.choose;
-        let reqFlag = false;//必填项标识
-        for(let i in datas){
-          // 时间控件需要清除缓存的index
-          if(datas[i].controlType ==9){
-            if(datas[i].pickIndex){
-              datas[i].pickIndex = [];
-            } 
-          }
-          datas[i].value = "";
-          datas[i].valueP = "";
-          if(datas[i].required==1){
-            reqFlag = true;
-          }
-          let detaiList = datas[i].questionDetailList;
-          if(detaiList.length>0){
-            for(let k in detaiList){
-              detaiList[k].select = 0;
-              if(detaiList[k].value){
-                detaiList[k].value = "";
-                detaiList[k].valueP = "";
-              }
-            }
-          }
-        }
+      // clearData(){//清空
+      //   // const datas = this.checkDatas.questionMapping;
+      //   const datas = JSON.parse(JSON.stringify(this.checkDatas.questionMapping))
+      //   let chooseSymp = this.$store.state.symptom.choose;
+      //   let reqFlag = false;//必填项标识
+      //   for(let i in datas){
+      //     // 时间控件需要清除缓存的index
+      //     if(datas[i].controlType ==9){
+      //       if(datas[i].pickIndex){
+      //         datas[i].pickIndex = [];
+      //       } 
+      //     }
+      //     datas[i].value = "";
+      //     datas[i].valueP = "";
+      //     if(datas[i].required==1){
+      //       reqFlag = true;
+      //     }
+      //     let detaiList = datas[i].questionDetailList;
+      //     if(detaiList.length>0){
+      //       for(let k in detaiList){
+      //         detaiList[k].select = 0;
+      //         if(detaiList[k].value){
+      //           detaiList[k].value = "";
+      //           detaiList[k].valueP = "";
+      //         }
+      //       }
+      //     }
+      //   }
 
-        this.checkDatas = Object.assign({},this.checkDatas,{questionMapping:datas});
-        // 已有选中内容重新进来,点清空时并非真的清空
-        if(this.checkDatas.select ==1){return}
-        let msg = this.checkDatas.name;
-        let msgP = (this.checkDatas.description||this.checkDatas.name);
-        // 没有点过完成直接选择然后清空,外层不会处于选中状态,故没有必填项时添加{select:1}
-        if(reqFlag){
-          this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.data.moduleType,ppId:this.data.ppId});
-        }else{
-          this.$store.commit('setDatas',{data:Object.assign({},this.checkDatas,{select:1}),pId:this.checkDatas.id,type:this.data.moduleType,ppId:this.data.ppId});
-        }
-        this.$store.commit('setText',{text:msg,textP:msgP,pId:this.checkDatas.id,type:this.data.moduleType,flag:true,order:this.data.order,arrFlag:true,index:this.data.index,idx:1});
-      },
+      //   this.checkDatas = Object.assign({},this.checkDatas,{questionMapping:datas});
+      //   // 已有选中内容重新进来,点清空时并非真的清空
+      //   if(this.checkDatas.select ==1){return}
+      //   let msg = this.checkDatas.name;
+      //   let msgP = (this.checkDatas.description||this.checkDatas.name);
+      //   // 没有点过完成直接选择然后清空,外层不会处于选中状态,故没有必填项时添加{select:1}
+      //   if(reqFlag){
+      //     this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.data.moduleType,ppId:this.data.ppId});
+      //   }else{
+      //     this.$store.commit('setDatas',{data:Object.assign({},this.checkDatas,{select:1}),pId:this.checkDatas.id,type:this.data.moduleType,ppId:this.data.ppId});
+      //   }
+      //   this.$store.commit('setText',{text:msg,textP:msgP,pId:this.checkDatas.id,type:this.data.moduleType,flag:true,order:this.data.order,arrFlag:true,index:this.data.index,idx:1});
+      // },
       check(){// 校验是否有已填项
         const datas = this.checkDatas.questionMapping;
         let checkArr = [];
@@ -399,6 +405,15 @@ import $ from 'jquery';
         return true;
       }
     },
+    components:{
+      Radio,
+      CheckBox,
+      Input,
+      ComTextArea,
+      MultiLineInput,
+      RadioSelect,
+      PickTime
+    },
   }
 </script>
 <style lang="less" scoped>
@@ -470,10 +485,9 @@ import $ from 'jquery';
     }
     .head{
       height: 1.6rem; //增加了提示
-      line-height: .88rem;
+      line-height: 1rem;
       display: flex; //有清空时
       justify-content: space-between;
-      border-bottom: 1px solid #E6E7EF;
       padding: 0 .4rem 0 .32rem;
       font-size: .28rem;
       color: #7C828E;
@@ -484,18 +498,30 @@ import $ from 'jquery';
       // top: 45px;
       box-sizing: border-box;
       border-radius:.2rem .2rem 0px 0px;
-      i{
+      .stepWrap{
         position: absolute;
         bottom:0;
         left:0;
-        font-size: .24rem;
+        font-size: .26rem;
         width:100%;
-        height: .6rem;
-        line-height: .6rem;
+        height: .65rem;
+        line-height: .65rem;
         display: inline-block;
-        background-color: #EAF1F9;
+        // background-color: #EAF1F9;
         color: #colors[btn];
         text-indent: .4rem;
+        .stepLine {
+          height: 0.04rem;
+          background-color: #F1F1F1;
+        }
+        .lineBlue {
+          width: 100px;
+          height: 0.04rem;
+          background-color: #6678FF;
+        }
+        i {
+          padding-left: .24rem;
+        }
       }
       .icon{
         display: inline-block;

+ 5 - 4
src/components/DetailBox.vue

@@ -8,7 +8,6 @@
                   ref="detail"
                   :flags="flags"
                   :data="data"
-                  :tips="tips"
                   :checkF="checkF"
                   @check="changeCheck($event)"
                   @setBtnTxt="setBtnTxt($event)"
@@ -19,7 +18,7 @@
       </div>
     </div>
     <div style="position:absolute" class="foot">
-      <div class="slide" @click="slideAll">{{btnTxt}}</div>
+      <!-- <div class="slide" @click="slideAll">{{btnTxt}}</div> -->
       <div class="nextBtn compete" @click="complete">完成</div>
     </div>
     <Toast :message="clearTxt" 
@@ -63,7 +62,6 @@
         compFlag:false,
         clearTxt:"是否清空当前已选内容?",
         showToast:false,
-        tips:"温馨提示:请完成病情预问诊可让医生提前了解病情",
         checkF:false, //详情页有无已选项标识
         show:detailShow,
         reqFinish:false,
@@ -214,8 +212,11 @@
       display: inline-block;
     }
     .compete {
-      width: 49%;
+      width: 99%;
       display: inline-block;
+      background-color: #fff;
+      border: 1px solid #6678FF;
+      color: #6678FF;
     }
     animation-delay:.6s;
     animation: foo .4s linear;

+ 23 - 32
src/components/DiagTreat.vue

@@ -5,7 +5,7 @@
           v-if="dtoList"
           :key="it.id"
           class="label">
-        <p class="quest">{{i + 1 +'.' + (it.description||it.name)}}</p>
+        <p class="quest">{{i + 1 +'.' + (it.description||it.name)}}{{it.controlType==1?'(单选)':it.controlType==2?'(多选)':''}}</p>
         <img class="questionImg" :src="it.url.replace('{imageUrlPrefix}',imgUrl)" v-if="it.url">
         <Label v-if="it.controlType==0" 
               :item="it" 
@@ -60,13 +60,13 @@
     <div class="foot" v-if="modluesLen==2">
       <!-- <span class="back" @click="beBack">{{'返回'+ preName}}</span> -->
       <span class="back" @click="beBack">上一步</span>
-      <span class="next" @click="toNext">预览并提交病历</span>
+      <span class="next" @click="toNext(4)">预览并提交病历</span>
     </div>
     <div class="foot" v-else>
       <!-- <span class="back" @click="beBack">{{'返回'+ preName}}</span> -->
       <!-- <span class="next" @click="toNext">{{'进入'+ nextName}}</span> -->
       <span class="back" @click="beBack">上一步</span>
-      <span class="next" @click="toNext">下一步</span>
+      <span class="next" @click="toNext('',2)">下一步</span>
     </div>
   </div>
 </template>
@@ -76,31 +76,38 @@
   import DetailBox from './DetailBox.vue';
   import Input from '../common/Input.vue';
   import ComTextArea from '../common/ComTextArea.vue';
-  import {moduleCP,patt,imageUrlPrefix,setScroll,trimDots} from '@utils/tools';
+  import {moduleCP,patt,imageUrlPrefix,setScroll,trimDots,getRouteName} from '@utils/tools';
   import Radio from '../common/Radio.vue';
   import CheckBox from '../common/CheckBox.vue';
   import BScroll from 'better-scroll';
   import MultiLineInput from '../common/MultiLineInput.vue';
   import PickTime from '../common/PickTime.vue';
+  import {mapState} from 'vuex';
   export default {
     name:'DiagTreat',
     data(){
-      let {origin,text,datas} = this.$store.state.diagnose;
       return{
         msg:"诊疗情况",
-        imgs:this.$store.state.diagnose.imgSrc,
-        // dtoList:origin, //模板数据
-        dtoList:datas, //模板数据
         labelDetail:{}, //标签明细
-        checkText:text, //选中的文字-Arr
         show:false,
         ppId:null,
         imgUrl:imageUrlPrefix,
-        scroll:null
+        scroll:null,
       }
     },
-    props:['datas','preName','nextName','modluesLen'],
+    computed:{
+      ...mapState({
+        activeModule: state => state.activeModule,
+        datas: state => state.activeModule.obj.diagnosis_show,
+        modluesLen: state => state.activeModule.len,
+        diagnose: state => state.diagnose,
+        imgs: state => state.diagnose.imgSrc,
+        dtoList: state => state.diagnose.datas,//模板数据
+        checkText: state => state.diagnose.text,//选中的文字-Arr
+      }),
+    },
     mounted(){
+      this.$store.commit('setFinish',51)
       this.$nextTick(()=>{
         let scroll = setScroll(BScroll,true,'.treatper')
         this.scroll = scroll
@@ -110,17 +117,14 @@
     methods:{
       onScroll(data) {
         this.$store.commit('setScroll', data);
-        document.activeElement.scrollIntoViewIfNeeded(true);
       },
       beBack(){
-        this.$emit('back');
+        this.$router.go(-1);
       },
-      toNext(){
-        if(this.modluesLen==2){
-          this.$emit('next','preview')
-        }else{
-          this.$emit('next');
-        }
+      toNext(flg,order){
+        this.$router.push({
+          path:getRouteName(flg?flg:'',this.activeModule.obj,order)
+        })
       },
       getText(){
         let textArr = this.checkText;
@@ -179,19 +183,6 @@
       CheckBox,
       MultiLineInput,
       PickTime
-    },
-    computed:{
-      getItem(){
-        return this.$store.state.diagnose.text;
-      }
-    },
-    watch:{
-      getItem:{
-        handler(value){
-          this.checkText = value;
-        },
-        deep:true
-      }
     }
   }
 </script>

+ 2 - 0
src/components/Login.vue

@@ -445,6 +445,8 @@ export default {
         padding: 0.1rem 0.3rem 0 0.3rem;
         box-sizing: border-box;
         font-size: 0.28rem;
+        max-height: 5rem;
+        overflow: auto;
         li {
           border-bottom: 1px solid #f5f5f5;
           height: .88rem;

+ 22 - 24
src/components/Others.vue

@@ -5,7 +5,7 @@
           v-if="dtoList"
           :key="it.id"
           class="label">
-        <p class="quest" :style="{'margin-bottom':it.controlType==0?'.3rem':'0'}">{{i + 1 +'.' + (it.description||it.name)}}</p>
+        <p class="quest" :style="{'margin-bottom':it.controlType==0?'.3rem':'0'}">{{i + 1 +'.' + (it.description||it.name)}}{{it.controlType==1?'(单选)':it.controlType==2?'(多选)':''}}</p>
         <img class="questionImg" :src="it.url.replace('{imageUrlPrefix}',imgUrl)" v-if="it.url">
         <Label v-if="it.controlType==0"
               :item="it"
@@ -54,13 +54,13 @@
     <div class="foot" v-if="modluesLen==3&&!nextName||modluesLen==2">
       <!-- <span class="back" @click="beBack">{{'返回'+ preName}}</span> -->
       <span class="back" @click="beBack">上一步</span>
-      <span class="next" @click="toNext">预览并提交病历</span>
+      <span class="next" @click="toNext(4)">预览并提交病历</span>
     </div>
     <div class="foot" v-else>
       <!-- <span class="back" @click="beBack">{{'返回'+ preName}}</span>
       <span class="next" @click="toNext">{{'进入'+ nextName}}</span> -->
       <span class="back" @click="beBack">上一步</span>
-      <span class="next" @click="toNext">下一步</span>
+      <span class="next" @click="toNext('',3)">下一步</span>
     </div>
   </div>
 </template>
@@ -71,11 +71,12 @@
   import Toast from '../common/Toast.vue';
   import Input from '../common/Input.vue';
   import ComTextArea from '../common/ComTextArea.vue';
-  import {moduleCP,patt,imageUrlPrefix,setScroll,trimDots} from '@utils/tools';
+  import {moduleCP,patt,imageUrlPrefix,setScroll,trimDots,getRouteName} from '@utils/tools';
   import Radio from '../common/Radio.vue';
   import CheckBox from '../common/CheckBox.vue';
   import MultiLineInput from '../common/MultiLineInput.vue';
   import BScroll from 'better-scroll';
+  import {mapState} from 'vuex';
   import PickTime from '../common/PickTime.vue';
   export default {
     name:'Others',
@@ -83,18 +84,25 @@
       let {origin,datas,text} = this.$store.state.others;
       return{
         msg:"其他情况",
-        dtoList:datas, //模板数据
         labelDetail:{}, //标签明细
-        checkText:text, //选中的文字
         ppId:null,
         show:false,
         imgUrl:imageUrlPrefix,
-        scroll:null
+        scroll:null,
       }
     },
-    props:['datas','preName','nextName','modluesLen'],
-    created(){},
+    computed:{
+      ...mapState({
+        activeModule: state => state.activeModule,
+        datas: state => state.activeModule.obj.omhistory_show,
+        modluesLen: state => state.activeModule.len,
+        dtoList: state => state.others.datas,//模板数据
+        checkText: state => state.others.text,//选中的文字-Arr
+      }),
+    },
     mounted(){
+      this.$store.commit('setFinish',3)
+
       this.$nextTick(()=>{
         let scroll = setScroll(BScroll,true,'.otherper')
         this.scroll = scroll
@@ -107,9 +115,12 @@
         document.activeElement.scrollIntoViewIfNeeded(true);
       },
       beBack(){
-        this.$emit('back');
+        this.$router.go(-1);
       },
-      toNext(){
+      toNext(flg,order){
+        this.$router.push({
+          path:getRouteName(flg?flg:'',this.activeModule.obj,order)
+        })
         if(!this.nextName){
           this.$emit('next','preview')
         }else{
@@ -173,19 +184,6 @@
       CheckBox,
       MultiLineInput,
       PickTime
-    },
-    computed:{
-      getItem(){
-        return this.$store.state.others.text;
-      }
-    },
-    watch:{
-      getItem:{
-        handler(value){
-          this.checkText = value;
-        },
-        deep:true
-      }
     }
   }
 </script>

+ 53 - 21
src/components/PathInfo.vue

@@ -2,36 +2,50 @@
   <div class="path-wrap">
     <div class="content">
       <div class="topContent">
-        <p class="hospitalName">{{pathInfo.sonHospitalName||pathInfo.hospitalName}}</p>
-        <h2>智能预问诊</h2>
-        <p class="explain">请认真填写以下内容,以便就诊时医生可以更好的了解病情,感谢您的配合!</p>
+        <h2>{{pathInfo.sonHospitalName||pathInfo.hospitalName}}</h2>
+        <p class="hospitalName">智能预问诊</p>
       </div>
       <div class="minContent">
         <p class="msg"><i class="person"></i>挂号信息</p>
+        <p class="perLine">
+          <span class="msgTitle">姓名</span>
+          <i>:</i>
+          <span>{{pathInfo.patientName}}</span>  
+        </p>
+        <p class="perLine">
+          <span class="msgTitle">性别</span>
+          <i>:</i>
+          <span>{{pathInfo.patientSex}}</span>  
+        </p>
         <p class="perMsg perLine">
-          <span class="msgTitle">患者信息:</span>
-          <span class="perDetail">{{pathInfo.patientName}}</span>
-          <span class="perDetail">{{pathInfo.patientSex}}</span>
+          <span class="msgTitle">年龄</span>
+          <i>:</i>
           <span class="perDetail">{{pathInfo.patientAge}}岁</span>
         </p>
+        <p class="emptyLine"></p>
         <p class="perLine">
-          <span class="msgTitle">挂号科室:</span>
-          <span>{{pathInfo.hospitalDeptName}}</span>  
+          <span class="msgTitle">{{pathInfo.doctorName?'预约医生':''}}</span>
+          <i v-if="pathInfo.doctorName">:</i>
+          <span>{{pathInfo.doctorName}}</span>
         </p>
         <p class="perLine">
-          <span class="msgTitle">{{pathInfo.doctorName?'预约医生:':''}}</span>
-          <span>{{pathInfo.doctorName}}</span>
+          <span class="msgTitle">{{pathInfo.hospitalDeptName?'科室':''}}</span>
+          <i v-if="pathInfo.hospitalDeptName">:</i>
+          <span>{{pathInfo.hospitalDeptName}}</span>  
         </p>
         <p class="perLine">
-          <span class="msgTitle">{{pathInfo.recordId?'门诊号:':''}}</span>
+          <span class="msgTitle">{{pathInfo.recordId?'门诊号':''}}</span>
+          <i v-if="pathInfo.recordId">:</i>
           <span>{{pathInfo.recordId}}</span>
         </p>
         <p class="perLine">
-          <span class="msgTitle">{{time?'预约时间:':''}}</span>
+          <span class="msgTitle">{{time?'预约时间':''}}</span>
+          <i v-if="time">:</i>
           <span>{{time}}</span>
         </p>
       </div>
-      <div class="btmContent" @click="getStart">开始</div>
+      <p class="explain">注:请核对您的挂号信息,如有错误请到窗口询问</p>
+      <div class="btmContent" @click="getStart">确认并继续</div>
       <!-- <div class="con">
         <p class="already" v-if="type !== 1">{{text[type]}}</p>
       </div> -->
@@ -102,7 +116,7 @@
         let query = this.$route.query
         let hasQuery = JSON.stringify(query) == '{}'
         let tmpTime = dateParser(!hasQuery&&query.recordTime) || (localStorage.getItem('loginParam')&&dateParser(JSON.parse(localStorage.getItem('loginParam')).time))
-        this.time = tmpTime
+        this.time = tmpTime||'2020-01-05'
         const params = {
           'hospitalCode':!hasQuery&&query.hospitalCode||'',
           'hospitalDeptCode':!hasQuery&&query.hospitalDeptCode||'',
@@ -166,7 +180,7 @@
       },
       goNext(){
         if(this.isReady){
-          this.$router.replace({path:'/tab'})
+          this.$router.push({path:'/tab'})
         }else{
           this.defaultWaring('请先维护症状模块')
         }
@@ -229,17 +243,19 @@
     }
     .topContent {
       // background-color: #6678FF;
-      height: 4.78rem;
-      padding: .72rem .6rem;
+      height: 3.8rem;
+      padding-top: .3rem;
       box-sizing: border-box;
       background:url(../images/topContent.png) no-repeat;
       background-size: cover;
       .hospitalName {
         color: #FFFFFF;
         font-size: .32rem;
+        text-align: center;
       }
       h2 {
-        font-size: .56rem;
+        text-align: center;
+        font-size: .52rem;
         padding: .36rem 0 .18rem 0;
         color: #fff;
       }
@@ -249,14 +265,22 @@
         line-height: .4rem;
       }
     }
+    .explain {
+      font-size: .24rem;
+      color: #AAAAAA;
+      padding:0 .4rem; 
+      line-height: .4rem;
+      position: relative;
+      bottom: 1.1rem;
+    }
     .minContent {
-      padding: .3rem .6rem .6rem .6rem;
+      padding: .3rem .6rem .3rem .6rem;
       box-sizing: border-box;
       border-radius: 5px;
       width: 90%;
       box-shadow:0px 12px 24px 0px rgba(198,187,224,0.15);
       position: relative;
-      top: -0.9rem;
+      top: -1.3rem;
       background-color: #fff;
       margin: 0 auto;
       .msg {
@@ -281,9 +305,14 @@
       }
       .msgTitle {
         display: inline-block;
-        width: 1.6rem;
+        width: 1.2rem;
         color: #777777;
       }
+      i {
+        color: #777777;
+        position: relative;
+        bottom: 1px;
+      }
       .perMsg {
         .perDetail {
           margin-right: .24rem;
@@ -306,5 +335,8 @@
       transform: translateX(-50%);
       left: 50%;
     }
+    .emptyLine {
+      height: 0.22rem;
+    }
   }
 </style>

+ 15 - 9
src/components/Preview.vue

@@ -44,13 +44,13 @@
               </p>
               <p><span>{{getDetailText(diagnose.text,false).view}}</span></p>
             </li>
-            <li v-if="showLis[moduleCP['other']]==1">
+            <li v-if="tabType[moduleCP['other']]==1">
               <h4><i></i> 其他史:</h4>
               <p>
                 <span>{{getDetailText(others.text,false).view}}</span>
               </p>
             </li>
-            <li v-if="showLis[moduleCP['suplement']]==1">
+            <li v-if="tabType[moduleCP['suplement']]==1">
               <h4><i></i> 补充内容:</h4>
               <p>{{addContent.txt}}</p>
             </li>
@@ -84,7 +84,7 @@
         :showType="showType"
         @showSubmit="showSubmit"
       ></Submit>
-      <Loading v-if="loadingShow"></Loading>
+      <Loading v-if="this.$store.state.loadingShow"></Loading>
       <div class="personMsgDoc" v-show="showDoc">
         <div class="personMsgDocModal" @click="handleClick(false)"></div>
         <div class="personMsgDocDetail">
@@ -111,13 +111,13 @@
                 </p>
                 <p><span>{{getDetailText(diagnose.text,false).view}}</span></p>
               </li>
-              <li v-if="showLis[moduleCP['other']]==1">
+              <li v-if="tabType[moduleCP['other']]==1">
                 <h4><i></i> 其他史:</h4>
                 <p>
                   <span>{{getDetailText(others.text,false).view}}</span>
                 </p>
               </li>
-              <li v-if="showLis[moduleCP['suplement']]==1">
+              <li v-if="tabType[moduleCP['suplement']]==1">
                 <h4><i></i> 补充内容:</h4>
                 <p>{{addContent.txtDoc}}</p>
               </li>
@@ -139,10 +139,11 @@ import Submit from '../common/Submit';
 import Loading from '../common/Loading';
 import BScroll from 'better-scroll';
 import {moduleCP,trimDots,setScroll,dateParser} from '@utils/tools.js'
+import { mapState } from 'vuex';
 export default {
-  props: ['preName','showLis','loadingShow'],
   data() {
-    const { pathInfo, originDatas,loadingShow } = this.$store.state;
+    const { pathInfo, originDatas } = this.$store.state;
+    let sysConfig = this.$store.state.sysConfig;
     let symptomDate = this.$store.state.symptom;
     let diagnoseDate = this.$store.state.diagnose;
     let othersDate = this.$store.state.others;
@@ -165,6 +166,11 @@ export default {
       time:''
     }
   },
+  computed:{
+    ...mapState([
+      'tabType'
+    ])
+  },
   created(){
     this.getTime();
   },
@@ -173,7 +179,6 @@ export default {
       let scroll = setScroll(BScroll,true,'.previewper')
       this.scroll = scroll
     })
-
   },
   methods: {
     getTime() {
@@ -195,7 +200,7 @@ export default {
       this.submit = flg
     },
     back() {
-      this.$emit('back', 'preview')
+      this.$router.go(-1);
     },
     saveAllImage() {
       let formData = new FormData();
@@ -385,6 +390,7 @@ export default {
   float: right;
   color: #0043E8;
   margin-bottom: 30px;
+  font-size: 14px;
 }
 .preview {
   color: red;

+ 10 - 3
src/components/Search.vue

@@ -44,8 +44,9 @@
 </template>
 <script>
 import api from '@utils/api.js';
+import {mapState} from 'vuex';
+
 export default {
-  props: ['age', 'sexType', 'chooseSymp'],
   data() {
     return {
       searchVal: '',
@@ -54,6 +55,12 @@ export default {
       hasMore:false
     }
   },
+  computed:{
+    ...mapState({
+      chooseSymp: state => state.symptom.choose,//已选症状
+      pathInfo: state => state.pathInfo
+    }),
+  },
   watch:{
     searchVal(curVal, oldVal) {
       if (curVal.trim() == "") {
@@ -95,10 +102,10 @@ export default {
         }
       }
       const param = {
-        "age": this.age,
+        "age": this.pathInfo.patientAge,
         "inputIds": tmpArr,
         "inputStr": this.searchVal,
-        "sexType": this.sexType
+        "sexType": this.pathInfo.sexType
       }
       api.getTagInfos(param).then((res) => {
         const result = res.data;

+ 124 - 55
src/components/Symptom.vue

@@ -18,12 +18,17 @@
         </p>
       </div>
       <div class="label">
-        <p class="quest" id="test">{{quesText}}<img
-            @click="search(true)"
+        <p class="quest" id="test">{{quesText}}</p>
+        <div class="searchWrap" @click="search(true)">
+          <input type="text" placeholder="搜索">
+          <img
             class="searchImg"
             src="../images/search.png"
             alt=""
-          ></p>
+          >
+        </div>
+        <p class="tips">常见症状(长按可解释该症状)</p>
+
         <div class="showHide" ref="showHide">
           <span
             class="symp"
@@ -33,7 +38,12 @@
             @touchend.prevent="touchend(it,ind+1)"
           >{{it.description || it.name}}</span>
         </div>
-        <p class="tip" v-show="chooseSymp.length==0">长按症状按钮可显示症状解释说明 <span @click="slideToggle" v-show="slide">{{slideTxt}}</span></p>
+        <p class="tip" @click="slideToggle" v-show="chooseSymp.length==0&&slide">
+          {{slideTxt}}
+          <span class="blueSlide" :style="{'transform':'rotate('+degNum+'deg)'}">
+            <img src="../images/blueSlide.png" />
+          </span>
+        </p>
       </div>
       <div
         class="result"
@@ -51,14 +61,14 @@
       </div>
     </div>
     <div v-if="modluesLen>1"
-      @click="toNext"
+      @click="toNext('',1)"
       class="footer"
     >
       <div class="nextBtn" :class="{'nofoot':chooseSymp.length==0}">下一步</div>
     </div>
     <div v-if="modluesLen==1"
       class="footer"
-      @click="toNext"
+      @click="toNext(4)"
     >
       <div class="nextBtn" :class="{'nofoot':chooseSymp.length==0}">预览并提交病历</div>    
     </div>
@@ -73,9 +83,6 @@
       v-if="this.$store.state.searchShow"
       @search="search"
       @showDetil="showDetil"
-      :age="age"
-      :chooseSymp="chooseSymp"
-      :sexType="sexType"
     ></Search>
     <Tiptoast :show="showExp" :data="message" @close="closeTip"/>
   </div>
@@ -85,34 +92,25 @@ import api from '@utils/api.js';
 import Toast from '../common/Toast.vue';
 import Tiptoast from '../common/Tiptoast.vue';
 import Search from './Search.vue';
-import {moduleCP,setScroll,trimDots} from '@utils/tools'
+import {moduleCP,setScroll,trimDots,setTitle,getRouteName} from '@utils/tools'
 import Submit from "../common/Submit";
 import BScroll from 'better-scroll';
+import {mapState} from 'vuex';
 import $ from 'jquery';
 export default {
   name: 'Symptom',
-  props:['modluesLen','nameStr'],
   data() {
-    let { datas, pathInfo,searchShow } = this.$store.state;
-    const { choose, text } = this.$store.state.symptom;
     return {
-      age: pathInfo.patientAge,
-      sexType: pathInfo.patientSex == '男' ? 1 : (pathInfo.patientSex == '女' ? 2 : 3),
-      deptName: pathInfo.selfDeptName,
-      hosCode: pathInfo.hospitalCode,
-      chooseSymp: choose, //已选症状
       symp: [], //症状
       labelDetail: {}, //明细
-      checkText: text, //症状情况文字
       questId: null, //id
       delText: "是否删除该信息?<br/>(已填内容将清除)",
       delIndex: null,
       showToast: false,
-      searchShow: searchShow,//显示搜索界面
       tmpItem:{},//检索的症状
       isSearch:false,
       scroll:null,
-      quesText:"请问这次哪里不舒服?",
+      quesText:"您哪里不舒服?",
       startTime:'',
       timer:null,
       showExp:false,
@@ -124,10 +122,38 @@ export default {
       start:{},
       end:{},
       slide:false,
-      slideTxt:'展开',
+      slideTxt:'点击展开',
       failMsg: "无法选择症状,已超过最大个数",
+      modluesLen:null,
+      nameStr:'',
+      degNum:0
     }
   },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      // setTitle('ishdsjahd')
+        document.title = 'title';
+        let i = document.createElement('iframe');//解决qq内title不刷新问题
+        i.style.display = 'none';
+        i.src = '.';
+        i.onload = ()=>{
+            setTimeout(()=>{
+                i.remove()
+            }, 0);
+        }
+        document.body.appendChild(i);
+        
+    })
+  },
+  computed:{
+    ...mapState({
+      activeModule: state => state.activeModule,
+      searchShow: state => state.searchShow,//搜索界面显示
+      chooseSymp: state => state.symptom.choose,//已选症状
+      checkText: state => state.symptom.text,//症状情况文字
+      pathInfo: state => state.pathInfo
+    }),
+  },
   created() {
     if (this.chooseSymp.length > 0) {
       this.quesText = "请问您还有其他不适吗?";
@@ -139,7 +165,12 @@ export default {
     }
   },
   mounted(){
+    this.$store.commit('setFinish',1)
     this.$nextTick(()=>{
+      let activePart = this.activeModule;
+      this.modluesLen = activePart.len
+      this.nameStr = activePart.obj.symptoms_show.name
+
       let scroll = setScroll(BScroll,true,'.symper')
       this.scroll = scroll
       scroll.on('scroll', this.onScroll)
@@ -163,17 +194,28 @@ export default {
     }
   },
   methods: {
+    toNext(flg,order) {
+      // 把1切换成完成图标,且2高亮--判断有几个模块显示,1个--提交预览;1个以上--下一步
+      if (this.chooseSymp.length == 0) { return }
+      // 把症状情况的数据存起-已选
+      this.$store.commit('setChoose', { choose: this.chooseSymp, type: moduleCP['symp'] });
+      this.$router.push({
+        path:getRouteName(flg?flg:'',this.activeModule.obj,order)
+      })
+    },
     showSubmit(flg){
       this.submit = flg;
     },
     slideToggle(){
       let flg = this.slideTxt;
-      if(flg == '展开'){
+      if(flg == '点击展开'){
         this.$refs.showHide.style.height = 'auto'
-        this.slideTxt = '收起'
+        this.slideTxt = '点击收起'
+        this.degNum = 180
       }else{
         this.$refs.showHide.style.height = '3rem'
-        this.slideTxt = '展开'
+        this.slideTxt = '点击展开'
+        this.degNum = 0
       }
     },  
     touchend(item,flg) {//症状点开详情
@@ -188,7 +230,8 @@ export default {
           item.idx = 1
         }
         this.common(item,flg);
-        this.slideTxt = '展开'
+        this.slideTxt = '点击展开'
+        this.degNum = 0
       }
       this.startTime = "";
     },
@@ -215,7 +258,6 @@ export default {
     },
     onScroll(data) {
       this.$store.commit('setScroll', data);
-      document.activeElement.scrollIntoViewIfNeeded(true);
     },
     search(flg) {
       this.$store.commit('setSearchShow', flg);
@@ -223,9 +265,9 @@ export default {
 
     getSympList() {
       const param = {
-        "age": this.age,
-        "deptName": this.deptName,
-        "sexType": this.sexType
+        "age": this.pathInfo.patientAge,
+        "deptName": this.pathInfo.selfDeptName,
+        "sexType": this.pathInfo.sexType
       }
       api.getSymptom(param).then((res) => {
         const result = res.data;
@@ -239,17 +281,6 @@ export default {
         }
       })
     },
-    toNext() {
-      // 把1切换成完成图标,且2高亮--判断有几个模块显示,1个--提交预览;1个以上--下一步
-      if (this.chooseSymp.length == 0) { return }
-      // 把症状情况的数据存起-已选
-      this.$store.commit('setChoose', { choose: this.chooseSymp, type: moduleCP['symp'] });
-      if(this.modluesLen==1){
-        this.$emit('next','preview')
-      }else{
-        this.$emit('next');
-      }
-    },
     common(item,flg,sign){
       if(this.chooseSymp.length>12){
         this.$store.commit('setSearchShow', false);
@@ -265,9 +296,9 @@ export default {
       //将选中的name存到store中的text
       if (id&&this.chooseSymp.length == 0) {//只有第一次
         const param = {
-          "age": this.age,
+          "age": this.pathInfo.patientAge,
           "id": id,
-          "sexType": this.sexType
+          "sexType": this.pathInfo.sexType
         }
         localStorage.setItem("staticSymp",null)
         this.$store.commit('setText', { type: moduleCP['symp'], text: (this.chooseSymp.length == 0?'患者出现':'')+item.name,textP: (this.chooseSymp.length == 0?'患者出现':'')+(item.description||item.name), pId: this.questId,idx:this.chooseSymp.length == 0?1:'' });
@@ -347,9 +378,9 @@ export default {
     },
     getPush(symptoms) {//推理
       const param = {
-        "age": this.age,
-        "hosCode": this.hosCode,
-        "sex": this.sexType,
+        "age": this.pathInfo.patientAge,
+        "hosCode": this.pathInfo.hospitalCode,
+        "sex": this.pathInfo.sexType,
         "symptom": symptoms //症状+选择的明细,string
       }
       api.getPush(param).then((res) => {
@@ -449,10 +480,30 @@ export default {
   overflow: hidden;
   height: 3rem;
 }
-.tip span {
-  color: #colors[theme];
-  float: right;
-  font-size: .28rem;
+.tips {
+  color: #AAAAAA;
+  margin-bottom:.2rem;
+  font-size: .13rem;
+}
+.tip {
+  font-size: .28rem !important;
+  text-align:center;
+  color: #colors[theme] !important;
+  .blueSlide {
+    display: inline-block;
+    position: relative;
+    height: 14px;
+    width: 14px;
+    top: 1px;
+    img {
+      width: 14px;
+      height: 7px;
+      position: absolute;
+      top: 50%;
+      left: 0;
+      margin-top: -3.5px;
+    }
+  }
 }
 .symp-wrap {
   font-size: 0.3rem;
@@ -460,13 +511,31 @@ export default {
     color: #colors[quest];
     margin-bottom: 0.36rem;
     font-weight: 700;
-    .searchImg {
-      width: 0.44rem;
-      height: 0.44rem;
-      float: right;
-    }
   }
 }
+.searchWrap {
+  border: 1px solid #E6E6E6;
+  height: .64rem;
+  border-radius: .32rem;
+  margin-bottom: .4rem;
+  box-sizing: border-box;
+  position: relative;
+  input {
+    height: 100%;
+    border-radius: .32rem;
+    padding-left:.7rem; 
+    color: #AAAAAA;
+  }
+  .searchImg {
+    width: 0.44rem;
+    height: 0.44rem;
+    float: right;
+    position: absolute;
+    left: .2rem;
+    top: .05rem;
+  }
+
+}
 .choose{
   padding-bottom: .2rem;
   position: relative;

+ 35 - 163
src/components/TabPage.vue

@@ -1,65 +1,24 @@
 <template>
   <div class="tab-wrap">
     <div class="tab"
-      v-if="modlues&&modlues.length>0 && moduleShow">
-      <p v-for="(it,index) in modlues"
-        :style="{'width':1/modlues.length*100+'%'}"
+      v-if="allMoudles.data&&allMoudles.data.length>0 && moduleShow">
+      <p v-for="(it,index) in allMoudles.data"
+        :style="{'width':1/allMoudles.data.length*100+'%'}"
         :key="it.id"
         @click="clickTab(it,index)">
-        <span :class="{current:index==number,comp:finish[it.type]}" v-if="type[it.type]==1">
+        <span :class="{current:finish[it.type]}" v-if="type[it.type]==1">
           <i class="order">{{index+1}}</i>
           {{it.name}}
-          <i class="line" v-if="index==number"></i>
+          <i class="line" v-if="currentTab[it.type]"></i>
         </span>
       </p>
     </div>
-    <!-- 内容 -->
     <div class="content">
-      <template v-for="(item,idx) in modlues">
-        <Symptom
-          v-if="flag==moduleCP['symp']&&item.type==moduleCP['symp']&&moduleShow"
-          @next="toNext"
-          :nameStr="item.name"
-          :modluesLen="modluesLen"
-        />
-        <DiagTreat
-          v-if="flag==moduleCP['diagT']&&item.type==moduleCP['diagT']&&moduleShow"
-          :datas="item"
-          :preName="modlues[0]&&modlues[0].name"
-          :modluesLen="modluesLen"
-          :nextName="modlues[2]&&modlues[2].name"
-          @next="toNext"
-          @back="beBack"
-        />
-        <Others
-          v-if="flag==moduleCP['other']&&item.type==moduleCP['other']&&moduleShow"
-          :modluesLen="modluesLen"
-          :datas="item"
-          :preName="modlues[idx-1]&&modlues[idx-1].name"
-          :nextName="modlues[idx+1]&&modlues[idx+1].name"
-          @next="toNext"
-          @back="beBack"
-        />
-        <AddContent
-          v-if="flag == moduleCP['suplement']&&item.type==moduleCP['suplement']&&moduleShow"
-          :modluesLen="modluesLen"
-          :allMoudles="item"
-          :preName="modlues[idx-1]&&modlues[idx-1].name"
-          @toggleModule="toggleModule"
-          @next="toNext"
-          @back="beBack"
-        />
-      </template>
-      <Preview v-if="!moduleShow" 
-        :preName="getPreviewName()"
-        :loadingShow="this.$store.state.loadingShow"
-        :showLis="type"
-        @back="beBack" 
-      />
+      <router-view></router-view>
     </div>
     <!-- 详情页 -->
-    <div class="detail" v-if="this.$store.state.detailShow">
-      <DetailBox :flags="flag"/>
+    <div class="detail" v-if="detailShow">
+      <DetailBox :flags="allMoudles.order"/>
     </div>
   </div>
 </template>
@@ -69,40 +28,33 @@ import AddContent from './AddContent.vue';
 import DiagTreat from './DiagTreat.vue';
 import Others from './Others.vue';
 import Preview from './Preview.vue';
-import {moduleConfig,moduleCP} from '../utils/tools.js';
-import $ from 'jquery';
+import {moduleConfig,moduleCP,getRouteName} from '../utils/tools.js';
 import DetailBox from './DetailBox.vue';
+import {mapState} from 'vuex';
 export default {
   name: 'TabPage',
   data() {
-    let sysConfig = this.$store.state.sysConfig;
-    let tmpAllMoudles = this.$store.state.allMoudles;
-    let allMoudles = moduleConfig(sysConfig,tmpAllMoudles);
-    const { choose} = this.$store.state.symptom;
     return {
-      config: sysConfig,
-      modlues: allMoudles.data,
-      modluesLen: allMoudles.len,
-      type: {
-        "1": sysConfig.length > 0 && sysConfig.filter(item => item.code == "symptoms_show")[0].value,
-        "51": sysConfig.length > 0 && sysConfig.filter(item => item.code == "diagnosis_show")[0].value,
-        "3": sysConfig.length > 0 && sysConfig.filter(item => item.code == "omhistory_show")[0].value,
-        "52": sysConfig.length > 0 && sysConfig.filter(item => item.code == "replenish_show")[0].value,
-      },
-      flag: allMoudles.order,
       moduleShow:true,
-      finish:{ //标识已填
-        '1':true,
-        '51':false,
-        '3':false,
-        '52':false
-      },
       number:0,
       moduleCP:moduleCP,
-      symChoose:choose
+      routerName:'',
+      allMoudles:{}
     }
   },
+  computed:{
+    ...mapState({
+      finish: state => state.finish,
+      currentTab: state => state.currentTab,
+      detailShow: state => state.detailShow,
+      symChoose: state => state.symptom.choose,
+      type: state => state.tabType,
+      config: state => state.sysConfig,
+      tmpAllMoudles: state => state.allMoudles,
+    }),
+  },
   created() {
+    this.routerName = this.$route.name
     if (this.config.length == 0) {//登录进去返回到列表页,扫码返回到开始页
       let scan = localStorage.getItem('scan');
       let params = JSON.parse(localStorage.getItem('infoParam'));
@@ -119,100 +71,24 @@ export default {
       }
     }
   },
+  mounted(){
+    let tmpModule = moduleConfig(this.config,this.tmpAllMoudles);
+    this.allMoudles = tmpModule;
+    this.$store.commit('setActiveModule', tmpModule);
+  },
   methods: {
     // 症状情况有内容后才可以点击tab栏
     clickTab(item,index){
       if(this.symChoose.length>0){
         this.number = index;
         this.flag = item.type;
-        this.finish[parseInt(item.type)] = true;
-
-        document.title = index;
-        // let i = document.createElement('iframe');//解决qq内title不刷新问题
-        // i.style.display = 'none';
-        // i.src = '.'; 
-        // i.onload = ()=>{
-        //     setTimeout(()=>{
-        //         i.remove()
-        //     }, 0);
-        // }
-        // document.body.appendChild(i);
-
-      }
-    },
-    getPreviewName(){
-      let len = this.modluesLen,tmpModule = this.modlues;
-      let preName = '';
-      if(len == 1){
-        preName=tmpModule[0].name
-      }else if(len == 2){
-        preName=tmpModule[1].name
-      }else if(len == 3){
-        preName=tmpModule[2].name
-      }else if(len == 4){
-        preName=tmpModule[3].name
-      }
-      return preName
-    },
-    getNames(type){
-      let len = this.modluesLen,tmpModule = this.modlues;
-      let nextName = '';
-      if(len == 1){
-        preName=tmpModule[0].name
-      }else if(len == 2){
-        preName=tmpModule[1].name
-      }else if(len == 3){
-        preName=tmpModule[2].name
-      }else if(len == 4){
-        preName=tmpModule[3].name
+        // this.finish[parseInt(item.type)] = true;
+        this.$store.commit('setFinish',item.type)
+        let routeName = getRouteName(item.type)
+        this.$router.push({
+          path:routeName
+        })
       }
-      return preName
-    },
-    toNext(preview) {
-      if(preview === 'preview'){
-        this.moduleShow=false
-        return
-      }
-      let flag = parseInt(this.flag),num=this.number;
-      this.number = ++num;
-
-      for(let i = 0;i < this.modlues.length;i++){
-        let part = this.modlues[i];
-        if(part.type == flag){
-          if(i < (this.modlues.length-1)){
-            this.flag = this.modlues[i+1].type
-          }
-        }
-      }
-      
-      for(let j in this.finish){
-        if(j == this.flag){
-          this.finish[j] = true
-        }
-      }
-    },
-    beBack(preview) {
-      if(preview === 'preview'){
-        this.moduleShow=true
-        return
-      }
-      let flag = parseInt(this.flag),num=this.number;
-      this.number = --num;
-
-      for(let i = 0;i < this.modlues.length;i++){
-        let part = this.modlues[i];
-        if(part.type == flag){
-          this.flag = this.modlues[i-1].type
-        }
-      }
-      for(let j in this.finish){
-        if(j == this.flag){
-          this.finish[j] = true
-        }
-      }
-    },
-    toggleModule(flg){
-      this.moduleShow = flg
     },
   },
   components: {
@@ -271,10 +147,6 @@ export default {
     }
     .current {
       color: #colors[btn];
-      border-radius: 25px;
-    }
-    .comp{
-      color: #colors[btn];
     }
 }
   .content {

+ 0 - 1
src/main.js

@@ -8,7 +8,6 @@ import VueAwesomeSwiper from 'vue-awesome-swiper'
 import 'swiper/dist/css/swiper.css'
 import PortalVue from 'portal-vue';
 import './utils/getfile.js';
-// import {Picker} from 'vant';
 import Picker from 'vant/lib/picker';
 import 'vant/lib/picker/style';
 

+ 55 - 7
src/router/index.js

@@ -3,6 +3,11 @@ import Router from 'vue-router';
 import PathInfo from '@components/PathInfo.vue';
 import TabPage from '@components/TabPage.vue';
 import Login from '@components/Login.vue';
+import Symptom from '@components/Symptom.vue';
+import DiagTreat from '@components/DiagTreat.vue';
+import Others from '@components/Others.vue';
+import AddContent from '@components/AddContent.vue';
+import Preview from '@components/Preview.vue';
 import Department from '@components/Department.vue';
 Vue.use(Router);
 const router = new Router({
@@ -15,24 +20,67 @@ const router = new Router({
     {
       path:'/home',
       name:'PathInfo',
+      meta:{
+        title:'挂号详情'
+      },
       component:PathInfo
     },
     {
       path:'/tab',
-      name:'TabPage',
-      component:TabPage
+      component:TabPage,
+      children:[
+        {
+          path:'/',      
+          name:'symptom',
+          component:Symptom
+        },{
+          path:'/tab/treat',
+          name:'treat',
+          component:DiagTreat
+        },{
+          path:'/tab/others',
+          name:'others',
+          component:Others
+        },{
+          path:'/tab/add',
+          name:'add',
+          component:AddContent
+        }
+      ]
     },
-    /*{
-      path:'/login',
-      name:'Login',
-      component:Login
-    },*/
     {
       path:'/department',
       name:'Department',
+      meta:{
+        title:'挂号信息'
+      },
       component:Department
+    },
+    {
+      path:'/preview',
+      name:'Preview',
+      meta:{
+        title:'预览病历'
+      },
+      component:Preview
     }
   ]
 })
 
+router.beforeEach((to, from, next) => {
+  /* 路由发生变化修改页面title */
+  if (to.meta.title) {
+    document.title = to.meta.title;
+    // let i = document.createElement('iframe');//解决qq内title不刷新问题
+    // i.style.display = 'none';
+    // i.src = '.'; 
+    // i.onload = ()=>{
+    //     setTimeout(()=>{
+    //         i.remove()
+    //     }, 0);
+    // }
+    // document.body.appendChild(i);
+  }
+  next();
+})
 export default router;

+ 48 - 2
src/store.js

@@ -37,11 +37,46 @@ const store = new Vuex.Store({
       txt:'',
       txtDoc:''
     },
+    activeModule:{},//有效显示的模块
     loadingShow:false,
     detailInfo:{},
-    detailShow:false
+    detailShow:false,
+    finish:{ //标识已填
+      '1':true,
+      '51':false,
+      '3':false,
+      '52':false
+    },
+    currentTab:{ //标识当前tab页
+      '1':true,
+      '51':false,
+      '3':false,
+      '52':false
+    },
+    tabType: {
+      "1": 1,
+      "51": 0,
+      "3": 0,
+      "52": 0,
+    },
   },
   mutations:{
+    setFinish(state,param){
+      let obj = state.finish
+      let obj1 = state.currentTab
+      for(let key in obj){
+        if(key == param){
+          obj[key] = true
+          obj1[key] = true
+        }else{
+          obj1[key] = false
+        }
+      } 
+      state.finish = obj
+    },
+    setActiveModule(state,param){
+      state.activeModule = param
+    },
     initAllData(state){
       state.symptom={ //症状情况
         choose:[],
@@ -100,10 +135,21 @@ const store = new Vuex.Store({
       state.allMoudles = res
     },
     savePathInfo(state,param){
-      state.pathInfo = param;
+      let obj = param;
+      obj.sexType = obj.patientSex == '男' ? 1 : (obj.patientSex == '女' ? 2 : 3);
+      obj.doctorName = '傻子'
+      obj.recordId = '265254885'
+      state.pathInfo = obj;
     },
     saveSysConfig(state,param){
       state.sysConfig = param;
+      let tabType = {
+        "1": param.length > 0 && param.filter(item => item.code == "symptoms_show")[0].value,
+        "51": param.length > 0 && param.filter(item => item.code == "diagnosis_show")[0].value,
+        "3": param.length > 0 && param.filter(item => item.code == "omhistory_show")[0].value,
+        "52": param.length > 0 && param.filter(item => item.code == "replenish_show")[0].value,
+      }
+      state.tabType = tabType
     },
     saveAll(state,param){
       state.allMoudles = param;

+ 4 - 0
src/utils/api.js

@@ -15,10 +15,14 @@ const urls = {
   // uploadImageThums:'http://192.168.3.117:5050/api/prec/file/uploadImageThums',//多个文件上传同时生成缩略图
   getTagInfos:'/api/prec/retrieval/getTagInfos',//检索
   signIn:'/api/prec/patientInfo/signIn',//登录
+  getDisclaimerInformations:'/api/prec/disclaimerInformation/getDisclaimerInformations',//配置文案
   // uploadImageThums:'http://192.168.3.1:8849/file/uploadImageThums',//多个文件上传同时生成缩略图
 }
 
 export default {
+  getDisclaimerInformations(){
+    return axios.post(urls.getDisclaimerInformations)
+  },
   getHospitalDatas(param){
     return axios.post(urls.getHospitalDatas,param)
   },

+ 64 - 8
src/utils/tools.js

@@ -173,27 +173,32 @@ const moduleCP = {
 }
 
 const moduleConfig = (config,modules) => {
-  let activeModule = []
+  let activeModule = [],activeModuleObj = {};
   for(let i = 0;i < config.length;i++){
-    let tmpCode = config[i].code
-    let tmpVal = config[i].value
+    let tmpCode = config[i].code;
+    let tmpVal = config[i].value;
     for(let j = 0;j < modules.length;j++){
-      let tmpType = modules[j].type
+      let tmpType = modules[j].type;
       if(tmpCode=="symptoms_show"&&tmpType==moduleCP['symp']&&tmpVal==1){
         activeModule.push(modules[j])
+        activeModuleObj.symptoms_show = modules[j]
       }else if(tmpCode=="diagnosis_show"&&tmpType==moduleCP['diagT']&&tmpVal==1){
         activeModule.push(modules[j])
+        activeModuleObj.diagnosis_show = modules[j]
       }else if(tmpCode=="omhistory_show"&&tmpType==moduleCP['other']&&tmpVal==1){
         activeModule.push(modules[j])
+        activeModuleObj.omhistory_show = modules[j]
       }else if(tmpCode=="replenish_show"&&tmpType==moduleCP['suplement']&&tmpVal==1){
         activeModule.push(modules[j])
+        activeModuleObj.replenish_show = modules[j]
       }
     }
   }
   return {
-    data:activeModule,
-    len:activeModule.length||0,
-    order:activeModule.length>0?activeModule[0].type:''
+    data:activeModule,//需要展示的模块
+    obj:activeModuleObj,
+    len:activeModule.length||0,//需要展示的模块数量
+    order:activeModule.length>0?activeModule[0].type:''//默认展示的模块
   }
 }
 
@@ -385,6 +390,55 @@ const getNum = () => {
   return num;
 }
 
+// 设置title
+const setTitle = (title) => {
+  document.title = title;
+  let i = document.createElement('iframe');//解决qq内title不刷新问题
+  i.style.display = 'none';
+  i.src = '.';
+  i.onload = ()=>{
+      setTimeout(()=>{
+          i.remove()
+      }, 0);
+  }
+  document.body.appendChild(i);
+}
+// 匹配下一步的路由
+const getRouteName = (flg,active,order) => {
+  if(flg){
+    if(flg == 51){
+      return '/tab/treat'
+    }else if(flg == 3){
+      return '/tab/others'
+    }else if(flg == 52){
+      return '/tab/add'
+    }else if(flg == 4){
+      return '/preview'
+    } else if(flg == 1){
+      return '/tab'
+    } 
+  }else{
+    if(order == 1){
+      if(active.diagnosis_show){
+        return '/tab/treat' 
+      }else if(active.omhistory_show){
+        return '/tab/others'
+      }else if(active.replenish_show){
+        return '/tab/add'
+      }
+    }else if(order == 2){
+      if(active.omhistory_show){
+        return '/tab/others'
+      }else if(active.replenish_show){
+        return '/tab/add'
+      }
+    }else if(order == 3){
+      if(active.replenish_show){
+        return '/tab/add'
+      }
+    }
+  }
+}
 
 module.exports =  {
   imageUrlPrefix,
@@ -411,7 +465,9 @@ module.exports =  {
   name,
   isQQ,
   getNum,
-  configer
+  configer,
+  setTitle,
+  getRouteName
 }