浏览代码

Merge remote-tracking branch 'origin/master' into referMaster

# Conflicts:
#	src/utils/tools.js
zhouna 5 年之前
父节点
当前提交
a017dd9c3b

+ 4 - 1
src/App.vue

@@ -13,9 +13,12 @@
       (/iphone|ipod|ipad/i.test(navigator.appVersion)) && document.addEventListener('blur', (e) => {
         // 这里加了个类型判断,因为a等元素也会触发blur事件
         if(['input', 'textarea'].includes(e.target.localName)) {
+        // if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
+        //   document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
+        // }
           setTimeout(()=> {
             document.scrollingElement.scrollTo(0, document.scrollingElement.scrollTop);
-          }, 200);
+          }, 100);
         }
       }, true)
     },

+ 12 - 9
src/common/CheckBox.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="check-wrap bgques" v-if="item" :style="getStyle(detail,slide)">
+  <div class="check-wrap bgques clearfix" v-if="item" :style="getStyle(detail,slide)">
       <p v-for="(it,index) in datas.questionDetailList" 
           :key="it.id" 
           :class="['list',{'block':((it.description||it.name).indexOf('${'))!=-1}]" >
@@ -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:{},
@@ -185,11 +184,12 @@ import OptionInp from '../common/OptionInp.vue';
     }
     .list{
       color: #colors[text];
-      margin:0 .1rem .07rem 0;
-      padding: .1rem .1rem .1rem 0;
+      margin:0 .05rem;
+      padding: .05rem;
       display: inline-block;
       white-space: nowrap;
-      overflow-x: hidden;
+      // overflow-x: hidden;
+      float: left;
       img{
         width: .38rem;
         vertical-align: middle;
@@ -204,15 +204,18 @@ import OptionInp from '../common/OptionInp.vue';
       line-height: .66rem;
       // min-width: 2rem;
       // text-align: center;
+      color: #7C828E;
       padding:0 .2rem;
       box-sizing: border-box;
       border-radius: .38rem;
-      border: 1px solid #DFE0E4;
+      border: 1px solid #dfe0e4;
+      background-color: #ffffff;
     }
     
     .check{
-      color: #colors[theme];
-      border: 1px solid #colors[theme];
+      color: #fff;
+      background-color: #6678FF;
+      border: 1px solid #6678FF;
     }
     .exclu{
       color:#colors[exclu];

+ 6 - 12
src/common/ComTextArea.vue

@@ -55,26 +55,20 @@ export default {
       }
     },
     changeVal(){
-          // $(".btscroll").css({'position':'fixed'})
       this.$emit('changeAreaVal',this.txt)
       const newData = Object.assign({},this.item,{value:this.txt,valueP:this.txt});
       this.$emit("updata",newData);
     },
     blur(){
-      if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
-        document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
-      }
-      $(".foot").css({'display':'block'})
-      // document.activeElement.scrollIntoViewIfNeeded(true);
-      // $(".foot").css({'display':'block'})
-      // setTimeout(()=>{
-      //   document.activeElement.scrollIntoViewIfNeeded(true);
-      // },300)
+      setTimeout(()=>{
+        $(".foot").css({'display':'block'})
+      },150)
     },
     focus(){
       if(isIos()){
-          // $(".btscroll").css({'position':'absolute'})
-        $(".foot").css({'display':'none'})
+        setTimeout(() => {
+          $(".foot").css({'display':'none'})
+        }, 150);
       }
     }
   },

+ 128 - 0
src/common/HomePage.vue

@@ -0,0 +1,128 @@
+<template>
+  <div class="startPage" v-if="show">
+    <div class="startBg">
+      <div class="title">{{title}}</div>
+      <div class="description" v-html="description"></div>
+    </div>
+    <span class="time">{{num}}s</span>
+    <div class="button" @click="close">开始填写</div>
+  </div>
+</template>
+<script>
+import api from "@utils/api.js";
+
+export default {
+  props:['showStart'],
+  data(){
+    return {
+      title:'',
+      description:'',
+      show:this.showStart,
+      num:5
+    }
+  },
+  watch:{
+    showStart(newVal,oldVal){
+      this.show = newVal
+    }
+  },
+  created(){
+    this.getDisclaimerInformations()
+  },
+  mounted(){
+    let num = this.num;
+    let timer = setInterval(() => {
+      this.num = --num
+      if(num == -1){
+        localStorage.setItem('startPage',0)
+        this.show = false
+        clearInterval(timer)
+      }
+    }, 1000);
+  },
+  methods:{
+    close(){
+      this.show = false
+    },
+    getDisclaimerInformations(){
+        api.getDisclaimerInformations().then(res => {
+            let result = res.data;
+            if (result.code == 0) {
+              let dataList = result.data
+              for(let i=0;i <dataList.length;i++){
+                if(dataList[i].disclaimerCode == 4){
+                  this.title = dataList[i].title
+                  this.description = dataList[i].description
+                }
+              }
+            }else{
+
+            }
+        })
+    },
+  }
+}
+</script>
+<style lang="less" scoped>
+.startPage {
+  position: fixed;
+  width: 100%;
+  height: 100%;
+  background-color: #fff;
+  z-index: 999;
+}
+.startBg {
+  width: 6.4rem;
+  height: 6.4rem;
+  position: absolute;
+  top: 15%;
+  left: 50%;
+  margin-left: -3.2rem;
+  background: url('../images/startBg.png') no-repeat;
+  background-size:contain;
+}
+.time {
+  background-color: #F5F5F5;
+  position: absolute;
+  width: 1rem;
+  height: .56rem;
+  line-height: .56rem;
+  border-radius: .28rem;
+  color: #ccc;
+  right: .3rem;
+  top:.4rem;
+  text-align: center;
+}
+.title{
+  color: #333333;
+  font-weight: 800;
+  font-size: .28rem;
+  position: absolute;
+  top: 12%;
+  width: 100%;
+  text-align: center;
+}
+.description {
+  font-size: .26rem;
+  color: #3A458A;
+  width: 3.2rem;
+  position: absolute;
+  top: 24%;
+  left: 1.55rem;
+}
+.button {
+  height: 0.88rem;
+  line-height: 0.88rem;
+  text-align: center;
+  background: #6678FF;
+  border-radius: 0.44rem;
+  color: #fff;
+  font-size: 0.32rem;
+  font-weight: 500;
+  width: 5.2rem;
+  position: absolute;
+  bottom: 15%;
+  left: 50%;
+  margin-left: -2.6rem;
+}
+</style>

+ 6 - 12
src/common/Input.vue

@@ -50,29 +50,23 @@
         if(this.item.controlType==7){//数字键盘
             this.val = e.target.value=e.target.value.replace(/^\.$/,'').slice(0,10)
         }
-        // document.activeElement.scrollIntoViewIfNeeded(true);
         this.borColor = false;
         const newData = Object.assign({},this.item,{value:this.val,valueP:this.val});
         this.$emit("updata",newData);
       },
       blur(){
-        // $(".btscroll").css({'position':'fixed'})
-        $(".foot").css({'display':'block'})
-        if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
-          document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
-        }
-        // document.activeElement.scrollIntoViewIfNeeded(true);
-        // setTimeout(()=>{
-        //   document.activeElement.scrollIntoViewIfNeeded(true);
-        // },300)
+        setTimeout(()=>{
+          $(".foot").css({'display':'block'})
+        },150)
         // this.borColor = false;
         // const newData = Object.assign({},this.item,{value:this.val,valueP:this.val});
         // this.$emit("updata",newData);
       },
       focus(e){
         if(isIos()){
-          // $(".btscroll").css({'position':'absolute'})
-          $(".foot").css({'display':'none'})
+          setTimeout(() => {
+            $(".foot").css({'display':'none'})
+          }, 150);
         }
       }
     },

+ 7 - 16
src/common/MultiLineInput.vue

@@ -1,5 +1,5 @@
 <template>
-  <div :style="{'margin-bottom':isLast?'0':'.3rem'}" :class="['multipIpt',{'border':border,'inline':inline,'check':select}]">
+  <div :style="{'margin-bottom':isLast?'0':'.2rem'}" :class="['multipIpt',{'border':border,'inline':inline,'check':select}]">
     <span class="prefix" v-if="content.prefix">{{content.prefix}}</span>
     <div class="sticP" :style="{paddingRight:content.suffix?'1rem':'0'}">
         <div class="iptWrap">
@@ -74,7 +74,6 @@ export default {
   methods:{
     changeVal(e,num,type){
       let tmpTxt = '',arr=this.tmpArr
-      // document.activeElement.scrollIntoViewIfNeeded(true);
       if(type == 'number'){
           e.currentTarget.value = e.currentTarget.value.replace(/^\.$/,'').slice(0,10)
       }
@@ -90,27 +89,19 @@ export default {
       this.$emit('handleInp',this.txt);
     },
     blur(){
-      // 如果该项未选中,则不存值
-      // $(".btscroll").css({'position':'fixed'})
-      $(".foot").css({'display':'block'})
-      
-      if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
-        document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
-      }
-      // document.activeElement.scrollIntoViewIfNeeded(true);
-      // setTimeout(()=>{
-      //   document.activeElement.scrollIntoViewIfNeeded(true);
-      // },300)
+      setTimeout(()=>{
+        $(".foot").css({'display':'block'})
+      },150)
     },
     focus(){
       if(isIos()){
-          // $(".btscroll").css({'position':'absolute'})
-        $(".foot").css({'display':'none'})
+        setTimeout(() => {
+          $(".foot").css({'display':'none'})
+        }, 150);
       }
     },
     handleClick(e){
       // 点击输入框时不选中该项
-      // document.activeElement.scrollIntoViewIfNeeded(true);
       e.stopPropagation();
     }
   },

+ 10 - 14
src/common/OptionInp.vue

@@ -48,16 +48,9 @@ import $ from 'jquery';
         this.$emit('handleSelec');
       },
       handleBlur(){
-          // $(".btscroll").css({'position':'fixed'})
-        $(".foot").css({'display':'block'})
-        
-        if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
-          document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
-        }
-        // document.activeElement.scrollIntoViewIfNeeded(true);
-        // setTimeout(()=>{
-        //   document.activeElement.scrollIntoViewIfNeeded(true);
-        // },300)
+        setTimeout(()=>{
+          $(".foot").css({'display':'block'})
+        },150)
           // 如果该项未选中,则不存值
         // const select = this.item.select;
         // if(!select){return}
@@ -67,8 +60,9 @@ import $ from 'jquery';
       },
       focus(){
         if(isIos()){
-          // $(".btscroll").css({'position':'absolute'})
-          $(".foot").css({'display':'none'})
+          setTimeout(() => {
+            $(".foot").css({'display':'none'})
+          }, 150);
         }
       },
       preClick(e){
@@ -103,6 +97,7 @@ import $ from 'jquery';
     vertical-align: middle;
     height: .42rem;
     line-height: .42rem;
+    margin-bottom:.08rem;
     .prefix,.suffix{
       display: inline-block;
       vertical-align: middle;
@@ -118,14 +113,15 @@ import $ from 'jquery';
       height: .42rem;
       color: #4F50FF;
       font-size: .3rem;
-      border-bottom: 1px solid #DFE0E4 !important;
+      border-bottom: 1px solid #CCCCCC !important;
       border-radius: 0;
       padding-left: .05rem;
       background-color: transparent;
       height: 0.38rem;
       line-height: 0.38rem;
       position: relative;
-      top: 2px;
+      top: 1px;
+      box-sizing: border-box;
     }
     .check{//选中
       color: #colors[theme];

+ 0 - 148
src/common/PickSlide.vue

@@ -1,148 +0,0 @@
-<template>
-  <portal to="notification-outlet">
-    <div v-if="show" class="swipper-content">
-      <div class="swipper-wrapper">
-        <swiper ref="mySwiper1">
-          <swiper-slide v-for="(item,i) in num" :key="i+'fst'">{{item}}</swiper-slide>
-        </swiper>
-        <swiper ref="mySwiper2">
-          <swiper-slide v-for="(item,i) in num" :key="i+'sec'">{{item}}</swiper-slide>
-        </swiper>
-        <swiper ref="mySwiper3">
-          <swiper-slide v-for="(item,i) in data" :key="i+'trd'">{{item}}</swiper-slide>
-        </swiper>
-        <div class="lineT"></div>
-        <div class="lineB"></div>
-        <div class="confBtn">
-          <p class="tip" style="display: none;">请选择正确的时间</p>
-          <p class="btnS">确认</p>
-        </div>
-      </div>
-      <div class="mask" :styke="{'z-index':'999'}" v-if="show"></div>
-    </div>
-  </portal>
-</template>
-
-<script>
-  export default {
-    name: 'carrousel',
-    props:['show'],
-    data() {
-      return {
-        num : [0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9],
-        data:['分钟', '小时', '天', '周', '月','年','分钟', '小时', '天', '周', '月','年','分钟', '小时', '天', '周', '月','年','分钟', '小时', '天', '周', '月','年']
-      }
-    },
-    computed: {
-      swiper1() {
-        setTimeout(()=>{
-          return this.$refs.mySwiper1.swiper
-        },0)
-      },
-      swiper2() {
-        setTimeout(()=>{
-          return this.$refs.mySwiper2.swiper
-        },0)
-      },
-      swiper3() {
-        setTimeout(()=>{
-          return this.$refs.mySwiper3.swiper
-        },0)
-      }
-    },
-    mounted() {
-      // this.swiper1 = new Swiper( this.$refs.mySwiper1, {
-      //   sliderMove: function(swiper){
-      //     console.log(this.swiper1.activeIndex)
-      //   }
-      // })
-      setTimeout(()=>{
-        console.log(this.swiper1)
-        this.swiper1.on('sliderMove',()=>{
-          console.log(this.swiper1.activeIndex)
-        })
-        this.swiper2.on('sliderMove',()=>{
-          console.log(this.swiper2.activeIndex)
-        })
-        this.swiper3.on('sliderMove',()=>{
-          console.log(this.swiper3.activeIndex)
-        })
-        // this.swiper.slideTo(3, 1000, false)
-
-      },400)
-    },
-    methods:{
-      onChange(){
-        
-      }
-    }
-  }
-</script>
-<style lang="less" scoped>
-@import '../less/base.less';
-.swiper-slide {
-  background-color: #fff;
-  height: 44px;
-  line-height: 44px;
-}
-.swiper-container {
-  height: 132px;
-  float: left;
-  width: 2.1rem;
-  text-align: center;
-}
-.swipper-wrapper {
-  font-size: .32rem;
-  height: 227px;
-  width: 6.3rem;
-  // overflow: hidden;
-  background-color: #ffffff;
-  position: fixed;
-  top: 50%;
-  left: 50%;
-  transform: translateX(-50%) translateY(-50%);
-  padding-top: 25px;
-  box-sizing: border-box;
-  border-radius: 0.2rem;
-  z-index: 1000;
-  .lineT {
-    height: 1px;
-    background-color: #f5f5f5;
-    position: absolute;
-    top: 2.1rem;
-  }
-  .lineB {
-    height: 1px;
-    background-color: #f5f5f5;
-    position: absolute;
-    top: 4.2rem;
-  }
-  .confBtn {
-    height: 44px;
-    line-height: 44px;
-    text-align: center;
-    border-top: 1px solid #ebedf0;
-    margin-top: 25px;
-    position: absolute;
-    bottom: 0;
-    width: 100%;
-    .btnS {
-      color: #6678FF;
-    }
-    .tip {
-      position: absolute;
-      top: -22px;
-      font-size: 0.24rem;
-      color: red;
-      line-height: 20px;
-      width: 100%;
-      text-align: center;
-    }
-  }
-}
-.swipper-content {
-  .mask{
-    z-index: 999;
-  }
-}
-</style>

+ 0 - 2
src/common/PickTime.vue

@@ -5,14 +5,12 @@
       <p v-show="val" :class="['ptab',{'check':val != '请选择'}]" @click="showPicker">{{val}}</p>
       <p v-show="val != '请选择'" class="tip">点击可修改</p>
       <Picker ref="picker" :show="showTime" @comfirn="getTimeVal" @cancel="close" :picIndex="picIndex"/>
-      <!-- <carrousel ref="picker"  v-if="showTime" :show="showTime" @comfirn="getTimeVal" @cancel="close" :picIndex="picIndex"></carrousel> -->
     </div> 
   <!-- </transition> -->
 </template>
 <script type="text/javascript">
   import $ from 'jquery';
   import Picker from './Picker.vue';
-  // import carrousel from './PickSlide.vue';
   export default {
     name:'PickTime',
     props:{

文件差异内容过多而无法显示
+ 51 - 48
src/common/Picker.vue


+ 16 - 14
src/common/Radio.vue

@@ -1,17 +1,17 @@
 <template>
-  <div v-if="item" class="radio-wrap bgques" :style="getStyle(detail,slide)">
+  <div v-if="item" class="radio-wrap bgques clearfix" :style="getStyle(detail,slide)">
     <!-- <p v-for="(it,index) in datas.questionDetailList" :key="it.id" class="list" @click="handleClick(it,index,true)"> -->
-    <p v-for="(it,index) in datas.questionDetailList" :key="it.id" :class="['list',{'block':((it.description||it.name).indexOf('${'))!=-1}]">
+    <div v-for="(it,index) in datas.questionDetailList" :key="it.id" :class="['list',{'block':((it.description||it.name).indexOf('${'))!=-1}]">
       <!-- <img :src="it.select==1?check:defaultPic"> -->
       <span v-if="((it.description||it.name).indexOf('${'))==-1" :class="['radioCheck',{'check':it.select==1}]" @click="handleClick(it,index,true)">{{it.description||it.name}}</span>
       <OptionInp v-else :item="it" @handleInp="inpVal($event,index)" @handleSelec="handleClick(it,index,false,true)"/>
-    </p>
+    </div>
   </div>
 </template>
 <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 icon from '../images/radio-default.png';
+import checkIcon from '../images/radio-check.png';
+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(){
@@ -122,11 +121,12 @@ import OptionInp from '../common/OptionInp.vue';
     }
     .list{
       color: #colors[text];
-      margin:0 .1rem .07rem 0;
-      padding: .1rem .1rem .1rem 0;
+      margin:0 .05rem;
+      padding: .05rem;
       display: inline-block;
       white-space: nowrap;
-      overflow-x: hidden;
+      // overflow-x: hidden;
+      float: left;
       // -webkit-white-space: nowrap;
       // -webkit-box-orient: vertical;
       img{
@@ -145,11 +145,13 @@ import OptionInp from '../common/OptionInp.vue';
         padding:0 .2rem;
         box-sizing: border-box;
         border-radius: .38rem;
-        border: 1px solid #DFE0E4;
+        border: 1px solid #dfe0e4;
+        background-color: #ffffff;
       }
       .check{
-        color: #colors[theme];
-        border: 1px solid #colors[theme];
+        color: #fff;
+        background-color: #6678FF;
+        border: 1px solid #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:'', //是有还是无

+ 2 - 1
src/common/Toast.vue

@@ -76,6 +76,7 @@ import $ from 'jquery';
         height: .9rem;
         line-height: .9rem;
         border-top: 1px solid #colors[line];
+        // font-weight: bold;
         span{
           display: inline-block;
           width: 50%;
@@ -88,7 +89,7 @@ import $ from 'jquery';
           color: #FF6167;
         }
         .canc{
-          color: #colors[btn];
+          color: #333333;
         }
       }
     }

+ 35 - 10
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"
@@ -54,9 +54,8 @@
       </div>
     </div>
     <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 +65,44 @@ 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,setTitle} from '@utils/tools.js';
 import BScroll from 'better-scroll';
 import PickTime from '../common/PickTime.vue';
+import {mapState} from 'vuex';
+
 export default {
   name: 'AddContent',
-  props: ['allMoudles','preName'],
   data() {
     return {
       imgUrl:imageUrlPrefix,
       dataTrd: [],
       val: '',
       allStr:'',
-      scroll:null
+      scroll:null,
+      allMoudles:{}
     }
   },
+  computed:{
+    ...mapState({
+      activeModule: state => state.activeModule,
+      datas: state => state.activeModule.obj.omhistory_show,
+    }),
+  },
   created(){
-    this.dataTrd = this.allMoudles && this.allMoudles.moduleDetailDTOList
-    this.allStr = this.$store.state.addContent.txt
+    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;
+  },
+  beforeRouteEnter (to, from , next) {
+    next(vm => {
+      // 通过 `vm` 访问组件实例
+      setTitle(vm.activeModule.obj.replenish_show.name)
+    })
   },
   mounted() {
+    this.$store.commit('setFinish',52)
     this.$nextTick(()=>{
       let scroll = setScroll(BScroll,true,'.addper')
       this.scroll = scroll
@@ -98,12 +115,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 +202,10 @@ export default {
       margin-bottom: 0.2rem;
       font-weight: bold;
     }
+    .comArea {
+      padding-top: 0;
+      padding-bottom: 0;
+    }
   }
 }
   .foot{

+ 52 - 19
src/components/Department.vue

@@ -11,7 +11,7 @@
                         <p>预约时间:{{item.recordTime}}</p>
                         <p>姓名:{{item.patientName}}</p>
                         <p>病历号:{{item.recordId}}</p>
-                        <p>挂号信息:{{item.registerNum}}</p>
+                        <p>排队号:{{item.registerNum}}</p>
                         <p v-if="item.dided">您已完成过一次预问诊,是否再次录入</p>
                     </div>
                 </div>
@@ -22,6 +22,7 @@
             :show="showTip"
             @close="close"
             :data="message"/>
+        <StartPage v-if="showStart" :showStart="showStart"/>
     </div>
 </template>
 <script>
@@ -29,6 +30,7 @@
     import BScroll from 'better-scroll';
     import Submit from "../common/Submit";
     import Tiptoast from "../common/Tiptoast";
+    import StartPage from "../common/HomePage";
     import api from "@utils/api.js";
     export default {
         name: "Department",
@@ -47,13 +49,15 @@
                 show: false,
                 son:false,//有无子医院
                 hospitalNum:'',
-                hospitalName:''
+                hospitalName:'',
+                showStart:false,//显示启动页
             }
         },
         created(){
             let query = this.$route.query;
             let type = query.patientInfoType,name = query.patientName,value = query.patientInfo,code=query.hospitalCode,sonHospitalCode=query.sonHospitalCode,sonHospitalName=query.sonHospitalName;
-            if(value&&name&&type&&code){
+            if(value&&name&&type&&code){//带信息直接跳转列表页面
+                this.getSysConfig(code)
                 const param = {
                     patientInfo: value,
                     patientInfoType: type,
@@ -62,6 +66,44 @@
                     sonHospitalCode: sonHospitalCode||'',
                     sonHospitalName: sonHospitalName||''
                 };
+                this.signInStr(param);
+            }else{
+                if(localStorage.getItem("startPage") !== null&&localStorage.getItem("startPage")==1){
+                    this.showStart = true
+                }
+                this.departmentLis = this.sortPart();
+            }
+        },
+        mounted(){
+            this.$nextTick(()=>{
+                let scroll = setScroll(BScroll,true,'.departmentView')
+                this.scroll = scroll
+            })
+        },
+        methods:{
+            getSysConfig(code){
+                api.getSysConfig({'hospitalCode':code}).then((res)=>{
+                    const result = res.data;
+                    if(result.code==0){
+                        const datas = result.data;
+                        this.$store.commit('saveSysConfig',datas)
+                        for(let i = 0;i < datas.length;i++){
+                            if(datas[i].code == 'homepage_show' && localStorage.getItem("startPage") === null){
+                                if(+datas[i].value==1){
+                                    localStorage.setItem('startPage',1)
+                                    //显示启动页
+                                    this.showStart = true
+                                }else{
+                                    localStorage.setItem('startPage',0)
+                                }
+                            }
+                        }
+                    }else{
+                        this.defaultWaring(res.data.msg);
+                    }
+                })
+            },
+            signInStr(param){
                 api.signIn(param).then(res => {
                     let result = res.data;
                     if (result.code == 0) {
@@ -96,25 +138,15 @@
                 }).catch(() => {
                     this.defaultWaring("网络异常请稍后重试");
                 });
-            }else{
-                this.departmentLis = this.sortPart();
-            }
-        },
-        mounted(){
-            this.$nextTick(()=>{
-                let scroll = setScroll(BScroll,true,'.departmentView')
-                this.scroll = scroll
-            })
-        },
-        methods:{
-            sortPart(){
+            },
+            sortPart(){//按日期排序
                 let tmpList = JSON.parse(localStorage.getItem('loginData'));
                 let tmpTime = JSON.parse(localStorage.getItem('recordTime'));
                 let sortArr = tmpList.sort(compare("recordTime"));
                 if(tmpTime){
                     for(let j = 0;j < tmpTime.length;j++){
                         for(let i = 0;i < sortArr.length;i++){
-                            if(tmpTime[j] == (new Date((sortArr[i].recordTime).replace(/\-/g, "/"))).getTime()){
+                            if(sortArr[i].recordTime&&tmpTime[j] == (new Date((sortArr[i].recordTime).replace(/\-/g, "/"))).getTime()){
                                 sortArr[i].dided = 1
                             }
                         }
@@ -148,9 +180,9 @@
                     patientCode:msg.patientCode,
                     recordId:msg.recordId,
                     sonHospitalCode:msg.sonHospitalCode||'',
-                    time:(new Date(time.replace(/\-/g, "/"))).getTime()
+                    time:time&&(new Date(time.replace(/\-/g, "/"))).getTime()
                 }
-                localStorage.setItem('loginParam',JSON.stringify(params))//保存登陆信息,扫码进入删除该参数
+                localStorage.setItem('loginParam',JSON.stringify(params))//保存登陆信息,扫码进入删除该参数
                 this.$router.push({
                     path:'/home',
                     query:params
@@ -159,7 +191,8 @@
         },
         components:{
             Submit,
-            Tiptoast
+            Tiptoast,
+            StartPage
         }
     }
 </script>

+ 106 - 66
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"
@@ -85,7 +90,7 @@ import ComTextArea from '../common/ComTextArea.vue';
 import RadioSelect from '../common/RadioSelect.vue';
 import MultiLineInput from '../common/MultiLineInput.vue';
 import PickTime from '../common/PickTime.vue';
-import {patt,trimDots,imageUrlPrefix,setScroll} from '@utils/tools.js';
+import {patt,trimDots,imageUrlPrefix,setScroll,configer} from '@utils/tools.js';
 import $ from 'jquery';
 // 将获取到的数据源转换成私有数据,处理选择事件。点击完成后统一存到store中,便于回读
   export default {
@@ -97,12 +102,28 @@ 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));
+      let num = 0;
+      if(tmpData.questionMapping&&tmpData.questionMapping.length>0){
+        for(let i = 0;i < tmpData.questionMapping.length;i++){
+          let tmpMap = tmpData.questionMapping[i]
+          if(configer.slide){
+            tmpMap.slide = 1
+          }
+          if(tmpMap.value || tmpMap.valueP){
+            ++num
+          }
+        }
+      }
+      this.current = num
+      this.$emit('isReadyCompete',num == tmpData.questionMapping.length)
       this.checkDatas = tmpData
     },
     mounted(){
@@ -124,15 +145,6 @@ import $ from 'jquery';
           }
       })
     },
-    components:{
-      Radio,
-      CheckBox,
-      Input,
-      ComTextArea,
-      MultiLineInput,
-      RadioSelect,
-      PickTime
-    },
     methods:{
       onScroll(data) {
         this.$store.commit('setScroll', data)
@@ -215,8 +227,16 @@ import $ from 'jquery';
               mapping.splice(i,1,data)
             }
           }
-          
         }
+        let num = 0;
+        for(let i = 0;i < mapping.length;i++){
+          let tmpMap = mapping[i];
+          if(tmpMap.value || tmpMap.valueP){
+            ++num
+          }
+        }
+        this.current = num
+        this.$emit('isReadyCompete',num == mapping.length)
         // 实时更新清空样式
         if(data.value){
           this.$emit('check',true)
@@ -318,48 +338,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 = [];
@@ -391,6 +411,15 @@ import $ from 'jquery';
         return true;
       }
     },
+    components:{
+      Radio,
+      CheckBox,
+      Input,
+      ComTextArea,
+      MultiLineInput,
+      RadioSelect,
+      PickTime
+    },
   }
 </script>
 <style lang="less" scoped>
@@ -418,7 +447,7 @@ import $ from 'jquery';
         display: inline-block;
         position: absolute;
         left: 0.22rem;
-        top: 0.55rem;
+        top: 0.38rem;
         width: 0.14rem;
         height: .14rem;
         border-radius: 50%;
@@ -462,10 +491,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;
@@ -476,18 +504,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;

+ 22 - 12
src/components/DetailBox.vue

@@ -8,9 +8,9 @@
                   ref="detail"
                   :flags="flags"
                   :data="data"
-                  :tips="tips"
                   :checkF="checkF"
                   @check="changeCheck($event)"
+                  @isReadyCompete="isReadyCompete($event)"
                   @setBtnTxt="setBtnTxt($event)"
                   @close="close($event)"
                   @handleClear="handleClear($event)"
@@ -19,8 +19,8 @@
       </div>
     </div>
     <div style="position:absolute" class="foot">
-      <div class="slide" @click="slideAll">{{btnTxt}}</div>
-      <div class="nextBtn compete" @click="complete">完成</div>
+      <!-- <div class="slide" @click="slideAll">{{btnTxt}}</div> -->
+      <div :class="['nextBtn','compete',{'readyComplete':readyComplete}]" @click="complete">完成</div>
     </div>
     <Toast :message="clearTxt" 
           :show="showToast"
@@ -63,12 +63,12 @@
         compFlag:false,
         clearTxt:"是否清空当前已选内容?",
         showToast:false,
-        tips:"温馨提示:请完成病情预问诊可让医生提前了解病情",
         checkF:false, //详情页有无已选项标识
         show:detailShow,
         reqFinish:false,
         showPic:false,
-        btnTxt:'展开全部'
+        btnTxt:'展开全部',
+        readyComplete:false
       }
     },
     mounted(){
@@ -85,6 +85,9 @@
       })
     },
     methods:{
+      isReadyCompete(flg){
+        this.readyComplete = flg
+      },
       setBtnTxt(txt){
         this.btnTxt = txt
       },
@@ -99,15 +102,15 @@
         $(".foot").css({'display':'block'})
         if(type == moduleCP['symp'] && !select){//只处理主诉症状
           const list = this.privateData.questionMapping;
-          if(list){
-            for(let i in list){
+          // if(list){
+            // for(let i in list){
               // if(list[i].required==1 && !list[i].value){
-              if(list[i].required==1){
+              // if(list[i].required==1){
                 // this.$store.commit('delChoose', {id: this.privateData.id })
                 // this.$store.commit('delText', { type: moduleCP['symp'], pId: this.privateData.id })
-              }
-            }
-          }
+              // }
+            // }
+          // }
         }
         this.$store.commit('setDetail',{detail:{}})
       },
@@ -214,8 +217,15 @@
       display: inline-block;
     }
     .compete {
-      width: 49%;
+      width: 99%;
       display: inline-block;
+      background-color: #fff;
+      border: 1px solid #6678FF;
+      color: #6678FF;
+    }
+    .readyComplete {
+      background-color: #6678FF;
+      color: #fff;
     }
     animation-delay:.6s;
     animation: foo .4s linear;

+ 29 - 35
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" 
@@ -58,15 +58,12 @@
     </div>
 
     <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 +73,44 @@
   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,setTitle} 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
+      }),
+    },
+    beforeRouteEnter (to, from , next) {
+      next(vm => {
+        // 通过 `vm` 访问组件实例
+        setTitle(vm.activeModule.obj.diagnosis_show.name)
+      })
+    },
     mounted(){
+      this.$store.commit('setFinish',51)
       this.$nextTick(()=>{
         let scroll = setScroll(BScroll,true,'.treatper')
         this.scroll = scroll
@@ -110,17 +120,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 +186,6 @@
       CheckBox,
       MultiLineInput,
       PickTime
-    },
-    computed:{
-      getItem(){
-        return this.$store.state.diagnose.text;
-      }
-    },
-    watch:{
-      getItem:{
-        handler(value){
-          this.checkText = value;
-        },
-        deep:true
-      }
     }
   }
 </script>

+ 12 - 7
src/components/Login.vue

@@ -8,13 +8,13 @@
     </div>
     <div class="main">
       <div class="iptWrap choose" v-if="hospitalShow">
-        <p @click="handleShow(1)">
+        <p class="ellips" @click="handleShow(1)">
           {{hospitalName}}
           <img src="../images/down.png" />
         </p>
         <div class="slideType" v-if="showH">
           <ul>
-            <li v-for="(item,idx) in hospitalList" :key="idx"  @click="handleCode(item,idx)" :style="{'border':(idx == (hospitalList.length-1))?'0 none':''}">{{item.hospitalName}}</li>
+            <li class="ellips" v-for="(item,idx) in hospitalList" :key="idx"  @click="handleCode(item,idx)" :style="{'border':(idx == (hospitalList.length-1))?'0 none':''}">{{item.hospitalName}}</li>
           </ul>
         </div>
       </div>
@@ -58,7 +58,7 @@
       </div>
       <div :class="['btn',canClick?'btnClick':'btnDis']" @click.stop.prevent="handleDepart">进入预问诊</div>
     </div>
-    <!-- <div class="tip">注:建议您可先输入病情情况,方便医生提前了解情况</div> -->
+    <div class="tip">注:建议您可先输入病情情况,方便医生提前了解情况</div>
     <Submit v-if="submit" :showType="showType" :fail="failMsg" @showSubmit="showSubmit"></Submit>
     <Loading v-if="this.$store.state.loadingShow"></Loading>
     <Tiptoast
@@ -180,9 +180,11 @@ export default {
         const result = res.data;
         if(result.code==0){
           const datas = result.data;
-          this.child = datas.filter((item)=>{return item.code == "constitution_show"})
           this.$store.commit('saveSysConfig',datas)
           for(let i = 0;i < datas.length;i++){
+            if(datas[i].code == 'homepage_show' && localStorage.getItem("startPage") === null){
+              localStorage.setItem('startPage',+datas[i].value==1?1:0)
+            }
             if(datas[i].code == 'junior_show'){
               this.hospitalShow = +datas[i].value==1?true:false
               if(datas[i].value==1){
@@ -373,9 +375,10 @@ export default {
   height: 100%;
   width: 100%;
   position: absolute;
-  background: #colors[btn];
   padding: 0rem 0.6rem;
   box-sizing: border-box;
+  overflow: auto;
+  background: #colors[btn];
   .top {
     .img {
       width: 1.6rem;
@@ -444,6 +447,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;
@@ -473,7 +478,7 @@ export default {
       line-height: 0.88rem;
       text-align: center;
       background: #colors[btn];
-      border-radius: 0.2rem;
+      border-radius: 0.44rem;
       color: #fff;
       font-size: 0.32rem;
       font-weight: 500;
@@ -488,7 +493,7 @@ export default {
   .tip {
     color: #fff;
     font-size: 0.24rem;
-    margin-top: 0.5rem;
+    margin-top: 0.4rem;
   }
 }
 </style>

+ 29 - 33
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"
@@ -51,16 +51,13 @@
         <p class="bgResult">{{getText()}}</p>
       </div>
     </div>
-    <div class="foot" v-if="modluesLen==3&&!nextName||modluesLen==2">
-      <!-- <span class="back" @click="beBack">{{'返回'+ preName}}</span> -->
+    <div class="foot" v-if="modluesLen==2||modluesLen==3&&!activeModule.obj.replenish_show">
       <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 +68,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,setTitle} 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 +81,31 @@
       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
+      }),
+    },
+    beforeRouteEnter (to, from , next) {
+      next(vm => {
+        // 通过 `vm` 访问组件实例
+        setTitle(vm.activeModule.obj.omhistory_show.name)
+      })
+    },
     mounted(){
+      this.$store.commit('setFinish',3)
+
       this.$nextTick(()=>{
         let scroll = setScroll(BScroll,true,'.otherper')
         this.scroll = scroll
@@ -107,14 +118,12 @@
         document.activeElement.scrollIntoViewIfNeeded(true);
       },
       beBack(){
-        this.$emit('back');
+        this.$router.go(-1);
       },
-      toNext(){
-        if(!this.nextName){
-          this.$emit('next','preview')
-        }else{
-          this.$emit('next');
-        }
+      toNext(flg,order){
+        this.$router.push({
+          path:getRouteName(flg?flg:'',this.activeModule.obj,order)
+        })
       },
       updataData(data,id,order,index){//输入框存值
         let list = this.dtoList;
@@ -173,19 +182,6 @@
       CheckBox,
       MultiLineInput,
       PickTime
-    },
-    computed:{
-      getItem(){
-        return this.$store.state.others.text;
-      }
-    },
-    watch:{
-      getItem:{
-        handler(value){
-          this.checkText = value;
-        },
-        deep:true
-      }
     }
   }
 </script>

+ 99 - 34
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="perMsg perLine">
-          <span class="msgTitle">患者信息:</span>
-          <span class="perDetail">{{pathInfo.patientName}}</span>
-          <span class="perDetail">{{pathInfo.patientSex}}</span>
-          <span class="perDetail">{{pathInfo.patientAge}}岁</span>
-        </p>
         <p class="perLine">
-          <span class="msgTitle">挂号科室:</span>
-          <span>{{pathInfo.hospitalDeptName}}</span>  
+          <span class="msgTitle">姓名</span>
+          <i>:</i>
+          <span>{{pathInfo.patientName}}</span>  
         </p>
         <p class="perLine">
-          <span class="msgTitle">{{pathInfo.doctorName?'预约医生:':''}}</span>
+          <span class="msgTitle">性别</span>
+          <i>:</i>
+          <span>{{pathInfo.patientSex}}</span>  
+        </p>
+        <p class="perMsg perLine">
+          <span class="msgTitle">年龄</span>
+          <i>:</i>
+          <span class="perDetail">{{pathInfo.patientAge}}岁</span>
+        </p>
+        <p class="emptyLine"></p>
+        <p class="perLine" v-if="pathInfo.doctorName">
+          <span class="msgTitle">{{pathInfo.doctorName?'预约医生':''}}</span>
+          <i v-if="pathInfo.doctorName">:</i>
           <span>{{pathInfo.doctorName}}</span>
         </p>
-        <p class="perLine">
-          <span class="msgTitle">{{pathInfo.recordId?'门诊号:':''}}</span>
+        <p class="perLine" v-if="pathInfo.hospitalDeptName">
+          <span class="msgTitle">{{pathInfo.hospitalDeptName?'科室':''}}</span>
+          <i v-if="pathInfo.hospitalDeptName">:</i>
+          <span>{{pathInfo.hospitalDeptName}}</span>  
+        </p>
+        <p class="perLine" v-if="pathInfo.recordId">
+          <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>
+        <p class="perLine" v-if="time">
+          <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> -->
@@ -48,14 +62,18 @@
       :fail="tipMsg"
       showType="fail"
     ></Submit>
+    <StartPage v-if="showStart" :showStart="showStart"/>
   </div>
 </template>
 <script type="text/javascript">
   import api from '@utils/api.js'
   import Submit from '../common/Submit';
   import Toast from '../common/Toast.vue';
-  import {setScroll,dateParser} from '@utils/tools.js'
+  import {setScroll,dateParser,setTitle,moduleConfig } from '@utils/tools.js'
+  import StartPage from "../common/HomePage";
   import BScroll from 'better-scroll';
+  import {mapState} from 'vuex';
+
   export default {
     name:'PathInfo',
     data(){
@@ -77,15 +95,25 @@
         time:'',
         params:{},
         showToast:false,
-        message:'您已完成一次预问诊,是否重新录入?'
+        message:'您已完成一次预问诊,是否重新录入?',
+        showStart:false,
+        allMoudles:{}
       }
     },
+    computed:{
+      ...mapState({
+        config: state => state.sysConfig,
+        tmpAllMoudles: state => state.allMoudles,
+      }),
+    },
     created(){
       this.getPathInfo();
-      this.getSysConfig();
       this.$store.commit('initAllData');//初始化store数据
     },
     mounted(){
+      let tmpModule = moduleConfig(this.config,this.tmpAllMoudles);
+      this.allMoudles = tmpModule;
+      this.$store.commit('setActiveModule', tmpModule);
       this.$nextTick(()=>{
         let scroll = setScroll(BScroll,true,'.path-wrap')
         this.scroll = scroll
@@ -109,6 +137,7 @@
           'doctorCode':!hasQuery&&query.doctorCode||'',
           'patientCode':!hasQuery&&query.patientCode||'',
           'recordId':!hasQuery&&query.recordId||'',
+          'recordTime':!hasQuery&&query.recordTime||'',
           "sonHospitalCode": !hasQuery&&query.sonHospitalCode||''
         }
         if(!hasQuery&&query.scan){//扫码进入的
@@ -116,9 +145,14 @@
           localStorage.removeItem('loginData')
           localStorage.setItem('scan',true)//保存扫码标记
           localStorage.setItem('infoParam',JSON.stringify(params))//保存扫码信息,登录进入需删除该参数
+          this.getSysConfig();
         }else{//登陆进入的
           localStorage.removeItem('infoParam')
           localStorage.removeItem('scan')
+          this.getSysConfig(1);
+          if(localStorage.getItem("startPage") == 1){
+            this.showStart = true
+          }
         }
         api.getPathInfo(params).then((res)=>{
           const result = res.data;
@@ -129,7 +163,7 @@
           }
         })
       },
-      getSysConfig(){
+      getSysConfig(flg){
         let query = this.$route.query
         let hasQuery = JSON.stringify(query) == '{}';
         const param = {
@@ -139,8 +173,19 @@
           const result = res.data;
           if(result.code==0){
             const datas = result.data;
-            // this.child = datas.filter((item)=>{return item.code == "constitution_show"})
             this.$store.commit('saveSysConfig',datas)
+            if(flg){return}
+            for(let i = 0;i < datas.length;i++){
+                if(datas[i].code == 'homepage_show' && localStorage.getItem("startPage") === null){
+                    if(+datas[i].value==1){
+                        localStorage.setItem('startPage',1)
+                        //显示启动页
+                        this.showStart = true
+                    }else{
+                        localStorage.setItem('startPage',0)
+                    }
+                }
+            }
           }
         })
       },
@@ -166,7 +211,7 @@
       },
       goNext(){
         if(this.isReady){
-          this.$router.replace({path:'/tab'})
+          this.$router.push({path:'/tab'})
         }else{
           this.defaultWaring('请先维护症状模块')
         }
@@ -209,7 +254,8 @@
     },
     components:{
       Submit,
-      Toast
+      Toast,
+      StartPage
     }
   }
 </script>
@@ -229,18 +275,20 @@
     }
     .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;
-        padding: .36rem 0 .18rem 0;
+        text-align: center;
+        font-size: .46rem;
+        padding: .3rem 0 .18rem 0;
         color: #fff;
       }
       .explain {
@@ -249,21 +297,30 @@
         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;
+      height: 6.4rem;
       .msg {
         font-size: .32rem;
-        padding-bottom: .28rem;
+        padding-bottom: .18rem;
         border-bottom: 1px solid #E6E6E6;
-        margin-bottom: .6rem;
+        margin-bottom: .4rem;
         .person {
           display: inline-block;
           width: .38rem;
@@ -281,8 +338,13 @@
       }
       .msgTitle {
         display: inline-block;
-        width: 1.6rem;
+        width: 1.3rem;
+        color: #777777;
+      }
+      i {
         color: #777777;
+        position: relative;
+        bottom: 1px;
       }
       .perMsg {
         .perDetail {
@@ -300,11 +362,14 @@
       font-size: .32rem;
       color: #fff;
       margin: 0 auto;
-      border-radius: 5px;
+      border-radius: .44rem;
       position: absolute;
       bottom: .68rem;
       transform: translateX(-50%);
       left: 50%;
     }
+    .emptyLine {
+      height: 0.22rem;
+    }
   }
 </style>

+ 44 - 27
src/components/Preview.vue

@@ -10,7 +10,7 @@
               <td><span>挂号科室:</span>{{pathInfo.selfDeptName}}</td>
             </tr>
             <tr v-if="pathInfo.recordId">
-              <td><span>门诊号:</span>{{pathInfo.recordId}}</td>
+              <td><span>排队号:</span>{{pathInfo.recordId}}</td>
             </tr>
             <tr v-if="pathInfo.doctorName">
               <td><span>预约医生:</span>{{pathInfo.doctorName}}</td>
@@ -38,19 +38,19 @@
                 <template v-for="(value,index) in checkText">
                   <!-- 患者于时间单位前诱因出现症状,其余题目的内容; -->
                   <span :key="index" v-if="index==0">{{(value.idx==1?'':'伴')+value.textP}}{{checkText.length==1?'':','}}</span>
-                  <span :key="index" v-if="index==1">{{(checkText[0].idx == 1?'伴':'')+value.text}}{{checkText.length==2?'':'、'}}</span>
-                  <span :key="index" v-if="index>1">{{value.text}}{{index == checkText.length-1?'':'、'}}</span>
+                  <span :key="index" v-if="index==1">{{(checkText[0].idx == 1?'伴':'')+value.textP}}{{checkText.length==2?'':'、'}}</span>
+                  <span :key="index" v-if="index>1">{{value.textP}}{{index == checkText.length-1?'':'、'}}</span>
                 </template>
               </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>
@@ -66,10 +66,6 @@
       </div>
     </div>
     <div class="foot">
-        <!-- <span
-          class="back"
-          @click="back"
-        >{{'返回'+ preName}}</span> -->
         <span
           class="back"
           @click="back"
@@ -84,7 +80,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">
@@ -105,19 +101,19 @@
                   <template v-for="(value,index) in checkText">
                     <!-- 患者于时间单位前诱因出现症状,其余题目的内容; -->
                     <span :key="index" v-if="index==0">{{(value.idx==1?'':'伴')+value.text}}{{checkText.length==1?'':','}}</span>
-                    <span :key="index" v-if="index==1">{{(checkText[0].idx == 1?'伴':'')+value.textP}}{{checkText.length==2?'':'、'}}</span>
-                    <span :key="index" v-if="index>1">{{value.textP}}{{index == checkText.length-1?'':'、'}}</span>
+                    <span :key="index" v-if="index==1">{{(checkText[0].idx == 1?'伴':'')+value.text}}{{checkText.length==2?'':'、'}}</span>
+                    <span :key="index" v-if="index>1">{{value.text}}{{index == checkText.length-1?'':'、'}}</span>
                   </template>
                 </p>
-                <p><span>{{getDetailText(diagnose.text,false).view}}</span></p>
+                <p><span>{{getDetailText(diagnose.text,false).content}}</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>
+                  <span>{{getDetailText(others.text,false).content}}</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,14 +135,16 @@ 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;
     let addContentDate = this.$store.state.addContent;
+    console.log(symptomDate)
     return {
       msg: '预览',
       pathInfo: pathInfo,
@@ -165,15 +163,33 @@ export default {
       time:''
     }
   },
+  computed:{
+    ...mapState({
+      tabType: state => state.tabType,
+      config: state => state.sysConfig,
+    })
+  },
   created(){
     this.getTime();
+    if (this.config.length == 0) {//登录进去返回到列表页,扫码返回到开始页
+      let scan = localStorage.getItem('scan');
+      let params = JSON.parse(localStorage.getItem('infoParam'));
+      let param = JSON.parse(localStorage.getItem('loginParam'));
+      let data = JSON.parse(localStorage.getItem('loginData'));
+      if(!scan){
+        if(data.length>1){
+          this.$router.push({path:'/department'});
+        }else{
+          this.$router.push({path:'/home',query:param});
+        }
+      }else{
+        this.$router.push({path:'/home',query:Object.assign({}, params,{scan:true})});
+      }
+    }
   },
   mounted() {
-    this.$nextTick(()=>{
-      let scroll = setScroll(BScroll,true,'.previewper')
-      this.scroll = scroll
-    })
-
+    let scroll = setScroll(BScroll,true,'.previewper')
+    this.scroll = scroll
   },
   methods: {
     getTime() {
@@ -195,7 +211,7 @@ export default {
       this.submit = flg
     },
     back() {
-      this.$emit('back', 'preview')
+      this.$router.go(-1);
     },
     saveAllImage() {
       let formData = new FormData();
@@ -385,6 +401,7 @@ export default {
   float: right;
   color: #0043E8;
   margin-bottom: 30px;
+  font-size: 14px;
 }
 .preview {
   color: red;
@@ -452,10 +469,10 @@ export default {
       font-weight: bold;
       position: relative;
       i {
-        width: .16rem;
-        height: .16rem;
+        width: .12rem;
+        height: .12rem;
         border-radius: 50%;
-        background: #colors[theme];
+        background: #FFAD00;
         display: inline-block;
         position: absolute;
         top: .15rem;

+ 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','setText'],
   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;

+ 175 - 92
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/>(已填内容将清除)",
+      delText: "是否删除该症状?",
       delIndex: null,
       showToast: false,
-      searchShow: searchShow,//显示搜索界面
       tmpItem:{},//检索的症状
       isSearch:false,
       scroll:null,
-      quesText:"请问这次哪里不舒服?",
+      quesText:"您哪里不舒服?",
       startTime:'',
       timer:null,
       showExp:false,
@@ -124,13 +122,34 @@ export default {
       start:{},
       end:{},
       slide:false,
-      slideTxt:'展开',
+      slideTxt:'点击展开',
       failMsg: "无法选择症状,已超过最大个数",
+      modluesLen:null,
+      nameStr:'',
+      degNum:0,
+      startNum:0
     }
   },
+  computed:{
+    ...mapState({
+      activeModule: state => state.activeModule,
+      searchShow: state => state.searchShow,//搜索界面显示
+      chooseSymp: state => state.symptom.choose,//已选症状
+      checkText: state => state.symptom.text,//症状情况文字
+      config: state => state.sysConfig,
+      pathInfo: state => state.pathInfo
+    }),
+  },
+    
+  beforeRouteEnter (to, from , next) {
+    next(vm => {
+      // 通过 `vm` 访问组件实例
+      setTitle(vm.activeModule.obj.symptoms_show.name)
+    })
+  },
   created() {
     if (this.chooseSymp.length > 0) {
-      this.quesText = "请问您还有其他不适吗?";
+      this.quesText = "您是否还有其他不舒服?";
       // 推送
       const sympText = this.getSympText();
       this.getPush(sympText);
@@ -139,7 +158,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)
@@ -153,33 +177,45 @@ export default {
           if(this.chooseSymp.length>1||localStorage.getItem("staticSymp")){
             this.getPush(sympText);
           }
-          this.quesText = "请问您还有其他不适吗?";
+          this.quesText = "您是否还有其他不舒服?";
         }else{
           this.getSympList();
-          this.quesText = "请问这次哪里不舒服?";
+          this.quesText = "您哪里不舒服?";
         } 
       },
       deep:true
     }
   },
   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) {//症状点开详情
       clearTimeout(this.timer);
       this.end = this.$store.state.scroll
       if(JSON.stringify(this.start) != JSON.stringify(this.end)){
+        this.startNum = 0
         return
       }
       let endTime = +new Date();
@@ -187,13 +223,18 @@ export default {
         if(this.chooseSymp.length == 0){
           item.idx = 1
         }
-        this.common(item,flg);
-        this.slideTxt = '展开'
+        if(this.startNum == 1){
+          this.common(item,flg);
+        }
+        this.startNum = 0
+        this.slideTxt = '点击展开'
+        this.degNum = 0
       }
       this.startTime = "";
     },
     touchstart(it){
-      this.start = this.$store.state.scroll
+      this.startNum = ++this.startNum;
+      this.start = this.$store.state.scroll;
       this.startTime = +new Date();
       const that = this;
       this.timer = setTimeout(function(){
@@ -206,26 +247,26 @@ export default {
             that.message.title = "";
             that.message.text = "暂无资料";
           }
+          this.startNum = 0
         },600)
     },
     closeTip(){
       this.showExp = false,
+      this.startNum = 0
       this.message.title = '';
       this.message.text = '';
     },
     onScroll(data) {
       this.$store.commit('setScroll', data);
-      document.activeElement.scrollIntoViewIfNeeded(true);
     },
     search(flg) {
       this.$store.commit('setSearchShow', flg);
     },
-
     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 +280,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 +295,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:'' });
@@ -285,7 +315,6 @@ export default {
               let signNum = 1;//第一个打标的,保存为伴随
               for(let i = 0;i < mapping.length;i++){
                 let tmpMap = mapping[i]
-                tmpMap.slide = 1
                 if(tmpMap.flag == 3 && signNum == 1){
                   ++signNum
                   for(let j = 0;j < tmpMap.questionDetailList.length;j++){
@@ -301,11 +330,11 @@ export default {
               if(sign){
                 return
               }
+              this.hasSymptom(item)
               this.$store.commit('setSearchShow', false);
-              this.chooseSymp.push(item);
             } else { 
+              this.hasSymptom(item)
               this.$store.commit('setSearchShow', false);
-              this.chooseSymp.push(item);
             }
             result.data.questionMapping = mapping
             this.labelDetail = result.data;
@@ -324,12 +353,23 @@ export default {
         }
         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:'' });
         this.$store.commit('setSearchShow', false);
-        this.chooseSymp.push(item);
+        this.hasSymptom(item)
         const sympText = this.getSympText();
         this.getPush(sympText);
         // this.checkText = this.$store.state.symptom.text;
       }
     },
+    hasSymptom(item){
+      let tmpLis = this.chooseSymp,num=0;
+      for(let i = 0;i<tmpLis.length;i++){
+        if(item.name != tmpLis[i].name){
+          ++num
+        }
+      }
+      if(num == tmpLis.length){
+        this.chooseSymp.push(item);
+      }
+    },
     showDetil(item,flg) {//搜索点开的详情
       this.tmpItem=item
       this.isSearch=flg||false
@@ -348,50 +388,56 @@ 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) => {
         const result = res.data;
         if (result.code == 0) {
-          let symp = result.data.symptom||[];
-          let symped = JSON.parse(JSON.stringify(this.chooseSymp));//已选症状
-          let sympStic = JSON.parse(localStorage.getItem('staticSymp'))||[];//首次有无症状
-          let sympAll = sympStic.concat(symp);
-          var obj = {};
-          sympAll = sympAll.reduce(function(item, next) {
-            obj[next.name] ? '' : obj[next.name] = true && item.push(next);
-            return item;
-          }, []);
-          for(let i = 0;i < symped.length;i++){//去掉已选的已选症状
-            for(let j = 0;j < sympAll.length;j++){//去掉
-              if(sympAll[j].name == symped[i].name){
-                sympAll.splice(j,1)
-              }
-            }
-          }
-          this.symp = sympAll.slice(0,12);
-          this.$refs.showHide.style.height = 'auto'
+          this.getSymptomLisCom(result)
+        }else{
+          this.getSymptomLisCom()
         }
-      }).catch(()=>{
-
+      }).catch((err)=>{
+        
       })
     },
+    getSymptomLisCom(result){
+      let symp = (result&&result.data.symptom)||[];
+      let symped = JSON.parse(JSON.stringify(this.chooseSymp));//已选症状
+      let sympStic = JSON.parse(localStorage.getItem('staticSymp'))||[];//首次有无症状
+      let sympAll = sympStic.concat(symp);
+      var obj = {};
+      sympAll = sympAll.reduce(function(item, next) {
+        obj[next.name] ? '' : obj[next.name] = true && item.push(next);
+        return item;
+      }, []);
+      for(let i = 0;i < symped.length;i++){//去掉已选的已选症状
+        for(let j = 0;j < sympAll.length;j++){//去掉
+          if(sympAll[j].name == symped[i].name){
+            sympAll.splice(j,1)
+          }
+        }
+      }
+      this.symp = sympAll.slice(0,12);
+      this.$refs.showHide.style.height = 'auto'
+    },
     deletSymp(item, index) {
       this.delIndex = index;
       this.questId = item.questionId || item.id || item.conceptId;
-
       if (this.chooseSymp.length == 1) {
         if(item.idx != 1){
-          this.delText = "是否删除该信息?<br/>删除后将重新填写预问诊流程 <br/>"
+          this.delText = "是否删除该症状?"
         }else{
-          this.delText = "是否删除该信息?<br/>删除后将重新填写预问诊流程 <br/>(已填内容将清除)"
+          this.delText = "要删除症状,重新填写?"
         }
       }else{
         if(item.idx != 1){
-          this.delText = "是否删除该信息?"
+          this.delText = "是否删除该症状?"
+        }else{
+          this.delText = "要删除症状,重新填写?"
         }
       }
       this.showToast = true;
@@ -413,7 +459,7 @@ export default {
         // 全部删除完 重新走问诊流程
         // this.$router.push("/")
         // this.$router.replace({path:'/'})
-        // 停留在当前页 8-19
+        // 停留在当前页 8-19   
         this.quesText = "请问您这次哪里最不舒服?";
         this.getSympList();
       }
@@ -425,7 +471,7 @@ export default {
       this.showToast = false;
       this.delIndex = null;
       this.questId = null;
-      this.delText = "是否删除该信息?<br/>(已填内容将清除)";
+      this.delText = "是否删除该症状?";
     },
     showChecked(item,i) {
       const origin = this.$store.state.symptom.origin;
@@ -450,10 +496,29 @@ export default {
   overflow: hidden;
   height: 3rem;
 }
-.tip span {
-  color: #colors[theme];
-  float: right;
-  font-size: .28rem;
+.tips {
+  color: #AAAAAA;
+  margin-bottom:.2rem;
+  font-size: .26rem;
+}
+.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: 15px;
+      height:15px;
+      position: absolute;
+      bottom: 1px;
+      left: 0;
+    }
+  }
 }
 .symp-wrap {
   font-size: 0.3rem;
@@ -461,13 +526,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;

+ 45 - 157
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,139 +28,69 @@ 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,setTitle} 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,
+      getPathInfo:state=>state.getPathInfo,
+      tmpAllMoudles: state => state.allMoudles,
+    }),
+  },
   created() {
+    this.routerName = this.$route.name
     if (this.config.length == 0) {//登录进去返回到列表页,扫码返回到开始页
       let scan = localStorage.getItem('scan');
+      let data = JSON.parse(localStorage.getItem('loginData'));
       let params = JSON.parse(localStorage.getItem('infoParam'));
       let param = JSON.parse(localStorage.getItem('loginParam'));
-      let data = JSON.parse(localStorage.getItem('loginData'));
       if(!scan){
         if(data.length>1){
-          this.$router.replace({path:'/department'});
+          this.$router.push({path:'/department'});
         }else{
-          this.$router.replace({path:'/home',query:param});
+          this.$router.push({path:'/home',query:param});
         }
       }else{
-        this.$router.replace({path:'/home',query:Object.assign({}, params,{scan:true})});
+        this.$router.push({path:'/home',query:Object.assign({}, params,{scan:true})});
       }
     }
   },
+  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;
+        // this.finish[parseInt(item.type)] = true;
+        this.$store.commit('setFinish',item.type)
+        let routeName = getRouteName(item.type)
+        this.$router.push({
+          path:routeName
+        })
       }
     },
-    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
-      }
-      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: {
     Symptom,
@@ -254,15 +143,14 @@ export default {
       height: .04rem;
       background-color: #colors[btn];
       display: inline-block;
-      position: relative;
-      bottom: .2rem;
+      position: absolute;
+      bottom: -0.16rem;
+      left: 50%;
+      margin-left: -0.3rem;
     }
     .current {
       color: #colors[btn];
-      border-radius: 25px;
-    }
-    .comp{
-      color: #colors[btn];
+      position: relative;
     }
 }
   .content {

二进制
src/images/banerbg@1.5x.png


二进制
src/images/blueSlide.png


二进制
src/images/childbg@1.5x.png


文件差异内容过多而无法显示
+ 0 - 1
src/images/important.svg


二进制
src/images/startBg.png


二进制
src/images/topContent.png


+ 4 - 4
src/less/base.less

@@ -36,7 +36,7 @@
     height: .88rem;
     line-height: .88rem;
     background: #colors[btn];
-    border-radius: 5px;
+    border-radius: .44rem;
   }
 }
 .dbfooter{
@@ -61,7 +61,7 @@
     vertical-align: top;
     border: 1px solid #colors[theme];  
     box-sizing: border-box;
-    border-radius: 5px;
+    border-radius: .44rem;
   }
   .back{
     width: 48%;
@@ -158,13 +158,13 @@
   background-color: #colors[quest];
 }
 .bgques {//问题内容
-  padding: .24rem .3rem .2rem .3rem;
+  padding: .12rem .3rem .12rem .3rem;
   // display: none;
 }
 .pubques {//问题题目
   font-size: .32rem;
   // font-weight: 800;
-  padding: .4rem 0.5rem .4rem .3rem;
+  padding: .24rem 0.5rem .24rem .3rem;
   word-break: break-all;
   background-color: #fff;
   box-shadow:0px 2px 8px 0px rgba(0,0,0,0.07);

+ 0 - 12
src/main.js

@@ -4,25 +4,13 @@ import store from './store.js';
 import App from './App.vue';
 import preview from 'vue-photo-preview';
 import 'vue-photo-preview/dist/skin.css';
-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';
 
 
 Vue.use(PortalVue);
-
-Vue.use(VueAwesomeSwiper,{
-  direction:'vertical',
-  // loop:true,
-  slidesPerView: 3,
-  spaceBetween: 0,
-  freeMode: false,
-})
-
 Vue.use(preview);
 Vue.use(Picker);
 Vue.config.productionTip = false;

+ 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;

+ 46 - 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,19 @@ 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);
+      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

@@ -4,6 +4,10 @@ const $ = require('jquery');
 const imageUrlPrefix = 'http://192.168.2.122:82';//'http://223.93.170.82:10082' //后台图片地址
 // const imageUrlPrefix = 'http://192.168.2.236:82' //后台图片地址
 
+const configer = {
+  slide:true,//true展开false折叠
+}
+
 const getUrlArgObject = (parm) => {
     let query = window.location.search;
     let args = qs.parse(query.substr(1));
@@ -118,6 +122,7 @@ const phoneTest = /^[1]([3-9])[0-9]{9}$/;
  * \d{2}[0-9Xx]                顺序码两位,一位校验码最后一位数字或者大小写X
  */
 /**18位
+ *
  *
  *
  * [1-9]\d{5}                 前六位地区,非0打头
@@ -167,27 +172,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:''//默认展示的模块
   }
 }
 
@@ -326,6 +336,7 @@ function setScroll(scroll,flg,wrapper){
       scrollY: flg,
       click: true,
       tap: true,
+      autoBlur:isIos()?true:false,
       probeType:3,
       bounceTime:800,
       momentumLimitTime:300,//只有在屏幕上快速滑动的时间小于 momentumLimitTime,才能开启 momentum 动画。
@@ -378,6 +389,48 @@ const getNum = () => {
   return num;
 }
 
+
+// 设置title
+const setTitle = (title) => {
+  document.title = title;
+}
+// 匹配下一步的路由
+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,
   getUrlArgObject,
@@ -402,7 +455,10 @@ module.exports =  {
   dateParser,
   name,
   isQQ,
-  getNum
+  getNum,
+  configer,
+  setTitle,
+  getRouteName
 }