|
@ -24,7 +24,30 @@
|
|
|
<div class="single-choice-question">
|
|
|
<div class="question-title">问卷题目</div>
|
|
|
<div class="question-content">
|
|
|
<ul class="question-list">
|
|
|
<div v-if="screeningType == 'aa9bd609fd8b492296f6a34849b76520'" class="question-list">
|
|
|
<!-- 大肠癌筛查OB -->
|
|
|
<div class="pt10 pb5 pr10" v-for="(item,index) in questionList" :key="item.field">
|
|
|
<div class="question-name">
|
|
|
{{index + 1}}、{{item.label}}
|
|
|
<span class="required-icon" v-if="item.required">*</span>
|
|
|
</div>
|
|
|
<div class="daan-list" v-if="item.type== 'input'">
|
|
|
<textarea class="wenjuan-textarea" rows="1" v-model="answer[item.field]"></textarea>
|
|
|
</div>
|
|
|
<div class="daan-list" v-if="item.type =='radio'">
|
|
|
<el-radio-group v-model="answer[item.field]">
|
|
|
<el-radio :label="el.value" v-for="(el,i) in item.options" style="display: block; margin-left: 0" :key="i">{{el.label}}</el-radio>
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
|
<div class="daan-list" v-if="item.type =='checkbox'">
|
|
|
<el-checkbox-group v-model="answer[item.field]">
|
|
|
<el-checkbox :label="el.value" v-for="(el,i) in item.options" style="display: block; margin-left: 0" :key="i">{{el.label}}</el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<ul class="question-list" v-else>
|
|
|
<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">
|
|
@ -216,6 +239,7 @@
|
|
|
<script src="../../../api/http-request.js" type="text/javascript" charset="utf-8"></script>
|
|
|
<script type="text/javascript" src="../../../api/jbsc-api.js"></script>
|
|
|
<script type="text/javascript" src="../component/canvas-progress.js"></script>
|
|
|
<script type="text/javascript" src="../js/questionList.js"></script>
|
|
|
<script type="text/javascript">
|
|
|
var httpData = GetRequest()
|
|
|
var docInfo = JSON.parse(window.localStorage.getItem('docInfo'))
|
|
@ -233,6 +257,8 @@
|
|
|
age: decodeURI(httpData['age']),
|
|
|
doctorInfo: { code: docInfo.code },
|
|
|
surveyStatus: httpData['surveyStatus'] || '',
|
|
|
idCard: httpData['idcard'],
|
|
|
mobile: httpData['mobile'],
|
|
|
questions: [],
|
|
|
tizhongRecord: {},
|
|
|
labelType: 5, //问卷筛查labelType=5
|
|
@ -246,19 +272,71 @@
|
|
|
smoke: '',
|
|
|
hypertension: '',
|
|
|
diabetes: '',
|
|
|
|
|
|
noswitch: httpData['noswitch']
|
|
|
questionList: [],
|
|
|
noswitch: httpData['noswitch'],
|
|
|
dictData: [
|
|
|
{
|
|
|
name: 'obScreen_isMerge',
|
|
|
field: 'isMerge'
|
|
|
},
|
|
|
{
|
|
|
name: 'obScreen_eduState',
|
|
|
field: 'eduState'
|
|
|
},
|
|
|
{
|
|
|
name: 'obScreen_jobState',
|
|
|
field: 'jobState'
|
|
|
},
|
|
|
{
|
|
|
name: 'obScreen_ksDrugName1',
|
|
|
field: 'ksDrugName1'
|
|
|
}
|
|
|
],
|
|
|
answer: {},
|
|
|
progress1: 0
|
|
|
},
|
|
|
mounted: function () {
|
|
|
// if (this.screeningType != '6bcd306aaafb4e4381071346d86fadbb1') {
|
|
|
this.getHealth()
|
|
|
// console.log(123456);
|
|
|
var vm = this
|
|
|
|
|
|
// }
|
|
|
this.getQuestion()
|
|
|
this.getDoctorInfo()
|
|
|
if (this.screeningType == 'aa9bd609fd8b492296f6a34849b76520') this.getDictData()
|
|
|
else {
|
|
|
this.getHealth()
|
|
|
this.getQuestion()
|
|
|
this.getDoctorInfo()
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
getDictData() {
|
|
|
this.questionList = questionList
|
|
|
this.answer = {
|
|
|
belongCommunity: docInfo.hospitalName,
|
|
|
doctorName: docInfo.name,
|
|
|
doctorPhoneNo: docInfo.mobile,
|
|
|
userName: this.screeningResidentsName,
|
|
|
idNoType: '身份证',
|
|
|
idNo: this.idCard,
|
|
|
phoneNo: this.mobile,
|
|
|
age: this.age,
|
|
|
sex: this.sex,
|
|
|
ksDrugName1: []
|
|
|
}
|
|
|
var vm = this
|
|
|
this.dictData.forEach(function (item) {
|
|
|
jbscAPI.getDictDataByName(item.name).then(function (res) {
|
|
|
var index = vm.questionList.findIndex(function (el) {
|
|
|
return el.field == item.field
|
|
|
})
|
|
|
vm.questionList[index].options = res.list.map(function (el) {
|
|
|
return {
|
|
|
label: el.value,
|
|
|
value: el.code
|
|
|
}
|
|
|
})
|
|
|
|
|
|
vm.$forceUpdate()
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
getInitData() {
|
|
|
var vm = this
|
|
|
httpRequest.get('doctor/screen/physicalList', { data: { patient: vm.screeningResidents } }).then(function (res) {
|
|
@ -316,7 +394,6 @@
|
|
|
vm.selectItem(vm.questions[i].question, vm.questions[i].option[Number(index)])
|
|
|
}
|
|
|
if (vm.questions[i].question.title == '缺血性脑卒中病史' && data.CerebralIschemicStroke) {
|
|
|
console.log('缺血性脑卒中病史', vm.questions[i], data.CerebralIschemicStroke)
|
|
|
var index = data.CerebralIschemicStroke == 1 ? 0 : data.CerebralIschemicStroke == 2 ? 1 : ''
|
|
|
vm.selectItem(vm.questions[i].question, vm.questions[i].option[Number(index)])
|
|
|
}
|
|
@ -325,7 +402,6 @@
|
|
|
vm.selectItem(vm.questions[i].question, vm.questions[i].option[index])
|
|
|
}
|
|
|
if (vm.questions[i].question.title == '糖尿病' && data.Diabetes) {
|
|
|
console.log('vm.questions[i]', vm.questions[i])
|
|
|
var index = data.Diabetes == 1 ? 0 : data.Diabetes == 2 ? 1 : ''
|
|
|
vm.selectItem(vm.questions[i].question, vm.questions[i].option[Number(index)])
|
|
|
}
|
|
@ -644,7 +720,6 @@
|
|
|
}
|
|
|
jbscAPI.getAllQuestions(data).then(function (res) {
|
|
|
if (res.status == 200) {
|
|
|
// 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') {
|
|
@ -762,7 +837,6 @@
|
|
|
.then(function (res) {
|
|
|
if (res.status == 200) {
|
|
|
var data = res.medical_detail
|
|
|
console.log(data, 'data')
|
|
|
|
|
|
for (var i in vm.questions) {
|
|
|
if (vm.questions[i].question.thirdKey == 'height') {
|
|
@ -892,21 +966,38 @@
|
|
|
v.content = new Date(v.content).format('yyyy-MM-dd HH:mm')
|
|
|
}
|
|
|
})
|
|
|
var data = {
|
|
|
patientCode: vm.screeningResidents,
|
|
|
labelType: vm.labelType,
|
|
|
isAgain: vm.isAgain,
|
|
|
source: 1,
|
|
|
surveyStatus: vm.surveyStatus,
|
|
|
jsonData: JSON.stringify({
|
|
|
surveyCode: vm.screeningType,
|
|
|
questions: vm.selectArr
|
|
|
})
|
|
|
var data
|
|
|
if (vm.screeningType == 'aa9bd609fd8b492296f6a34849b76520') {
|
|
|
var formData = JSON.parse(JSON.stringify(this.answer))
|
|
|
formData.ksDrugName1 = (formData.ksDrugName1 ?? []).join(',')
|
|
|
data = {
|
|
|
patientCode: vm.screeningResidents,
|
|
|
labelType: vm.labelType,
|
|
|
isAgain: vm.isAgain,
|
|
|
source: 1,
|
|
|
jsonData: JSON.stringify({
|
|
|
surveyCode: vm.screeningType,
|
|
|
surveyData: formData
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
|
data = {
|
|
|
patientCode: vm.screeningResidents,
|
|
|
labelType: vm.labelType,
|
|
|
isAgain: vm.isAgain,
|
|
|
source: 1,
|
|
|
surveyStatus: vm.surveyStatus,
|
|
|
jsonData: JSON.stringify({
|
|
|
surveyCode: vm.screeningType,
|
|
|
questions: vm.selectArr
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
jbscAPI.saveAnswer(data).then(function (res) {
|
|
|
top.layer.close(loadding)
|
|
|
if (res.status == 200) {
|
|
|
if (vm.questions[1].isThird == 3) {
|
|
|
if (vm.screeningType == 'aa9bd609fd8b492296f6a34849b76520' || vm.questions[1].isThird == 3) {
|
|
|
top.layer.open({
|
|
|
type: 2,
|
|
|
// offset: ['100px'], //右下角弹出
|
|
@ -984,6 +1075,56 @@
|
|
|
watch: {
|
|
|
screeningType: function () {
|
|
|
$('.daan-list input').attr('checked', false)
|
|
|
},
|
|
|
answer: {
|
|
|
handler(nv) {
|
|
|
var vm = this
|
|
|
if (nv.isFuyongks) {
|
|
|
var obj = this.questionList.find(function (el) {
|
|
|
return el.field == 'ksDrugName1'
|
|
|
})
|
|
|
obj.required = nv.isFuyongks == 1 ? true : false
|
|
|
}
|
|
|
if (nv.isEndoscopy) {
|
|
|
var obj1 = this.questionList.find(function (el) {
|
|
|
return el.field == 'endoscopyTime'
|
|
|
})
|
|
|
var obj2 = this.questionList.find(function (el) {
|
|
|
return el.field == 'endoscopyResult'
|
|
|
})
|
|
|
var obj3 = this.questionList.find(function (el) {
|
|
|
return el.field == 'endoscopyHospitalName'
|
|
|
})
|
|
|
obj1.required = nv.isEndoscopy == 1 ? true : false
|
|
|
obj2.required = nv.isEndoscopy == 1 ? true : false
|
|
|
obj3.required = nv.isEndoscopy == 1 ? true : false
|
|
|
}
|
|
|
|
|
|
var all = 0
|
|
|
var have = 0
|
|
|
this.questionList.forEach(function (item) {
|
|
|
if (item.required) {
|
|
|
all++
|
|
|
if (item.field == 'ksDrugName1' && vm.answer.ksDrugName1 && vm.answer.ksDrugName1.length > 0) {
|
|
|
have++
|
|
|
} else if (item.field != 'ksDrugName1' && vm.answer[item.field]) {
|
|
|
have++
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
|
|
|
var progress = Math.floor((have / all) * 100)
|
|
|
if (progress != vm.progress1) {
|
|
|
vm.$refs.progress.dataFunction(progress)
|
|
|
vm.progress1 = progress
|
|
|
}
|
|
|
if (progress == 100) {
|
|
|
vm.progress = progress
|
|
|
}
|
|
|
|
|
|
this.$forceUpdate()
|
|
|
},
|
|
|
deep: true
|
|
|
}
|
|
|
}
|
|
|
})
|