1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8" />
- <title>筛选类型</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <meta name="renderer" content="webkit" />
- <meta http-equiv="Cache-Control" content="no-siteapp" />
- <meta name="keywords" content="筛选类型" />
- <meta name="description" content="筛选类型" />
- <link rel="shortcut icon" href="../../../favicon.ico" />
- <link rel="stylesheet" type="text/css" href="../../../css/bootstrap.min.css" />
- <link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
- <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>
- <div class="flex-box-item ptb20">
- <!--<div class="prompt-text">请认真填写本页面,方便医生进行综合评估【厦门i健康】</div>-->
- <div class="single-choice-question">
- <div class="question-title">问卷题目</div>
- <div class="question-content">
- <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">
- <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?'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?'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?'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?'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=='smoke'">
- <input
- :type="qst.questionType==1?'checkbox':'radio'"
- :checked="opt.thirdValue == smoke"
- 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=='isCkd34'">
- <input
- :type="qst.questionType==1?'checkbox':'radio'"
- :checked="opt.thirdValue == isCkd34"
- 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=='diabetes'">
- <input
- :type="qst.questionType==1?'checkbox':'radio'"
- :checked="opt.thirdValue == diabetes"
- 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=='hypertension'">
- <input
- :type="qst.questionType==1?'checkbox':'radio'"
- :checked="opt.thirdValue == hypertension"
- 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?'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!='smoke'&&qst.question.thirdKey!='isCkd34'&&qst.question.thirdKey!='hypertension'&&qst.question.thirdKey!='diabetes'&&qst.question.thirdKey!='seriousMedicalHistory'">
- <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')||(qst.question.thirdKey == 'createDate'&&screeningTitle=='大肠癌筛查问卷(OB筛查)')||(qst.question.thirdKey == 'createDate'&&screeningTitle=='脑卒中风险评估(冠心病、脑卒中、肾病)')">
- <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'||(!shaowas&&qst.question.thirdKey == 'bmi'))">
- <textarea class="wenjuan-textarea" disabled rows="2" v-model="qst.question.content"></textarea>
- </div>
- <div class="daan-list" v-else-if="qst.question.thirdKey != 'bmi'">
- <textarea class="wenjuan-textarea" @keyup="changeContent(qst.question,qst.question.content,1)" @four rows="2" v-model="qst.question.content"></textarea>
- </div>
- <div class="daan-list" v-if="(shaowas&&qst.question.thirdKey == 'bmi')">
- <textarea class="wenjuan-textarea" disabled rows="2" v-model="shaowas"></textarea>
- </div>
- </template>
- </div>
- </li>
- </ul>
- </div>
- </div>
- </div>
- <div class="w-250">
- <div class="base-info">
- <p class="f-16 mb0">基本信息</p>
- <div :class="`flex-box ${noswitch?'':'right-triangle'}`">
- <span class="w-70">类型</span>
- <a class="flex-box-item" :alt="screeningTitle" v-text="screeningTitle" @click="goBack">--</a>
- </div>
- <div :class="`flex-box ${noswitch?'':'right-triangle'}`">
- <span class="w-70">对象</span>
- <a class="flex-box-item" :alt="screeningResidentsName" v-text="screeningResidentsName" @click="goBack(1)">--</a>
- </div>
- <div class="flex-box">
- <span class="w-70">筛查人员</span>
- <div class="flex-box-item c-999" v-text="doctorInfo.name"></div>
- </div>
- <div class="flex-box" style="align-items: flex-start">
- <span class="w-70">体征记录</span>
- <div class="flex-box-item" v-if="tizhongRecord.value1 || tizhongRecord.value2">
- <p v-if="tizhongRecord.value1">
- 体重
- <input type="number" step="0.1" readonly="readonly" :value="tizhongRecord.value1" />
- kg
- </p>
- <p class="mb0" v-if="tizhongRecord.value2">
- 身高
- <input type="number" step="0.1" readonly="readonly" :value="tizhongRecord.value2" />
- cm
- </p>
- </div>
- <div class="flex-box-item" v-else>暂无体征</div>
- </div>
- </div>
- <div class="completion-of-progress">
- <p class="f16 mb0">完成情况</p>
- <div class="canvas-box">
- <canvas-progress :progress="progress" ref="progress"></canvas-progress>
- <p class="progress-number">
- <span>已完成</span>
- </p>
- </div>
- </div>
- <div class="btn-group-bottom">
- <button class="btn submit-btn" @click="save">提交</button>
- <button class="btn btn-exit" @click="signOut">退出</button>
- </div>
- </div>
- </div>
- <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>
- <script type="text/javascript" src="../../../plugins/layer/layer.min.js"></script>
- <script src="../../../js/util.js" type="text/javascript" charset="utf-8"></script>
- <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'))
- var question = new Vue({
- el: '#app',
- data: {
- //数据结果
- progress: 0,
- selectArr: [],
- screeningTitle: decodeURI(httpData['fliter_title']),
- screeningType: httpData['fliter_code'],
- screeningResidents: httpData['resident_code'],
- screeningResidentsName: decodeURI(httpData['resident_name']),
- sex: decodeURI(httpData['sex']),
- age: decodeURI(httpData['age']),
- doctorInfo: { code: docInfo.code },
- surveyStatus: httpData['surveyStatus'] || '',
- idCard: httpData['idcard'],
- mobile: httpData['mobile'],
- questions: [],
- tizhongRecord: {},
- labelType: 5, //问卷筛查labelType=5
- isAgain: httpData['isAgain'] || 0,
- ascvdShow: '',
- ascvdS1: '',
- ascvdS2: '',
- ascvdS3: '',
- ascvdS4: '',
- shaowas: '',
- smoke: '',
- isCkd34: '',
- hypertension: '',
- diabetes: '',
- 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 () {
- var vm = this
- if (this.screeningType == 'aa9bd609fd8b492296f6a34849b76520') this.getDictData()
- else {
- this.getHealth()
- this.getQuestion()
- }
- this.getDoctorInfo()
- },
- methods: {
- getDictData() {
- var vm = this
- httpRequest.post('doctor/patient_label_info/patient', { data: { patient: this.screeningResidents } }).then(function (res) {
- // vm.patientInfo = res.data
- var data = res.data
- vm.answer = {
- belongCommunity: docInfo.hospitalName,
- doctorName: docInfo.name,
- doctorPhoneNo: docInfo.mobile,
- userName: data.name,
- idNoType: '身份证',
- idNo: data.idcard,
- phoneNo: data.mobile,
- age: data.age,
- sex: data.sex + '',
- hujiAddress: data.address,
- hujiAddressJiedao: data.address,
- juzhuAddress: data.address,
- juzhuAddressJiedao: data.address,
- ksDrugName1: [],
- createDate: new Date().format('yyyy-MM-dd hh:mm:ss')
- }
- })
- this.questionList = questionList
- 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) {
- var data = res.data
- if (res.status == 200 && data) {
- for (var i in vm.questions) {
- if (vm.questions[i].question.thirdKey == 'height' && data.height) {
- vm.questions[i].question.content = data.height + ''
- vm.changeContent(vm.questions[i].question, data.height + '')
- }
- if (vm.questions[i].question.thirdKey == 'weight' && data.weight) {
- vm.questions[i].question.content = data.weight + ''
- vm.changeContent(vm.questions[i].question, data.weight + '')
- }
- if (vm.questions[i].question.thirdKey == 'bmi') {
- if (data.height && data.weight) {
- var w = data.weight
- var h = data.height / 100
- var s = (w / (h * h)).toFixed(2)
- vm.questions[i].question.content = s
- vm.shaowas = s
- vm.changeContent(vm.questions[i].question, s + '')
- } else {
- vm.questions[i].question.content = ''
- vm.shaowas = ''
- vm.changeContent(vm.questions[i].question, '')
- }
- }
- if (vm.questions[i].question.thirdKey == 'systolicPressure' && data.systolicPressure) {
- vm.questions[i].question.content = data.systolicPressure + ''
- vm.changeContent(vm.questions[i].question, data.systolicPressure + '')
- }
- if (vm.questions[i].question.thirdKey == 'diastolicPressure' && data.diastolicPressure) {
- vm.questions[i].question.content = data.diastolicPressure + ''
- vm.changeContent(vm.questions[i].question, data.diastolicPressure + '')
- }
- if (vm.questions[i].question.thirdKey == 'totalCholesterol' && data.totalCholesterol) {
- vm.questions[i].question.content = data.totalCholesterol + ''
- vm.changeContent(vm.questions[i].question, data.totalCholesterol + '')
- }
- if (vm.questions[i].question.thirdKey == 'hdlc' && data.HDL) {
- vm.questions[i].question.content = data.HDL + ''
- vm.changeContent(vm.questions[i].question, data.HDL + '')
- }
- if (vm.questions[i].question.thirdKey == 'ldlc' && data.LDL) {
- vm.questions[i].question.content = data.LDL + ''
- vm.changeContent(vm.questions[i].question, data.LDL + '')
- }
- // if (vm.questions[i].question.thirdKey == 'ckd34' && data.height) {
- // vm.questions[i].question.content = data.height + ''
- // vm.changeContent(vm.questions[i].question, data.LDL + '')
- // }
- if (vm.questions[i].question.title == '既往有心肌梗死病史' && data.AMI) {
- var index = data.AMI == 1 ? 0 : data.AMI == 2 ? 1 : ''
- vm.selectItem(vm.questions[i].question, vm.questions[i].option[Number(index)])
- }
- if (vm.questions[i].question.title == '缺血性脑卒中病史' && data.CerebralIschemicStroke) {
- var index = data.CerebralIschemicStroke == 1 ? 0 : data.CerebralIschemicStroke == 2 ? 1 : ''
- vm.selectItem(vm.questions[i].question, vm.questions[i].option[Number(index)])
- }
- if (vm.questions[i].question.title == '高血压' && data.hypertension) {
- var index = data.hypertension == 1 ? 0 : data.hypertension == 2 ? 1 : ''
- vm.selectItem(vm.questions[i].question, vm.questions[i].option[index])
- }
- if (vm.questions[i].question.title == '糖尿病' && data.Diabetes) {
- var index = data.Diabetes == 1 ? 0 : data.Diabetes == 2 ? 1 : ''
- vm.selectItem(vm.questions[i].question, vm.questions[i].option[Number(index)])
- }
- if (vm.questions[i].question.title == '吸烟' && (data.smoke || data.smoke == 0)) {
- var index = data.smoke == 1 ? 0 : data.smoke == 0 ? 1 : ''
- vm.selectItem(vm.questions[i].question, vm.questions[i].option[Number(index)])
- }
- }
- vm.$forceUpdate()
- }
- httpRequest.get('doctor/screen/checkUpList', { data: { patient: vm.screeningResidents } }).then(function (res) {
- var obj = res.data
- if (res.status == 200 && obj) {
- for (var i in vm.questions) {
- if (vm.questions[i].question.thirdKey == 'hdlc' && !vm.questions[i].question.content) {
- vm.questions[i].question.content = obj.hdlc
- vm.changeContent(vm.questions[i].question, obj.hdlc)
- }
- if (vm.questions[i].question.thirdKey == 'ldlc' && !vm.questions[i].question.content) {
- vm.questions[i].question.content = obj.ldlc
- vm.changeContent(vm.questions[i].question, obj.ldlc + '')
- }
- if (vm.questions[i].question.thirdKey == 'totalCholesterol' && !vm.questions[i].question.content) {
- vm.questions[i].question.content = obj.totalCholesterol
- vm.changeContent(vm.questions[i].question, obj.totalCholesterol + '')
- }
- if (vm.questions[i].question.thirdKey == 'diastolicPressure' && !vm.questions[i].question.content) {
- vm.questions[i].question.content = obj.diastolicPressure
- vm.changeContent(vm.questions[i].question, obj.diastolicPressure + '')
- }
- if (vm.questions[i].question.thirdKey == 'systolicPressure' && !vm.questions[i].question.content) {
- vm.questions[i].question.content = obj.systolicPressure
- vm.changeContent(vm.questions[i].question, obj.systolicPressure + '')
- }
- }
- }
- // var data = res.data
- // if (!vm.form.totalCholesterol) {
- // vm.form.totalCholesterol = data.totalCholesterol
- // }
- // if (!vm.form.hdlc) {
- // vm.form.hdlc = data.hdlc
- // }
- // if (!vm.form.ldlc) {
- // vm.form.ldlc = data.ldlc
- // }
- // if (!vm.form.systolicPressure) {
- // vm.form.systolicPressure = data.systolicPressure
- // }
- // if (!vm.diastolicPressure) {
- // vm.form.diastolicPressure = data.diastolicPressure
- // }
- vm.$forceUpdate()
- })
- })
- },
- getDoctorInfo: function () {
- var vm = this
- var data = {
- code: vm.doctorInfo.code
- }
- jbscAPI.doctorBaseinfo(data).then(function (res) {
- if (res.status == 200) {
- vm.doctorInfo = res.data
- } else {
- top.layer.msg(res.msg, { icon: 5 })
- }
- })
- },
- //计算选中个数,组装成后台接收格式
- 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
- }
- }
- var data = {
- qstCode: qst.code,
- type: qst.questionType,
- content: qst.content,
- thirdKey: qst.thirdKey
- }
- var options = []
- var ls = []
- var lsTo = []
- if (select) {
- 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()
- 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]
- var v = this.questions[i].question
- ls.push({
- qstCode: v.code,
- type: v.questionType,
- thirdKey: v.thirdKey,
- options: [
- {
- optionCode: s.code,
- comment: s.content,
- score: s.score,
- thirdKey: s.thirdKey,
- thirdValue: s.thirdValue
- }
- ]
- })
- }
- }
- 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
- }
- if (select.thirdKey == 'smoke') {
- vm.smoke = select.thirdValue
- }
- if (select.thirdKey == 'isCkd34') {
- vm.isCkd34 = select.thirdValue
- console.log('kkkkkkkkkkkkkkkkkkkkkkkkkk88888888888',select)
- }
- if (select.thirdKey == 'hypertension') {
- vm.hypertension = select.thirdValue
- }
- if (select.thirdKey == 'diabetes') {
- vm.diabetes = select.thirdValue
- }
- }
- if ((num && qst.thirdKey == 'weight') || qst.thirdKey == 'height') {
- var weight = ''
- var height = ''
- for (var i in vm.questions) {
- if (vm.questions[i].question.thirdKey == 'weight') {
- weight = vm.questions[i].question.content
- }
- if (vm.questions[i].question.thirdKey == 'height') {
- height = vm.questions[i].question.content
- }
- }
- var w = qst.thirdKey == 'weight' ? qst.content : weight
- var h = qst.thirdKey == 'height' ? qst.content : height / 100
- var s = (w / (h * h)).toFixed(2)
- vm.selectArr.forEach(function (v, i) {
- if (v.thirdKey == 'bmi') {
- vm.selectArr.splice(i, 1)
- }
- })
- for (var i in vm.questions) {
- if (vm.questions[i].question.thirdKey == 'bmi') {
- lsTo.push({
- qstCode: vm.questions[i].question.code,
- type: vm.questions[i].question.questionType,
- content: s,
- thirdKey: vm.questions[i].question.thirdKey,
- options: []
- })
- vm.shaowas = s
- // if(w && h) {
- // vm.shaowas = s
- // }
- // console.log(vm.questions[i].question.content,"0809")
- // vm.questions[i].question.content = ''
- // console.log(vm.questions[i].question.content,"00000---")
- }
- }
- }
- 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(lsTo)
- 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
- 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层的索引
- var current = top.layer.confirm(
- '问卷还未提交,确定要关闭?',
- {
- btn: ['关闭', '取消'] //按钮
- },
- function () {
- top.layer.closeAll() //再执行关闭
- },
- function () {
- top.layer.close(current) //再执行关闭
- }
- )
- },
- changeContent: function (qst, content, num) {
- if (!content) return
- this.selectItem(qst, '', num)
- },
- getQuestion: function () {
- var vm = this
- var data = {
- surveyTemplateCode: vm.screeningType
- }
- jbscAPI.getAllQuestions(data).then(function (res) {
- if (res.status == 200) {
- 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()
- }
- 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
- }
- }
- 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'
- 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])
- }
- }
- vm.questions = res.data
- for (var i in res.data) {
- if (res.data[i].isThird == 3) {
- if (res.data[i].question.thirdKey == 'assessTime') {
- vm.changeContent(res.data[i].question, new Date().format('yyyy-MM-dd HH:mm'))
- }
- 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])
- }
- }
- }
- vm.$forceUpdate()
- }
- })
- },
- getHealth: function () {
- var vm = this
- jbscAPI
- .listMedical({
- patient: vm.screeningResidents,
- pageIndex: 1,
- pageSize: 1
- })
- .then(function (v) {
- if (v.status == 200) {
- if (v.list[0]) {
- jbscAPI
- .findMedicalDetail({
- medicalNo: v.list[0].medicalNo
- })
- .then(function (res) {
- if (res.status == 200) {
- var data = res.medical_detail
- for (var i in vm.questions) {
- if (vm.questions[i].question.thirdKey == 'height') {
- vm.questions[i].question.content = data.height
- vm.changeContent(vm.questions[i].question, data.height)
- }
- if (vm.questions[i].question.thirdKey == 'weight') {
- vm.questions[i].question.content = data.weight
- vm.changeContent(vm.questions[i].question, data.weight)
- }
- if (vm.questions[i].question.thirdKey == 'bmi') {
- if (data.height && data.weight) {
- var w = data.weight
- var h = data.height / 100
- var s = (w / (h * h)).toFixed(2)
- vm.questions[i].question.content = s
- vm.shaowas = s
- vm.changeContent(vm.questions[i].question, s)
- }
- }
- if (vm.questions[i].question.thirdKey == 'systolicPressure') {
- vm.questions[i].question.content = data.bloodPressureRigthU
- vm.changeContent(vm.questions[i].question, data.bloodPressureRigthU)
- }
- if (vm.questions[i].question.thirdKey == 'diastolicPressure') {
- 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)
- }
- if (vm.questions[i].question.thirdKey == 'ckd34') {
- if (data.renalFunctionCreatinine) {
- var ckd34 = (((140 - vm.age) * data.weight) / (0.818 * data.renalFunctionCreatinine)).toFixed(2)
- vm.questions[i].question.content = ckd34
- vm.selectItem(vm.questions[i - 1].question, vm.questions[i - 1].option[0])
- vm.changeContent(vm.questions[i].question, ckd34)
- } else {
- vm.selectItem(vm.questions[i - 1].question, vm.questions[i - 1].option[1])
- // vm.questions[i].question.content = '1'
- vm.changeContent(vm.questions[i].question, '1')
- vm.questions[i].question.content = ''
- }
- }
- }
- if (vm.screeningType == '6bcd306aaafb4e4381071346d86fadbb1') {
- // 如果是ascvd筛查再调用第三方接口
- vm.getInitData()
- }
- }
- })
- vm.$forceUpdate()
- } else {
- var data = {
- patient: vm.screeningResidents
- }
- jbscAPI.getHealth(data).then(function (res) {
- if (res.status == 200) {
- 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)
- }
- if (vm.questions[i].question.thirdKey == 'systolicPressure') {
- vm.questions[i].question.content = res.data.xy.value1
- vm.changeContent(vm.questions[i].question, res.data.xy.value1)
- }
- if (vm.questions[i].question.thirdKey == 'diastolicPressure') {
- vm.questions[i].question.content = res.data.xy.value2
- vm.changeContent(vm.questions[i].question, res.data.xy.value2)
- }
- if (vm.questions[i].question.thirdKey == 'bmi') {
- if (vm.tizhongRecord.value2 && vm.tizhongRecord.value1) {
- var w = vm.tizhongRecord.value1
- var h = vm.tizhongRecord.value2 / 100
- var s = (w / (h * h)).toFixed(2)
- vm.questions[i].question.content = s
- vm.shaowas = s
- vm.changeContent(vm.questions[i].question, s)
- }
- }
- }
- } else {
- top.layer.msg(res.msg, { icon: 5 })
- }
- vm.$forceUpdate()
- })
- }
- }
- })
- },
- save: function () {
- var vm = this
- var flag=0
- if (vm.progress != 100) {
- top.layer.msg('问卷还未全部填写', { icon: 5 })
- return
- }
- vm.selectArr.forEach(function (v) {
- if (v.thirdKey == 'assessTime') {
- v.content = new Date(v.content).format('yyyy-MM-dd HH:mm')
- }
- if (v.thirdKey == 'isCkd34') {
- if (v.options[0].thirdValue == '0') {
- vm.selectArr.forEach(function (it) {
- if (it.thirdKey == 'ckd34') {
- it.content = ''
- }
- })
- }
- if (v.options[0].thirdValue == '1') {
-
- vm.selectArr.forEach(function (it) {
- if (it.thirdKey == 'ckd34'&&(typeof it.content == "undefined"||it.content =='')) {
- flag=1
- }
- })
-
- }
- }
- })
- if(flag){
- top.layer.msg('问卷还未全部填写', { icon: 5 })
- return
- }
- var loadding = top.layer.load(0, { shade: false }) //0代表加载的风格,支持0-2
- 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.screeningType == 'aa9bd609fd8b492296f6a34849b76520' || 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 })
- }
- })
- },
- // 返回选择居民或者问卷类型
- goBack: function (number) {
- if (this.noswitch) {
- return
- }
- var vm = this
- if (vm.isAgain) {
- var content
- if (number == 1) {
- content = '再次筛查无法选择居民'
- } else {
- content = '再次筛查无法选择问卷类型'
- }
- top.layer.msg(content, { icon: 5 })
- return
- }
- var content = '../../jbsc/html/filter_type.html?isReLoad=1'
- if (number === 1) {
- //选择居民
- content += '&goDenizen=1&fliter_code=' + vm.screeningType + '&fliter_title=' + vm.screeningTitle
- }
- layer.open({
- type: 2,
- offset: 'rb', //右下角弹出
- id: 'filter_type',
- background: 'transparent',
- area: ['280px', '100%'],
- shade: 0.5,
- title: false,
- fixed: true, //不固定
- maxmin: false,
- closeBtn: 0,
- shift: 5,
- shadeClose: true, //点击遮罩关闭层
- content: content
- })
- }
- },
- 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
- }
- }
- })
- </script>
- </body>
- </html>
|