|
@@ -2,9 +2,7 @@
|
|
|
<div class="page">
|
|
|
<div class="progress-bar">
|
|
|
<div class="title">
|
|
|
- <span :class="{'active':activeTab===0}">症状情况</span>
|
|
|
- <span :class="{'active':activeTab===1}">诊疗情况</span>
|
|
|
- <span :class="{'active':activeTab===2}">其他情况</span>
|
|
|
+ <span :class="{'active':activeTab==i.type}" :style="{width:(100/allMoudles.length)+'%'}" v-for="i in allMoudles">{{i.name}}</span>
|
|
|
</div>
|
|
|
<div class="progress">
|
|
|
<p :style="{width:progress}"></p>
|
|
@@ -38,14 +36,14 @@
|
|
|
</div>
|
|
|
<span v-if="!canceledSym&&num<1" class="edit" @click="cancelSymptom">修改</span>
|
|
|
</div>
|
|
|
- <div v-for="(item,idx) in allquestionLis" :key="'0'+item.id" v-if="activeTab>-1">
|
|
|
- <Dialog :idx="idx" v-if="item.show" :item="item" @cancel="cancelSelected" :num="num" :cancelNum="canceledQa" :isLast="idx===allquestionLis.length-1"/>
|
|
|
+ <div v-for="(item,idx) in symptomQasList" :key="'0'+item.id" v-if="activeTab">
|
|
|
+ <Dialog :idx="idx" v-if="item.show" :item="item" @cancel="cancelSelected" :num="num" :cancelNum="canceledQa" :isLast="idx===symptomQasList.length-1"/>
|
|
|
</div>
|
|
|
- <div v-for="(item,idx) in diagQasList" :key="'1'+item.id" v-if="activeTab>0">
|
|
|
- <Dialog :idx="idx" v-if="item.show" :item="item" @cancel="cancelSelected" :num="num" :extNum ="allquestionLis.length" :cancelNum="canceledQa" :isLast="idx===diagQasList.length-1"/>
|
|
|
+ <div v-for="(item,idx) in diagnoseQasList" :key="'1'+item.id" v-if="activeTab==moduleKeys[1]||activeTab==moduleKeys[2]">
|
|
|
+ <Dialog :idx="idx" v-if="item.show" :item="item" @cancel="cancelSelected" :num="num" :extNum ="symptomQasList.length" :cancelNum="canceledQa" :isLast="idx===diagnoseQasList.length-1"/>
|
|
|
</div>
|
|
|
- <div v-for="(item,idx) in otherQasList" :key="'2'+item.id" v-if="activeTab>1">
|
|
|
- <Dialog :idx="idx" v-if="item.show" :item="item" @cancel="cancelSelected" :num="num" :extNum ="allquestionLis.length+diagQasList.length" :cancelNum="canceledQa"/>
|
|
|
+ <div v-for="(item,idx) in othersQasList" :key="'2'+item.id" v-if="activeTab==moduleKeys[2]">
|
|
|
+ <Dialog :idx="idx" v-if="item.show" :item="item" @cancel="cancelSelected" :num="num" :extNum ="symptomQasList.length+diagnoseQasList.length" :cancelNum="canceledQa"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -101,7 +99,7 @@ import MultSelect from '../common/MultSelect.vue';
|
|
|
import TipWarning from '../common/TipWarning.vue';
|
|
|
import api from "../utils/api.js";
|
|
|
import {mapState} from 'vuex';
|
|
|
-import {moduleCP} from '@utils/tools'
|
|
|
+import {moduleCP,moduleConfig} from '@utils/tools'
|
|
|
|
|
|
export default {
|
|
|
name:'MainPage',
|
|
@@ -109,8 +107,9 @@ export default {
|
|
|
return {
|
|
|
num:-1,//题目计数
|
|
|
pickDVal:'1天', //时间控件默认值
|
|
|
+ allMoudles:[],
|
|
|
showUsual:false, //常用症状显示
|
|
|
- activeTab:0, //当前模块
|
|
|
+ activeTab:1, //当前模块
|
|
|
scroll:null,
|
|
|
canceledSym:false, //是否已修改过主症状
|
|
|
canceledQa:-1,
|
|
@@ -120,19 +119,13 @@ export default {
|
|
|
symptomResult:'',//症状选择
|
|
|
connectResult:[],//关联问题的id
|
|
|
contentResult:{},//选中的结果val医生端显示,valp患者端显示
|
|
|
- allquestionLis:[],//症状详情所有的问题
|
|
|
- diagQasList:[], //诊疗详情所有问题
|
|
|
- otherQasList:[],//其他情况所有问题
|
|
|
- moduleKeys:[1,51,3,52],
|
|
|
- listMap:{
|
|
|
- 0:'allquestionLis',
|
|
|
- 1:'diagQasList',
|
|
|
- 2:'otherQasList'
|
|
|
- },
|
|
|
+ symptomQasList:[],//症状详情所有的问题
|
|
|
+ diagnoseQasList:[], //诊疗详情所有问题
|
|
|
+ othersQasList:[],//其他情况所有问题
|
|
|
moduleMap:{
|
|
|
- 0:'symptom',
|
|
|
- 1:'diagnose',
|
|
|
- 2:'others'
|
|
|
+ 1:'symptom',
|
|
|
+ 51:'diagnose',
|
|
|
+ 3:'others'
|
|
|
},
|
|
|
defaultIndex: 0, //温度默认值
|
|
|
order:0,
|
|
@@ -148,6 +141,8 @@ export default {
|
|
|
//const userInfo= JSON.parse(localStorage.getItem("userInfo"))
|
|
|
const userInfo = this.$store.state.pathInfo;
|
|
|
this.userInfo = userInfo;
|
|
|
+ let tmpModule = moduleConfig(this.config,this.tmpAllMoudles);
|
|
|
+ this.allMoudles = tmpModule.data;
|
|
|
this.updata()
|
|
|
},
|
|
|
mounted(){
|
|
@@ -164,12 +159,19 @@ export default {
|
|
|
computed:{
|
|
|
...mapState({
|
|
|
imgs: state => state.diagnose.imgSrc,
|
|
|
+ tmpAllMoudles: state => state.allMoudles,
|
|
|
+ config: state => state.sysConfig,
|
|
|
}),
|
|
|
+ moduleKeys(){
|
|
|
+ return this.allMoudles.map((it)=>{
|
|
|
+ return it.type;
|
|
|
+ });
|
|
|
+ },
|
|
|
progress(){
|
|
|
if(this.num===-1){
|
|
|
return '0.1px';
|
|
|
}
|
|
|
- const moduleName = this.listMap[this.activeTab];
|
|
|
+ const moduleName = this.moduleMap[this.activeTab]+'QasList';
|
|
|
const precent = (this.num+1)/this[moduleName].length;
|
|
|
return precent*100+"%";
|
|
|
}
|
|
@@ -181,7 +183,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
updata(){
|
|
|
- this.allquestionLis = [];
|
|
|
+ this.symptomQasList = [];
|
|
|
this.pdbm = '8.5rem';
|
|
|
this.showUsual=true;
|
|
|
this.num = 0;
|
|
@@ -217,13 +219,13 @@ export default {
|
|
|
},
|
|
|
cancelSelected(){ //修改题目
|
|
|
let moduleName='',tmpArr=[],tmpPreItem={},tmpNowItem={};
|
|
|
- moduleName = this.listMap[this.activeTab];
|
|
|
+ moduleName = this.moduleMap[this.activeTab]+'QasList';
|
|
|
tmpArr = this[moduleName];
|
|
|
tmpNowItem = tmpArr[this.num];
|
|
|
this.type = -1;
|
|
|
tmpNowItem.show = false;
|
|
|
- if(this.activeTab!==0&&this.num===0){ //取消上一阶段的最后一题时
|
|
|
- moduleName = this.listMap[this.activeTab-1];
|
|
|
+ if(this.activeTab!==this.moduleKeys[0]&&this.num===0){ //取消上一阶段的最后一题时
|
|
|
+ moduleName = this.moduleMap[this.activeTab-1]+'QasList';
|
|
|
const n = this[moduleName].length-1;
|
|
|
tmpPreItem = this[moduleName][n];
|
|
|
this.activeTab=this.activeTab-1;
|
|
@@ -243,7 +245,8 @@ export default {
|
|
|
updataResultSingle(result,contentResult,num){
|
|
|
this.num = num;
|
|
|
this.type = -1;
|
|
|
- let moduleName = this.listMap[this.activeTab];
|
|
|
+ const mkeys =this.moduleKeys;
|
|
|
+ let moduleName = this.moduleMap[this.activeTab]+'QasList';
|
|
|
let tmpArr = JSON.parse(JSON.stringify(this[moduleName]));
|
|
|
tmpArr[num-1].content = contentResult.valp;
|
|
|
//选没有可上传报告,则上传控件不显示
|
|
@@ -255,18 +258,25 @@ export default {
|
|
|
this[moduleName] = tmpArr;
|
|
|
//上传的图片及是否有可上传***答案不显示在预览所以不记录到state.diagnose.text中
|
|
|
if(this.symptomResult.id!==999999&&this.symptomResult.controlType!=4){
|
|
|
- this.$store.commit('setText', { type: this.moduleKeys[this.activeTab], text: contentResult.val,textP: contentResult.valp,idx:contentResult.idx,flag:contentResult.flag });
|
|
|
+ this.$store.commit('setText', { type: this.activeTab,
|
|
|
+ text: contentResult.val,
|
|
|
+ textP: contentResult.valp,
|
|
|
+ idx:contentResult.idx,
|
|
|
+ flag:contentResult.flag,
|
|
|
+ isEdit:this.num-1==this.canceledQa
|
|
|
+ });
|
|
|
}
|
|
|
console.log(this.$store.state); //最后一题答完
|
|
|
if(+num===this[moduleName].length||(noUpload&&+num===this[moduleName].length+1)){
|
|
|
- if(this.activeTab>1){ //模块配置待修改
|
|
|
+ if(this.activeTab===mkeys[mkeys.length-1]){ //最后一个模块时显示预览按钮
|
|
|
this.showPreview=true;
|
|
|
return;
|
|
|
}
|
|
|
const state = this.$store.state;
|
|
|
- this.activeTab++; //进入下一个阶段问题
|
|
|
+ const tabIndx = this.moduleKeys.findIndex((i)=>i==this.activeTab);
|
|
|
+ this.activeTab=this.moduleKeys[+tabIndx+1]; //进入下一个阶段问题
|
|
|
this.num = 0;
|
|
|
- moduleName = this.listMap[this.activeTab];
|
|
|
+ moduleName = this.moduleMap[this.activeTab]+'QasList';
|
|
|
const mDataName = this.moduleMap[this.activeTab];
|
|
|
this[moduleName] = JSON.parse(JSON.stringify(state[mDataName].datas));
|
|
|
let tmpArrDetail1 = JSON.parse(JSON.stringify(this[moduleName][0]));
|
|
@@ -312,7 +322,7 @@ export default {
|
|
|
},4500);*/
|
|
|
},
|
|
|
cancelSymptom(){ //修改(即删除)已选主症
|
|
|
- this.allquestionLis = [];
|
|
|
+ this.symptomQasList = [];
|
|
|
this.selectedSymptom=[];
|
|
|
this.showUsual=true;
|
|
|
this.type=-1;
|
|
@@ -350,7 +360,7 @@ export default {
|
|
|
this.type = qaLis[0].controlType;
|
|
|
this.symptomResult = qaLis[0];
|
|
|
this.$store.commit('setSymptomDatas',qaLis);
|
|
|
- this.allquestionLis = this.$store.state.symptom.origin;
|
|
|
+ this.symptomQasList = this.$store.state.symptom.origin;
|
|
|
}else{
|
|
|
|
|
|
}
|
|
@@ -401,7 +411,6 @@ export default {
|
|
|
span{
|
|
|
display: inline-block;
|
|
|
font-size: .26rem;
|
|
|
- width: 30%;
|
|
|
color: #aaa;
|
|
|
text-align: center;
|
|
|
&:not(:last-child):after{
|