Bladeren bron

单选带输入框
Squashed commit of the following:

commit 5bd71c3bc78864981c754befd7191968348efe92
Author: liucf <liucf@zjlantone.com>
Date: Fri Jul 12 09:57:23 2019 +0800

配置项

commit f951842a2e9c38782ad1d203bb0371229eee8615
Author: Luolei <16657115156@163.com>
Date: Thu Jul 11 17:22:45 2019 +0800

text文本

commit bc0334d2f9433b08466fad4a052abf8c3e68a4f9
Merge: a76ca62 6cf8212
Author: Luolei <16657115156@163.com>
Date: Thu Jul 11 17:03:13 2019 +0800

Merge branch 'dev' into byll

commit a76ca621c03cd43366a3b4d94920110cc953fded
Author: Luolei <16657115156@163.com>
Date: Thu Jul 11 16:34:13 2019 +0800

搜索,完成提示弹窗

commit d4c321a248ca8460a3d5212ce6574e2193bb6e7b
Merge: f0cc127 bf08847
Author: Luolei <16657115156@163.com>
Date: Wed Jul 10 16:01:07 2019 +0800

Merge branch 'byll' of http://192.168.2.236:10080/zhouna/preliminary into byll

commit f0cc127f19d77f83b7350f8ac47b6b0902eaf8a4
Author: Luolei <16657115156@163.com>
Date: Wed Jul 10 16:01:00 2019 +0800

多列填写组件优化

commit bf08847a4f5104bdcd0c4facbdd619724f4c3060
Author: liucf <liucf@zjlantone.com>
Date: Wed Jul 10 15:36:17 2019 +0800

合并development分支

commit 7b4d2b7b39905403b1d2291a82a5cc534a096dc9
Merge: 39113f2 528de93
Author: Luolei <16657115156@163.com>
Date: Tue Jul 9 19:32:53 2019 +0800

Merge branch 'development' into byll

commit 39113f251e86e6a2fd2f32ac158a916d8731a1a8
Author: Luolei <16657115156@163.com>
Date: Tue Jul 9 19:20:36 2019 +0800

README.md

commit cbdf8d48f24b5bb3cb0779c024e9889377730190
Author: Luolei <16657115156@163.com>
Date: Tue Jul 9 19:13:20 2019 +0800

环境切换

commit 528de93f2e75bf3746f4c3ea6b77db95cd6284bf
Author: liucf <liucf@zjlantone.com>
Date: Mon Jul 8 20:32:12 2019 +0800

多选数据处理及诊疗

commit ef957e1efb30367dc50ed54ebd75d006c2095d59
Author: liucf <liucf@zjlantone.com>
Date: Mon Jul 8 14:34:17 2019 +0800

test build

commit 379f8dd0adbc97944ab2fdc49bbccd2e319b19fe
Author: liucf <liucf@zjlantone.com>
Date: Sat Jul 6 17:38:52 2019 +0800

合并dev
Squashed commit of the following:

commit 6c1978b3cf95d01b6979fc8d2e558db73ea6699c
Merge: 2817f6f 29702b2
Author: Luolei <16657115156@163.com>
Date: Sat Jul 6 13:51:22 2019 +0800

Merge branch 'development' into dev

commit 2817f6fe89bbc72b5b85f996b054ae959a6d715c
Author: Luolei <16657115156@163.com>
Date: Sat Jul 6 13:26:30 2019 +0800

改回配置

commit 99fd5c92c83ff78da644fceb2e73d9646d63eaad
Author: Luolei <16657115156@163.com>
Date: Fri Jul 5 17:10:57 2019 +0800

多列填写,预览

commit 54aa3aad2d6163449bff54abd5fbee53f8010941
Merge: 9b50ae5 ea78834
Author: Luolei <16657115156@163.com>
Date: Wed Jul 3 20:22:00 2019 +0800

Merge remote-tracking branch 'remotes/origin/development' into dev

commit 9b50ae5cf4fb61577133d0ff0f0470f86c3da87d
Author: Luolei <16657115156@163.com>
Date: Wed Jul 3 19:43:27 2019 +0800

新增文本域组件

commit c49d6a90ceb0a9f4166b1bb787c8b36171d6db41
Author: Luolei <16657115156@163.com>
Date: Wed Jul 3 09:56:18 2019 +0800

添加补充内容页面

commit db3d558cc2e8292c65bb8e460a206c40b44e4f75
Author: liucf <liucf@zjlantone.com>
Date: Tue Jul 2 11:38:56 2019 +0800

Squashed commit of the following:

commit abb05f77689576a0834513d2a21f5f05b321e495
Author: liucf <liucf@zjlantone.com>
Date: Tue Jul 2 11:36:51 2019 +0800

增加图片

commit 1a3e1b96d9dfd09cf7c9b5d05001db5a12cc2ac4
Author: liucf <liucf@zjlantone.com>
Date: Mon Jul 1 20:44:08 2019 +0800

新增弹窗,单选,多选,待完善

commit 565f06729383a7df1bfde511faacb5979432a7da
Author: liucf <liucf@zjlantone.com>
Date: Fri Jun 28 17:36:42 2019 +0800

患者信息页完成

commit 41fb3a249052d8beac52da5923b5718a6a758d3d
Author: liucf <liucf@zjlantone.com>
Date: Sat Jul 6 17:33:09 2019 +0800

症状情况数据处理

# Conflicts:
# src/components/Symptom.vue

liucf 6 jaren geleden
bovenliggende
commit
71b2343c35

+ 55 - 9
src/common/MultiLineInput.vue

@@ -1,8 +1,10 @@
 <template>
-  <div class="multipIpt">
+  <div :class="['multipIpt',{'border':border,'inline':inline,'check':select}]">
     <span class="prefix" v-if="content.prefix">{{content.prefix}}</span>
-    <div class="sticP">
-        <input class="contentVal" :type="content.type" :placeholder="content.placeholder" v-model="val" @input="changeVal">
+    <div class="sticP" :style="{paddingRight:content.suffix?'1rem':'0'}">
+        <div class="iptWrap">
+          <input class="contentVal" :type="content.type" :placeholder="content.placeholder" v-model="val" @input="changeVal" @blur="blur">
+        </div>
     </div>
     <span class="suffix" v-if="content.suffix">{{content.suffix}}</span>
   </div>
@@ -15,12 +17,28 @@ export default {
     msg:{
       default:'',
       type:String
+    },
+    border:{//最外层边框
+      default:true,
+      type:Boolean
+    },
+    inline:{ //是否行内元素
+      default:false,
+      type:Boolean
+    },
+    select:{ //是否选中
+      default:false,
+      type:Boolean
+    },
+    value:{ //回读的值
+      default:'',
+      type:String
     }
   },
   data(){
     return {
       content:{},
-      val:''
+      val:this.value
     }
   },
   mounted(){
@@ -29,6 +47,9 @@ export default {
   methods:{
     changeVal(){
       this.$emit('changeMultipVal',this.val)
+    },
+    blur(){
+      this.$emit('handleInp',this.val)
     }
   }
 }
@@ -38,8 +59,8 @@ export default {
     width: 100%;
     height: .74rem /* 74/100 */;
     line-height: .74rem /* 74/100 */;
-    border: 1px solid #DFE0E4;
-    border-radius: .08rem /* 8/100 */;
+    // border: 1px solid #DFE0E4;
+    // border-radius: .08rem /* 8/100 */;
     padding: 0 .12rem 0 .26rem;
     box-sizing: border-box;
     position: relative;
@@ -53,24 +74,49 @@ export default {
       border-radius: 0;
       background-color: #fff;
       outline-color: invert;
-      padding-left: 0.1rem;
+      height: .36rem;
+      line-height: .36rem;
+      width: 100%;
+      padding:0 0.1rem;
       box-sizing: border-box;
     }
   }
+  .border{
+    border: 1px solid #DFE0E4;
+    border-radius: .08rem
+  }
+  .inline{
+    display: inline-block;
+    vertical-align: middle;
+    color: #7C828E;
+    padding: 0;
+    margin:0;
+    height: auto /* 74/100 */;
+    line-height: .36rem /* 74/100 */;
+  }
   .prefix {
     float: left;
   }
   .suffix {
     position: absolute;
-    right: .12rem /* 12/100 */;
+    right: .12rem;
     top: 0;
     width: 1rem;
     text-align: right;
+    text-align: left;
   }
   .sticP {
     width: 100%;
-    position: relative;
+    // position: relative;
     padding-right: 1rem;
     box-sizing: border-box;
+    .iptWrap {
+      // width: 100%;
+      position: relative;
+      overflow: hidden;
+    }
+  }
+  .check{
+    color: #4F50FF;
   }
 </style>

+ 32 - 2
src/common/Radio.vue

@@ -3,7 +3,17 @@
     <img :src="datas.url.replace('{imageUrlPrefix}',imgUrl)" v-if="datas.url">
     <p v-for="(it,index) in datas.questionDetailList" :key="it.id" class="list" @click="handleClick(it,index)">
       <img :src="it.select==1?check:defaultPic">
-      <span :class="{'check':it.select==1}">{{it.name}}</span>
+      <!-- <span :class="{'check':it.select==1}">{{it.name}}</span> -->
+      <span v-if="(it.name.indexOf('${'))==-1" :class="{'check':it.select==1}">{{it.name}}</span>
+      <MultiLineInput v-else 
+          @changeMultipVal="changeMultipVal($event,index)" 
+          @handleInp="inpVal($event,index)"
+          :msg="it.name" 
+          :value="it.value" 
+          :border="false" 
+          :inline="true" 
+          :select="it.select==1" 
+          />
     </p>
   </div>
 </template>
@@ -11,6 +21,7 @@
 import icon from '../images/radio-default.png'
 import checkIcon from '../images/radio-check.png'
 import {deepClone} from '@utils/tools.js'
+import MultiLineInput from '../common/MultiLineInput.vue';
   export default{
     name:'Radio',
     data(){
@@ -39,7 +50,22 @@ import {deepClone} from '@utils/tools.js'
         }
         const newData = Object.assign({},this.datas,{questionDetailList:data},{value:value})
         this.$emit("updata",newData);
-      }
+      },
+      inpVal(val,index){//输入框失焦处理
+        let valueStr = this.datas.value;
+        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];
+        currItem.value = val; //console.log('单选:',val,valueStr,str,this.datas)
+        this.$emit("updata",this.datas);
+      },
+      changeMultipVal(val){
+        // console.log('输入:',this.datas,val)
+      },
     },
     watch:{
       item:{
@@ -48,6 +74,9 @@ import {deepClone} from '@utils/tools.js'
         },
         deep:true
       }
+    },
+    components:{
+      MultiLineInput
     }
   }
 </script>
@@ -61,6 +90,7 @@ import {deepClone} from '@utils/tools.js'
       margin:0 .1rem .1rem 0;
       padding: .12rem .1rem;
       display: inline-block;
+      white-space: nowrap;
       img{
         width: .38rem;
         vertical-align: middle;

+ 124 - 0
src/common/Submit.vue

@@ -0,0 +1,124 @@
+<template>
+  <div>
+    <div class="modalWrap"></div>
+    <div
+      v-if="showType=='success'"
+      class="submitSuccess"
+    >
+      <img
+        src="../images/complete.png"
+        alt=""
+      >
+      <p class="success">{{msg}}</p>
+      <p class="tip">{{tip}}</p>
+      <span @click="goStart">完 成</span>
+    </div>
+    <div
+      v-if="showType=='fail'"
+      class="submitFail"
+    >
+      <p>{{fail}}</p>
+    </div>
+  </div>
+</template>
+<script>
+export default {
+  props: ['showType'],
+  data() {
+    return {
+      msg: '提交成功',
+      tip: '您的病历信息已提交至医生问诊系统,点击完成按钮结束本次预问诊服务。',
+      fail: '提交失败请稍后再试'
+    }
+  },
+  // mounted(){
+  //   if(this.showType=='fail'){
+  //     setTimeout(() => {
+  //       this.$emit('showSubmit',false)
+  //     }, 2000);
+  //   }
+  // },
+  methods: {
+    goStart() {
+      this.$router.push("/")
+    }
+  }
+}
+</script>
+<style lang="less" scoped>
+@import "../less/base.less";
+.modalWrap {
+  .mask;
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+}
+.submitSuccess {
+  width: 6rem;
+  height: 7rem;
+  background: #fff;
+  z-index: 999;
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  padding: 0.8rem 0.5rem 0.5rem 0.5rem;
+  box-sizing: border-box;
+  border-radius: 0.2rem;
+  text-align: center;
+  img {
+    width: 1.28rem;
+    height: 1.28rem;
+  }
+  .success {
+    font-size: 0.36rem;
+    color: #333333;
+    font-weight: bold;
+    margin-top: 0.5rem;
+    margin-bottom: 0.24rem;
+  }
+  .tip {
+    font-size: 0.24rem;
+    color: #666666;
+    line-height: 0.44rem;
+    margin-bottom: 1.2rem;
+  }
+  span {
+    width: 4.9rem;
+    height: 0.88rem;
+    line-height: 0.88rem;
+    font-size: 0.32rem;
+    color: #ffffff;
+    font-weight: bold;
+    display: inline-block;
+    background: -webkit-gradient(
+      linear,
+      right top,
+      left top,
+      from(#4f8bff),
+      to(#4f4fff)
+    );
+    background: -webkit-linear-gradient(right, #4f8bff, #4f4fff);
+    box-shadow: 0 0.12rem 0.24rem 0 rgba(79, 129, 255, 0.4);
+    border-radius: 0.44rem;
+  }
+}
+.submitFail {
+  width: 6rem;
+  height: 0.88rem;
+  line-height: 0.88rem;
+  z-index: 999;
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  box-sizing: border-box;
+  border-radius: 0.2rem;
+  text-align: center;
+  background-color: #fff;
+}
+</style>
+
+

+ 3 - 7
src/components/Detail.vue

@@ -75,16 +75,12 @@ import ComTextArea from '../common/ComTextArea.vue';
             text += datas[i].value+',';
           }
         }
-        let msg = this.checkDatas.name+ ',' + text.substring(0,text.length-1);//console.log("完成:",this.checkDatas)
+        // 替换占位符 {}
+        let msg = this.checkDatas.name+ ',' + text.substring(0,text.length-1);
         this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.type,ppId:this.ppId});
-        this.$store.commit('setText',{text:msg,pId:this.checkDatas.id,type:this.type,flag:true});
+        this.$store.commit('setText',{text:msg.replace('{','').replace('}',''),pId:this.checkDatas.id,type:this.type,flag:true});
       },
       clearData(){//清空
-        /*if(!this.finished){//没有点完成
-          this.checkDatas = JSON.parse(JSON.stringify(this.datas));console.log("未完成清空:",this.checkDatas,this.datas)
-          this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.type,ppId:this.ppId});
-          return
-        }*/
         const datas = this.checkDatas.questionMapping;
         for(let i in datas){
           datas[i].value = "";

+ 91 - 9
src/components/Preview.vue

@@ -25,13 +25,19 @@
       >{{'返回'+ preName}}</span>
       <span
         class="next"
-        @click="saveAllDate"
+        @click="saveAllImage"
       >提 交</span>
     </div>
+    <Submit
+      v-if="submit"
+      :showType="showType"
+      @showSubmit="showSubmit"
+    ></Submit>
   </div>
 </template>
 <script>
 import api from '@utils/api.js';
+import Submit from '../common/Submit';
 export default {
   props: ['preName'],
   data() {
@@ -40,26 +46,102 @@ export default {
     return {
       msg: '预览',
       pathInfo: pathInfo,
-      diagnose: diagnoseDate
+      diagnose: diagnoseDate,
+      submit: false,
+      showType: 'fail',
     }
   },
 
   methods: {
+    showSubmit(flg) {
+      this.submit = flg
+    },
     back() {
       this.$emit('back', 'preview')
     },
-    saveAllDate() {
+    saveAllImage() {
       let formData = new FormData();
-      let imgList = this.diagnose.imgFile
-      for(let i = 0;i < imgList.length;i++){
-        let pageFile = imgList[i].file
-        formData.append('upfiles', imgList[i].file);
-        formData.append('type', i+1);
+      let imgList = this.diagnose.imgFile;
+      if (imgList.length > 0) {
+        for (let i = 0; i < imgList.length; i++) {
+          let pageFile = imgList[i].file
+          formData.append('upfiles', imgList[i].file);
+          formData.append('type', i + 1);
+        }
+        api.uploadImageThums(formData).then((res) => {//获取图片
+          console.log(res)
+          if (res.data.length > 0) {
+            this.showType = 'success'
+            this.submit = true
+          } else {
+            this.showType = 'fail'
+            this.submit = true
+            let timer = setTimeout(() => {
+              this.submit = false
+              clearTimeout(timer)
+            }, 2000);
+          }
+        })
+        return;
+      } else {
+
       }
-      api.uploadImageThums(formData).then((res) => {
+    },
+    saveAllDate() {
+      let params = {
+        "dataJson": "1",
+        "detailList": [
+          {
+            "content": "string",
+            "contentValue": "string",
+            "type": 0
+          }
+        ],
+        "doctorCode": "string",//医生编码
+        "doctorId": 0,//医生id
+        "doctorName": "string",//医生name
+        "hospitalCode": "string",//医院编码
+        "hospitalDeptCode": "string",//医院科室编码
+        "hospitalDeptId": 0,//科室id
+        "hospitalDeptName": "string",//科室name
+        "hospitalId": 0,//医院id
+        "hospitalName": "string",//医院名称
+        "inquiryCode": "string",//就诊序列号
+        "patientBirthday": "2019-07-11T07:27:28.981Z",//患者出生日期,格式为:2018-11-28 17:25:30
+        "patientCode": "string",//患者编号
+        "patientId": 0,//患者id
+        "patientIdNo": "string",//患者证件号码(病历号)
+        "patientName": "string",//患者姓名
+        "patientPhone": "string",//患者联系电话(非)
+        "patientSex": 0,//患者性别:1男2女(非)
+        "regVisitedState": 0,//就诊状态(0待接诊,1接诊中,2完成接诊)(非)
+        "reportList": [
+          {
+            "narrowImage": "string",//缩略图
+            "orderNum": 0,//图片排序号
+            "originalImage": "string"//原图
+          }
+        ],
+        "type": 0//病历分类(1:门诊,2:住院)
+      }
+      api.saveInquiry(params).then((res) => {//获取图片
         console.log(res)
+        if (res.data.length > 0) {
+          this.showType = 'success'
+          this.submit = true
+        } else {
+          this.showType = 'fail'
+          this.submit = true
+          let timer = setTimeout(() => {
+            this.submit = false
+            clearTimeout(timer)
+          }, 2000);
+        }
       })
     }
+  },
+  components: {
+    Submit
   }
 }
 </script>

+ 179 - 0
src/components/Search.vue

@@ -0,0 +1,179 @@
+<template>
+  <div class="searchWrap">
+    <div class="searchTop">
+      <div class="iptWrap">
+        <img
+          class="searchImg"
+          src="../images/searchB.png"
+          alt=""
+        >
+        <input
+          type="text"
+          autofocus
+          placeholder="请搜索"
+          v-model="searchVal"
+        >
+      </div>
+      <span @click="search">取消</span>
+    </div>
+    <div class="searchList">
+      <p
+        class="waring"
+        v-if="!searchVal&&searchLis.length==0"
+      >请输入搜索内容</p>
+      <p
+        class="waring"
+        v-if="searchVal&&searchLis.length==0"
+      >暂无搜索结果</p>
+      <ul>
+        <li
+          v-for="(item,idx) in searchLis"
+          :key="item.conceptId+idx"
+          @click="showDetil(item)"
+          :style="{'borderBottom':(idx==searchLis.length-1)?'0':'1px solid #a8a8a8'}"
+        ><img
+            class="searchImgLis"
+            src="../images/search.png"
+            alt=""
+          >{{item.name}}</li>
+      </ul>
+    </div>
+  </div>
+</template>
+<script>
+import api from '@utils/api.js';
+export default {
+  props: ['age', 'sexType', 'chooseSymp'],
+  data() {
+    return {
+      searchVal: '',
+      searchLis: []
+    }
+  },
+  watch:{
+    searchVal(curVal, oldVal) {
+      if (curVal.trim() == "") {
+        this.searchVal = "";
+        this.searchLis = [];
+        return;
+      }
+      if (curVal != "" && curVal != oldVal) {
+        this.searchList()
+      }
+    }
+  },
+  methods: {
+    showDetil(item) {
+      this.$emit('showDetil', item)
+      this.$emit('search', false)
+    },
+    search() {
+      this.$emit('search', false)
+    },
+    searchList() {
+      let tmpArr = [], chooseSymp = this.chooseSymp;
+      for (let i = 0; i < chooseSymp.length; i++) {
+        tmpArr.push(chooseSymp[i].conceptId)
+      }
+      const param = {
+        "age": this.age,
+        "inputIds": tmpArr,
+        "inputStr": this.searchVal,
+        "sexType": this.sexType
+      }
+      api.getTagInfos(param).then((res) => {
+        const result = res.data;
+        console.log(result)
+        if (result.code == 0) {
+          this.searchLis = result.data
+        }
+      })
+    }
+  }
+}
+</script>
+<style lang="less" scoped>
+.searchWrap {
+  position: fixed;
+  height: 100%;
+  width: 100%;
+  top: 0;
+  left: 0;
+  background-color: #ededed;
+}
+.searchTop {
+  padding: 0.15rem 0.4rem;
+  padding-right: 1.2rem;
+  background-color: #ededed;
+  box-sizing: border-box;
+  position: absolute;
+  width: 100%;
+  top: 0;
+  z-index: 999;
+  span {
+    position: absolute;
+    right: 0.32rem;
+    top: 0.32rem;
+    font-size: 0.3rem;
+    color: #666666;
+  }
+}
+.iptWrap {
+  height: 0.74rem;
+  border-radius: 0.37rem;
+  background-color: #fff;
+  overflow: hidden;
+  padding: 0.16rem 0.3rem 0.16rem 0.75rem;
+  box-sizing: border-box;
+  width: 100%;
+  position: relative;
+  .searchImg {
+    width: 0.44rem;
+    height: 0.44rem;
+    position: absolute;
+    left: 0.2rem;
+    top: 0.14rem;
+  }
+  input {
+    width: 100%;
+    height: 0.42rem;
+    font-size: 0.3rem;
+    line-height: 0.42rem;
+  }
+}
+.searchList {
+  overflow: scroll;
+  position: absolute;
+  -webkit-overflow-scrolling: touch;
+  top: 0;
+  left: 0;
+  padding-top: 1.04rem;
+  height: 100%;
+  width: 100%;
+  background-color: #ededed;
+  .waring {
+    padding-left: 0.5rem;
+    margin-top: 0.2rem;
+  }
+  ul {
+    padding: 0 0.4rem;
+    box-sizing: border-box;
+    background-color: #fff;
+  }
+  li {
+    height: 1rem;
+    line-height: 1rem;
+    padding: 0 0.4rem;
+    border-bottom: 1px solid #a8a8a8;
+    box-sizing: border-box;
+    .searchImgLis {
+      width: 0.44rem;
+      height: 0.44rem;
+      float: left;
+      margin-top: 0.26rem;
+      margin-right: 0.15rem;
+    }
+  }
+}
+</style>
+

+ 233 - 182
src/components/Symptom.vue

@@ -1,228 +1,282 @@
 <template>
   <div class="symp-wrap">
-    <div class="choose" v-if="chooseSymp.length>0">
+    <div
+      class="choose"
+      v-if="chooseSymp.length>0"
+    >
       <p class="quest">已选症状</p>
-      <p class="choo-symp" v-for="(v,i) in chooseSymp">
+      <p
+        class="choo-symp"
+        v-for="(v,i) in chooseSymp"
+      >
         <span @click="showChecked(v)">{{v.name}}</span>
-        <span @click="deletSymp(v,i)"><img src="../images/delete.png" alt=""></span>
+        <span @click="deletSymp(v,i)"><img
+            src="../images/delete.png"
+            alt=""
+          ></span>
       </p>
     </div>
     <div class="label">
-      <p class="quest">请问您有哪些不适?</p>
-      <span class="symp" 
-      v-for="(it,ind) in symp" 
-      :key="it.conceptId"
-      @click="showDetil(it)">{{it.name}}</span>
+      <p class="quest">请问您有哪些不适?<img
+          @click="search(true)"
+          class="searchImg"
+          src="../images/search.png"
+          alt=""
+        ></p>
+      <span
+        class="symp"
+        v-for="(it,ind) in symp"
+        :key="it.conceptId"
+        @click="showDetil(it)"
+      >{{it.name}}</span>
     </div>
-    <div class="result" v-if="checkText.length>0">
+    <div
+      class="result"
+      v-if="checkText.length>0"
+    >
       <p class="title">症状情况</p>
       <p v-for="(value,index) in checkText">{{value.text}}</p>
     </div>
-    <div :class="['footer',{'nofoot':chooseSymp.length==0}]" @click="toNext">下一步</div>
-    <div class="detail" v-if="show">
-      <DetailBox @close="closeDetal" 
-              :data="labelDetail" 
-              :moduleType="1"
-              v-if="labelDetail.questionMapping&&labelDetail.questionMapping.length>0"
-              @pComplete="complete"
-              @reload="reload"/>
+    <div :class="['footer',{'nofoot':chooseSymp.length==0}]"
+      @click="toNext"
+    >下一步</div>
+    <div
+      class="detail"
+      v-if="show"
+    >
+      <DetailBox
+        @close="closeDetal"
+        :data="labelDetail"
+        :moduleType="1"
+        v-if="labelDetail.questionMapping&&labelDetail.questionMapping.length>0"
+        @pComplete="complete"
+        @reload="reload"
+      />
     </div>
-    <Toast :message="delText" 
-          :show="showToast"
-          @comfirn="comfirnDel" 
-          @cancel="cancelDel"/>
+    <Toast
+      :message="delText"
+      :show="showToast"
+      @comfirn="comfirnDel"
+      @cancel="cancelDel"
+    />
+    <Search
+      v-if="searchShow"
+      @search="search"
+      @showDetil="showDetil"
+      :age="age"
+      :chooseSymp="chooseSymp"
+      :sexType="sexType"
+    ></Search>
   </div>
 </template>
 <script type="text/javascript">
 import api from '@utils/api.js';
 import DetailBox from './DetailBox.vue';
 import Toast from '../common/Toast.vue';
-  export default {
-    name:'Symptom',
-    data(){
-      let {datas,pathInfo} = this.$store.state;
-      const {choose,text} = this.$store.state.symptom;
-      return {
-        age:pathInfo.patientAge,
-        sexType:pathInfo.patientSex=='男'?1:(pathInfo.patientSex=='女'?2:3),
-        deptName:pathInfo.selfDeptName,
-        hosCode:pathInfo.hospitalCode,
-        choose:false,
-        check:false,
-        show:false, //显示明细
-        chooseSymp:choose, //已选症状
-        symp:[], //症状
-        labelDetail:{}, //明细
-        checkText:text, //症状情况文字
-        questId:null, //id
-        delText:"是否删除该信息?<br/> (已填内容将清除)",
-        delIndex:null,
-        showToast:false,
-        finished:false,   //是否填写了明细
-      }
+import Search from './Search.vue';
+export default {
+  name: 'Symptom',
+  data() {
+    let { datas, pathInfo } = this.$store.state;
+    const { choose, text } = this.$store.state.symptom;
+    return {
+      age: pathInfo.patientAge,
+      sexType: pathInfo.patientSex == '男' ? 1 : (pathInfo.patientSex == '女' ? 2 : 3),
+      deptName: pathInfo.selfDeptName,
+      hosCode: pathInfo.hospitalCode,
+      choose: false,
+      check: false,
+      show: false, //显示明细
+      chooseSymp: choose, //已选症状
+      symp: [], //症状
+      labelDetail: {}, //明细
+      checkText: text, //症状情况文字
+      questId: null, //id
+      delText: "是否删除该信息?<br/> (已填内容将清除)",
+      delIndex: null,
+      showToast: false,
+      finished: false,   //是否填写了明细
+      searchShow: false,//显示搜索界面
+    }
+  },
+  created() {
+    if (this.chooseSymp.length > 0) {
+      // 推送
+      const sympText = this.getSympText();
+      this.getPush(sympText);
+    } else {
+      this.getSympList(); //常见
+    }
+  },
+  methods: {
+    searchVal(val) {
+      console.log(val)
     },
-    created(){
-      if(this.chooseSymp.length>0){
-        // 推送
-        const sympText = this.getSympText();
-        this.getPush(sympText);
-      }else{
-        this.getSympList(); //常见
-      } 
+    search(flg) {
+      this.searchShow = flg
     },
-    methods:{
-      getSympList(){ 
-        const param = {
-          "age":this.age,
-          "deptName":this.deptName,
-          "sexType":this.sexType
-        }
-        api.getSymptom(param).then((res)=>{
-          const result = res.data;
-          if(result.code==0){
-            this.symp = result.data;
-          }
-        })
-      },
-      toNext(){
-        // 把1切换成完成图标,且2高亮--判断有几个模块显示,1个--提交预览;1个以上--下一步
-        if(this.chooseSymp.length==0){return}
-        this.$emit('next');
-        // 把症状情况的数据存起-已选
-        this.$store.commit('setChoose',{choose:this.chooseSymp,type:"1"});
 
-      },
-      showDetil(item){
-        this.chooseSymp.push(item);
-        this.questId = item.questionId || item.id || item.conceptId;
-        const id = item.questionId || item.id; //常见症状questionId,推送id,两者均有可能没有
-        //将选中的name存到store中的text
-        this.$store.commit('setText',{type:"1",text:item.name,pId:this.questId});
-        if(id){
-          const param = {
-            "age":this.age,
-            "id":id,
-            "sexType":this.sexType
-          }
-          api.getById(param).then((res)=>{
-            const result = res.data;
-            if(result.code==0){
-              const mapping = result.data.questionMapping;
-              this.labelDetail = result.data;
-              this.$store.commit('setOrigin',{type:"1",data:result.data});
-              if(mapping&&mapping.length>0){
-                this.show = true;
-              }
-            }
-          })
-        }else{//没有questionId或id 就没有详情,则直接调推送
-          const sympText = this.getSympText();
-          this.getPush(sympText);
-          this.checkText = this.$store.state.symptom.text;
-        }
-        
-      },
-      getSympText(){
-        const text = this.$store.state.symptom.text;
-        let msg = "";
-        for(let i in text){
-          msg += text[i].text;
+    getSympList() {
+      const param = {
+        "age": this.age,
+        "deptName": this.deptName,
+        "sexType": this.sexType
+      }
+      api.getSymptom(param).then((res) => {
+        const result = res.data;
+        if (result.code == 0) {
+          this.symp = result.data;
         }
-        return msg;
-      },
-      getPush(symptoms){//推理
+      })
+    },
+    toNext() {
+      // 把1切换成完成图标,且2高亮--判断有几个模块显示,1个--提交预览;1个以上--下一步
+      // if (this.chooseSymp.length == 0) { return }
+      this.$emit('next');
+      // 把症状情况的数据存起-已选
+      this.$store.commit('setChoose', { choose: this.chooseSymp, type: "1" });
+
+    },
+    showDetil(item) {
+      this.chooseSymp.push(item);
+      this.questId = item.questionId || item.id || item.conceptId;
+      const id = item.questionId || item.id; //常见症状questionId,推送id,两者均有可能没有
+      //将选中的name存到store中的text
+      this.$store.commit('setText', { type: "1", text: item.name, pId: this.questId });
+      if (id) {
         const param = {
-          "age":this.age,
-          "hosCode":this.hosCode,
-          "sex":this.sexType,
-          "symptom":symptoms //症状+选择的明细,string
+          "age": this.age,
+          "id": id,
+          "sexType": this.sexType
         }
-        api.getPush(param).then((res)=>{
+        api.getById(param).then((res) => {
           const result = res.data;
-          if(result.code==0){
-            this.symp = result.data.symptom;
+          if (result.code == 0) {
+            const mapping = result.data.questionMapping;
+            this.labelDetail = result.data;
+            this.$store.commit('setOrigin', { type: "1", data: result.data });
+            if (mapping && mapping.length > 0) {
+              this.show = true;
+            } else { //没有详情,推送
+              const sympText = this.getSympText();
+              this.getPush(sympText);
+            }
           }
         })
-      },
-      closeDetal(){
-        // 推理 
+      } else {//没有questionId或id 则直接调推送
         const sympText = this.getSympText();
         this.getPush(sympText);
-        this.show = false;
-        this.questId = null;
-      },
-      deletSymp(item,index){
-        this.delIndex = index;
-        this.questId = item.questionId || item.conceptId;
-        if(this.chooseSymp.length==1){
-          this.delText = "是否删除该信息?删除后将重新填写预问诊流程 (已填内容将清除)"
-        }
-        this.showToast = true;
-      },
-      comfirnDel(){
-        this.chooseSymp.splice(this.delIndex,1);
-        // delete(this.checkText[this.questId]);
-        this.checkText.splice(this.delIndex,1);
-        this.$store.commit('delText',{type:"1",pId:this.questId})
-        // 删除完-常见;其他-推送
-        if(this.chooseSymp.length>0){
-          const sympText = this.getSympText();
-          this.getPush(sympText);//删除后重新调推理-入参:拼好的内容
-        }else{
-          this.getSympList();
-        } 
-        this.cancelDel();
-      },
-      cancelDel(){
-        this.showToast = false;
-        this.delIndex = null;
-        this.questId = null;
-        this.delText = "是否删除该信息?<br/> (已填内容将清除)";
-      },
-      complete(){//明细填写完成
         this.checkText = this.$store.state.symptom.text;
-        this.show = false;
-        this.questId = null;
-        // 推理 
-        const sympText = this.getSympText();
-        this.getPush(sympText);
-      },
-      showChecked(item){  
-        const origin = this.$store.state.symptom.origin;
-        const read = this.$store.state.symptom.datas;
-        const data = read[item.questionId] || origin[item.questionId];
-        if(data.questionMapping&&data.questionMapping.length>0){
-          this.labelDetail = data;
-          this.show = true;
+      }
+
+    },
+    getSympText() {
+      const text = this.$store.state.symptom.text;
+      let msg = "";
+      for (let i in text) {
+        msg += text[i].text;
+      }
+      return msg;
+    },
+    getPush(symptoms) {//推理
+      const param = {
+        "age": this.age,
+        "hosCode": this.hosCode,
+        "sex": this.sexType,
+        "symptom": symptoms //症状+选择的明细,string
+      }
+      api.getPush(param).then((res) => {
+        const result = res.data;
+        if (result.code == 0) {
+          this.symp = result.data.symptom;
         }
-      },
-      reload(id){//清空重新赋值
-        const read = this.$store.state.symptom.datas;
-        const data = read[id];
-        this.labelDetail = data;
+      })
+    },
+    closeDetal() {
+      // 推理 
+      const sympText = this.getSympText();
+      this.getPush(sympText);
+      this.show = false;
+      this.questId = null;
+    },
+    deletSymp(item, index) {
+      this.delIndex = index;
+      this.questId = item.questionId || item.conceptId;
+      if (this.chooseSymp.length == 1) {
+        this.delText = "是否删除该信息?删除后将重新填写预问诊流程 (已填内容将清除)"
+      }
+      this.showToast = true;
+    },
+    comfirnDel() {
+      this.chooseSymp.splice(this.delIndex, 1);
+      // delete(this.checkText[this.questId]);
+      this.checkText.splice(this.delIndex, 1);
+      this.$store.commit('delText', { type: "1", pId: this.questId })
+      // 删除完-常见;其他-推送
+      if (this.chooseSymp.length > 0) {
+        const sympText = this.getSympText();
+        this.getPush(sympText);//删除后重新调推理-入参:拼好的内容
+      } else {
+        this.getSympList();
       }
+      this.cancelDel();
     },
-    components:{
-      DetailBox,
-      Toast
+    cancelDel() {
+      this.showToast = false;
+      this.delIndex = null;
+      this.questId = null;
+      this.delText = "是否删除该信息?<br/> (已填内容将清除)";
     },
-  }
+    complete() {//明细填写完成
+      this.checkText = this.$store.state.symptom.text;
+      this.show = false;
+      this.questId = null;
+      // 推理 
+      const sympText = this.getSympText();
+      this.getPush(sympText);
+    },
+    showChecked(item) {
+      const origin = this.$store.state.symptom.origin;
+      const read = this.$store.state.symptom.datas;
+      const data = read[item.questionId] || origin[item.questionId];
+      if (data.questionMapping && data.questionMapping.length > 0) {
+        this.labelDetail = data;
+        this.show = true;
+      }
+    },
+    reload(id) {//清空重新赋值
+      const read = this.$store.state.symptom.datas;
+      const data = read[id];
+      this.labelDetail = data;
+    }
+  },
+  components: {
+    DetailBox,
+    Toast,
+    Search
+  },
+}
 </script>
 <style lang="less" scoped>
-@import '../less/base.less';
-  .symp-wrap{
+@import "../less/base.less";
+.symp-wrap{
     font-size: .3rem;
     .quest{
       color: #000;
       margin-bottom: .36rem;
       font-weight: 700;
+      .searchImg {
+        width: 0.44rem;
+        height: 0.44rem;
+        float: right;
+      }
     }
   }
   .choose{
     padding-bottom: .2rem;
     .choo-symp{
       display: inline-block;
-      width:1.9rem;
+      min-width:1.9rem;
       height: .74rem;
       // background: linear-gradient(-270deg, #4F4FFF, #4F8BFF);
       background: linear-gradient(-270deg, #3638EE, #4E72FF);
@@ -235,7 +289,7 @@ import Toast from '../common/Toast.vue';
         vertical-align: top;
       }
       span:first-child{
-        width:1.34rem;
+        min-width:1.34rem;
         height: .74rem;
         line-height: .74rem;
         text-align: center;
@@ -245,9 +299,6 @@ import Toast from '../common/Toast.vue';
         width:.56rem;
         height: .74rem;
       }
-      .over{
-        .over;
-      }
     }
   }
   .label{

BIN
src/images/complete.png


BIN
src/images/search.png


BIN
src/images/searchB.png


+ 7 - 0
src/utils/api.js

@@ -11,6 +11,7 @@ const urls = {
   saveInquiry:'/api/prec/inquiryInfo/saveInquiry',//保存问诊记录
   uploadImage:'/api/prec/file/uploadImage',//单个文件上传同时生成缩略图
   uploadImageThums:'/api/prec/file/uploadImageThums',//多个文件上传同时生成缩略图
+  getTagInfos:'/api/prec/retrieval/getTagInfos',//检索
   // uploadImageThums:'http://192.168.3.1:8849/file/uploadImageThums',//多个文件上传同时生成缩略图
 }
 
@@ -42,4 +43,10 @@ export default {
   uploadImage(param){
     return axios.post(urls.uploadImage,param)
   },
+  getTagInfos(param){
+    return axios.post(urls.getTagInfos,param)
+  },
+  saveInquiry(param){
+    return axios.post(urls.saveInquiry,param)
+  },
 }

+ 9 - 4
src/utils/tools.js

@@ -17,10 +17,9 @@ const deepClone = (arr) =>{
 }
 
 const getModelExpStr = (str) =>{
-  // str = '${number_}'
-  let matchStr = str.match(/\${number_(.*})/)[0]
   let result = {}
-  if(matchStr){//数字输入框
+  if(str.match(/\${number_(.*})/)){//数字输入框
+    let matchStr = str.match(/\${number_(.*})/)[0]
     result = {
       type:'number',
       placeholder:matchStr.split('${number_')[1].split('}')[0],
@@ -28,7 +27,13 @@ const getModelExpStr = (str) =>{
       suffix:str.split(matchStr)[1]||''
     }
   }else if(str.match(/\${input_(.*})/)){
-
+    let matchStr = str.match(/\${input_(.*})/)[0]
+    result = {
+      type:'text',
+      placeholder:matchStr.split('${input_')[1].split('}')[0],
+      prefix:str.split(matchStr)[0]||'',
+      suffix:str.split(matchStr)[1]||''
+    }
   }
   return result
 }