|
@@ -1,26 +1,29 @@
|
|
|
<template>
|
|
|
<div class="symp-wrap">
|
|
|
<div class="choose" v-if="chooseSymp.length>0">
|
|
|
- <h3>已选症状</h3>
|
|
|
+ <p class="quest">已选症状</p>
|
|
|
<p class="choo-symp" v-for="(v,i) in chooseSymp">
|
|
|
<span>{{v.name}}</span>
|
|
|
<span @click="deletSymp(v,i)"><img src="../images/delete.png" alt=""></span>
|
|
|
</p>
|
|
|
</div>
|
|
|
<div class="label">
|
|
|
- <h3>请问您有哪些不适?</h3>
|
|
|
+ <p class="quest">请问您有哪些不适?</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="JSON.stringify(checkText) !== '{}'">
|
|
|
- <h4>症状情况</h4>
|
|
|
+ <p class="title">症状情况</p>
|
|
|
<p v-for="(value,key,index) in checkText">{{value}}</p>
|
|
|
</div>
|
|
|
- <div class="footer" @click="toNext">下一步</div>
|
|
|
+ <div :class="['footer',{'nofoot':chooseSymp.length==0}]" @click="toNext">下一步</div>
|
|
|
<div class="detail" v-if="show">
|
|
|
- <DetailBox @close="closeDetal" :data="labelDetail"/>
|
|
|
+ <DetailBox @close="closeDetal"
|
|
|
+ :data="labelDetail"
|
|
|
+ v-if="labelDetail.questionMapping&&labelDetail.questionMapping.length>0"
|
|
|
+ @pComplete="complete"/>
|
|
|
</div>
|
|
|
<Toast :message="delText"
|
|
|
:show="showToast"
|
|
@@ -35,7 +38,8 @@ import Toast from '../common/Toast.vue';
|
|
|
export default {
|
|
|
name:'Symptom',
|
|
|
data(){
|
|
|
- const pathInfo = this.$store.state.pathInfo;
|
|
|
+ let {datas,update} = this.$store.state;
|
|
|
+ const {pathInfo,originDatas} = this.$store.state;
|
|
|
return {
|
|
|
age:pathInfo.patientAge,
|
|
|
sexType:pathInfo.patientSex=='男'?1:(pathInfo.patientSex=='女'?2:3),
|
|
@@ -48,10 +52,13 @@ import Toast from '../common/Toast.vue';
|
|
|
symp:[], //症状
|
|
|
labelDetail:{}, //明细
|
|
|
checkText:{}, //选中拼好的明细
|
|
|
- current:null,
|
|
|
- delText:"是否删除该信息?",
|
|
|
+ questId:null, //id
|
|
|
+ // symptomName:'', //点击的症状名称
|
|
|
+ delText:"是否删除该信息? (已填内容将清除)",
|
|
|
delIndex:null,
|
|
|
- showToast:false
|
|
|
+ showToast:false,
|
|
|
+ finished:false, //是否填写了明细
|
|
|
+ upData:update
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
@@ -73,26 +80,40 @@ import Toast from '../common/Toast.vue';
|
|
|
},
|
|
|
toNext(){
|
|
|
// 把1切换成完成图标,且2高亮
|
|
|
- this.$emit("nextStep",3);
|
|
|
+ if(this.chooseSymp.length==0){return}
|
|
|
+ this.$emit('next');
|
|
|
},
|
|
|
showDetil(item){
|
|
|
this.chooseSymp.push(item);
|
|
|
- this.current = item.conceptId;
|
|
|
- const id = item.questionId;
|
|
|
+ // this.questId = item.conceptId;
|
|
|
+ this.questId = item.questionId;
|
|
|
const param = {
|
|
|
"age":this.age,
|
|
|
- "id":id,
|
|
|
+ "id":item.questionId,
|
|
|
"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.show = true;
|
|
|
+ this.$store.commit('setOrigin',result.data);
|
|
|
+ // this.$store.commit('getUpdate');
|
|
|
+ if(mapping&&mapping.length>0){
|
|
|
+ this.show = true;
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
- // 推理
|
|
|
-
|
|
|
+ // 推理
|
|
|
+ const sympText = this.getSympText();
|
|
|
+ this.getPush(sympText);
|
|
|
+ },
|
|
|
+ getSympText(){
|
|
|
+ let sympText = "";
|
|
|
+ for(let k in this.chooseSymp){
|
|
|
+ sympText += this.chooseSymp[k].name;
|
|
|
+ }
|
|
|
+ return sympText;
|
|
|
},
|
|
|
getPush(symptoms){//推理
|
|
|
const param = {
|
|
@@ -109,36 +130,65 @@ import Toast from '../common/Toast.vue';
|
|
|
})
|
|
|
},
|
|
|
closeDetal(msg){
|
|
|
- const current = this.current;
|
|
|
+ const questId = this.questId;
|
|
|
this.getPush(msg);
|
|
|
- this.checkText = Object.assign({},this.checkText,{[current]:msg});
|
|
|
+ // this.checkText = Object.assign({},this.checkText,{[questId]:msg});
|
|
|
this.show = false;
|
|
|
- this.current = null;console.log('子组件触发关闭',this.checkText);
|
|
|
+ this.questId = null;
|
|
|
},
|
|
|
deletSymp(item,index){
|
|
|
this.delIndex = index;
|
|
|
- this.current = item.conceptId;
|
|
|
+ this.questId = item.questionId;
|
|
|
if(this.chooseSymp.length==1){
|
|
|
- this.delText = "是否删除该信息?删除后将重新填写预问诊流程"
|
|
|
+ this.delText = "是否删除该信息?删除后将重新填写预问诊流程 (已填内容将清除)"
|
|
|
}
|
|
|
this.showToast = true;
|
|
|
},
|
|
|
comfirnDel(){
|
|
|
this.chooseSymp.splice(this.delIndex,1);
|
|
|
- delete(this.checkText[this.current]);
|
|
|
- // this.getPush(''); //删除后重新调推理-入参:拼好的内容
|
|
|
+ delete(this.checkText[this.questId]);
|
|
|
+ // 删除完-常见;其他-推送
|
|
|
+ if(this.chooseSymp.length>0){
|
|
|
+ const sympText = this.getSympText();
|
|
|
+ this.getPush(sympText);//删除后重新调推理-入参:拼好的内容
|
|
|
+ }else{
|
|
|
+ this.getSympList();
|
|
|
+ }
|
|
|
this.cancelDel();
|
|
|
- console.log("确认删除:",this.chooseSymp,this.checkText)
|
|
|
},
|
|
|
cancelDel(){
|
|
|
this.showToast = false;
|
|
|
this.delIndex = null;
|
|
|
- this.current = null;
|
|
|
+ this.questId = null;
|
|
|
+ this.delText = "是否删除该信息? (已填内容将清除)";
|
|
|
+ },
|
|
|
+ complete(msg){//明细填写完成
|
|
|
+ // 获取选择后的明细数据-拼接症状情况-关闭明细弹窗
|
|
|
+ // let text = this.symptomName + text;
|
|
|
+ this.checkText = Object.assign({},this.checkText,{[this.questId]:msg});
|
|
|
+ this.show = false;
|
|
|
+ this.questId = null;
|
|
|
}
|
|
|
},
|
|
|
components:{
|
|
|
DetailBox,
|
|
|
Toast
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ getQuestId(){
|
|
|
+ return this.upData;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ getQuestId:{
|
|
|
+ handler(newVal,oldVal){
|
|
|
+ console.log("数据更新了11",newVal,oldVal);
|
|
|
+ let datas = this.$store.state.datas;
|
|
|
+ let originDatas = this.$store.state.originDatas;
|
|
|
+ this.labelDetail = datas[this.questId] || originDatas[this.questId];
|
|
|
+ },
|
|
|
+ deep:true
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -146,9 +196,10 @@ import Toast from '../common/Toast.vue';
|
|
|
@import '../less/base.less';
|
|
|
.symp-wrap{
|
|
|
font-size: .3rem;
|
|
|
- h3{
|
|
|
+ .quest{
|
|
|
color: #000;
|
|
|
margin-bottom: .36rem;
|
|
|
+ font-weight: 700;
|
|
|
}
|
|
|
}
|
|
|
.choose{
|
|
@@ -198,11 +249,12 @@ import Toast from '../common/Toast.vue';
|
|
|
}
|
|
|
}
|
|
|
.result{
|
|
|
- h4{
|
|
|
+ .title{
|
|
|
color: #4F50FF;
|
|
|
padding-left: .1rem;
|
|
|
border-left: .08rem solid #4F50FF;
|
|
|
margin-bottom: .19rem;
|
|
|
+ font-weight: 700;
|
|
|
}
|
|
|
p{
|
|
|
color: #666;
|
|
@@ -212,6 +264,10 @@ import Toast from '../common/Toast.vue';
|
|
|
.footer{
|
|
|
.footer;
|
|
|
}
|
|
|
+ .nofoot{
|
|
|
+ opacity: 0.3;
|
|
|
+ background: linear-gradient(-270deg,#4F4FFF, #4F8BFF);
|
|
|
+ }
|
|
|
.detail{
|
|
|
.mask;
|
|
|
z-index: 66;
|