Bläddra i källkod

Merge branch 'dev' into byll

Luolei 5 år sedan
förälder
incheckning
e9eeb45896

+ 9 - 6
src/common/CheckBox.vue

@@ -17,7 +17,7 @@
   </div>
 </template>
 <script type="text/javascript">
-import tools from '@utils/tools.js';
+import {imageUrlPrefix,patt} from '@utils/tools.js';
 import icon from '../images/check-default.png';
 import checkIcon from '../images/check.png';
 import MultiLineInput from '../common/MultiLineInput.vue';
@@ -25,7 +25,7 @@ import MultiLineInput from '../common/MultiLineInput.vue';
     name:'CheckBox',
     data(){
       return{
-        imgUrl:tools.imageUrlPrefix,
+        imgUrl:imageUrlPrefix,
         defaultPic:icon,
         check:checkIcon,
         datas:{},
@@ -80,10 +80,13 @@ import MultiLineInput from '../common/MultiLineInput.vue';
       },
       inpVal(val,index){//输入框失焦处理
         let valueStr = this.datas.value;
-        let patt = /\$\{[^\]]+\}/g;
-        let newVal =  val;
-        const str = valueStr.replace(patt,newVal);
-        this.datas.value = str;
+        if(valueStr){
+          // let patt = /\$\{[^\]]+\}/g;
+          let newVal =  val;
+          const str = valueStr.replace(patt,newVal);
+          this.datas.value = str;
+        }
+        
         // 输入框回读
         let detailList = this.datas.questionDetailList;
         let currItem = detailList[index];

+ 3 - 1
src/common/Input.vue

@@ -45,12 +45,14 @@
       color: #4F50FF;
       font-size: .3rem;
       border: 0 none;
-      border-bottom: 1px solid #7C828E;
+      // border-bottom: 1px solid #7C828E;
+      border-bottom: 1px solid #DFE0E4;
       margin-bottom: .3rem;
       border-radius: 0;
       outline-color: invert;
       padding-left: 0.1rem;
       box-sizing: border-box;
+      background: transparent;
     }
     .change{
       border-color:  #4F50FF;

+ 6 - 1
src/common/Label.vue

@@ -67,8 +67,13 @@ import Toast from '../common/Toast.vue';
       },
       deletSymp(e,it,index){
         e.stopPropagation();
-        this.showToast = true;
+        // 删除互斥项(无)不弹窗提醒 7-18
         this.tempItem = it;
+        if(it.exclusionType == 1){
+          this.comfirnDel();
+          return
+        }
+        this.showToast = true;
       },
       comfirnDel(){
         const temp = this.tempItem;

+ 10 - 4
src/common/MultiLineInput.vue

@@ -3,9 +3,7 @@
     <span class="prefix" v-if="content.prefix">{{content.prefix}}</span>
     <div class="sticP" :style="{paddingRight:content.suffix?'1rem':'0'}">
         <div class="iptWrap">
-          <!-- <input class="contentVal" :type="content.type" :placeholder="content.placeholder" v-model="txt" @input="changeVal" @blur="blur"> -->
-          <!-- <input class="contentVal" type="text" pattern="[0-9]*" :placeholder="content.placeholder" v-model="txt" @input="changeVal" @blur="blur"> -->
-          <input class="contentVal" type="number" pattern="\d*" :placeholder="content.placeholder" v-model="txt" @input="changeVal" @blur="blur">
+          <input class="contentVal" :type="content.type" :placeholder="content.placeholder" pattern="\d*" v-model.number="txt" @input="changeVal" @blur="blur" @click="handleClick">
         </div>
     </div>
     <span class="suffix" v-if="content.suffix">{{content.suffix}}</span>
@@ -51,9 +49,16 @@ export default {
       // this.$emit('changeMultipVal',this.txt)
     },
     blur(){
+      // 如果该项未选中,则不存值
+      const select = this.part.select;
+      if(!select){return}
       const newData = Object.assign({},this.part,{value:this.txt,controlType:3});
       this.$emit("updata",newData);
       this.$emit('handleInp',this.txt);
+    },
+    handleClick(e){
+      // 点击输入框时不选中该项
+      e.stopPropagation();
     }
   },
   watch:{
@@ -84,7 +89,8 @@ export default {
       border: 0 none;
       border-bottom: 1px solid #b0afaf !important;
       border-radius: 0;
-      background-color: #fff;
+      // background-color: #fff;
+      background: transparent;
       outline-color: invert;
       height: .36rem;
       line-height: .36rem;

+ 11 - 6
src/common/Radio.vue

@@ -19,7 +19,7 @@
 <script type="text/javascript">
 import icon from '../images/radio-default.png'
 import checkIcon from '../images/radio-check.png'
-import {deepClone} from '@utils/tools.js'
+import {patt} from '@utils/tools.js'
 import MultiLineInput from '../common/MultiLineInput.vue';
   export default{
     name:'Radio',
@@ -37,6 +37,7 @@ import MultiLineInput from '../common/MultiLineInput.vue';
     },
     methods:{
       handleClick(it,index){
+        // let patt = /\$\{[^\]]+\}/g;
         const list = this.datas;
         let data = list.questionDetailList&&list.questionDetailList.slice(0); //数组深拷贝?
         let value = "";
@@ -52,11 +53,13 @@ import MultiLineInput from '../common/MultiLineInput.vue';
       },
       inpVal(val,index){//输入框失焦处理
         let valueStr = this.datas.value;
-        let patt = /\$\{[^\]]+\}/g;
-        // let newVal = '{' + val + '}';//修改时替换值用
-        let newVal =  val;//修改时替换值用
-        const str = valueStr.replace(patt,newVal);
-        this.datas.value = str;
+        if(valueStr){
+          // let patt = /\$\{[^\]]+\}/g;
+          let newVal =  val;//修改时替换值用
+          const str = valueStr.replace(patt,newVal);
+          this.datas.value = str;
+        }
+        
         // 输入框回读
         let detailList = this.datas.questionDetailList;
         let currItem = detailList[index];
@@ -88,6 +91,8 @@ import MultiLineInput from '../common/MultiLineInput.vue';
       padding: .12rem .1rem;
       display: inline-block;
       white-space: nowrap;
+      -webkit-white-space: nowrap;
+      // -webkit-box-orient: vertical;
       img{
         width: .38rem;
         vertical-align: middle;

+ 1 - 1
src/common/Submit.vue

@@ -40,7 +40,7 @@ export default {
   // },
   methods: {
     goStart() {
-      this.$store.commit('initAllData')
+      // this.$store.commit('initAllData') //已在患者页进行初始化
       this.$router.push("/")
     }
   }

+ 1 - 5
src/common/UploadImg.vue

@@ -171,11 +171,6 @@ export default {
 <style lang="less" scoped>
 .img-wrap {
   font-size: 0.3rem;
-  /* .name {
-    color: #000;
-    margin-bottom: 0.36rem;
-    font-weight: 700;
-  } */
   .upload-imgs {
     margin-bottom: 0.2rem;
     .uploadBox {
@@ -190,6 +185,7 @@ export default {
     li {
       width: 1.86rem;
       height: 1.9rem;
+      border: 1px solid #dfe0e4;
       display: inline-block;
       position: relative;
       vertical-align: top;

+ 4 - 2
src/components/Detail.vue

@@ -28,6 +28,7 @@ import Radio from '../common/Radio.vue';
 import CheckBox from '../common/CheckBox.vue';
 import Input from '../common/Input.vue';
 import ComTextArea from '../common/ComTextArea.vue';
+import {patt} from '@utils/tools.js'
 // 将获取到的数据源转换成私有数据,处理选择事件。点击完成后统一存到store中,便于回读
   export default {
     name:'Detail',
@@ -78,7 +79,7 @@ import ComTextArea from '../common/ComTextArea.vue';
 
         this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.type,ppId:this.ppId});
         // flag是区分点开已选症状 未点完成
-        this.$store.commit('setText',{text:newMsg,pId:this.checkDatas.id,type:this.type,flag:true});
+        this.$store.commit('setText',{text:newMsg.replace(patt,''),pId:this.checkDatas.id,type:this.type,flag:true});
       },
       clearData(){//清空
         const datas = this.checkDatas.questionMapping;
@@ -104,7 +105,8 @@ import ComTextArea from '../common/ComTextArea.vue';
 </script>
 <style lang="less" scoped>
   .detail-wrap{
-    padding: .3rem .5rem 1.2rem .6rem;
+    // padding: .3rem .5rem 1.2rem .6rem;
+    padding: .3rem .5rem 2rem .6rem;
     font-size: .3rem;
     .quest{
       color:#000;

+ 18 - 6
src/components/DetailBox.vue

@@ -40,7 +40,7 @@
     mounted(){
       const box = this.$refs.detailBox;
       const height = document.documentElement.clientHeight;
-      box.style.height = height - 50 + 'px'; 
+      box.style.height = height - 45 + 'px'; 
     },
     methods:{
       close(){
@@ -75,7 +75,7 @@
 @import '../less/base.less';
   .detailBox-wrap{
     width: 100%;
-    overflow-y: auto;
+    // overflow-y: auto;
     position: fixed;
     bottom: 0;
     left: 0;
@@ -83,7 +83,8 @@
     background: #fff;
     border-radius: .08rem .08rem 0 0;
     font-size: .3rem;
-    animation: wave .4s ease-in;
+    // animation: wave .4s ease-in;
+    animation: wave .4s linear;
     .head{
       height: .88rem;
       line-height: .88rem;
@@ -108,10 +109,14 @@
       }
     }
     .main{
-
+      height: 100%;
+      width:100%;
+      overflow-y: auto;
     }
     .foot{
       .footer;
+      animation-delay:.6s;
+      animation: foo .4s linear;
       /* width:100%;
       height: .88rem;
       line-height: .88rem;
@@ -122,7 +127,14 @@
     }
   }
   @keyframes wave {
-    0%   {height:0 ;}
-    100% {height: 100%;}
+    0%   {top:100% ;}
+    25% {top: 75%;}
+    50% {top: 50%;}
+    75% {top: 25%;}
+    100% {top: 45px;}
   } 
+  @keyframes foo {
+    0% {bottom:-1rem;}
+    100% {bottom:0;}
+  }
 </style>

+ 21 - 1
src/components/DiagTreat.vue

@@ -11,11 +11,21 @@
               :ppId="it.id" 
               :moduleType="datas.type" 
               @setDetail="setDetail"/>
-      <UploadImg v-if="it.controlType==4" 
+        <!-- 上传图片 -->
+        <UploadImg v-if="it.controlType==4" 
             :item="it" 
             :moduleType="datas.type"
             :imgList="imgs"
             />
+        <!-- 输入框 -->
+        <Input v-if="it.controlType==6 || it.controlType==7"
+            :item="it"
+            :key="it.id"
+            @updata="updataData($event,it.id)"/>
+        <!-- 文本域 -->
+        <ComTextArea v-if="it.controlType == 5"
+            :item="it"
+            @updata="updataData($event,it.id)"/>
     </div>
     <div class="result" v-if="checkText.length>0">
       <p class="title">治疗情况</p>
@@ -95,6 +105,16 @@
           msg += textArr[k].text + ';'
         }
         return msg;
+      },
+      updataData(data,id){//输入框存值
+        let list = this.dtoList;
+        for(let i in list){
+          if(list[i].id==data.id){
+            list.splice(i,1,data)
+          }
+        }
+        this.$store.commit('setDatas',{type:'2',data:data,pId:data.id,ppId:id});
+        this.$store.commit('setText',{type:'2',text:data.value,pId:data.id,flag:true}); 
       }
     },
     components:{

+ 5 - 2
src/components/Others.vue

@@ -15,10 +15,13 @@
             :item="it"
             :key="it.id"
             @updata="updataData($event,it.id)"/>
+        <!-- 文本域 -->
+        <ComTextArea v-if="it.controlType == 5"
+            :item="it"
+            @updata="updataData($event,it.id)"/>
     </div>
     <div class="result" v-if="checkText.length>0">
       <p class="title">其他病史</p>
-      <!-- <p v-for="(v,i) in checkText">{{v.text}}</p> -->
       <p>{{getText()}}</p>
     </div>
     <div class="foot" v-if="modluesLen==3&&!nextName||modluesLen==2">
@@ -67,7 +70,7 @@
         this.$emit('back');
       },
       toNext(){
-        if(this.modluesLen==2&&!nextName){
+        if(this.modluesLen==2&&!this.nextName){
           this.$emit('next','preview')
         }else{
           this.$emit('next');

+ 8 - 2
src/components/PathInfo.vue

@@ -73,8 +73,10 @@
       }
     },
     created(){
+      // this.ifWX();
       this.getPathInfo();
       this.getSysConfig();
+      this.$store.commit('initAllData');//初始化store数据
     },
     methods:{
       getPathInfo(){
@@ -141,8 +143,12 @@
         })
       },
       getStart(){
-        if(this.isReady){
-          this.$router.push({path:'/tab'})
+        this.$router.push({path:'/tab'})
+      },
+      ifWX(){
+        let us = navigator.userAgent.toLowerCase();
+        if(us.indexOf('micromessenger') == -1){
+          console.log("非微信打开")
         }
       }
     }

+ 8 - 1
src/components/TabPage.vue

@@ -80,7 +80,7 @@ export default {
         "3": sysConfig.length > 0 && sysConfig.filter(item => item.code == "omhistory_show")[0].value,
         "4": sysConfig.length > 0 && sysConfig.filter(item => item.code == "replenish_show")[0].value,
       },
-      flag: allMoudles.order-0,
+      flag: allMoudles.order,
       moduleShow:true,
       finish:{ //标识已填
         "1":true,
@@ -186,7 +186,14 @@ export default {
   width: 100%;
   height: 100%;
   padding-bottom: 0.88rem;
+  padding-top: 0.82rem;
   .tab {
+    position: fixed;
+    top: 0;
+    left: 0;
+    width: 100%;
+    background: #fff;
+    z-index: 50;
     height: 0.82rem;
     line-height: 0.82rem;
     border-bottom: 1px solid #ededed;

+ 1 - 0
src/less/base.less

@@ -28,6 +28,7 @@
   bottom: 0;
   left: 0;
   background: #F2F2F5;
+  z-index: 66;
   .back,.next{
     display: inline-block;
     height: .88rem;

+ 5 - 2
src/utils/tools.js

@@ -76,7 +76,6 @@ const moduleConfig = (config,modules) => {
       }
     }
   }
-  // console.log(activeModule)
   return {
     data:activeModule,
     len:activeModule.length||0,
@@ -84,13 +83,17 @@ const moduleConfig = (config,modules) => {
   }
 }
 
+// 替换输入框占位符
+const patt = /\$\{[^\]]+\}/g;
+
 module.exports =  {
   imageUrlPrefix,
   getUrlArgObject,
   deepClone,
   getModelExpStr,
   getAllStr,
-  moduleConfig
+  moduleConfig,
+  patt
 }