Переглянути джерело

Merge branch 'newVersion' of http://223.93.170.82:10080/zhouna/preliminary into newVersion

luolei 5 роки тому
батько
коміт
d62fa4f0a7

+ 3 - 2
src/common/ComTextArea.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="comArea" :style="getStyle(detail,slide)">
+  <div class="comArea" :style="getStyle(detail,slide)" @touchmove.prevent>
     <textarea
             :style="{width:width,height:height}"
             v-model="txt"
@@ -70,6 +70,7 @@ export default {
       }
     },
     makeSuer(){
+      //if(!this.sure){return}
       let n = this.num;
       this.$emit("updata",'',{val:this.txt||'无',valp:this.txt||'无'},++n);
     }
@@ -83,7 +84,7 @@ export default {
     position:fixed;
     bottom:0;
     background:#fff;
-    padding:0.28rem 0 4%;
+    padding:0.28rem 0 0;
     box-shadow: 0 0 30px -10px rgba(104, 124, 189, 0.25);
     text-align: center;
     textarea {

+ 5 - 3
src/common/HomePage.vue

@@ -34,15 +34,17 @@ export default {
     let timer = setInterval(() => {
       this.num = --num
       if(num == -1){
-        localStorage.setItem('startPage',0)
-        this.show = false
+        localStorage.setItem('startPage',0);
+        document.title = '挂号详情';
+        this.show = false;
         clearInterval(timer)
       }
     }, 1000);
   },
   methods:{
     close(){
-      localStorage.setItem('startPage',0)
+      localStorage.setItem('startPage',0);
+      document.title = '挂号详情';
       this.show = false
     },
     getDisclaimerInformations(){

+ 11 - 9
src/common/Input.vue

@@ -20,6 +20,9 @@
       item:{
         default:''
       },
+      num:{
+        default:-1
+      },
       slide:{
         default:false,
         type:Boolean
@@ -88,21 +91,20 @@
 <style lang="less" scoped>
 @import '../less/base.less';
   .inp-wrap{
-    .bgques;
-    padding-bottom: 0;
+    display: block;
+    position: fixed;
+    bottom: 0;
+    width: 100%;
+    padding:0.12rem 0 0;
+    text-align:center;
     input{
-      width: 100%;
+      width: 92%;
       color: #colors[theme];
       font-size: .3rem;
-      border: 0 none;
-      border-bottom: 1px solid #DFE0E4;
-      margin-bottom: .3rem;
-      border-radius: 0;
+      border-bottom: 1px solid #e6e6e6;
       outline-color: invert;
       padding-left: 0.1rem;
       box-sizing: border-box;
-      // background: #fff;
-      background: transparent;
     }
     .change{
       border-color:  #colors[theme];

+ 2 - 2
src/common/MultSelect.vue

@@ -1,6 +1,6 @@
 <template>
   <portal to="notification-outlet">
-  <div class="select">
+  <div class="select" @touchmove.prevent>
     <ul class="clearfix">
       <li
         v-for="(item,idx) in result"
@@ -110,7 +110,7 @@ export default {
         const text=result[i].name;
         const textp=result[i].description||result[i].name;
         const msg = getExpStr(text);
-        const msgp = getExpStr(text);
+        const msgp = getExpStr(textp);
         if(result[i].name.indexOf("${")!==-1){
           if(result[i].value){
             tmpResult.push(msg.prefix+(result[i].value||"")+msg.suffix);

+ 6 - 2
src/common/OptionInp.vue

@@ -34,12 +34,16 @@ import $ from 'jquery';
     },
     methods:{
       changeVal(e){
-        this.txt = e.target.value;
+        /*const val = e.target.value;
+        if(!val.match(/\S/g)){      //只有空白符不算输入
+          this.txt='';
+        }*/
         if(this.msg.type=='number'){//数字键盘
           this.txt = e.target.value=e.target.value.replace(/^\.$/,'')
         }
         this.$emit('handleInp',this.txt,this.inx);
-        if(this.txt&&!this.item.select||(!this.txt&&this.item.select)){
+        const notNull=this.txt.match(/\S/g);
+        if(notNull&&!this.item.select||(!notNull&&this.item.select)){
           this.$emit("handleSelect")
         }
       },

+ 1 - 4
src/common/Picker.vue

@@ -1,7 +1,6 @@
 <template>
 <portal to="notification-outlet">
-    <div>
-        <div class="pickerBox">
+        <div class="pickerBox" @touchmove.prevent>
             <div class="picker">
                 <van-picker :columns="columns"
                     :visible-item-count = "5"
@@ -15,8 +14,6 @@
             确定
           </div>
         </div>
-    </div>
-
 </portal>
 </template>
 <script>

+ 50 - 14
src/common/PushSymptom.vue

@@ -1,6 +1,6 @@
 <template>
   <portal to="notification-outlet">
-    <div class="select">
+    <div class="select" @touchmove.prevent>
       <div class="selected-tags">
         <p class="title">已选伴随症状:</p>
         <ul class="clearfix">
@@ -86,7 +86,11 @@
           const result = res.data;
           if (result.code == 0&&result.data) {
             const syms = result.data.symptom;
-            const none={
+            if((!syms||syms.length===0)&&this.extSyms.length===0){
+              this.$emit('warning',"数据异常,请退出重新进入~");
+              return;
+            }
+            /*const none={
               conceptId: 0,
               name: "没有了",
               tagName: "没有了",
@@ -97,11 +101,11 @@
               exclusion:1,
               hasExplain: 0,
               explains: null,
-            };
+            };*/
             //没有了与其他互斥
-            const hasNone = symptoms.indexOf("没有了")!==-1;
+            //const hasNone = symptoms.indexOf("没有了")!==-1;
             const selecteds = this.selecteds;
-            const exts=JSON.parse(JSON.stringify(this.extSyms));
+            const exts=this.getPushExts();
             const newSyms = delResymptoms(exts,syms);
             const newSymsCopy=JSON.parse(JSON.stringify(newSyms));
             const newExt =selecteds.length>0?newSymsCopy.reduce((total,it)=>{
@@ -110,19 +114,51 @@
                 }
               return total;
             },[]):newSyms;
-            if(hasNone){
+            //if(hasNone){
               this.symptoms = [...newExt];
-            }else{
+            /*}else{
               this.symptoms = [none,...newExt];
-            }
+            }*/
             this.symptoms.length=this.symptoms.length>10?10:this.symptoms.length;
-            //this.getSymptomLisCom(result)
           }else{
-            //this.getSymptomLisCom()
+            this.setErrorSymps();
           }
         }).catch((err)=>{
-
-        })
+         this.setErrorSymps();
+        });
+      },
+      setErrorSymps(){
+          const symps = this.getPushExts();
+          const selecteds = this.selecteds;
+          const newExt1 =selecteds.length>0?symps.reduce((total,it)=>{
+            if(selecteds.findIndex((i)=>i.name===it.name)===-1){
+              total.push(it);
+            }
+            return total;
+          },[]):symps;
+        this.symptoms = newExt1;
+        this.symptoms.length=this.symptoms.length>10?10:this.symptoms.length;
+      },
+      getPushExts(){
+        let syms = [];
+        const none={
+          conceptId: 0,
+          name: "没有了",
+          tagName: "没有了",
+          libType: 1,
+          id: 0,
+          type: 1,
+          description: "",
+          exclusion:1,
+          hasExplain: 0,
+          explains: null,
+        };
+        const exts=JSON.parse(JSON.stringify(this.extSyms));
+        if(exts.length===0){
+          return [none];
+        }
+        syms = [none,...exts];
+        return syms;
       },
       showExplain(it){
         if(it.explains){
@@ -195,7 +231,7 @@
       delSelected(item){    //删除已选伴随症状
         const selecteds = JSON.parse(JSON.stringify(this.selecteds));
         const inx = selecteds.findIndex((it)=>{
-          return it.tagName === item.tagName;
+          return it.name === item.name;
         });
         if(inx!==-1){
           this.selectedsName = this.selectedsName.replace(item.name,"");
@@ -208,7 +244,7 @@
       }
     },
     components:{
-      Tiptoast
+      Tiptoast,
     }
   };
 </script>

+ 1 - 1
src/common/Radio.vue

@@ -1,6 +1,6 @@
 <template>
  <!-- <portal to="notification-outlet">-->
-  <div class="select">
+  <div class="select" @touchmove.prevent>
     <ul class="clearfix">
       <li
         v-for="(item,idx) in result"

+ 1 - 1
src/common/Select.vue

@@ -99,7 +99,7 @@ export default {
           const text=result[i].name;
           const textp=result[i].description||result[i].name;
           const msg = getExpStr(text);
-          const msgp = getExpStr(text);
+          const msgp = getExpStr(textp);
           if(result[i].select){
             subQas = subQas+","+result[i].subQuestion;
             if(result[i].name.indexOf("${")!==-1){

+ 8 - 7
src/common/UploadImg.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="img-wrap">
+  <div class="img-wrap" @touchmove.prevent>
     <div class="box">
 
       <ul class="upload-imgs">
@@ -210,8 +210,9 @@ export default {
   background:#fff;
   width:100%;
   box-shadow: 0 0 30px -10px rgba(104, 124, 189, 0.25);
+  padding-top: .4rem;
   .upload-imgs {
-    margin:0 1rem 0.2rem;
+    margin:0 1rem;
     height: 3.5rem;
     .upload{
       width: 1.5rem;
@@ -249,15 +250,15 @@ export default {
       position: relative;
       vertical-align: top;
       border-radius: 0.08rem;
-      margin: 0 0 0.3rem 0.3rem;
+      margin: 0 0 0.3rem 0.4rem;
       .close {
-        width: 0.54rem;
-        height: 0.54rem;
+        width: 0.3rem;
+        height: 0.3rem;
         background: url(../images/closeimg.png) no-repeat;
         background-size: cover;
         position: absolute;
-        top: -0.27rem;
-        right: -0.27rem;
+        top: -0.17rem;
+        right: -0.17rem;
         z-index: 3;
       }
     }

+ 1 - 1
src/common/UsualSymptom.vue

@@ -1,6 +1,6 @@
 <template>
   <portal to="notification-usual">
-  <div class="usual-symptom">
+  <div class="usual-symptom" @touchmove.prevent>
     <p class="title-bar">
       <!--<a href="javascript:void(0)">--><img @click="back" src="../images/back.png" alt="返回"/><!--</a>-->
       <span>您哪里不舒服?</span>

+ 14 - 9
src/components/MainPage.vue

@@ -37,16 +37,16 @@
           </div>
           <span v-if="!canceledSym&&num<1" class="edit" @click="cancelSymptom">修改</span>
         </div>
-        <div v-for="(item,idx) in symptomQasList" :key="'0'+item.id" v-if="activeTab">
+        <div v-for="(item,idx) in symptomQasList" :key="'0'+idx+item.id" v-if="activeTab">
           <Dialog :idx="idx" v-if="item.show" :item="item" @cancel="cancelSelected" :num="activeNum" :cancelNum="canceledQa" :extNum ="[]" :cancelTab="cancelTab" :isLast="idx===symptomQasList.length-1"/>
         </div>
-        <div v-for="(item,idx) in diagnoseQasList" :key="'1'+item.id" v-if="activeTab==moduleKeys[1]||activeTab==moduleKeys[2]||activeTab==moduleKeys[3]">
+        <div v-for="(item,idx) in diagnoseQasList" :key="'1'+idx+item.id" v-if="activeTab==moduleKeys[1]||activeTab==moduleKeys[2]||activeTab==moduleKeys[3]">
           <Dialog :idx="idx" v-if="item.show" :item="item" @cancel="cancelSelected" :num="activeNum" :extNum ="[symptomQasList.length]" :cancelNum="canceledQa" :cancelTab="cancelTab" :isLast="idx===diagnoseQasList.length-1"/>
         </div>
-        <div v-for="(item,idx) in othersQasList" :key="'2'+item.id" v-if="activeTab==moduleKeys[2]||activeTab==moduleKeys[3]">
+        <div v-for="(item,idx) in othersQasList" :key="'2'+idx+item.id" v-if="activeTab==moduleKeys[2]||activeTab==moduleKeys[3]">
           <Dialog :idx="idx" v-if="item.show" :item="item" @cancel="cancelSelected" :num="activeNum" :extNum ="[symptomQasList.length,diagnoseQasList.length]" :cancelNum="canceledQa" :cancelTab="cancelTab" :isLast="idx===othersQasList.length-1"/>
         </div>
-        <div v-for="(item,idx) in addContentQasList" :key="'3'+item.id" v-if="activeTab==moduleKeys[3]">
+        <div v-for="(item,idx) in addContentQasList" :key="'3'+idx+item.id" v-if="activeTab==moduleKeys[3]">
           <Dialog :idx="idx" v-if="item.show" :item="item" @cancel="cancelSelected" :num="activeNum" :extNum ="[symptomQasList.length,diagnoseQasList.length,othersQasList.length]" :cancelNum="canceledQa" :cancelTab="cancelTab"/>
         </div>
       </div>
@@ -67,11 +67,11 @@
                @updataResult="updataResultSingle"
                :imgList="imgs"/>
     <!-- 输入框 -->
-    <Input v-if="type==7"
+    <!--<Input v-if="type==7"
            :num="num"
            :item="symptomResult"
            :key="symptomResult.id"
-           @updata="updataResultSingle"/>
+           @updata="updataResultSingle"/>-->
     <!-- 文本域 -->
     <ComTextArea v-if="type==6 || type == 5"
                  :num="num"
@@ -93,7 +93,7 @@ import Dialog from '../common/Dialog';
 import Picker from '../common/Picker';
 import Label from '../common/Label.vue';
 import ComTextArea from '../common/ComTextArea.vue';
-import Input from '../common/Input.vue';
+/*import Input from '../common/Input.vue';*/
 import PickTime from '../common/PickTime.vue';
 import UploadImg from '../common/UploadImg.vue';
 import PushSymptom from '../common/PushSymptom.vue';
@@ -249,7 +249,12 @@ export default {
       tmpArr = this[moduleName];
       tmpNowItem = tmpArr[this.num];
       this.type = -1;
-      tmpNowItem?tmpNowItem.show = false:'';      //最后一题时没有下一题
+      if(tmpNowItem){
+        tmpNowItem.show = false;
+      }else{//最后一题时没有下一题
+        this.showPreview=false;
+      }
+
       const keyIdx = this.moduleKeys.findIndex((i)=>i==this.activeTab);
       if(this.activeTab!==this.moduleKeys[0]&&this.num===0){     //取消上一阶段的最后一题时
         this.activeTab=this.moduleKeys[keyIdx-1];
@@ -428,7 +433,7 @@ export default {
     Picker,
     Label,
     ComTextArea,
-    Input,
+    /*Input,*/
     PickTime,
     UploadImg,
     PushSymptom,

+ 5 - 2
src/components/PathInfo.vue

@@ -151,7 +151,8 @@
           localStorage.removeItem('scan')
           this.getSysConfig(1);
           if(localStorage.getItem("startPage") == 1){
-            this.showStart = true
+            this.showStart = true;
+            document.title = '智能预问诊';
           }
         }
         api.getPathInfo(params).then((res)=>{
@@ -181,8 +182,10 @@
                     if(+datas[i].value==1){
                         localStorage.setItem('startPage',1)
                         //显示启动页
-                        this.showStart = true
+                        this.showStart = true;
+                        document.title = '智能预问诊';
                     }else{
+                        document.title = '挂号详情';
                         localStorage.setItem('startPage',0)
                     }
                 }

+ 1 - 0
src/components/Search.vue

@@ -141,6 +141,7 @@ export default {
   left: 0;
   z-index: 102;
   font-size: .3rem;
+  overflow: hidden;
 }
 .searchTop {
   padding: 0.4rem 0.4rem 0.15rem;

+ 1 - 1
src/store.js

@@ -149,7 +149,7 @@ const store = new Vuex.Store({
       const temp = formatSymptomData(data);
       state.symptom.origin = temp.newArr;
       state.symptom.datas = JSON.parse(JSON.stringify(temp.newArr));
-      state.extPushSymptom = temp.extSymptoms;
+      state.extPushSymptom = temp.extSymptoms||[];
     },
     setUsualSymptom(state,data){
       const arr = [...data];

+ 4 - 1
src/utils/tools.js

@@ -448,7 +448,10 @@ function getNSum(arr){
 //2数组去重
 function delResymptoms(arr,arr1){
   let idx = -1;
-  const newArr = arr1.reduce((total,it)=>{
+  if(!arr1||arr1.length===0){
+    return arr;
+  }
+  let newArr = arr1.reduce((total,it)=>{
     idx = arr.findIndex((t)=>t.name===it.name);
     if(idx===-1){
       total.push(it);