hwy пре 6 месеци
родитељ
комит
96107ea77f
2 измењених фајлова са 143 додато и 20 уклоњено
  1. 2 2
      app/jbsc/html/filter_type.html
  2. 141 18
      app/jbsc/html/questionnaire.html

+ 2 - 2
app/jbsc/html/filter_type.html

@ -466,7 +466,7 @@
										closeBtn:1,
										shift: 5,
										shadeClose: false, //点击遮罩关闭层
										content: '../../jbsc/html/questionnaire.html?fliter_code='+vm.screeningType.code+'&fliter_title='+vm.screeningType.title+'&resident_code='+pCode+'&resident_name='+vm.screeningResidents.name+'&sex='+vm.screeningResidents.sex+'&age='+vm.screeningResidents.age
										content: '../../jbsc/html/questionnaire.html?fliter_code='+vm.screeningType.code+'&fliter_title='+vm.screeningType.title+'&resident_code='+pCode+'&resident_name='+vm.screeningResidents.name+'&sex='+vm.screeningResidents.sex+'&age='+vm.screeningResidents.age+vm.screeningResidents.idcard+'&mobile='+vm.screeningResidents.mobile
									});
									var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
									parent.layer.close(index); //再执行关闭
@ -513,7 +513,7 @@
								closeBtn:1,
								shift: 5,
								shadeClose: false, //点击遮罩关闭层
								content: '../../jbsc/html/questionnaire.html?fliter_code='+vm.screeningType.code+'&fliter_title='+vm.screeningType.title+'&resident_code='+pCode+'&resident_name='+vm.screeningResidents.name+'&sex='+vm.screeningResidents.sex+'&age='+vm.screeningResidents.age
								content: '../../jbsc/html/questionnaire.html?fliter_code='+vm.screeningType.code+'&fliter_title='+vm.screeningType.title+'&resident_code='+pCode+'&resident_name='+vm.screeningResidents.name+'&sex='+vm.screeningResidents.sex+'&age='+vm.screeningResidents.age+'&idcard='+vm.screeningResidents.idcard+'&mobile='+vm.screeningResidents.mobile
							});
							var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
							parent.layer.close(index); //再执行关闭

+ 141 - 18
app/jbsc/html/questionnaire.html

@ -28,30 +28,30 @@
							<li v-for="(qst,key,index) in questions">
								<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)">
									<lable class="label-block" v-for="opt in qst.option" @click="selectItem(qst.question,opt,index)">
										<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>									
											<input :type="qst.questionType==1?'checkbox':'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>									
											<input :type="qst.questionType==1?'checkbox':'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>									
											<input :type="qst.questionType==1?'checkbox':'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>									
											<input :type="qst.questionType==1?'checkbox':'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>									
											<input :type="qst.questionType==1?'checkbox':'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>									
											<input :type="qst.questionType==1||qst.question.questionType?'checkbox':'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 v-else>
									<template v-if="qst.isThird==3&&qst.question.thirdKey == 'assessTime'">
									<template v-if="(qst.isThird=='3' && qst.question.thirdKey == 'assessTime')||(qst.question.thirdKey == 'createDate'&&screeningTitle=='大肠癌筛查问卷(OB筛查)')||(qst.question.thirdKey == 'createDate'&&screeningTitle=='脑卒中风险评估(冠心病、脑卒中、肾病)')">
										<div style="padding-left: 20px;">
											<el-date-picker
											  v-model="qst.question.content"
@ -70,7 +70,7 @@
										<div class="daan-list" v-else-if="qst.question.thirdKey != 'bmi'">
											<textarea class="wenjuan-textarea" @keyup="changeContent(qst.question,qst.question.content,1)" rows="2"  v-model="qst.question.content"></textarea>
										</div>
										<div class="daan-list" v-if="qst.isThird==3 && (shaowas&&qst.question.thirdKey == 'bmi')">
										<div class="daan-list" v-if="(shaowas&&qst.question.thirdKey == 'bmi')">
											<textarea class="wenjuan-textarea" disabled rows="2"  v-model="shaowas"></textarea>
										</div>
										
@ -178,6 +178,7 @@
					shaowas:'',
				},
				mounted: function(){
					console.log('screeningTitle',this.screeningTitle)
					this.getHealth();
					this.getQuestion();
					this.getDoctorInfo()
@ -200,6 +201,26 @@
					//计算选中个数,组装成后台接收格式
					selectItem:function(qst,select,num){
						var vm = this
						var isFlag=1
						if (qst.title == '抗栓药物其他名称' && vm.screeningTitle == '大肠癌筛查问卷(OB筛查)') {
							vm.selectArr.forEach(function(item, index) {
							if (item.thirdKey == 'ksDrugName1') {
							item.options.forEach(function(v, i) {
								if (v.comment == '其他') {
									isFlag = 0;
									return false;
								}
							});
							}
							});
							// 如果没有勾选“其他”选项,提示并返回
							if (isFlag) {
								qst.content = '';  // 清空当前输入的内容
							this.$message.error('请先勾选抗栓药物名称的其他选项');
							return false;
							}
							}
						if(vm.ascvdShow) {
							if(select.thirdKey == 'acs' || select.thirdKey == 'myocardialInfarct' || select.thirdKey == 'ischemicStroke' || select.thirdKey == 'seriousMedicalHistory') {
								return false
@ -215,13 +236,39 @@
						var ls = []
						var lsTo = []
						if(select){
							options=[{
								optionCode:select.code,
								comment:select.content,
								score:select.score,
								thirdKey:select.thirdKey,
								thirdValue:select.thirdValue
							}]
							if(qst.questionType == '1') {
						// 处理多选题
						if (!qst.selectedOptions) {
						qst.selectedOptions = [];
						}
						var optionIndex = qst.selectedOptions.findIndex(item => item.optionCode == select.code);
						if (optionIndex > -1) {
						// 如果已经选中,则取消选择
						qst.selectedOptions.splice(optionIndex, 1);
						} else {
						// 如果未选中,则添加选项
						qst.selectedOptions.push({
						optionCode:select.code,
						comment:select.content,
						score:select.score,
						thirdKey:select.thirdKey,
						thirdValue:select.thirdValue
						});
						}
						options = qst.selectedOptions; // 将选中的所有选项赋值给options
						}else{
		
									options=[{
										optionCode:select.code,
										comment:select.content,
										score:select.score,
										thirdKey:select.thirdKey,
										thirdValue:select.thirdValue
									}]
	                          }
							if(select.thirdKey=="ascvd"&&select.thirdValue==0) {
								this.ascvdShow = '0'
								vm.spliceFunction()
@ -307,6 +354,7 @@
						}
						
						data.options=options;
						console.log('111111111111xsssssssss')
						var oldLen = this.selectArr.length;
						this.selectArr = _.filter(this.selectArr,function(o) {
								return o.qstCode !=data.qstCode;
@ -315,7 +363,7 @@
						this.selectArr = this.selectArr.concat(ls)
						this.selectArr.push(data);
						
						// console.log(this.selectArr,'this.selectArr')
						console.log(this.selectArr,'this.selectArr')
						var len=this.selectArr.length;
//						var questions=Object.values(this.questions)
                        var questions = _.toArray(this.questions)
@ -374,6 +422,9 @@
								// console.log(res.data,"res.data")
								for(var i in res.data) {
									if(res.data[i].isThird == 3){
										if (res.data[i].question.questionType == '1') {
                                       res.data[i].question.selectedOptions = []; // 初始化多选项的数组
                }
										if(res.data[i].question.thirdKey == 'assessTime') {
											res.data[i].question.content = new Date()
										}
@ -397,8 +448,55 @@
										} 
										
									}
									if(res.data[i].question.thirdKey == 'belongCommunity') {
											res.data[i].question.content = docInfo.hospitalName
										}
									if(res.data[i].question.thirdKey == 'doctorName') {
											res.data[i].question.content = docInfo.name
										}	
									if(res.data[i].question.thirdKey == 'doctorPhoneNo') {
											res.data[i].question.content = docInfo.mobile
										}
									if(res.data[i].question.thirdKey == 'userName') {
											res.data[i].question.content =decodeURI(httpData.resident_name)
										}
										if(res.data[i].question.thirdKey == 'idNo') {
											res.data[i].question.content =httpData.idcard
										}
										if(res.data[i].question.thirdKey == 'phoneNo') {
											res.data[i].question.content =httpData.mobile
										}
										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 == 'age') {
											res.data[i].question.content =httpData.age
										}
										if(res.data[i].question.title == "性别") {
											var index = vm.sex==1?"0":'1'
											console.log(
												'==================aaaaaaaaaa',res.data[i].question,res.data[i].option[index]
											)
											vm.selectItem(res.data[i].question,res.data[i].option[index])
										}
										if(res.data[i].question.thirdKey == "createDate") {
											res.data[i].question.content =new Date().format('yyyy-MM-dd hh:mm:ss')
										}
										if(res.data[i].question.thirdKey == "assessTime") {
											res.data[i].question.content =new Date().format('yyyy-MM-dd hh:mm:ss')
										}
								
										if(res.data[i].question.thirdKey == 'sex'&&(vm.screeningTitle=='大肠癌筛查问卷(OB筛查)'||vm.screeningTitle=='脑卒中风险评估(冠心病、脑卒中、肾病)')) {
											var index = vm.sex==1?"0":'1'
											vm.selectItem(res.data[i].question,res.data[i].option[index])
										}  	 	 		
								}
								console.log(res.data,'ssssssssslllllllllll')
								vm.questions = res.data;
								
								for(var i in res.data) {
									if(res.data[i].isThird == 3){
										if(res.data[i].question.thirdKey == 'assessTime') {
@ -418,6 +516,7 @@
										} 
										if(res.data[i].question.thirdKey == 'sex') {
											var index = vm.sex==1?"0":'1'
											console.log('------111111000000000',res.data[i].question,res.data[i].option[index])
											vm.selectItem(res.data[i].question,res.data[i].option[index])
										} 
									}
@ -467,7 +566,30 @@
													vm.questions[i].question.content = data.bloodPressureRigthD
													vm.changeContent(vm.questions[i].question,data.bloodPressureRigthD)
												}
												
												if(vm.questions[i].question.thirdKey == "bpU") {
													vm.questions[i].question.content = data.bloodPressureLeftU || data.bloodPressureRigthU
													vm.changeContent(vm.questions[i].question,data.bloodPressureLeftU || data.bloodPressureRigthU)
												}
												if(vm.questions[i].question.thirdKey == "bpD") {
													vm.questions[i].question.content = data.bloodPressureLeftD || data.bloodPressureRigthD
													vm.changeContent(vm.questions[i].question,data.bloodPressureLeftD || data.bloodPressureRigthD)
												}
												if(vm.questions[i].question.thirdKey == "glycolatedHemoglobin") {
													vm.questions[i].question.content = data.glycolatedHemoglobin
													vm.changeContent(vm.questions[i].question,data.glycolatedHemoglobin)
												}
												if(vm.questions[i].question.thirdKey == "fbg") {
													vm.questions[i].question.content = data.fastingPlasmaGlucoseL
													vm.changeContent(vm.questions[i].question,data.fastingPlasmaGlucoseL)
												}
												if(vm.questions[i].question.thirdKey == "bloodPotassium") {
													vm.questions[i].question.content = data.renalFunctionBloodPotassium
													vm.changeContent(vm.questions[i].question,data.renalFunctionBloodPotassium)
												}
												if(vm.questions[i].question.thirdKey == "renalFunctionCreatinine") {
													vm.questions[i].question.content = data.renalFunctionCreatinine
													vm.changeContent(vm.questions[i].question,data.renalFunctionCreatinine)
												}
											}
											 
										}
@ -519,6 +641,7 @@
						})
					},
					save:function(){
						console.log('2222221sssssssssssssssss',this.selectArr)
						var vm=this;
						if(vm.progress!=100){
							top.layer.msg('问卷还未全部填写', {icon: 5});