|
@@ -0,0 +1,479 @@
|
|
|
+<template>
|
|
|
+ <div class="page">
|
|
|
+ <div class="progress-bar">
|
|
|
+ <div class="title">
|
|
|
+ <span class="active">症状情况</span>
|
|
|
+ <span>诊疗情况</span>
|
|
|
+ <span>其他情况</span>
|
|
|
+ </div>
|
|
|
+ <div class="progress">
|
|
|
+ <p :style="{width:progress}"></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="wrapper">
|
|
|
+ <div class="scrollPart" :style="{'paddingBottom':pdbm}">
|
|
|
+ <!--<div class="right clearfix">
|
|
|
+ <img src="../assets/patient.png" alt="" class="fr">
|
|
|
+ <div class="content fr">
|
|
|
+ <p>医生您好!我想咨询新型冠状病毒。(个人信息:{{userInfo.patientName}}{{userInfo.patientSex?','+userInfo.patientSex:''}}{{userInfo.patientAge?','+userInfo.patientAge+'岁':''}})</p>
|
|
|
+ </div>
|
|
|
+ </div>-->
|
|
|
+ <div class="left clearfix">
|
|
|
+ <img src="../images/doctor.png" alt="" class="fl">
|
|
|
+ <div class="content fl">
|
|
|
+ <p>欢迎来到{{userInfo.hospitalName}}!候诊期间请先填写自己实际症状,信息会马上传送到您预约的医生,便于您实现快速就诊。</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--<div class="left clearfix" @click="selectToggle(2,disData.symptom.result,true)">
|
|
|
+ <img src="../assets/doctor.png" alt="" class="fl">
|
|
|
+ <div class="content fl">
|
|
|
+ <p>您哪里不舒服?</p>
|
|
|
+ </div>
|
|
|
+ </div>-->
|
|
|
+ <UsualSymptom v-if="showUsual" @selectUsual="selectUsual"></UsualSymptom>
|
|
|
+ <div class="right clearfix" v-if="selectedSymptom.name">
|
|
|
+ <img src="../images/patient.png" alt="" class="fr">
|
|
|
+ <div class="content fr">
|
|
|
+ <p>{{selectedSymptom.description||selectedSymptom.name}}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-for="(item,idx) in allquestionLis" :key="idx">
|
|
|
+ <Dialog :idx="idx" v-if="item.show" :item="item" @selectToggle="selectToggle"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <Select @updataResult="updataResultSingle" :num="num" :symptomResult="symptomResult" v-if="type == 2"></Select>
|
|
|
+ <Radio @updataResultSingle="updataResultSingle" :num="num" :symptomResult="symptomResult" v-if="type == 1"></Radio>
|
|
|
+ <Picker v-if="type == 9" @confirm="pickerConfirm" :num="num" :defaultIndex = "defaultIndex"></Picker>
|
|
|
+ <div v-if="wrong" class="tip">{{waring}}</div>
|
|
|
+ <!--<ConfirmBox :show="showConfirm" @confirmDialog="confirmDialog" @cancelDialog = "cancelDialog"></ConfirmBox>-->
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import BScroll from 'better-scroll';
|
|
|
+import {data} from '../utils/data.js'
|
|
|
+import Radio from '../common/Radio'
|
|
|
+import Select from '../common/Select'
|
|
|
+import Dialog from '../common/Dialog'
|
|
|
+import Picker from '../common/Picker'
|
|
|
+import ConfirmBox from '../common/ConfirmBox'
|
|
|
+import UsualSymptom from '../common/UsualSymptom';
|
|
|
+import api from "../utils/api.js";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name:'MainPage',
|
|
|
+ data(){
|
|
|
+ let tmpDatas = JSON.parse(JSON.stringify(data));
|
|
|
+ return {
|
|
|
+ disData:data,//所有的数据
|
|
|
+ result:'诊断结果',
|
|
|
+ num:0,//题目计数
|
|
|
+ show:false,
|
|
|
+ showUsual:false,
|
|
|
+ scroll:null,
|
|
|
+ type :-1,
|
|
|
+ tmpSymptom:'',
|
|
|
+ selectedSymptom:{},
|
|
|
+ tmpDatas:tmpDatas,
|
|
|
+ symptomResult:'',//症状选择
|
|
|
+ connectResult:[],//关联问题的id
|
|
|
+ contentResult:'',//选中的结果name
|
|
|
+ rules:[],//规则所需数据value
|
|
|
+ allquestionLis:[],//所有的问题
|
|
|
+ current:0,//第几题
|
|
|
+ defaultIndex: 0, //温度默认值
|
|
|
+ selectTemp: '', //选择的温度
|
|
|
+ order:0,
|
|
|
+ arr1:[],//规则数据1.....
|
|
|
+ arr2:[],//规则数据2.....
|
|
|
+ userInfo: {}, //用户信息
|
|
|
+ lastDis:'',//诊断
|
|
|
+ pdbm:'8.5rem',
|
|
|
+ waring:'',
|
|
|
+ wrong:false,
|
|
|
+ showConfirm: false,
|
|
|
+ time:1000,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ //const userInfo= JSON.parse(localStorage.getItem("userInfo"))
|
|
|
+ const userInfo = this.$store.state.pathInfo;
|
|
|
+ this.userInfo = userInfo;
|
|
|
+ this.updata()
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ let bs = new BScroll('.wrapper', {
|
|
|
+ probeType: 3,
|
|
|
+ click:true
|
|
|
+ })
|
|
|
+ this.scroll = bs
|
|
|
+ })
|
|
|
+ // this.tmpSymptom = JSON.parse(JSON.stringify(data))
|
|
|
+ this.symptomResult = data.symptom.result;
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ progress(){
|
|
|
+ if(!this.num){
|
|
|
+ return '0.1px';
|
|
|
+ }
|
|
|
+ const precent = this.num/(this.allquestionLis.length+1);
|
|
|
+ return precent*100+"%";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ updata(){
|
|
|
+ let tmpData = data
|
|
|
+ tmpData.symptom.content = ''
|
|
|
+ this.disData = this.tmpDatas
|
|
|
+
|
|
|
+ this.symptomResult = this.tmpDatas.symptom.result
|
|
|
+ this.connectResult = []
|
|
|
+ this.rules = []
|
|
|
+ this.allquestionLis = []
|
|
|
+ this.arr1 = []
|
|
|
+ this.arr2 = []
|
|
|
+ this.pdbm = '8.5rem'
|
|
|
+ //this.type = 1;
|
|
|
+ this.showUsual=true;
|
|
|
+ this.num = 0;
|
|
|
+ },
|
|
|
+ selectToggle(type,result,flg,idx,order){
|
|
|
+ return
|
|
|
+ if(flg){
|
|
|
+ this.num = 1
|
|
|
+ }
|
|
|
+ this.symptomResult = result
|
|
|
+ this.type = type
|
|
|
+ this.current = idx
|
|
|
+ this.order = order
|
|
|
+ this.scrollDown()
|
|
|
+ },
|
|
|
+ updataResultSingle(result,contentResult,num){
|
|
|
+ this.num = num;
|
|
|
+ this.type = -1;
|
|
|
+ let tmpArr = JSON.parse(JSON.stringify(this.allquestionLis));
|
|
|
+ let tmpArrDetailResult = JSON.parse(JSON.stringify(this.allquestionLis[num].questionDetailList));
|
|
|
+ tmpArr[num-1].content = contentResult;
|
|
|
+ let tmpArrDetail = JSON.parse(JSON.stringify(tmpArr[num]));
|
|
|
+
|
|
|
+ let timer = setTimeout(() => {
|
|
|
+ this.type = tmpArrDetail.controlType;
|
|
|
+ tmpArrDetail.show = true;
|
|
|
+ tmpArr[num] = tmpArrDetail;
|
|
|
+ this.symptomResult = tmpArrDetailResult;
|
|
|
+ clearTimeout(timer)
|
|
|
+ }, this.time);
|
|
|
+
|
|
|
+ this.allquestionLis = tmpArr;
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.scroll.refresh()
|
|
|
+ this.scroll.scrollTo(0, this.scroll.maxScrollY,500)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ updataResult(result,connectResult,contentResult,num){
|
|
|
+ this.num = num;
|
|
|
+ this.type = -1;
|
|
|
+ let tmpAllData = this.disData;
|
|
|
+ let tmpAllquestion = this.disData.allquestion,tmpArr = [],cur = this.current;
|
|
|
+ for(let i = 0;i < tmpAllquestion.length;i++){//根据选择的答案需要添加问题
|
|
|
+ for(let k = 0;k < connectResult.length;k++){
|
|
|
+ if(connectResult[k] == tmpAllquestion[i].id){
|
|
|
+ tmpAllquestion[i].order = k
|
|
|
+ tmpArr.push(tmpAllquestion[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(num == 0){//第一题完成
|
|
|
+ let tmpSymptom = this.disData.symptom
|
|
|
+ tmpSymptom.content = contentResult
|
|
|
+ tmpSymptom.result = result
|
|
|
+ this.disData.symptom = tmpSymptom
|
|
|
+ tmpAllData.symptom = tmpSymptom
|
|
|
+ let timer = setTimeout(() => {
|
|
|
+ tmpArr[0].show = true
|
|
|
+ this.type = tmpArr[0].type
|
|
|
+ this.symptomResult = tmpArr[0].result
|
|
|
+ this.allquestionLis = tmpArr
|
|
|
+ clearTimeout(timer)
|
|
|
+ }, this.time);
|
|
|
+ let tmpArr1 = []
|
|
|
+ for(let i = 0;i < result.length;i++){
|
|
|
+ if(result[i].select){
|
|
|
+ tmpArr1.push(result[i].value)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.arr1 = tmpArr1
|
|
|
+ }else{//最后一道题多选,答完匹配规则
|
|
|
+ let tmpAllquestion = this.disData.allquestion,tmpArrs = JSON.parse(JSON.stringify(this.allquestionLis));
|
|
|
+ let tmpArr1 = []
|
|
|
+ tmpArrs[num-1].content = contentResult
|
|
|
+ tmpAllquestion.result = result
|
|
|
+ this.allquestionLis = tmpArrs
|
|
|
+ tmpAllquestion[tmpAllquestion.length-1].content = contentResult
|
|
|
+ tmpAllData.allquestion = tmpAllquestion
|
|
|
+
|
|
|
+ for(let i = 0;i < result.length;i++){
|
|
|
+ if(result[i].select){
|
|
|
+ tmpArr1.push(result[i].value)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.arr2 = tmpArr1
|
|
|
+ this.getDis()
|
|
|
+ let detailArr=[];
|
|
|
+ let obj = {
|
|
|
+ "question":tmpAllData.symptom.question,
|
|
|
+ "answer":tmpAllData.symptom.content
|
|
|
+ };
|
|
|
+
|
|
|
+ detailArr.push(obj)
|
|
|
+ for(let k = 0;k < tmpArrs.length;k++){
|
|
|
+ let tmpObj = {}
|
|
|
+ tmpObj.question = tmpArrs[k].question
|
|
|
+ tmpObj.answer = tmpArrs[k].content
|
|
|
+ detailArr.push(tmpObj)
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ "doctorId": this.userInfo.doctorId,
|
|
|
+ "mpiId": this.userInfo.mpiId,
|
|
|
+ "appId": this.userInfo.appId,
|
|
|
+ "diagnosis": this.lastDis,
|
|
|
+ "detailList": detailArr,
|
|
|
+ "department":this.userInfo.department,
|
|
|
+ "doctorName": this.userInfo.doctorName,
|
|
|
+ "organName": this.userInfo.organName,
|
|
|
+ "patientAge": this.userInfo.patientAge,
|
|
|
+ "patientName": this.userInfo.patientName,
|
|
|
+ "patientSex": this.userInfo.patientSex
|
|
|
+ }
|
|
|
+ this.saveInfo(params)
|
|
|
+ }
|
|
|
+ this.disData = tmpAllData
|
|
|
+ // this.symptomResult = result
|
|
|
+ this.contentResult = contentResult
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.scroll.refresh()
|
|
|
+ this.scroll.scrollTo(0, this.scroll.maxScrollY,500)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ saveInfo(params){
|
|
|
+ api.saveInfo(params).then((res)=>{
|
|
|
+ let data = res.data;
|
|
|
+ if(data.code == 0){
|
|
|
+ let url = data.data.body
|
|
|
+ window.location.href = url
|
|
|
+ }else{
|
|
|
+ this.waring = data.msg
|
|
|
+ this.wrong = true
|
|
|
+ setTimeout(() => {
|
|
|
+ this.wrong = false
|
|
|
+ }, 2000);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getDis(){//规则匹配诊断结果诊断结果获取
|
|
|
+ const result1 = this.arr1;
|
|
|
+ const result2 = this.arr2;
|
|
|
+ const resultList = data.resultList;
|
|
|
+ let resultIndex = -1
|
|
|
+ for(let i = 0; i < resultList.length; i++) {
|
|
|
+ if(this.hasResult(resultList[i].result1,result1)&&this.hasResult(resultList[i].result2,result2)) {
|
|
|
+ resultIndex = i
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(resultIndex == 0){
|
|
|
+ this.lastDis = '建议立刻发热门诊就诊,并且佩戴好口罩做好防护。佩戴医用外科口罩或N95口罩,避免乘坐公共交通工具。'
|
|
|
+ }else if(resultIndex == 1){
|
|
|
+ this.lastDis = '结合你提供的病情症状及接触史特点,建议继续在家监测体温,可适当服用治疗感冒的中成药,注意手卫生,多饮水,休息为主。若体温持续不退或体温大于38℃或不适症状加重,及时就诊。'
|
|
|
+ }else if(resultIndex == 2){
|
|
|
+ this.lastDis = '建议你们全家及密切接触者居家隔离至少2周,在家期间建议戴口罩交流,条件允许时,尽量单独居住或居住在通风良好的单人房间。多休息,多饮水,注意手卫生和常用物品卫生消毒。若出现发热及呼吸道症状,需马上前往医院就诊。'
|
|
|
+ }else if(resultIndex == 3){
|
|
|
+ this.lastDis = '建议您戴口罩、勤洗手,避免人群聚集,减少不必要外出。'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ hasResult(arr1, arr2) {
|
|
|
+ let result = false;
|
|
|
+ for(let i = 0; i < arr2.length; i++) {
|
|
|
+ if(arr1.findIndex((item) => {return item === arr2[i]}) >-1) {
|
|
|
+ result = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ },
|
|
|
+ back(){
|
|
|
+ this.showConfirm = true
|
|
|
+ // this.$router.go(-1)
|
|
|
+ },
|
|
|
+ selectUsual(sym){
|
|
|
+ this.getSymptomQas(sym.questionId); //获取症状下的关联问题
|
|
|
+ this.selectedSymptom = sym; //设置搜索选中症状
|
|
|
+ this.showUsual=false; //关闭症状选择进入下一个问题
|
|
|
+ },
|
|
|
+ getSymptomQas(id){
|
|
|
+ const param = {
|
|
|
+ age:this.userInfo.patientAge,
|
|
|
+ id:id,
|
|
|
+ sexType:this.userInfo.sexType
|
|
|
+ };
|
|
|
+ api.getById(param).then((res) => {
|
|
|
+ const result = res.data;
|
|
|
+ if(result.code==='0'){
|
|
|
+ const data = result.data;
|
|
|
+ if(!data){
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ const qaLis = data.questionMapping;
|
|
|
+ qaLis[0].show=true; //第一题自动显示
|
|
|
+ this.type = qaLis[0].controlType;
|
|
|
+ this.symptomResult = qaLis[0].questionDetailList;
|
|
|
+ this.allquestionLis = qaLis;
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ scrollDown(){
|
|
|
+ this.scroll.scrollTo(0, this.scroll.maxScrollY)
|
|
|
+ },
|
|
|
+ pickerConfirm(value,index,num){
|
|
|
+ this.defaultIndex = index
|
|
|
+ this.type = -1;
|
|
|
+ this.num = num;
|
|
|
+ let tmpArr = JSON.parse(JSON.stringify(this.allquestionLis));
|
|
|
+ tmpArr[num-1].content = value;
|
|
|
+ let timer = setTimeout(() => {
|
|
|
+ tmpArr[num].show = true;
|
|
|
+ this.type = tmpArr[num].controlType;
|
|
|
+ this.symptomResult = tmpArr[num].questionDetailList;
|
|
|
+ clearTimeout(timer)
|
|
|
+ }, this.time);
|
|
|
+
|
|
|
+ this.allquestionLis = tmpArr;
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.scroll.refresh();
|
|
|
+ this.scroll.scrollTo(0, this.scroll.maxScrollY,500)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ confirmDialog(){
|
|
|
+ this.$router.replace({
|
|
|
+ path:'/',
|
|
|
+ query:this.userInfo
|
|
|
+ })
|
|
|
+ // this.$router.go(-1)
|
|
|
+ },
|
|
|
+ cancelDialog(){
|
|
|
+ this.showConfirm = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components:{
|
|
|
+ Radio,
|
|
|
+ Select,
|
|
|
+ Dialog,
|
|
|
+ Picker,
|
|
|
+ ConfirmBox,
|
|
|
+ UsualSymptom
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="less" scoped>
|
|
|
+ @import "../less/base.less";
|
|
|
+.wrapper {
|
|
|
+ height: 100%;
|
|
|
+ width: 100%;
|
|
|
+ position: fixed;
|
|
|
+ box-sizing: border-box;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.scrollPart {
|
|
|
+ // padding-bottom: 5rem;
|
|
|
+ // padding-top: 1.44rem;
|
|
|
+ // box-sizing: border-box;
|
|
|
+}
|
|
|
+.progress-bar {
|
|
|
+ height: .8rem;
|
|
|
+ line-height: .8rem;
|
|
|
+ background: #fff;
|
|
|
+ color: #aaa;
|
|
|
+ margin-bottom:.4rem;
|
|
|
+ span{
|
|
|
+ display: inline-block;
|
|
|
+ font-size: .26rem;
|
|
|
+ width: 30%;
|
|
|
+ color: #aaa;
|
|
|
+ text-align: center;
|
|
|
+ &:not(:last-child):after{
|
|
|
+ content: ">";
|
|
|
+ float: right;
|
|
|
+ color: #aaa;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .active{
|
|
|
+ font-size: .28rem;
|
|
|
+ color: #colors[theme];
|
|
|
+ }
|
|
|
+ .progress{
|
|
|
+ height:0.06rem;
|
|
|
+ background:#F5F5F5;
|
|
|
+ p{
|
|
|
+ width:.1px;
|
|
|
+ height: 100%;
|
|
|
+ background: #colors[theme];
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.right {
|
|
|
+ padding-top: .2rem;
|
|
|
+ margin-bottom: .12rem;
|
|
|
+ padding-right: .24rem;
|
|
|
+ .content {
|
|
|
+ max-width: 5rem;
|
|
|
+ background-color: #colors[theme];
|
|
|
+ border-radius: .24rem 0 .24rem .24rem;
|
|
|
+ margin-top: .3rem;
|
|
|
+ font-size: .28rem;
|
|
|
+ padding: .24rem;
|
|
|
+ display: inline-block;
|
|
|
+ p {
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ img {
|
|
|
+ width: 0.8rem;
|
|
|
+ height: 0.8rem;
|
|
|
+ margin-left: .24rem;
|
|
|
+ }
|
|
|
+}
|
|
|
+.left {
|
|
|
+ margin-bottom: .2rem;
|
|
|
+ padding-top: .12rem;
|
|
|
+ padding-left: .24rem;
|
|
|
+ .content {
|
|
|
+ max-width: 5rem;
|
|
|
+ background-color: #colors[bgques];
|
|
|
+ border-radius: 0 .24rem .24rem .24rem;
|
|
|
+ margin-top: .3rem;
|
|
|
+ font-size: .28rem;
|
|
|
+ padding: .24rem;
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+ img {
|
|
|
+ width: 0.8rem;
|
|
|
+ height: 0.8rem;
|
|
|
+ margin-right: .24rem;
|
|
|
+ }
|
|
|
+}
|
|
|
+.tip {
|
|
|
+ max-width: 80%;
|
|
|
+ padding: .2rem;
|
|
|
+ border-radius: .1rem;
|
|
|
+ background-color:rgba(0,0,0,0.7);
|
|
|
+ position: fixed;
|
|
|
+ top: 40%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|