Parcourir la source

Merge branch 'new' into new_ll

luolei il y a 5 ans
Parent
commit
fac628232e

+ 1 - 0
src/common/RadioSelect.vue

@@ -47,6 +47,7 @@ import OptionInp from '../common/OptionInp.vue';
           }
         }
         let temp = concatVal(data,true);
+
         const newData = Object.assign({},this.datas,{questionDetailList:data,value:temp.value,valueP:temp.valueP})
         this.$emit("updata",newData);
       },

+ 91 - 0
src/common/Tiptoast.vue

@@ -0,0 +1,91 @@
+<template>
+    <portal to="notification-outlet">
+      <div class="toast-wrap" v-if="show">
+            <div class="content">
+              <p class="tit" v-show="data.title">{{data.title}}</p>
+              <div class="text">
+                {{data.text}}
+              </div>
+                <img src="../images/icon_close@2x.png"  class="close" @click="handleClose">
+            </div>
+            
+            <div class="mask" @click="handleClose"></div>
+      </div>
+    </portal>
+</template>
+<script type="text/javascript">
+/**
+  提示性弹窗组件
+  接收参数:
+    show-布尔值,是否显示弹窗;
+    data-对象,包含title和text;
+    @close-关闭弹窗的方法(点击关闭按钮或者遮罩都关闭弹窗)
+**/
+  export default {
+    name:'Tiptoast',
+    data(){
+      return {
+        msg:""
+      }
+    },
+    props:{
+      show:{
+        default:false,
+        type:Boolean
+      },
+      data:{
+        default:{
+          title:'',
+          text:''
+        },
+        type:Object
+      },
+    },
+    methods:{
+      handleClose(){
+        this.$emit("close")
+      },
+    },
+  }
+</script>
+<style lang="less" scoped>
+  @import '../less/base.less';
+  .toast-wrap{
+    .content{
+      width: 6rem;
+      background: #fff;
+      z-index: 999;
+      position: fixed;
+      top:50%;
+      left: 50%;
+      transform: translate(-50%,-50%);
+      padding: .5rem .8rem .8rem;
+      box-sizing: border-box;
+      border-radius: .20rem;
+      z-index: 1000;
+      .tit{
+        font-family:PingFangSC;
+        color:#333333;
+        font-size: .32rem;
+        text-align: center;
+        font-weight: 700;
+      }
+      .text{
+        color:#000;
+        padding-top: .3rem;
+        font-size: .3rem;
+      }
+      .close{
+        width:1rem;
+        position: absolute;
+        bottom: -1.5rem;
+        left: 50%;
+        margin-left: -.5rem;
+      }
+    }
+    .mask{
+      .mask;
+      z-index: 999;
+    }
+  }
+</style>

+ 1 - 0
src/components/Department.vue

@@ -50,6 +50,7 @@
                     patientCode:msg.patientCode,
                     recordId:msg.recordId
                 }
+
                 this.$router.push({
                     path:'/',
                     query:params

+ 36 - 15
src/components/Detail.vue

@@ -111,6 +111,13 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
             this.$emit('check',false)
           }
         }
+        // 更新完成样式
+        let checkReq = this.checkReq();
+        if(checkReq){
+          this.$emit('checkReq',true)
+        }else{
+          this.$emit('checkReq',false)
+        }
       },
       saveData(){//存值
         this.checkDatas = Object.assign({},this.checkDatas,{select:1});
@@ -120,31 +127,32 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
         
         let text = ""; //医生
         let textP = "";//患者
+        let special = ""; //拼到主诉
+        let specialP = "";
         for(let i in datas){
           // 校验必填项
-          if(datas[i].required==1 && !datas[i].value){
-            alert("还有必填项没有填哦");
+         /* if(datas[i].required==1 && !datas[i].value){
+            alert("请先将必填项填完");
             return
-          }
+          }*/
           // 拼到主诉
           if(datas[i].specFlag==1 && datas[i].value){
-            for(let k in chooseSymp){
-              if(id == (chooseSymp[k].id ||chooseSymp[k].questionId)){
-                if(chooseSymp[k].special){
-                  chooseSymp[k].special += datas[i].value;
-                  chooseSymp[k].specialP += datas[i].valueP;
-                }else{
-                  chooseSymp[k].special = datas[i].value;
-                  chooseSymp[k].specialP = datas[i].valueP;
-                }
-              }
-            }
+            special += datas[i].value;
+            specialP += datas[i].valueP;
           }
           if(datas[i].value){
             text += datas[i].value+',';
             textP += datas[i].valueP+',';
           }
         }
+        if(special){//拼接到主诉的内容存到chooseSymp
+          for(let k in chooseSymp){
+            if(id == (chooseSymp[k].id ||chooseSymp[k].questionId)){
+              chooseSymp[k].special = special;
+              chooseSymp[k].specialP = specialP;
+            }
+          }
+        }
         
         let msg = this.checkDatas.name+ ',' + text;
         let msgP = (this.checkDatas.description || this.checkDatas.name)+ ',' + textP;
@@ -179,10 +187,14 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
             }
           }
         }
+
         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);
-        this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.data.moduleType,ppId:this.data.ppId});
+        // 没有点过完成直接选择然后清空,外层不会处于选中状态,故添加{select:1}
+        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});
       },
       check(){// 校验是否有已填项
@@ -206,6 +218,15 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
           return true;
         }
         return false;
+      },
+      checkReq(){// 校验必填项
+        const datas = this.checkDatas.questionMapping;
+        for(let k in datas){
+          if(datas[k].required==1 && !datas[k].value){
+            return false;
+          }
+        }
+        return true;
       }
     },
   }

+ 25 - 12
src/components/DetailBox.vue

@@ -8,7 +8,8 @@
           <Detail :datas="privateData" 
                   ref="detail"
                   :data="data"
-                  @check="changeCheck($event)"/>
+                  @check="changeCheck($event)"
+                  @checkReq="changeFins($event)"/>
         </div>
         <!-- <div class="foot" @click="complete">完成</div> -->
       </div>
@@ -17,11 +18,12 @@
           <img src="../images/small-close.png">
         </span>
         <span class="name">{{(privateData.description ||privateData.name)+'详情'}}</span>
-        <!-- <span @click="handleClear" :class="{'check':checkF}">清空</span> -->
+        <span @click="handleClear" :class="{'check':checkF}">清空</span>
         <i>{{tips}}</i>
       </div>
     </div>
-    <div :class="['foot',{'noCheck':!checkF}]" @click="complete">完成</div>
+    <!-- <div :class="['foot',{'noCheck':!checkF}]" @click="complete">完成</div> -->
+    <div :class="['foot',{'noCheck':!reqFinish}]" @click="complete">完成</div>
     <Toast :message="clearTxt" 
           :show="showToast"
           @comfirn="comfirnDel" 
@@ -48,7 +50,8 @@
         showToast:false,
         tips:"(请完成病情预问诊可让医生提前了解病情)",
         checkF:false, //详情页有无已选项标识
-        show:detailShow
+        show:detailShow,
+        reqFinish:false
       }
     },
     created(){
@@ -62,9 +65,13 @@
         // $('body').css({'height':height+'px','overflow-y':'hidden'})
         // 校验是否有已填项,有--弹窗;无--return
         let hasCheck = this.$refs.detail.check();
+        let checkReq = this.$refs.detail.checkReq();
         if(hasCheck){
           this.checkF = true;
         }
+        if(checkReq){
+          this.reqFinish = true;
+        }
         setTimeout(() => {
           let scroll = setScroll(BScroll,true,'.viewPrew')
           this.scroll = scroll
@@ -100,17 +107,23 @@
         
         this.$store.commit('setDetail',{detail:{}})
       },
-      complete(){//有选中内容才可以点完成#1919
-        if(this.checkF){
+      complete(){
+      //有选中内容才可以点完成#1919
+        // if(this.checkF){
+      //必填项都填完了才可以点完成
+        if(this.reqFinish){
           this.$refs.detail.saveData();
           this.$store.commit('setSearchShow', false);
           // this.$emit("pComplete");
           // this.$store.commit('setDetail',{detail:{}})
         }
       },
-      changeCheck(flag){
+      changeCheck(flag){//是否有选中项
         this.checkF = flag;
       },
+      changeFins(flag){//必填项是否都填了
+        this.reqFinish = flag;
+      },
       handleClear(){//清空
         // 校验是否有已填项,有--弹窗;无--return
         if(this.checkF){
@@ -185,9 +198,9 @@
       // height: .88rem;
       height: 1rem; //增加了提示
       line-height: .88rem;
-      // display: flex; //有清空时
-      // justify-content: space-between;
-      text-align: center; //去掉清空
+      display: flex; //有清空时
+      justify-content: space-between;
+      // text-align: center; //去掉清空
       border-bottom: 1px solid #E6E7EF;
       padding: 0 .4rem 0 .32rem;
       font-size: .28rem;
@@ -212,8 +225,8 @@
         display: inline-block;
         height: 100%;
         padding: 0 .1rem;
-        position: absolute;//去掉清空
-        left: .32rem;
+        // position: absolute;//去掉清空
+        // left: .32rem;
         img{
           width:.34rem;
           vertical-align: middle;

+ 3 - 3
src/components/DiagTreat.vue

@@ -122,14 +122,14 @@
             let temp = textArr[k];
             for(let j in temp){
               if(temp[j] && temp[j].textP){
-                msg += temp[j].textP + ''
+                msg += temp[j].textP + ''
               }
             }
           }else if(textArr[k]&&textArr[k].textP){
-            msg += textArr[k].textP + ''
+            msg += textArr[k].textP + ''
           }
         }    
-        return trimDots(msg);
+        return trimDots(msg.substring(0,msg.length-1));
       },
       updataData(data,id,order,index){//输入框存值
         let list = this.dtoList;

+ 3 - 3
src/components/Others.vue

@@ -151,14 +151,14 @@
             let temp = textArr[k];
             for(let j in temp){
               if(temp[j] && temp[j].textP){
-                msg += temp[j].textP + ''
+                msg += temp[j].textP + ''
               }
             }
           }else if(textArr[k]&&textArr[k].textP){
-            msg += textArr[k].textP + ''
+            msg += textArr[k].textP + ''
           }
         }    
-        return trimDots(msg);
+        return trimDots(msg.substring(0,msg.length-1));
       }
     },
     components:{

+ 1 - 1
src/components/PathInfo.vue

@@ -9,7 +9,7 @@
       </p>
       <p>
         <span>挂号科室:</span>
-        <span>{{pathInfo.selfDeptName}}</span>
+        <span>{{pathInfo.hospitalDeptName}}</span>
       </p>
       <div class="dept">
         <p>

+ 7 - 6
src/components/Preview.vue

@@ -171,21 +171,22 @@ export default {
           for(let j in temp){
             if(temp[j]){
               if(flag){//医生
-                msg += temp[j].text + ''
+                msg += temp[j].text + ''
               }else if(temp[j].textP){
-                msg += temp[j].textP + ''
+                msg += temp[j].textP + ''
               } 
             }
           }
         }else if(textArr[k]){
           if(flag){
-            msg += textArr[k].text + ''
+            msg += textArr[k].text + ''
           }else if(textArr[k].textP){
-            msg += textArr[k].textP + ''
+            msg += textArr[k].textP + ''
           }
         }
-      }    
-      return trimDots(msg);
+      }
+      // 去掉最后一个逗号
+      return trimDots(msg.substring(0,msg.length-1));
     },
     handleClick(flg){
       this.showDoc = flg

+ 62 - 10
src/components/Symptom.vue

@@ -18,17 +18,24 @@
         </p>
       </div>
       <div class="label">
-        <p class="quest">{{quesText}}<img
+        <p class="quest" id="test">{{quesText}}<img
             @click="search(true)"
             class="searchImg"
             src="../images/search.png"
             alt=""
           ></p>
-        <span
+        <!-- <span
           class="symp"
           v-for="(it,ind) in symp"
           :key="it.conceptId"
           @click="showDetil(it)"
+        >{{it.description || it.name}}</span> -->
+        <span
+          class="symp"
+          v-for="(it,ind) in symp"
+          :key="it.conceptId"
+          @touchstart.stop.prevent="touchstart(it)"
+          @touchend.stop.prevent="touchend(it)"
         >{{it.description || it.name}}</span>
       </div>
       <div
@@ -61,12 +68,14 @@
       :chooseSymp="chooseSymp"
       :sexType="sexType"
     ></Search>
+    <Tiptoast :show="showExp" :data="message" @close="closeTip"/>
   </div>
 </template>
 <script type="text/javascript">
 import api from '@utils/api.js';
 import DetailBox from './DetailBox.vue';
 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 BScroll from 'better-scroll';
@@ -95,6 +104,13 @@ export default {
       isSearch:false,
       scroll:null,
       quesText:"请问您有哪些不适?",
+      startTime:'',
+      timer:null,
+      showExp:false,
+      message:{
+        title:'',
+        text:''
+      }
     }
   },
   created() {
@@ -115,6 +131,27 @@ export default {
     })
   },
   methods: {
+    touchstart(it){
+      this.startTime = +new Date();
+      const that = this;
+      this.timer = setTimeout(function(){
+        // 长按事件
+          that.showExp = true;
+          if(it.explains){
+            that.message.title = it.description || it.name;
+            that.message.text = it.explains;
+          }else{
+            that.message.title = "";
+            that.message.text = "暂无资料";
+          }
+          
+        },600)
+    },
+    closeTip(){
+      this.showExp = false,
+      this.message.title = '';
+      this.message.text = '';
+    },
     onScroll() {
       document.activeElement.scrollIntoViewIfNeeded(true);        
     },
@@ -149,14 +186,12 @@ export default {
         this.$emit('next');
       }
     },
-    showDetil(item,flg) {
-      this.tmpItem=item
-      this.isSearch=flg||false
+    common(item,flg){
       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 });
-      this.quesText = "请问您还有其他不适吗?";
+      
       if (id) {
         const param = {
           "age": this.age,
@@ -185,7 +220,19 @@ export default {
         this.chooseSymp.push(item);
         this.checkText = this.$store.state.symptom.text;
       }
-
+    },
+    showDetil(item,flg) {//搜索点开的详情
+      this.tmpItem=item
+      this.isSearch=flg||false
+      this.common(item,flg);
+    },
+    touchend(item,flg) {//症状点开详情
+      clearTimeout(this.timer);
+      let endTime = +new Date();
+      if(endTime - this.startTime < 500){//点击事件
+        this.common(item,flg);
+      }
+      this.startTime = "";
     },
     getSympText() {//推送使用医生端信息
       const text = this.$store.state.symptom.text;
@@ -231,8 +278,10 @@ export default {
       } else {
         // 全部删除完 重新走问诊流程
         // this.$router.push("/")
-        this.$router.replace({path:'/'})
-        // this.getSympList();
+        // this.$router.replace({path:'/'})
+        // 停留在当前页 8-19
+        this.quesText = "请问您有哪些不适?";
+        this.getSympList();
       }
       this.cancelDel();
     },
@@ -254,7 +303,8 @@ export default {
   components: {
     DetailBox,
     Toast,
-    Search
+    Search,
+    Tiptoast
   },
   watch:{
     checkText:{//更新推送
@@ -262,8 +312,10 @@ export default {
         const sympText = this.getSympText();
         if(sympText){
           this.getPush(sympText);
+          this.quesText = "请问您还有其他不适吗?";
         }else{
           this.getSympList();
+          this.quesText = "请问您有哪些不适?";
         } 
       },
       deep:true

BIN
src/images/icon_close@2x.png


+ 0 - 1
src/utils/tools.js

@@ -254,7 +254,6 @@ function trimDots(str){
 
 // 拼值,并去掉占位符
 function concatVal(data,flg){
-  console.log(data,111)
   let value = ""; //医生
   let valueP = ""; //患者
   let tmpStrHas = [],tmpStrNo = [],tmpAll=[];