|
@@ -14,14 +14,15 @@
|
|
|
:key="it.conceptId"
|
|
|
@click="showDetil(it)">{{it.name}}</span>
|
|
|
</div>
|
|
|
- <div class="result" v-if="JSON.stringify(checkText) !== '{}'">
|
|
|
+ <div class="result" v-if="checkText.length>0">
|
|
|
<p class="title">症状情况</p>
|
|
|
- <p v-for="(value,key,index) in checkText">{{value}}</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"/>
|
|
|
</div>
|
|
@@ -38,8 +39,8 @@ import Toast from '../common/Toast.vue';
|
|
|
export default {
|
|
|
name:'Symptom',
|
|
|
data(){
|
|
|
- let {datas,update} = this.$store.state;
|
|
|
- const {pathInfo,originDatas} = this.$store.state;
|
|
|
+ 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),
|
|
@@ -48,25 +49,25 @@ import Toast from '../common/Toast.vue';
|
|
|
choose:false,
|
|
|
check:false,
|
|
|
show:false, //显示明细
|
|
|
- chooseSymp:[], //已选症状
|
|
|
+ chooseSymp:choose, //已选症状
|
|
|
symp:[], //症状
|
|
|
labelDetail:{}, //明细
|
|
|
- checkText:{}, //选中拼好的明细
|
|
|
+ checkText:text, //症状情况文字
|
|
|
questId:null, //id
|
|
|
- // symptomName:'', //点击的症状名称
|
|
|
- delText:"是否删除该信息? (已填内容将清除)",
|
|
|
+ delText:"是否删除该信息?<br/> (已填内容将清除)",
|
|
|
delIndex:null,
|
|
|
showToast:false,
|
|
|
finished:false, //是否填写了明细
|
|
|
- upData:update
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
|
- this.getSympList();
|
|
|
- },
|
|
|
- mounted(){
|
|
|
- // 从store中取数据
|
|
|
-
|
|
|
+ if(this.chooseSymp.length>0){
|
|
|
+ // 推送
|
|
|
+ const sympText = this.getSympText();
|
|
|
+ this.getPush(sympText);
|
|
|
+ }else{
|
|
|
+ this.getSympList(); //常见
|
|
|
+ }
|
|
|
},
|
|
|
methods:{
|
|
|
getSympList(){
|
|
@@ -83,44 +84,50 @@ import Toast from '../common/Toast.vue';
|
|
|
})
|
|
|
},
|
|
|
toNext(){
|
|
|
- // 把1切换成完成图标,且2高亮
|
|
|
- // if(this.chooseSymp.length==0){return}
|
|
|
+ // 把1切换成完成图标,且2高亮--判断有几个模块显示,1个--提交预览;1个以上--下一步
|
|
|
+ if(this.chooseSymp.length==0){return}
|
|
|
this.$emit('next');
|
|
|
- // 把症状情况的数据存起-已选、详情、拼好的文字
|
|
|
-
|
|
|
+ // 把症状情况的数据存起-已选
|
|
|
+ this.$store.commit('setChoose',{choose:this.chooseSymp,type:"1"});
|
|
|
|
|
|
},
|
|
|
- showDetil(item){
|
|
|
+ showDetil(item){console.log("getById:",item)
|
|
|
this.chooseSymp.push(item);
|
|
|
- // this.questId = item.conceptId;
|
|
|
- this.questId = item.questionId;
|
|
|
- const param = {
|
|
|
- "age":this.age,
|
|
|
- "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.$store.commit('setOrigin',{type:"1",data:result.data});
|
|
|
- // this.$store.commit('getUpdate');
|
|
|
- if(mapping&&mapping.length>0){
|
|
|
- this.show = true;
|
|
|
- }
|
|
|
+ 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
|
|
|
}
|
|
|
- })
|
|
|
- // 推理
|
|
|
- const sympText = this.getSympText();
|
|
|
- this.getPush(sympText);
|
|
|
+ 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(){
|
|
|
- let sympText = "";
|
|
|
- for(let k in this.chooseSymp){
|
|
|
- sympText += this.chooseSymp[k].name;
|
|
|
+ const text = this.$store.state.symptom.text;
|
|
|
+ let msg = "";
|
|
|
+ for(let i in text){
|
|
|
+ msg += text[i].text;
|
|
|
}
|
|
|
- return sympText;
|
|
|
+ return msg;
|
|
|
},
|
|
|
getPush(symptoms){//推理
|
|
|
const param = {
|
|
@@ -136,16 +143,16 @@ import Toast from '../common/Toast.vue';
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- closeDetal(msg){
|
|
|
- const questId = this.questId;
|
|
|
- this.getPush(msg);
|
|
|
- // this.checkText = Object.assign({},this.checkText,{[questId]:msg});
|
|
|
+ closeDetal(){
|
|
|
+ // 推理
|
|
|
+ const sympText = this.getSympText();
|
|
|
+ this.getPush(sympText);
|
|
|
this.show = false;
|
|
|
this.questId = null;
|
|
|
},
|
|
|
deletSymp(item,index){
|
|
|
this.delIndex = index;
|
|
|
- this.questId = item.questionId;
|
|
|
+ this.questId = item.questionId || item.conceptId;
|
|
|
if(this.chooseSymp.length==1){
|
|
|
this.delText = "是否删除该信息?删除后将重新填写预问诊流程 (已填内容将清除)"
|
|
|
}
|
|
@@ -153,7 +160,9 @@ import Toast from '../common/Toast.vue';
|
|
|
},
|
|
|
comfirnDel(){
|
|
|
this.chooseSymp.splice(this.delIndex,1);
|
|
|
- delete(this.checkText[this.questId]);
|
|
|
+ // 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();
|
|
@@ -167,19 +176,19 @@ import Toast from '../common/Toast.vue';
|
|
|
this.showToast = false;
|
|
|
this.delIndex = null;
|
|
|
this.questId = null;
|
|
|
- this.delText = "是否删除该信息? (已填内容将清除)";
|
|
|
+ this.delText = "是否删除该信息?<br/> (已填内容将清除)";
|
|
|
},
|
|
|
- complete(msg){//明细填写完成
|
|
|
- // 获取选择后的明细数据-拼接症状情况-关闭明细弹窗
|
|
|
- // let text = this.symptomName + text;
|
|
|
- this.checkText = Object.assign({},this.checkText,{[this.questId]:msg});
|
|
|
+ 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;
|
|
|
- console.log(1111,item,origin,read,)
|
|
|
const data = read[item.questionId] || origin[item.questionId];
|
|
|
if(data.questionMapping&&data.questionMapping.length>0){
|
|
|
this.labelDetail = data;
|
|
@@ -191,22 +200,6 @@ import Toast from '../common/Toast.vue';
|
|
|
DetailBox,
|
|
|
Toast
|
|
|
},
|
|
|
- computed:{
|
|
|
- getQuestId(){
|
|
|
- return this.upData;
|
|
|
- }
|
|
|
- },
|
|
|
- watch:{
|
|
|
- getQuestId:{
|
|
|
- handler(newVal,oldVal){
|
|
|
- console.log("数据更新了",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>
|
|
|
<style lang="less" scoped>
|
|
@@ -245,25 +238,13 @@ import Toast from '../common/Toast.vue';
|
|
|
width:.56rem;
|
|
|
height: .74rem;
|
|
|
}
|
|
|
+ .over{
|
|
|
+ .over;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.label{
|
|
|
- padding-bottom: .2rem;
|
|
|
- .symp{
|
|
|
- display: inline-block;
|
|
|
- width:1.9rem;
|
|
|
- height: .74rem;
|
|
|
- line-height: .74rem;
|
|
|
- border: 1px solid #DFE0E4;
|
|
|
- border-radius: .08rem;
|
|
|
- text-align: center;
|
|
|
- color: #7C828E;
|
|
|
- margin: 0 0 .3rem .3rem;
|
|
|
- box-sizing: border-box;
|
|
|
- }
|
|
|
- .symp:nth-child(3n+2){
|
|
|
- margin-left: 0;
|
|
|
- }
|
|
|
+ .label;
|
|
|
}
|
|
|
.result{
|
|
|
.title{
|