Quellcode durchsuchen

Merge remote-tracking branch 'origin/new1.1.1'

zhouna vor 5 Jahren
Ursprung
Commit
2caaa7b44d

+ 31 - 0
package-lock.json

@@ -3539,6 +3539,14 @@
         "entities": "^1.1.1"
       }
     },
+    "dom7": {
+      "version": "2.1.3",
+      "resolved": "https://registry.npmjs.org/dom7/-/dom7-2.1.3.tgz",
+      "integrity": "sha512-QTxHHDox+M6ZFz1zHPAHZKI3JOHY5iY4i9BK2uctlggxKQwRhO3q3HHFq1BKsT25Bm/ySSj70K6Wk/G4bs9rMQ==",
+      "requires": {
+        "ssr-window": "^1.0.1"
+      }
+    },
     "domain-browser": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz",
@@ -10575,6 +10583,11 @@
         "tweetnacl": "~0.14.0"
       }
     },
+    "ssr-window": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-1.0.1.tgz",
+      "integrity": "sha512-dgFqB+f00LJTEgb6UXhx0h+SrG50LJvti2yMKMqAgzfUmUXZrLSv2fjULF7AWGwK25EXu8+smLR3jYsJQChPsg=="
+    },
     "ssri": {
       "version": "5.3.0",
       "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz",
@@ -10858,6 +10871,15 @@
         }
       }
     },
+    "swiper": {
+      "version": "4.5.1",
+      "resolved": "https://registry.npmjs.org/swiper/-/swiper-4.5.1.tgz",
+      "integrity": "sha512-se6I7PWWu950NAMXXT+ENtF/6SVb8mPyO+bTfNxbQBILSeLqsYp3Ndap+YOA0EczOIUlea274PKejT6gKZDseA==",
+      "requires": {
+        "dom7": "^2.1.3",
+        "ssr-window": "^1.0.1"
+      }
+    },
     "tapable": {
       "version": "0.2.9",
       "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.9.tgz",
@@ -11377,6 +11399,15 @@
       "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.10.tgz",
       "integrity": "sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ=="
     },
+    "vue-awesome-swiper": {
+      "version": "3.1.3",
+      "resolved": "https://registry.npmjs.org/vue-awesome-swiper/-/vue-awesome-swiper-3.1.3.tgz",
+      "integrity": "sha512-E7suzkyApO8vNZbgdEnjSmnpsmQZyRvSVXJ7sey3XYwKPOkLhH3+GnHroBw+5PZIQXvWBwdCeQsPG1xQ1r1Rhg==",
+      "requires": {
+        "object-assign": "^4.1.1",
+        "swiper": "^4.0.7"
+      }
+    },
     "vue-hot-reload-api": {
       "version": "2.3.3",
       "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.3.tgz",

+ 1 - 0
package.json

@@ -21,6 +21,7 @@
     "portal-vue": "^2.1.6",
     "vant": "^2.2.10",
     "vue": "^2.5.2",
+    "vue-awesome-swiper": "^3.1.3",
     "vue-photo-preview": "^1.1.3",
     "vue-router": "^3.0.1",
     "vuex": "^3.1.1",

+ 2 - 2
src/common/CheckBox.vue

@@ -132,7 +132,7 @@ import OptionInp from '../common/OptionInp.vue';
             this.exclusion = filArr1[0].exclusion;
           }
         }
-        let temp = concatVal(data);
+        let temp = concatVal(data,false,this.datas.flag);
         const newData = Object.assign({},this.datas,{questionDetailList:data},{value:temp.value?temp.value:''},{valueP:temp.valueP?temp.valueP:''});
         this.$emit("updata",newData);
       },
@@ -142,7 +142,7 @@ import OptionInp from '../common/OptionInp.vue';
         let currItem = detailList[index];
         currItem.value = val;
         // 输入框失焦重新拼接父级的value
-        let temp = concatVal(detailList);
+        let temp = concatVal(detailList,false,this.datas.flag);
         this.datas.value = temp.value;
         this.datas.valueP = temp.valueP;
         this.$emit("updata",this.datas);

+ 148 - 0
src/common/PickSlide.vue

@@ -0,0 +1,148 @@
+<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>

+ 4 - 1
src/common/PickTime.vue

@@ -5,12 +5,14 @@
       <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:{
@@ -70,7 +72,8 @@
       }
     },
     components:{
-      Picker
+      Picker,
+      // carrousel
     },
     watch:{
       item:{

+ 6 - 4
src/common/Picker.vue

@@ -20,8 +20,8 @@
 </template>
 <script type="text/javascript">
   import $ from 'jquery';
-  const num = [0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9];
-  const unit = ['分钟', '小时', '天', '周', '月','年','分钟', '小时', '天', '周', '月','年'];
+  let num = [0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9];
+  let unit = ['分钟', '小时', '天', '周', '月','年','分钟', '小时', '天', '周', '月','年'];
   export default {
     name:'Picker',
     data() {
@@ -78,9 +78,11 @@
         this.showTip = false;
         for(let i=0;i<3;i++){
           if(i == 2){
-            this.columIndx[i] = unit.lastIndexOf(value[i]);
+            let tmpVal = unit.lastIndexOf(value[i]);
+            this.columIndx[i] = tmpVal;
           }else{
-            this.columIndx[i] = num.lastIndexOf(value[i]);
+            let tmpVal = num.lastIndexOf(value[i]);
+            this.columIndx[i] = tmpVal;
           }
         }
       },

+ 1 - 0
src/common/Submit.vue

@@ -140,6 +140,7 @@ export default {
   box-sizing: border-box;
   border-radius: 0.2rem;
   text-align: center;
+  padding: 0 .1rem;
   background-color: #fff;
 }
 </style>

+ 1 - 1
src/components/AddContent.vue

@@ -151,7 +151,7 @@ export default {
 </script>
 <style lang="less" scoped>
 @import "../less/base.less";
-.comArea {
+.comArea,.inp-wrap,.toast-wrap {
   padding-left:0 !important;
   padding-right: 0 !important;
 } 

+ 104 - 13
src/components/Department.vue

@@ -16,33 +16,88 @@
                 </div>
             </div>
         </div>
+        <Submit v-if="submit" :showType="showType" :fail="failMsg" @showSubmit="showSubmit"></Submit>
+        <Tiptoast
+            :show="showTip"
+            @close="close"
+            :data="message"/>
     </div>
 </template>
 <script>
-  import {setScroll,compare} from '@utils/tools.js';
-  import BScroll from 'better-scroll';
+    import {setScroll,compare} from '@utils/tools.js';
+    import BScroll from 'better-scroll';
+    import Submit from "../common/Submit";
+    import Tiptoast from "../common/Tiptoast";
+    import api from "@utils/api.js";
     export default {
         name: "Department",
         data(){
             return {
                 scroll:null,
-                departmentLis:[]
+                departmentLis:[],
+                showTip: false,
+                showType: "fail",
+                failMsg: "",
+                message:{
+                    title: "",
+                    text: ""
+                },
+                submit: false,
+                show: false,
+                son:false,//有无子医院
+                hospitalNum:'',
+                hospitalName:''
             }
         },
         created(){
-            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()){
-                            sortArr[i].dided = 1
+            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){
+                const param = {
+                    patientInfo: value,
+                    patientInfoType: type,
+                    hospitalCode: code,
+                    patientName:name,
+                    sonHospitalCode: sonHospitalCode||'',
+                    sonHospitalName: sonHospitalName||''
+                };
+                api.signIn(param).then(res => {
+                    let result = res.data;
+                    if (result.code == 0) {
+                        // result.data.splice(0,1);//测试只有一条数据
+                        localStorage.setItem('loginData',JSON.stringify(result.data))//保存登陆信息,扫码进入徐删除该参数
+                        if (result.data.length > 1) {
+                            this.departmentLis = this.sortPart();
+                        } else if (result.data.length == 1) {
+                            let msg = result.data[0];
+                            let params = {
+                                hospitalCode: msg.hospitalCode,
+                                hospitalDeptCode: msg.hospitalDeptCode,
+                                doctorCode: msg.doctorCode,
+                                patientCode: msg.patientCode,
+                                recordId: msg.recordId,
+                                sonHospitalCode:msg.sonHospitalCode||'',
+                                time:msg.recordTime&&(new Date((msg.recordTime).replace(/\-/g, "/"))).getTime()
+                            };
+                            localStorage.setItem('loginParam',JSON.stringify(params))//保存登陆信息,扫码进入删除该参数
+                            this.$router.push({
+                                path: "/home",
+                                query: params
+                            });
+                        } else {
+                            this.message.title = '温馨提示'
+                            this.message.text = '暂无今日挂号信息,可更换登录方式再次尝试。'
+                            this.showTip = true
                         }
+                    } else {
+                        this.defaultWaring(res.data.msg);
                     }
-                }
+                }).catch(() => {
+                    this.defaultWaring("网络异常请稍后重试");
+                });
+            }else{
+                this.departmentLis = this.sortPart();
             }
-            this.departmentLis = sortArr
         },
         mounted(){
             this.$nextTick(()=>{
@@ -51,7 +106,39 @@
             })
         },
         methods:{
+            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()){
+                                sortArr[i].dided = 1
+                            }
+                        }
+                    }
+                }
+                return sortArr;
+            },
+            showSubmit(flg){
+                this.submit = flg;
+            },
+            close() {
+                this.showTip = false;
+            },
+            defaultWaring(msg) {
+                this.$store.commit("handleToggleShow", false);
+                this.showType = "fail";
+                this.failMsg = msg;
+                this.submit = true;
+                let timer = setTimeout(() => {
+                    this.submit = false;
+                    clearTimeout(timer);
+                }, 2000);
+            },
             goStart(num,time){
+                this.show = !this.show
                 let msg = this.departmentLis[num]
                 let params = {
                     hospitalCode:msg.hospitalCode,
@@ -67,6 +154,10 @@
                     query:params
                 })
             }
+        },
+        components:{
+            Submit,
+            Tiptoast
         }
     }
 </script>

+ 61 - 28
src/components/Detail.vue

@@ -13,7 +13,8 @@
       <div class="content">
         <div class="preQuestion" v-for="(item,index) in checkDatas.questionMapping">
           <div class="quest" @click="slideToggle($event,index)">
-            <img class="sign" v-if="item.required==1" src="../images/important.svg" alt="">
+            <!-- <img class="sign" v-if="item.required==1" src="../images/important.svg" alt=""> -->
+            <span class="sign"></span>
             <p class="title clearfix">{{index + 1 +'.'+(item.description || item.name)}}{{item.controlType==1?'(单选)':item.controlType==2?'(多选)':''}}</p>
             <p class="result" v-if="item.valueP&&item.slide!=1">{{item.valueP}}</p>
             <i :class="[{'slideT':item.slide}]"></i>
@@ -90,14 +91,19 @@ import $ from 'jquery';
   export default {
     name:'Detail',
     data(){
+    let { pathInfo } = this.$store.state;
       return{
         checkDatas:{},
-        imgUrl:imageUrlPrefix
+        showCheckDatas:[],
+        imgUrl:imageUrlPrefix,
+        age: pathInfo.patientAge,
+        scroll:''
       }
     },
-    props:['datas','data','checkF','tips'],
+    props:['datas','data','checkF','tips','sex','flags'],
     created(){
-      this.checkDatas = JSON.parse(JSON.stringify(this.datas));
+      let tmpData = JSON.parse(JSON.stringify(this.datas));
+      this.checkDatas = tmpData
     },
     mounted(){
       this.$nextTick(()=>{
@@ -161,11 +167,6 @@ import $ from 'jquery';
       },
       slideToggle(e,idx){
         document.activeElement.blur();
-        // let y = this.$store.state.scroll.y
-        // if(idx==this.checkDatas.questionMapping.length-1){
-        //   this.scroll.scrollToElement(this.$refs.btm,0,true,true)
-        //   this.scroll.scrollTo(0,0,this.scroll.maxScrollY)
-        // }
         let mapping = this.checkDatas.questionMapping;
         let num = 0;
         for(let i in mapping){
@@ -245,6 +246,7 @@ import $ from 'jquery';
         let textP = "";//患者
         let special = ""; //拼到主诉
         let specialP = "";
+        let bj1 = "",bjP1 = "",bj2 = "",bjP2 = "",bj3="",bjP3="",signNum1=1,signNum2=1,signNum3=1;
         for(let i in datas){
           // 校验必填项
          /* if(datas[i].required==1 && !datas[i].value){
@@ -252,13 +254,42 @@ import $ from 'jquery';
             return
           }*/
           // 拼到主诉
-          if(datas[i].specFlag==1 && datas[i].value){
-            special += datas[i].value;
-            specialP += datas[i].valueP;
+          // if(datas[i].specFlag==1 && datas[i].value){
+          //   special += datas[i].value;
+          //   specialP += datas[i].valueP;
+          // }
+          if(datas[i].flag==1 && datas[i].value){
+            if(signNum3 == 1){
+              ++signNum3
+              special += datas[i].value;
+              specialP += datas[i].valueP;
+            }else{
+
+            }
           }
           if(datas[i].value){
-            text += datas[i].value+',';
-            textP += datas[i].valueP+',';
+            if(datas[i].flag == 1){
+              if(signNum1 == 1){
+                ++signNum1
+                bj1 += '于'+datas[i].value+'前';
+                bjP1 += '于'+datas[i].valueP+'前';
+              }else{
+                bj3 += datas[i].value+',';
+                bjP3 += datas[i].valueP+',';
+              }
+            }else if(datas[i].flag == 2){
+              if(signNum2 == 1){
+                ++signNum2
+                bj2 += datas[i].value;
+                bjP2 += datas[i].valueP;
+              }else{
+                bj3 += datas[i].value+',';
+                bjP3 += datas[i].valueP+',';
+              }
+            }else{
+              bj3 += datas[i].value+',';
+              bjP3 += datas[i].valueP+',';
+            }
           }
         }
         if(special){//拼接到主诉的内容存到chooseSymp
@@ -270,8 +301,8 @@ import $ from 'jquery';
           }
         }
         
-        let msg = this.checkDatas.name+ ',' + text;
-        let msgP = (this.checkDatas.description || this.checkDatas.name)+ ',' + textP;
+        let msg =  (this.flags == 51?'':(this.age>=18?'患者':'患儿'))+bj1+bj2+(this.flags == 51?'':'出现')+this.checkDatas.name+ ','+bj3;
+        let msgP =  (this.flags == 51?'':(this.age>=18?'患者':'患儿'))+bjP1+bjP2+(this.flags == 51?'':'出现')+(this.checkDatas.description || this.checkDatas.name)+ ','+bjP3;
         let newMsg = "";
         let newMsgP = "";
         if(msg[msg.length-1] == ','){
@@ -281,15 +312,16 @@ import $ from 'jquery';
           newMsg = msg;
           newMsgP = msgP;
         }
-        this.$store.commit('setDatas',{data:this.checkDatas,pId:id,type:this.data.moduleType,ppId:this.data.ppId});
+        this.$store.commit('setDatas',{data:this.checkDatas,pId:id,type:this.data.moduleType,ppId:this.data.ppId,idx:1});
         // flag是区分点开已选症状 未点完成
-        this.$store.commit('setText',{text:trimDots(newMsg),textP:trimDots(newMsgP),pId:id,type:this.data.moduleType,flag:true,order:this.data.order,arrFlag:true,index:this.data.index});
+        this.$store.commit('setText',{text:trimDots(newMsg),textP:trimDots(newMsgP),pId:id,type:this.data.moduleType,flag:true,order:this.data.order,arrFlag:true,index:this.data.index,idx:1});
         // 关闭详情
         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
@@ -326,8 +358,7 @@ import $ from 'jquery';
         }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});
+        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;
@@ -368,10 +399,10 @@ import $ from 'jquery';
     font-size: .3rem;
     padding:0;
     .viewPrew {
-      position: absolute;
+      position: fixed;
       width: 100%;
       height: 100%;
-      top: 1.6rem;
+      top: 2.6rem;
       left: 0;
       .content {
         padding-bottom: 3.88rem;
@@ -386,10 +417,12 @@ import $ from 'jquery';
       .sign {
         display: inline-block;
         position: absolute;
-        left: 0.16rem;
-        top: 0.45rem;
-        width: 0.32rem;
-        color: red;
+        left: 0.22rem;
+        top: 0.55rem;
+        width: 0.14rem;
+        height: .14rem;
+        border-radius: 50%;
+        background-color: #FFAD00;
       }
       .order {
         // float: left;
@@ -401,7 +434,7 @@ import $ from 'jquery';
       }
       .title {
         color: #000;
-        padding-left: .24rem;
+        padding-left: .22rem;
         display: inline-block;
       }
       i{
@@ -436,7 +469,7 @@ import $ from 'jquery';
       padding: 0 .4rem 0 .32rem;
       font-size: .28rem;
       color: #7C828E;
-      position: relative;
+      position: fixed;
       z-index: 100;
       width: 100%;
       background-color: #fff;

+ 21 - 7
src/components/DetailBox.vue

@@ -3,10 +3,10 @@
     <div class="detailBoxMask"></div>
     <div class="detailBox-wrap">
       <div class="content detailBoxMain" ref="detailBox">
-        <!-- <div class="tmpDom"></div> -->
         <div class="main">
           <Detail :datas="privateData" 
                   ref="detail"
+                  :flags="flags"
                   :data="data"
                   :tips="tips"
                   :checkF="checkF"
@@ -16,13 +16,10 @@
                   @handleClear="handleClear($event)"
                   @checkReq="changeFins($event)"/>
         </div>
-        <!-- <div class="foot" @click="complete">完成</div> -->
       </div>
     </div>
-    <!-- <div :class="['foot',{'noCheck':!checkF}]" @click="complete">完成</div> -->
     <div style="position:absolute" class="foot">
       <div class="slide" @click="slideAll">{{btnTxt}}</div>
-      <!-- <div class="nextBtn compete" :class="{'noCheck':!checkF || !reqFinish}" @click="complete">完成</div> -->
       <div class="nextBtn compete" @click="complete">完成</div>
     </div>
     <Toast :message="clearTxt" 
@@ -39,12 +36,30 @@
   import $ from 'jquery';
   export default {
     name:'DetailBox', //点开详情的盒子
+    props:['flags'],
     data(){
       const {detailInfo,detailShow} = this.$store.state;
+      const {detail} = this.$store.state.detailInfo;
+      let signNum = 1,tmpData = this.$store.state.detailInfo.detail,tmpArr=[];
+      if(tmpData.checkedAll != 1){
+        for(let i = 0;i < tmpData.questionMapping.length;i++){
+          if(tmpData.questionMapping[i].flag != 3){
+              tmpArr.push(tmpData.questionMapping[i])
+          }else{
+            if(signNum != 1){
+              tmpArr.push(tmpData.questionMapping[i])
+            }else{
+              ++signNum
+            }
+          }
+        }
+        tmpData.questionMapping = tmpArr
+        tmpData.checkedAll = 1
+      }
       return{
         msg:"胸痛详情",
         data:detailInfo,
-        privateData:this.$store.state.detailInfo.detail||{},
+        privateData:tmpData||{},
         compFlag:false,
         clearTxt:"是否清空当前已选内容?",
         showToast:false,
@@ -94,7 +109,6 @@
             }
           }
         }
-        
         this.$store.commit('setDetail',{detail:{}})
       },
       complete(){
@@ -184,8 +198,8 @@
     background: #fff;
     font-size: .3rem;
     animation: wave .4s linear;
-    overflow: hidden;
     border-radius:.2rem .2rem 0px 0px;
+    overflow: hidden;
     .content{
       // height: 100%;
       // width:100%;

+ 1 - 1
src/components/DiagTreat.vue

@@ -199,7 +199,7 @@
 @import '../less/base.less';
   .treat-wrap{
     font-size: .3rem;
-    .bgques {
+    .bgques,.toast-wrap,.inp-wrap,.comArea {
       padding-left:0;
       padding-right: 0;
     }

+ 159 - 51
src/components/Login.vue

@@ -7,8 +7,19 @@
       <h4>欢迎使用智能预问诊</h4>
     </div>
     <div class="main">
-      <div class="iptWrap choose">
-        <p @click="handleShow">
+      <div class="iptWrap choose" v-if="hospitalShow">
+        <p @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>
+          </ul>
+        </div>
+      </div>
+      <div class="iptWrap choose iptWrapS">
+        <p @click="handleShow(2)">
           {{name}}
           <img src="../images/down.png" />
         </p>
@@ -28,7 +39,6 @@
           :maxlength="type==103?11:type==101?18:type==102?20:type==104?9:30"
           v-model="value"
           @input="changeVal"
-          :type="type==101||type==104?'text':'tel'"
           class="input"
           type="text"
           :placeholder="'请输入'+name"
@@ -46,10 +56,11 @@
           placeholder="请输入姓名"
         />
       </div>
-      <div :class="['btn',canClick&&allow?'btnClick':'btnDis']" @click.stop.prevent="handleDepart">进入预问诊</div>
+      <div :class="['btn',canClick?'btnClick':'btnDis']" @click.stop.prevent="handleDepart">进入预问诊</div>
     </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
         :show="showTip"
 				@close="close"
@@ -61,17 +72,20 @@ import { phoneTest, identify, jgpattern,name } from "@utils/tools.js";
 import Submit from "../common/Submit";
 import Tiptoast from "../common/Tiptoast";
 import api from "@utils/api.js";
+import Loading from '../common/Loading';
 import $ from "jquery";
 // let iscanscrollpage = false
 export default {
   name: "Login",
   data() {
     return {
+      loadingShow: this.$store.state.loadingShow,
       showTip: false,
       showType: "fail",
       failMsg: "",
       submit: false,
       show: false,
+      showH:false,
       type: "102",
       name: "病历号",
       patName:'',
@@ -81,16 +95,39 @@ export default {
         text: ""
       },
       code:'',
-      allow:true,
+      allow:false,
       canClick:false,
+      hospitalName:'',
+      hospitalNum:'',
+      hospitalList:[],
+      hospitalShow:false,
+      son:false,//有无子医院
+      clique:1
     };
   },
   created(){
-    this.code = this.$route.query.hospitalCode||''
+    let query = this.$route.query;
+    let type = query.patientInfoType,name = query.patientName,value = query.patientInfo,code=query.hospitalCode,sonHospitalCode=query.sonHospitalCode,sonHospitalName=query.sonHospitalName,clique=(query.clique!=2?1:query.clique);
+    this.code = code||'';
+    if(value&&name&&type&&code){
+      this.type = type
+      this.name = type == 101?'身份证号':type == 102?'病历号':type == 104?'市民卡号':''
+      this.value = value
+      this.patName = name
+      if(sonHospitalCode&&sonHospitalName){
+        this.hospitalNum=sonHospitalCode
+        this.hospitalName=sonHospitalName
+        this.son = true
+      }else{
+        this.son = false
+      }
+    }
+    this.clique = clique
+    this.getSysConfig(code)
   },
   watch:{
     value:{
-      handler: function (val, oldVal) {
+      handler: function(val, oldVal) {
         if(val&&this.patName){
           this.canClick = true
         }else{
@@ -100,7 +137,7 @@ export default {
       deep: true
     },
     patName:{
-      handler: function (val, oldVal) {
+      handler: function(val, oldVal) {
         if(val&&this.value){
           this.canClick = true
         }else{
@@ -111,12 +148,56 @@ export default {
     }
   },
   beforeRouteLeave(to, from, next){
-    if(JSON.stringify(to.params) == '{}'){
+    const { value,patName,allow } = this;
+    if(!value||!patName){
       return
     }
     next();
   },
+  
   methods: {
+    getHospitalList(code){
+      api.getHospitalDatas({'hospitalCode':code}).then(res => {
+        let result = res.data;
+        if (result.code == 0) {
+          let tmpMain = result.data.superiorsInfo;
+          let tmpLis = result.data.juniorHospital;
+          if(this.clique == 1){
+            tmpLis.unshift(tmpMain)
+          }
+          this.hospitalList = tmpLis
+          if(!this.son){
+            this.hospitalName = tmpLis[0].hospitalName  //默认第一个
+            this.hospitalNum = tmpLis[0].hospitalCode   
+          }
+        }else{
+          // this.defaultWaring(res.data.msg);
+        }
+      })
+    },
+    getSysConfig(code){
+      api.getSysConfig({'hospitalCode':code}).then((res)=>{
+        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 == 'junior_show'){
+              this.hospitalShow = +datas[i].value==1?true:false
+              if(datas[i].value==1){
+                this.hospitalShow = true
+                this.getHospitalList(code)
+              }else{
+                this.hospitalShow = false
+              }
+            }
+          }
+        }else{
+          this.defaultWaring(res.data.msg);
+        }
+      })
+    },
     close() {
       this.showTip = false;
     },
@@ -129,9 +210,24 @@ export default {
       }
       this.show = false;
     },
-    handleShow() {
-      const { show } = this;
-      this.show = !show;
+    handleCode(item,idx) {
+      this.hospitalName = item.hospitalName
+      this.hospitalNum = item.hospitalCode
+      this.showH = false;
+    },
+    handleShow(flg) {
+      const { show,showH } = this;
+      if(flg == 1){
+        if(!showH){
+          this.show=false
+        }
+        this.showH = !showH;
+      }else{
+        if(!show){
+          this.showH=false
+        }
+        this.show = !show;
+      }
     },
     focus(){   
       // iscanscrollpage = false; 
@@ -142,22 +238,18 @@ export default {
       //   document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
       // }
     },
-    changeName() {
-      // document.activeElement.scrollIntoViewIfNeeded(true);
-      const { patName } = this;
-      this.patName = patName.replace(/[`~!@#$%^&)(*_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im,'')
+    changeName(e) {
+      this.patName = e.target.value.replace(/[`~!@#$%^&)(*_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im,'')
     },
     changeVal() {
-      // document.activeElement.scrollIntoViewIfNeeded(true);
       const { type, value } = this;
-      if (type == 102 || type == 103) {
+      if (type == 103) {
         this.value = value.replace(/[^\d]/g, "");
-      } else if (type == 101 || type == 104) {
+      } else if (type == 102 || type == 101 || type == 104) {
         this.value = value.replace(/[^\w\.\/]/ig, "");
       }
     },
     defaultWaring(msg) {
-      this.$store.commit("handleToggleShow", false);
       this.showType = "fail";
       this.failMsg = msg;
       this.submit = true;
@@ -170,43 +262,48 @@ export default {
       this.submit = flg;
     },
     handleDepart(){
-      const { type, value,patName,allow } = this;
-      this.allow = false
-      if (value&&patName&&allow) {
+      const { type, value,patName,allow,hospitalNum,hospitalName,code,hospitalList } = this;
+      if(allow){
+        return
+      }
+      if (value&&patName) {
+        this.allow = true
         let timer = setTimeout(() => {
           if (type == 102) {
-            if (!jgpattern.test(value)) {//验证不通过
+            if (!jgpattern.test(value) || value.length > 20) {//验证不通过
               this.defaultWaring("请输入正确的病历号");
-              this.allow = true
+              this.allow = false;
               return;
             }
           } else if (type == 101) {//身份证
-            if (!identify.test(value)) {//验证不通过
+            if (!identify.test(value) || value.length > 18) {//验证不通过
               this.defaultWaring("请输入正确的身份证号");
-              this.allow = true
+              this.allow = false;
               return;
             }
           } else if (type == 104) {//市民卡号只能输入数字字母
             if (!jgpattern.test(value)||value.length!=9) {//验证不通过
               this.defaultWaring("请输入正确的9位市民卡号");
-              this.allow = true
+              this.allow = false;
               return;
             }
           }
           if(!this.code){
             this.defaultWaring("医院编码必填");
-            this.allow = true
+            this.allow = false;
             return;
           }
+          this.$store.commit('handleToggleShow', true);
           const param = {
-            patientInfo: this.value,
-            patientInfoType: this.type,
-            hospitalCode:this.code,
-            patientName:patName
+            patientInfo: value,
+            patientInfoType: type,
+            hospitalCode:code,
+            hospitalName:hospitalList.length>0&&hospitalList[0].hospitalName||'',
+            patientName:patName,
+            sonHospitalCode: code==hospitalNum?'':hospitalNum||'',
+            sonHospitalName: code==hospitalNum?'':hospitalName||''
           };
-          api
-          .signIn(param)
-          .then(res => {
+          api.signIn(param).then(res => {
             let result = res.data;
             if (result.code == 0) {
               // result.data.splice(0,1);//测试只有一条数据
@@ -216,21 +313,24 @@ export default {
                   name: "Department",
                   params: { result: result.data }
                 });
+                this.allow = false
               } else if (result.data.length == 1) {
                 let msg = result.data[0];
                 let params = {
                   hospitalCode: msg.hospitalCode,
                   hospitalDeptCode: msg.hospitalDeptCode,
-                  doctorCode: msg.doctorCode,
-                  patientCode: msg.patientCode,
-                  recordId: msg.recordId,
-                  time:(new Date((msg.recordTime).replace(/\-/g, "/"))).getTime()
+                  doctorCode: msg.doctorCode||'',
+                  patientCode: msg.patientCode||'',
+                  recordId: msg.recordId||'',
+                  sonHospitalCode:msg.sonHospitalCode||'',
+                  time:msg.recordTime&&(new Date((msg.recordTime).replace(/\-/g, "/"))).getTime()||''
                 };
                 localStorage.setItem('loginParam',JSON.stringify(params))//保存登陆信息,扫码进入删除该参数
                 this.$router.push({
                   path: "/home",
                   query: params
                 });
+                this.allow = false
               } else {
                 this.message.title = '温馨提示'
                 this.message.text = '暂无今日挂号信息,可更换登录方式再次尝试。'
@@ -238,19 +338,22 @@ export default {
               }
               clearTimeout(timer)
             } else {
-              if(res.msg.indexOf('暂无今日挂号信息') != -1){
-                this.message.title = '温馨提示'
-                this.message.text = '暂无今日挂号信息,可更换登录方式再次尝试。'
-                this.showTip = true
-              }else{
-                this.defaultWaring(res.msg);
-              }
+              // if(res.msg.indexOf('暂无今日挂号信息') != -1){
+              //   this.message.title = '温馨提示'
+              //   this.message.text = '暂无今日挂号信息,可更换登录方式再次尝试。'
+              //   this.showTip = true
+              // }else{
+              //   this.defaultWaring(res.data.msg);
+              // }
+              this.allow = false
+              this.defaultWaring(res.data.msg||"网络异常请稍后重试");
               clearTimeout(timer)
             }
-          })
-          .catch(() => {
-            this.allow = true
+            this.$store.commit('handleToggleShow', false);
+          }).catch(() => {
+            this.allow = false
             clearTimeout(timer)
+            this.$store.commit('handleToggleShow', false);
             this.defaultWaring("网络异常请稍后重试");
           });
         }, 200);
@@ -259,7 +362,8 @@ export default {
   },
   components: {
     Submit,
-    Tiptoast
+    Tiptoast,
+    Loading
   }
 };
 </script>
@@ -310,6 +414,10 @@ export default {
       padding: 0.23rem 0.3rem;
       box-sizing: border-box;
     }
+
+    .iptWrapS{
+      margin-top: 0.3rem;
+    }
     .choose {
       position: relative;
       p {

+ 4 - 0
src/components/Others.vue

@@ -194,6 +194,10 @@
   .other-wrap{
     font-size: .3rem;
     // .btscroll;
+    .inp-wrap,.toast-wrap,.comArea {
+      padding-left: 0;
+      padding-right: 0;
+    }
     .bgques {
       padding-left:0;
       padding-right: 0;

+ 9 - 9
src/components/PathInfo.vue

@@ -2,7 +2,7 @@
   <div class="path-wrap">
     <div class="content">
       <div class="topContent">
-        <p class="hospitalName">{{pathInfo.hospitalName}}</p>
+        <p class="hospitalName">{{pathInfo.sonHospitalName||pathInfo.hospitalName}}</p>
         <h2>智能预问诊</h2>
         <p class="explain">请认真填写以下内容,以便就诊时医生可以更好的了解病情,感谢您的配合!</p>
       </div>
@@ -19,15 +19,15 @@
           <span>{{pathInfo.hospitalDeptName}}</span>  
         </p>
         <p class="perLine">
-          <span class="msgTitle">预约医生:</span>
+          <span class="msgTitle">{{pathInfo.doctorName?'预约医生:':''}}</span>
           <span>{{pathInfo.doctorName}}</span>
         </p>
         <p class="perLine">
-          <span class="msgTitle">门诊号:</span>
+          <span class="msgTitle">{{pathInfo.recordId?'门诊号:':''}}</span>
           <span>{{pathInfo.recordId}}</span>
         </p>
         <p class="perLine">
-          <span class="msgTitle">预约时间:</span>
+          <span class="msgTitle">{{time?'预约时间:':''}}</span>
           <span>{{time}}</span>
         </p>
       </div>
@@ -54,14 +54,14 @@
   import api from '@utils/api.js'
   import Submit from '../common/Submit';
   import Toast from '../common/Toast.vue';
-  import {getUrlArgObject,setScroll,dateParser} from '@utils/tools.js'
+  import {setScroll,dateParser} from '@utils/tools.js'
   import BScroll from 'better-scroll';
   export default {
     name:'PathInfo',
     data(){
       return {
         pathInfo:{},
-        child:[],
+        // child:[],
         type:null, //1-未做过;3-只做过问诊;4-只做过体质辨识;6-都做过
         text:{
           "3":'您已完成过一次预问诊,是否再次录入',
@@ -70,7 +70,7 @@
           "6":'您已完成过一次预问诊,是否再次录入',
         },
         isReady:false,
-        hideChild:true,  //隐藏儿童
+        // hideChild:true,  //隐藏儿童
         submit:false,
         scroll:null,
         tipMsg:'',
@@ -109,7 +109,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){//扫码进入的
           localStorage.removeItem('loginParam')
@@ -139,7 +139,7 @@
           const result = res.data;
           if(result.code==0){
             const datas = result.data;
-            this.child = datas.filter((item)=>{return item.code == "constitution_show"})
+            // this.child = datas.filter((item)=>{return item.code == "constitution_show"})
             this.$store.commit('saveSysConfig',datas)
           }
         })

+ 32 - 17
src/components/Preview.vue

@@ -9,13 +9,13 @@
             <tr>
               <td><span>挂号科室:</span>{{pathInfo.selfDeptName}}</td>
             </tr>
-            <tr>
+            <tr v-if="pathInfo.recordId">
               <td><span>门诊号:</span>{{pathInfo.recordId}}</td>
             </tr>
-            <tr>
+            <tr v-if="pathInfo.doctorName">
               <td><span>预约医生:</span>{{pathInfo.doctorName}}</td>
             </tr>
-            <tr>
+            <tr v-if="time">
               <td><span>就诊时间:</span>{{time}}</td>
             </tr>
           </table>
@@ -24,22 +24,25 @@
         </div>
         <div class="personMsg personMsg2">
           <ul class="previewParts">
-            <!-- <li v-if="symptom.choose.length>0"> -->
             <li>
-              <h4><i></i> 主诉:</h4>
+              <h4><i></i>主诉:</h4>
               <p>
-                <span v-for="(item,idx) in symptom.choose" :key="item.name+idx">
-                {{item.specialP?(item.description||item.name)+item.specialP+(idx == symptom.choose.length-1?'':','):(item.description||item.name)+(idx == symptom.choose.length-1?'':',')}}
+                <span v-for="(item,idx) in symptom.choose" :key="item.name+idx" v-if="item.idx == 1">
+                  {{item.specialP?(item.description||item.name)+item.specialP:(item.description||item.name)}}
                 </span>
               </p>
             </li>
-            <!-- <li v-if="diagnose.text.length>0||symptom.choose.length>0"> -->
             <li>
               <h4><i></i> 现病史:</h4>
-              <p v-for="item in symptom.text">{{item.textP}}</p>
               <p>
-                <span>{{getDetailText(diagnose.text,false).view}}</span>
+                <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>
+                </template>
               </p>
+              <p><span>{{getDetailText(diagnose.text,false).view}}</span></p>
             </li>
             <li v-if="showLis[moduleCP['other']]==1">
               <h4><i></i> 其他史:</h4>
@@ -82,7 +85,7 @@
         @showSubmit="showSubmit"
       ></Submit>
       <Loading v-if="loadingShow"></Loading>
-      <div class="personMsgDoc" v-if="showDoc">
+      <div class="personMsgDoc" v-show="showDoc">
         <div class="personMsgDocModal" @click="handleClick(false)"></div>
         <div class="personMsgDocDetail">
           <img class="close" src="../images/small-close.png" alt="" @click="handleClick(false)">
@@ -91,20 +94,27 @@
               <li>
                 <h4><i></i> 主诉:</h4>
                 <p>
-                  <span v-for="(item,idx) in symptom.choose" :key="item.name+idx">{{item.special?item.name+item.special+(idx == symptom.choose.length-1?'':','):item.name+(idx == symptom.choose.length-1?'':',')}}</span>
-                </p>
+                  <span v-for="(item,idx) in symptom.choose" :key="item.name+idx" v-if="item.idx == 1">
+                    {{item.special?item.name+item.special:item.name}}
+                  </span>
+                </p>                
               </li>
               <li>
                 <h4><i></i> 现病史:</h4>
-                <p v-for="item in symptom.text">{{item.text}}</p>
                 <p>
-                  <span>{{getDetailText(diagnose.text,false).content}}</span>
+                  <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>
+                  </template>
                 </p>
+                <p><span>{{getDetailText(diagnose.text,false).view}}</span></p>
               </li>
               <li v-if="showLis[moduleCP['other']]==1">
                 <h4><i></i> 其他史:</h4>
                 <p>
-                  <span>{{getDetailText(others.text,false).content}}</span>
+                  <span>{{getDetailText(others.text,false).view}}</span>
                 </p>
               </li>
               <li v-if="showLis[moduleCP['suplement']]==1">
@@ -144,6 +154,7 @@ export default {
       diagnose: diagnoseDate,
       others: othersDate,
       addContent: addContentDate,
+      checkText: symptomDate.text, //症状情况文字
       submit: false,
       showType: 'fail',
       imgList:[],
@@ -162,6 +173,7 @@ export default {
       let scroll = setScroll(BScroll,true,'.previewper')
       this.scroll = scroll
     })
+
   },
   methods: {
     getTime() {
@@ -243,6 +255,7 @@ export default {
       }
     },
     getDetailText(textArr,flg){
+      console.log(textArr,flg)
       let msg = "",obg={},msgP = "";
       if(flg == 1){
         for(let k in textArr){
@@ -271,7 +284,6 @@ export default {
           }
         }
       }
-      
       obg.view=trimDots(msgP.replace(/,$/,''))
       obg.content=trimDots(msg.replace(/,$/,''))
       obg.contentJson=trimDots(msg.replace(/,$/,''))
@@ -325,6 +337,9 @@ export default {
         "patientSex": pathInfo.patientSex=='男'?1:2,//患者性别:1男2女(非)
         // "regVisitedState": pathInfo,//就诊状态(0待接诊,1接诊中,2完成接诊)(非)
         "reportList": this.imgList,
+        "sonHospitalCode": pathInfo.sonHospitalCode,
+        "sonHospitalId": pathInfo.sonHospitalId,
+        "sonHospitalName": pathInfo.sonHospitalName,
         // "type": 0//病历分类(1:门诊,2:住院)
       }
       // console.log(params)

+ 3 - 1
src/components/Search.vue

@@ -90,7 +90,9 @@ export default {
     searchList() {
       let tmpArr = [], chooseSymp = this.chooseSymp;
       for (let i = 0; i < chooseSymp.length; i++) {
-        tmpArr.push(chooseSymp[i].conceptId)
+        if(chooseSymp[i].conceptId){
+          tmpArr.push(chooseSymp[i].conceptId)
+        }
       }
       const param = {
         "age": this.age,

+ 103 - 19
src/components/Symptom.vue

@@ -1,11 +1,11 @@
 <template>
   <div class="symp-wrap symper btscroll">
     <div class="content">
+      <p class="quest" v-if="chooseSymp.length>0">已选症状</p>
       <div
         class="choose"
         v-if="chooseSymp.length>0"
       >
-        <p class="quest">已选症状</p>
         <p
           class="choo-symp"
           v-for="(v,i) in chooseSymp"
@@ -29,8 +29,8 @@
             class="symp"
             v-for="(it,ind) in symp"
             :key="it.conceptId"
-            @touchstart.prevent="touchstart(it)"
-            @touchend.prevent="touchend(it)"
+            @touchstart.prevent="touchstart(it,ind)"
+            @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>
@@ -41,7 +41,12 @@
       >
         <p class="title"><span class="line"></span>{{nameStr}}</p>
         <div class="bgResult">
-          <p v-for="(value,index) in checkText">{{value.textP}}</p>
+          <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.textP}}{{checkText.length==2?'':'、'}}</span>
+            <span :key="index" v-if="index>1">{{value.textP}}{{index == checkText.length-1?'':'、'}}</span>
+          </template>
         </div>
       </div>
     </div>
@@ -63,6 +68,7 @@
       @comfirn="comfirnDel"
       @cancel="cancelDel"
     />
+    <Submit v-if="submit" showType="fail" :fail="failMsg" @showSubmit="showSubmit"></Submit>
     <Search
       v-if="this.$store.state.searchShow"
       @search="search"
@@ -80,6 +86,7 @@ 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 Submit from "../common/Submit";
 import BScroll from 'better-scroll';
 import $ from 'jquery';
 export default {
@@ -113,10 +120,12 @@ export default {
         title:'',
         text:''
       },
+      submit:false,
       start:{},
       end:{},
       slide:false,
-      slideTxt:'展开'
+      slideTxt:'展开',
+      failMsg: "无法选择症状,已超过最大个数",
     }
   },
   created() {
@@ -141,7 +150,9 @@ export default {
       handler(newVal,oldVal){
         const sympText = this.getSympText();
         if(sympText){
-          this.getPush(sympText);
+          if(this.chooseSymp.length>1||localStorage.getItem("staticSymp")){
+            this.getPush(sympText);
+          }
           this.quesText = "请问您还有其他不适吗?";
         }else{
           this.getSympList();
@@ -152,8 +163,11 @@ export default {
     }
   },
   methods: {
+    showSubmit(flg){
+      this.submit = flg;
+    },
     slideToggle(){
-      let flg = this.slideTxt
+      let flg = this.slideTxt;
       if(flg == '展开'){
         this.$refs.showHide.style.height = 'auto'
         this.slideTxt = '收起'
@@ -170,6 +184,9 @@ export default {
       }
       let endTime = +new Date();
       if(endTime - this.startTime < 500){//点击事件
+        if(this.chooseSymp.length == 0){
+          item.idx = 1
+        }
         this.common(item,flg);
         this.slideTxt = '展开'
       }
@@ -189,7 +206,6 @@ export default {
             that.message.title = "";
             that.message.text = "暂无资料";
           }
-          
         },600)
     },
     closeTip(){
@@ -234,17 +250,27 @@ export default {
         this.$emit('next');
       }
     },
-    common(item,flg){
+    common(item,flg,sign){
+      if(this.chooseSymp.length>12){
+        this.$store.commit('setSearchShow', false);
+        this.submit = true
+        let timer = setTimeout(() => {
+          this.submit = false;
+          clearTimeout(timer);
+        }, 2000);
+        return
+      }
       this.questId = item.questionId || item.id || item.conceptId;
       const id = item.questionId || item.id; //常见症状questionId,推送id,两者均有可能没有
       //将选中的name存到store中的text
-      this.$store.commit('setText', { type: moduleCP['symp'], text: item.name,textP: item.description||item.name, pId: this.questId });
-      if (id) {
+      if (id&&this.chooseSymp.length == 0) {//只有第一次
         const param = {
           "age": this.age,
           "id": id,
           "sexType": this.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:'' });
         api.getById(param).then((res) => {
           const result = res.data;
           if (result.code == 0) {
@@ -255,27 +281,57 @@ export default {
             }
             this.$store.commit('setOrigin', { type: moduleCP['symp'], data: result.data });
             if (mapping && mapping.length > 0) {
+              let numPlus = 0;
+              let signNum = 1;//第一个打标的,保存为伴随
+              for(let i = 0;i < mapping.length;i++){
+                let tmpMap = mapping[i]
+                if(tmpMap.flag == 3 && signNum == 1){
+                  ++signNum
+                  for(let j = 0;j < tmpMap.questionDetailList.length;j++){
+                    tmpMap.questionDetailList[j].questionId = tmpMap.questionDetailList[j].name
+                  }
+                  localStorage.setItem("staticSymp",JSON.stringify(tmpMap.questionDetailList))
+                }
+              }
+              if(numPlus == mapping.length){
+                localStorage.setItem("staticSymp",null)
+              }
               this.$store.commit('setDetail',{detail:result.data,ppId:null,moduleType:moduleCP['symp'],sign:1,idx:this.chooseSymp.length})
-              if(flg){
+              if(sign){
                 return
               }
               this.$store.commit('setSearchShow', false);
               this.chooseSymp.push(item);
             } else { 
-              this.chooseSymp.push(item);
               this.$store.commit('setSearchShow', false);
+              this.chooseSymp.push(item);
             }
+            const sympText = this.getSympText();
+            this.getPush(sympText);
+          }
+        }).catch(()=>{
+          if(this.chooseSymp.length == 1){
+            const sympText = this.getSympText();
+            this.getPush(sympText);
           }
         })
       } else {//没有questionId或id 
+        if(this.chooseSymp.length == 0){
+          item.idx = 1
+        }
+        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.checkText = this.$store.state.symptom.text;
+        const sympText = this.getSympText();
+        this.getPush(sympText);
+        // this.checkText = this.$store.state.symptom.text;
       }
     },
     showDetil(item,flg) {//搜索点开的详情
       this.tmpItem=item
       this.isSearch=flg||false
-      this.common(item,flg,this.chooseSymp);
+      let num = this.chooseSymp.length+1;
+      this.common(item,num,flg);
     },
     getSympText() {//推送使用医生端信息
       const text = this.$store.state.symptom.text;
@@ -297,16 +353,43 @@ export default {
       api.getPush(param).then((res) => {
         const result = res.data;
         if (result.code == 0) {
-          this.symp = result.data.symptom;
+          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'
         }
+      }).catch(()=>{
+
       })
     },
     deletSymp(item, index) {
       this.delIndex = index;
       this.questId = item.questionId || item.id || item.conceptId;
+
       if (this.chooseSymp.length == 1) {
-        this.delText = "是否删除该信息?<br/>删除后将重新填写预问诊流程 <br/>(已填内容将清除)"
+        if(item.idx != 1){
+          this.delText = "是否删除该信息?<br/>删除后将重新填写预问诊流程 <br/>"
+        }else{
+          this.delText = "是否删除该信息?<br/>删除后将重新填写预问诊流程 <br/>(已填内容将清除)"
+        }
+      }else{
+        if(item.idx != 1){
+          this.delText = "是否删除该信息?"
+        }
       }
       this.showToast = true;
       $(".btscroll").css({'position':'fixed'})
@@ -353,7 +436,8 @@ export default {
   components: {
     Toast,
     Search,
-    Tiptoast
+    Tiptoast,
+    Submit
   }
 }
 </script>
@@ -407,7 +491,7 @@ export default {
         height: .74rem;
       }
     }
-    .choo-symp:last-child{
+    .choo-symp:nth-child(3n+3){
       margin-right: 0;
     }
   .label{

+ 1 - 1
src/components/TabPage.vue

@@ -59,7 +59,7 @@
     </div>
     <!-- 详情页 -->
     <div class="detail" v-if="this.$store.state.detailShow">
-      <DetailBox />
+      <DetailBox :flags="flag"/>
     </div>
   </div>
 </template>

+ 13 - 0
src/main.js

@@ -4,12 +4,25 @@ 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;

+ 1 - 3
src/store.js

@@ -218,10 +218,8 @@ const store = new Vuex.Store({
                 return
               }
             }
-            text.push(param);
-          }else{
-            text.push(param);
           }
+          text.push(param);
           break;
         case moduleCP['diagT']: //诊疗情况
           let diaText = JSON.parse(JSON.stringify(state.diagnose.text)); 

+ 4 - 0
src/utils/api.js

@@ -3,6 +3,7 @@ import axios from 'axios';
 const urls = {
   getPathInfo:'/api/prec/patientInfo/getTopPatientInfo',//患者信息
   getSysConfig:'/api/prec/sysSet/getSysSetInfoDatas',//配置项
+  getHospitalDatas:'/api/prec/sysSet/getHospitalDatas',//获取医院列表
   recordCheck:'/api/prec/inquiryInfo/recordCheck',//校验是否已做过
   getAll:'/api/prec/moduleInfo/getAll',//获取模板
   getSymptom:'/api/prec/questionUsual/getQuestionUsual',//常用症状
@@ -18,6 +19,9 @@ const urls = {
 }
 
 export default {
+  getHospitalDatas(param){
+    return axios.post(urls.getHospitalDatas,param)
+  },
   getPathInfo(param){
     return axios.post(urls.getPathInfo,param)
   },

+ 3 - 3
src/utils/tools.js

@@ -283,7 +283,7 @@ function trimDots(str){
 }
 
 // 拼值,并去掉占位符
-function concatVal(data,flg){
+function concatVal(data,flg,flag){
   let value = ""; //医生
   let valueP = ""; //患者
   let tmpStrHas = [],tmpStrNo = [],tmpAll=[];
@@ -312,8 +312,8 @@ function concatVal(data,flg){
           value += str + ',';
           valueP += strP + ',';
         }else{
-          value += data[k].name.replace(patt,'') + ',';
-          valueP += (data[k].description || data[k].name).replace(patt,'') + ',';
+          value += data[k].name.replace(patt,'') +( flag == 2?'、':',');
+          valueP += (data[k].description || data[k].name).replace(patt,'') + (flag == 2?'、':',');
         }
       }
     }