123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751 |
- <!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">
- <ul class="question-list">
- <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=='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!='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)" 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 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 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">
- 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']||'',
- questions:[],
- tizhongRecord:{},
- labelType:5,//问卷筛查labelType=5
- isAgain:(httpData['isAgain'] || 0),
- ascvdShow:'',
- ascvdS1:'',
- ascvdS2:'',
- ascvdS3:'',
- ascvdS4:'',
- shaowas:'',
- },
- mounted: function(){
- console.log('screeningTitle',this.screeningTitle)
- this.getHealth();
- this.getQuestion();
- this.getDoctorInfo()
- },
- methods: {
- 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(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;
- console.log('111111111111xsssssssss')
- 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);
-
- console.log(this.selectArr,'this.selectArr')
- 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){
- // 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()
- }
- 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'
- 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') {
- 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'
- console.log('------111111000000000',res.data[i].question,res.data[i].option[index])
- vm.selectItem(res.data[i].question,res.data[i].option[index])
- }
- }
- }
- }
- })
- },
- 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)
- }
- }
-
- }
- })
- }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});
- }
-
- })
- }
- }
- })
- },
- save:function(){
- console.log('2222221sssssssssssssssss',this.selectArr)
- var vm=this;
- if(vm.progress!=100){
- top.layer.msg('问卷还未全部填写', {icon: 5});
- return ;
- }
- var loadding = top.layer.load(0, {shade: false}); //0代表加载的风格,支持0-2
- vm.selectArr.forEach(function(v){
- if(v.thirdKey == "assessTime") {
- 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
- })
- }
- jbscAPI.saveAnswer(data).then(function(res){
- top.layer.close(loadding);
- if(res.status == 200) {
- 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});
- }
-
- })
- },
- // 返回选择居民或者问卷类型
- goBack:function(number){
- 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)
- },
- }
- })
- </script>
- </body>
- </html>
|