|
@ -14,6 +14,8 @@
|
|
|
<link rel="stylesheet" type="text/css" href="../../../css/style.min.css" />
|
|
|
<link href="../../../plugins/toastr/toastr.min.css" rel="stylesheet">
|
|
|
<link rel="stylesheet" href="../css/questionnaire.css" />
|
|
|
<link rel="stylesheet" type="text/css" href="../../../css/element-ui.css" />
|
|
|
<!-- <link rel="stylesheet" type="text/css" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css" /> -->
|
|
|
</head>
|
|
|
<body>
|
|
|
<div class="ui-grid" id="app" style="align-items: flex-start;" v-cloak>
|
|
@ -27,12 +29,48 @@
|
|
|
<p class="question-name" v-text="key+'、'+qst.question.title"></p>
|
|
|
<div class="daan-list" v-if="qst.question.questionType!=2">
|
|
|
<lable class="label-block" v-for="opt in qst.option" @click="selectItem(qst.question,opt)">
|
|
|
<span class="pull-right" v-text="(opt.score || 0)+'分'"></span>
|
|
|
<input :type="qst.questionType==1?'checked':'radio'" :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')" value="1" /><i></i><span v-text="opt.content"></span>
|
|
|
</lable>
|
|
|
<span class="pull-right" v-text="(opt.score || 0)+'分'" v-if="qst.isThird!=3"></span>
|
|
|
<template v-if="qst.isThird==3&&qst.question.thirdKey=='sex'">
|
|
|
<input :type="qst.questionType==1?'checked':'radio'" :checked="opt.thirdValue == sex" :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')" value="1" /><i></i><span v-text="opt.content"></span>
|
|
|
</template>
|
|
|
<template v-if="qst.isThird==3&&qst.question.thirdKey=='acs'">
|
|
|
<input :type="qst.questionType==1?'checked':'radio'" :checked="opt.thirdValue == (ascvdShow?ascvdShow:ascvdS1)" id='myInput1' :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')" value="1" /><i></i><span v-text="opt.content"></span>
|
|
|
</template>
|
|
|
<template v-if="qst.isThird==3&&qst.question.thirdKey=='myocardialInfarct'">
|
|
|
<input :type="qst.questionType==1?'checked':'radio'" :checked="opt.thirdValue == (ascvdShow?ascvdShow:ascvdS2)" id='myInput2' :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')" value="1" /><i></i><span v-text="opt.content"></span>
|
|
|
</template>
|
|
|
<template v-if="qst.isThird==3&&qst.question.thirdKey=='ischemicStroke'">
|
|
|
<input :type="qst.questionType==1?'checked':'radio'" :checked="opt.thirdValue == (ascvdShow?ascvdShow:ascvdS3)" id='myInput3' :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')" value="1" /><i></i><span v-text="opt.content"></span>
|
|
|
</template>
|
|
|
<template v-if="qst.isThird==3&&qst.question.thirdKey=='seriousMedicalHistory'">
|
|
|
<input :type="qst.questionType==1?'checked':'radio'" :checked="opt.thirdValue == (ascvdShow?ascvdShow:ascvdS4)" id='myInput4' :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')" value="1" /><i></i><span v-text="opt.content"></span>
|
|
|
</template>
|
|
|
<template v-if="qst.question.thirdKey!='sex'&&qst.question.thirdKey!='acs'&&qst.question.thirdKey!='myocardialInfarct'&&qst.question.thirdKey!='ischemicStroke'&&qst.question.thirdKey!='seriousMedicalHistory'">
|
|
|
<input :type="qst.questionType==1?'checked':'radio'" v-if="qst.question.thirdKey!='sex'" :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')" value="1" /><i></i><span v-text="opt.content"></span>
|
|
|
</template>
|
|
|
</lable>
|
|
|
</div>
|
|
|
<div class="daan-list" v-else>
|
|
|
<textarea class="wenjuan-textarea" @keyup="changeContent(qst.question,qst.question.content)" rows="2" v-model="qst.question.content"></textarea>
|
|
|
<div v-else>
|
|
|
<template v-if="qst.isThird==3&&qst.question.thirdKey == 'assessTime'">
|
|
|
<div style="padding-left: 20px;">
|
|
|
<el-date-picker
|
|
|
v-model="qst.question.content"
|
|
|
type="datetime"
|
|
|
format="yyyy-MM-dd HH:mm"
|
|
|
value-format="yyyy-MM-dd HH:mm"
|
|
|
placeholder="选择日期时间"
|
|
|
@change='changeContent(qst.question,qst.question.content)'>
|
|
|
</el-date-picker>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<div class="daan-list" v-if="qst.isThird==3 && (qst.question.thirdKey == 'assessDoctor' || qst.question.thirdKey == 'assessOrgId')">
|
|
|
<textarea class="wenjuan-textarea" disabled rows="2" v-model="qst.question.content"></textarea>
|
|
|
</div>
|
|
|
<div class="daan-list" v-else>
|
|
|
<textarea class="wenjuan-textarea" @keyup="changeContent(qst.question,qst.question.content)" rows="2" v-model="qst.question.content"></textarea>
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</li>
|
|
|
</ul>
|
|
@ -81,7 +119,7 @@
|
|
|
<div class="completion-of-progress">
|
|
|
<p class="f16 mb0">完成情况</p>
|
|
|
<div class="canvas-box">
|
|
|
<canvas-progress :progress="progress"></canvas-progress>
|
|
|
<canvas-progress :progress="progress" ref="progress"></canvas-progress>
|
|
|
<p class="progress-number">
|
|
|
<span>已完成</span>
|
|
|
</p>
|
|
@ -97,6 +135,9 @@
|
|
|
<script type="text/javascript" src="../../../plugins/echarts/3.8.5/echarts.min.js" ></script>
|
|
|
<script src="../../../js/vue.js" type="text/javascript" charset="utf-8"></script>
|
|
|
<script src="../../../js/jquery-2.2.4.js" type="text/javascript" charset="utf-8"></script>
|
|
|
<script src="../../../component/common/event-bus.js"></script>
|
|
|
<script src="../../../js/element-ui.js" type="text/javascript" charset="utf-8"></script>
|
|
|
<!-- <script src="https://unpkg.com/element-ui/lib/index.js" type="text/javascript" charset="utf-8"></script> -->
|
|
|
<script src="../../../js/underscore.js" type="text/javascript" charset="utf-8"></script>
|
|
|
<script src="../../../js/es6-promise.js" type="text/javascript" charset="utf-8"></script>
|
|
|
<script src="../../../plugins/toastr/toastr.min.js"></script>
|
|
@ -107,7 +148,7 @@
|
|
|
<script type="text/javascript" src="../component/canvas-progress.js" ></script>
|
|
|
<script type="text/javascript">
|
|
|
var httpData=GetRequest();
|
|
|
var wlyyAgentForDoc=JSON.parse(window.localStorage.getItem('wlyyAgentForDoc'));
|
|
|
var docInfo = JSON.parse(window.localStorage.getItem('docInfo'));
|
|
|
var question=new Vue({
|
|
|
el: "#app",
|
|
|
data: {
|
|
@ -118,15 +159,22 @@
|
|
|
screeningType:httpData['fliter_code'],
|
|
|
screeningResidents:httpData['resident_code'],
|
|
|
screeningResidentsName:decodeURI(httpData['resident_name']),
|
|
|
doctorInfo:{code:wlyyAgentForDoc.uid},
|
|
|
sex:decodeURI(httpData['sex']),
|
|
|
age:decodeURI(httpData['age']),
|
|
|
doctorInfo:{code:docInfo.code},
|
|
|
questions:[],
|
|
|
tizhongRecord:{},
|
|
|
labelType:5,//问卷筛查labelType=5
|
|
|
isAgain:(httpData['isAgain'] || 0),
|
|
|
ascvdShow:'',
|
|
|
ascvdS1:'',
|
|
|
ascvdS2:'',
|
|
|
ascvdS3:'',
|
|
|
ascvdS4:'',
|
|
|
},
|
|
|
mounted: function(){
|
|
|
this.getQuestion();
|
|
|
this.getHealth();
|
|
|
this.getQuestion();
|
|
|
this.getDoctorInfo()
|
|
|
},
|
|
|
methods: {
|
|
@ -142,35 +190,111 @@
|
|
|
top.layer.msg(res.msg, {icon: 5});
|
|
|
}
|
|
|
})
|
|
|
|
|
|
},
|
|
|
//计算选中个数,组装成后台接收格式
|
|
|
selectItem:function(qst,select){
|
|
|
console.log("selectItem");
|
|
|
var vm = this
|
|
|
if(vm.ascvdShow) {
|
|
|
if(select.thirdKey == 'acs' || select.thirdKey == 'myocardialInfarct' || select.thirdKey == 'ischemicStroke' || select.thirdKey == 'seriousMedicalHistory') {
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
var data={
|
|
|
qstCode:qst.code,
|
|
|
type:qst.questionType,
|
|
|
content:qst.content,
|
|
|
thirdKey:qst.thirdKey
|
|
|
}
|
|
|
var options=[];
|
|
|
var ls = []
|
|
|
if(select){
|
|
|
options=[{
|
|
|
optionCode:select.code,
|
|
|
comment:select.content,
|
|
|
score:select.score
|
|
|
score:select.score,
|
|
|
thirdKey:select.thirdKey,
|
|
|
thirdValue:select.thirdValue
|
|
|
}]
|
|
|
if(select.thirdKey=="ascvd"&&select.thirdValue==0) {
|
|
|
this.ascvdShow = '0'
|
|
|
vm.spliceFunction()
|
|
|
for(var i in this.questions) {
|
|
|
if(this.questions[i].question.thirdKey == 'acs' || this.questions[i].question.thirdKey == 'myocardialInfarct' || this.questions[i].question.thirdKey == 'ischemicStroke' || this.questions[i].question.thirdKey == 'seriousMedicalHistory') {
|
|
|
var s = this.questions[i].option[1]
|
|
|
ls.push({
|
|
|
optionCode:s.code,
|
|
|
comment:s.content,
|
|
|
score:s.score,
|
|
|
thirdKey:s.thirdKey,
|
|
|
thirdValue:s.thirdValue
|
|
|
})
|
|
|
this.questions[i].question.content = '0'
|
|
|
}
|
|
|
}
|
|
|
document.getElementById("myInput1").disabled = true;
|
|
|
document.getElementById("myInput2").disabled = true;
|
|
|
document.getElementById("myInput3").disabled = true;
|
|
|
document.getElementById("myInput4").disabled = true;
|
|
|
}else if(select.thirdKey=="ascvd"&&select.thirdValue==1){
|
|
|
this.ascvdShow = ''
|
|
|
this.ascvdS1 = ''
|
|
|
this.ascvdS2 = ''
|
|
|
this.ascvdS3 = ''
|
|
|
this.ascvdS4 = ''
|
|
|
document.getElementById("myInput1").disabled = false;
|
|
|
document.getElementById("myInput2").disabled = false;
|
|
|
document.getElementById("myInput3").disabled = false;
|
|
|
document.getElementById("myInput4").disabled = false;
|
|
|
ls = []
|
|
|
vm.spliceFunction()
|
|
|
|
|
|
}
|
|
|
if(select.thirdKey == 'acs') {vm.ascvdS1 = select.thirdValue}
|
|
|
if(select.thirdKey == 'myocardialInfarct') {vm.ascvdS2 = select.thirdValue}
|
|
|
if(select.thirdKey == 'ischemicStroke') {vm.ascvdS3 = select.thirdValue}
|
|
|
if(select.thirdKey == 'seriousMedicalHistory') {vm.ascvdS4 = select.thirdValue}
|
|
|
}
|
|
|
data.options=options;
|
|
|
var oldLen = this.selectArr.length;
|
|
|
this.selectArr = _.filter(this.selectArr,function(o) {
|
|
|
return o.qstCode !=data.qstCode;
|
|
|
}) || [];
|
|
|
this.selectArr = this.selectArr.concat(ls)
|
|
|
this.selectArr.push(data);
|
|
|
var len=this.selectArr.length;
|
|
|
// var questions=Object.values(this.questions)
|
|
|
var questions = _.toArray(this.questions)
|
|
|
var allLen=questions.length;
|
|
|
var progress=len===allLen?100:((len/allLen)*100);
|
|
|
this.progress=progress;
|
|
|
if(select&&select.thirdKey=="ascvd") {
|
|
|
this.$refs.progress.dataFunction(progress)
|
|
|
}else{
|
|
|
this.progress=progress;
|
|
|
}
|
|
|
},
|
|
|
spliceFunction:function() {
|
|
|
var vm = this
|
|
|
vm.selectArr.forEach(function(v,i){
|
|
|
if(v.thirdKey == 'acs') {
|
|
|
vm.selectArr.splice(i,1)
|
|
|
}
|
|
|
})
|
|
|
vm.selectArr.forEach(function(v,i){
|
|
|
if(v.thirdKey == 'myocardialInfarct') {
|
|
|
vm.selectArr.splice(i,1)
|
|
|
}
|
|
|
})
|
|
|
vm.selectArr.forEach(function(v,i){
|
|
|
if(v.thirdKey == 'ischemicStroke') {
|
|
|
vm.selectArr.splice(i,1)
|
|
|
}
|
|
|
})
|
|
|
vm.selectArr.forEach(function(v,i){
|
|
|
if(v.thirdKey == 'seriousMedicalHistory') {
|
|
|
vm.selectArr.splice(i,1)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
signOut:function(){
|
|
|
var index = top.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
|
@ -193,8 +317,51 @@
|
|
|
}
|
|
|
jbscAPI.getAllQuestions(data).then(function(res){
|
|
|
if(res.status==200){
|
|
|
var questions = res.data;
|
|
|
vm.questions = questions
|
|
|
console.log(res.data,"res.data")
|
|
|
for(var i in res.data) {
|
|
|
if(res.data[i].isThird == 3){
|
|
|
if(res.data[i].option.length!=0){
|
|
|
res.data[i].question.thirdKey = res.data[i].option[0].thirdKey
|
|
|
}
|
|
|
if(res.data[i].question.thirdKey == 'assessDoctor') {
|
|
|
res.data[i].question.content = docInfo.name
|
|
|
}
|
|
|
if(res.data[i].question.thirdKey == 'assessOrgId') {
|
|
|
res.data[i].question.content = docInfo.hospitalName
|
|
|
}
|
|
|
if(res.data[i].question.thirdKey == 'name') {
|
|
|
res.data[i].question.content = vm.screeningResidentsName
|
|
|
}
|
|
|
if(res.data[i].question.thirdKey == 'sex') {
|
|
|
res.data[i].question.content = vm.sex
|
|
|
}
|
|
|
if(res.data[i].question.thirdKey == 'age') {
|
|
|
res.data[i].question.content = vm.age
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
vm.questions = res.data;
|
|
|
for(var i in res.data) {
|
|
|
if(res.data[i].isThird == 3){
|
|
|
if(res.data[i].question.thirdKey == 'assessDoctor') {
|
|
|
vm.changeContent(res.data[i].question,docInfo.name)
|
|
|
}
|
|
|
if(res.data[i].question.thirdKey == 'assessOrgId') {
|
|
|
vm.changeContent(res.data[i].question,docInfo.hospitalName)
|
|
|
}
|
|
|
if(res.data[i].question.thirdKey == 'name') {
|
|
|
vm.changeContent(res.data[i].question,vm.screeningResidentsName)
|
|
|
}
|
|
|
if(res.data[i].question.thirdKey == 'age') {
|
|
|
vm.changeContent(res.data[i].question,vm.age)
|
|
|
}
|
|
|
if(res.data[i].question.thirdKey == 'sex') {
|
|
|
var index = vm.sex==1?"0":'1'
|
|
|
vm.selectItem(res.data[i].question,res.data[i].option[index])
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@ -208,6 +375,16 @@
|
|
|
vm.tizhongRecord = _.find(res.data,function(o) {
|
|
|
return o.type =="3";
|
|
|
}) || {};
|
|
|
for(var i in vm.questions) {
|
|
|
if(vm.questions[i].question.thirdKey == "height") {
|
|
|
vm.questions[i].question.content = vm.tizhongRecord.value2
|
|
|
vm.changeContent(vm.questions[i].question,vm.tizhongRecord.value2)
|
|
|
}
|
|
|
if(vm.questions[i].question.thirdKey == "weight") {
|
|
|
vm.questions[i].question.content = vm.tizhongRecord.value1
|
|
|
vm.changeContent(vm.questions[i].question,vm.tizhongRecord.value1)
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
top.layer.msg(res.msg, {icon: 5});
|
|
|
}
|
|
@ -228,26 +405,45 @@
|
|
|
source:1,
|
|
|
jsonData:JSON.stringify({
|
|
|
surveyCode:vm.screeningType,
|
|
|
questions:vm.selectArr
|
|
|
questions:vm.selectArr
|
|
|
})
|
|
|
}
|
|
|
jbscAPI.saveAnswer(data).then(function(res){
|
|
|
top.layer.close(loadding);
|
|
|
if(res.status == 200) {
|
|
|
top.layer.open({
|
|
|
type: 2,
|
|
|
area: ['820px', '648px'],
|
|
|
shade: 0.5,
|
|
|
title: '筛选统计',
|
|
|
fixed: true, //不固定
|
|
|
maxmin: true,
|
|
|
closeBtn:1,
|
|
|
shift: 5,
|
|
|
shadeClose: false, //点击遮罩关闭层
|
|
|
content: '../../jbsc/html/filter_result.html?code='+res.data+'&filter_type='+vm.screeningType
|
|
|
});
|
|
|
var index = top.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
|
|
top.layer.close(index); //再执行关闭
|
|
|
if(vm.questions[1].isThird == 3) {
|
|
|
top.layer.open({
|
|
|
type: 2,
|
|
|
// offset: ['100px'], //右下角弹出
|
|
|
area: ['568px', '100%'],
|
|
|
shade: 0.5,
|
|
|
title: '查看筛选结果',
|
|
|
fixed: true, //不固定
|
|
|
maxmin: true,
|
|
|
closeBtn:1,
|
|
|
shift: 5,
|
|
|
shadeClose: false, //点击遮罩关闭层
|
|
|
content: '../../jbsc/html/view_screening_results.html?resultCode='+res.data,
|
|
|
end:function() {
|
|
|
var index = top.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
|
|
parent.eventBuss.$emit('guan_results',index)
|
|
|
},
|
|
|
});
|
|
|
}else{
|
|
|
top.layer.open({
|
|
|
type: 2,
|
|
|
area: ['820px', '648px'],
|
|
|
shade: 0.5,
|
|
|
title: '筛选统计',
|
|
|
fixed: true, //不固定
|
|
|
maxmin: true,
|
|
|
closeBtn:1,
|
|
|
shift: 5,
|
|
|
shadeClose: false, //点击遮罩关闭层
|
|
|
content: '../../jbsc/html/filter_result.html?code='+res.data+'&filter_type='+vm.screeningType
|
|
|
});
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
top.layer.msg(res.msg, {icon: 5});
|
|
|
}
|