|
@@ -2,9 +2,9 @@
|
|
|
<div class="page">
|
|
|
<div class="progress-bar">
|
|
|
<div class="title">
|
|
|
- <span class="active">症状情况</span>
|
|
|
- <span>诊疗情况</span>
|
|
|
- <span>其他情况</span>
|
|
|
+ <span :class="{'active':activeTab===0}">症状情况</span>
|
|
|
+ <span :class="{'active':activeTab===1}">诊疗情况</span>
|
|
|
+ <span :class="{'active':activeTab===2}">其他情况</span>
|
|
|
</div>
|
|
|
<div class="progress">
|
|
|
<p :style="{width:progress}"></p>
|
|
@@ -37,57 +37,95 @@
|
|
|
<p>{{selectedSymptom.description||selectedSymptom.name}}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-for="(item,idx) in allquestionLis" :key="idx">
|
|
|
+ <div v-for="(item,idx) in allquestionLis" :key="'0'+item.id" v-if="activeTab>-1">
|
|
|
+ <Dialog :idx="idx" v-if="item.show" :item="item" @selectToggle="selectToggle"/>
|
|
|
+ </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" @selectToggle="selectToggle"/>
|
|
|
+ </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" @selectToggle="selectToggle"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <Select @updataResult="updataResultSingle" :num="num" :symptomResult="symptomResult" v-if="type == 2"></Select>
|
|
|
+ <Select @updataResult="updataResultSingle" :num="num" :symptomResult="symptomResult" v-if="type == 2||type==8"></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>
|
|
|
+ <!--普通单列拨盘-->
|
|
|
+ <Picker v-if="type==10" @confirm="updataResultSingle" :num="num" :defaultIndex = "defaultIndex"></Picker>
|
|
|
+ <!--时间拨盘,拨盘内容写死-->
|
|
|
+ <Picker v-if="type == 9" :columns="getTimeColumns()" :defaultVal="pickDVal" @confirm="updataResultSingle" :num="num" :defaultIndex = "defaultIndex"></Picker>
|
|
|
+ <!-- 上传图片 -->
|
|
|
+ <UploadImg v-if="type==4"
|
|
|
+ :num="num"
|
|
|
+ :item="symptomResult"
|
|
|
+ :moduleType="symptomResult.type"
|
|
|
+ @updataResult="updataResultSingle"
|
|
|
+ :imgList="imgs"/>
|
|
|
+ <!-- 输入框 -->
|
|
|
+ <Input v-if="type==7"
|
|
|
+ :num="num"
|
|
|
+ :item="symptomResult"
|
|
|
+ :key="symptomResult.id"
|
|
|
+ @updata="updataResultSingle"/>
|
|
|
+ <!-- 文本域 -->
|
|
|
+ <ComTextArea v-if="type==6 || type == 5"
|
|
|
+ :num="num"
|
|
|
+ :item="symptomResult"
|
|
|
+ width="92%"
|
|
|
+ @updata="updataResultSingle"/>
|
|
|
+ <div class="submit" v-if="showPreview">
|
|
|
+ <a href="javascript:void(0)" @click="previewRes">提交并预览</a>
|
|
|
+ </div>
|
|
|
<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 Radio from '../common/Radio';
|
|
|
+import Select from '../common/Select';
|
|
|
+import Dialog from '../common/Dialog';
|
|
|
+import Picker from '../common/Picker';
|
|
|
+import Label from '../common/Label.vue';
|
|
|
+import ComTextArea from '../common/ComTextArea.vue';
|
|
|
+import Input from '../common/Input.vue';
|
|
|
+import PickTime from '../common/PickTime.vue';
|
|
|
+import UploadImg from '../common/UploadImg.vue';
|
|
|
import ConfirmBox from '../common/ConfirmBox'
|
|
|
import UsualSymptom from '../common/UsualSymptom';
|
|
|
import api from "../utils/api.js";
|
|
|
+import {mapState} from 'vuex';
|
|
|
|
|
|
export default {
|
|
|
name:'MainPage',
|
|
|
data(){
|
|
|
- let tmpDatas = JSON.parse(JSON.stringify(data));
|
|
|
return {
|
|
|
- disData:data,//所有的数据
|
|
|
- result:'诊断结果',
|
|
|
num:0,//题目计数
|
|
|
- show:false,
|
|
|
- showUsual:false,
|
|
|
+ pickDVal:'1天', //时间控件默认值
|
|
|
+ showUsual:false, //常用症状显示
|
|
|
+ activeTab:0, //当前模块
|
|
|
scroll:null,
|
|
|
- type :-1,
|
|
|
- tmpSymptom:'',
|
|
|
+ type :-1, //当前显示的控件类型
|
|
|
+ showPreview:false,//显示预览按钮
|
|
|
selectedSymptom:{},
|
|
|
- tmpDatas:tmpDatas,
|
|
|
symptomResult:'',//症状选择
|
|
|
connectResult:[],//关联问题的id
|
|
|
contentResult:'',//选中的结果name
|
|
|
- rules:[],//规则所需数据value
|
|
|
- allquestionLis:[],//所有的问题
|
|
|
- current:0,//第几题
|
|
|
+ allquestionLis:[],//症状详情所有的问题
|
|
|
+ diagQasList:[], //诊疗详情所有问题
|
|
|
+ otherQasList:[],//其他情况所有问题
|
|
|
+ listMap:{
|
|
|
+ 0:'allquestionLis',
|
|
|
+ 1:'diagQasList',
|
|
|
+ 2:'otherQasList'
|
|
|
+ },
|
|
|
+ moduleMap:{
|
|
|
+ 0:'symptom',
|
|
|
+ 1:'diagnose',
|
|
|
+ 2:'others'
|
|
|
+ },
|
|
|
defaultIndex: 0, //温度默认值
|
|
|
- selectTemp: '', //选择的温度
|
|
|
order:0,
|
|
|
- arr1:[],//规则数据1.....
|
|
|
- arr2:[],//规则数据2.....
|
|
|
userInfo: {}, //用户信息
|
|
|
- lastDis:'',//诊断
|
|
|
pdbm:'8.5rem',
|
|
|
waring:'',
|
|
|
wrong:false,
|
|
@@ -110,31 +148,30 @@ export default {
|
|
|
this.scroll = bs
|
|
|
})
|
|
|
// this.tmpSymptom = JSON.parse(JSON.stringify(data))
|
|
|
- this.symptomResult = data.symptom.result;
|
|
|
+ //this.symptomResult = data.symptom.result;
|
|
|
},
|
|
|
computed:{
|
|
|
+ ...mapState({
|
|
|
+ imgs: state => state.diagnose.imgSrc,
|
|
|
+ }),
|
|
|
progress(){
|
|
|
if(!this.num){
|
|
|
return '0.1px';
|
|
|
}
|
|
|
- const precent = this.num/(this.allquestionLis.length+1);
|
|
|
+ const moduleName = this.listMap[this.activeTab];
|
|
|
+ const precent = this.num/(this[moduleName].length+1);
|
|
|
return precent*100+"%";
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
+ previewRes(){
|
|
|
+ this.$router.push({
|
|
|
+ path:'/preview'
|
|
|
+ })
|
|
|
+ },
|
|
|
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.allquestionLis = [];
|
|
|
this.pdbm = '8.5rem'
|
|
|
- //this.type = 1;
|
|
|
this.showUsual=true;
|
|
|
this.num = 0;
|
|
|
},
|
|
@@ -145,16 +182,63 @@ export default {
|
|
|
}
|
|
|
this.symptomResult = result
|
|
|
this.type = type
|
|
|
- this.current = idx
|
|
|
this.order = order
|
|
|
this.scrollDown()
|
|
|
},
|
|
|
+ getTimeColumns(){
|
|
|
+ let num = [];
|
|
|
+ for(let i = 1; i <=60; i++) {
|
|
|
+ num.push(i)
|
|
|
+ }
|
|
|
+ let unit = ['分钟', '小时', '天', '周', '月','年'];
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ values:num,
|
|
|
+ className:'column1',
|
|
|
+ defaultIndex: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ values:unit,
|
|
|
+ className:'column2',
|
|
|
+ defaultIndex: 2
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ },
|
|
|
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));
|
|
|
+ let moduleName = this.listMap[this.activeTab];
|
|
|
+ let tmpArr = JSON.parse(JSON.stringify(this[moduleName]));
|
|
|
tmpArr[num-1].content = contentResult;
|
|
|
+ this[moduleName] = tmpArr;
|
|
|
+ if(+num===this[moduleName].length){
|
|
|
+ console.log(this.$store.state); //最后一题答完
|
|
|
+ if(this.activeTab>1){ //模块配置待修改
|
|
|
+ this.showPreview=true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const state = this.$store.state;
|
|
|
+ this.activeTab++; //进入下一个阶段问题
|
|
|
+ this.num = 0;
|
|
|
+ moduleName = this.listMap[this.activeTab];
|
|
|
+ const mDataName = this.moduleMap[this.activeTab];
|
|
|
+ this[moduleName] = JSON.parse(JSON.stringify(state[mDataName].datas));
|
|
|
+ let tmpArrDetail1 = JSON.parse(JSON.stringify(this[moduleName][0]));
|
|
|
+ this[moduleName][0] = tmpArrDetail1;
|
|
|
+ const tmpNowItem = this[moduleName][this.num];
|
|
|
+ let timer = setTimeout(() => {
|
|
|
+ this.type = tmpNowItem.controlType;
|
|
|
+ tmpNowItem.show = true;
|
|
|
+ console.log(tmpNowItem)
|
|
|
+ this.symptomResult = tmpNowItem;
|
|
|
+ });
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.scroll.refresh()
|
|
|
+ this.scroll.scrollTo(0, this.scroll.maxScrollY,500)
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let tmpArrDetailResult = JSON.parse(JSON.stringify(this[moduleName][num]));
|
|
|
let tmpArrDetail = JSON.parse(JSON.stringify(tmpArr[num]));
|
|
|
|
|
|
let timer = setTimeout(() => {
|
|
@@ -165,147 +249,11 @@ export default {
|
|
|
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; //设置搜索选中症状
|
|
@@ -324,10 +272,11 @@ export default {
|
|
|
if(!data){
|
|
|
return ;
|
|
|
}
|
|
|
- const qaLis = data.questionMapping;
|
|
|
+ let qaLis = data.questionMapping;
|
|
|
+ //qaLis.length=2; //开发测试代码,要删除
|
|
|
qaLis[0].show=true; //第一题自动显示
|
|
|
this.type = qaLis[0].controlType;
|
|
|
- this.symptomResult = qaLis[0].questionDetailList;
|
|
|
+ this.symptomResult = qaLis[0];
|
|
|
this.allquestionLis = qaLis;
|
|
|
}else{
|
|
|
|
|
@@ -337,41 +286,17 @@ export default {
|
|
|
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,
|
|
|
+ Label,
|
|
|
+ ComTextArea,
|
|
|
+ Input,
|
|
|
+ PickTime,
|
|
|
+ UploadImg,
|
|
|
ConfirmBox,
|
|
|
UsualSymptom
|
|
|
}
|
|
@@ -475,5 +400,21 @@ export default {
|
|
|
transform: translateX(-50%);
|
|
|
color: #fff;
|
|
|
}
|
|
|
+ .submit{
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0;
|
|
|
+ width: 100%;
|
|
|
+ a{
|
|
|
+ display: inline-block;
|
|
|
+ width: 100%;
|
|
|
+ height: 0.88rem;
|
|
|
+ font-size: .28rem;
|
|
|
+ background-color: #colors[btn];
|
|
|
+ line-height: 0.88rem;
|
|
|
+ margin-top: 0.8rem;
|
|
|
+ text-align: center;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
</style>
|