123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- <!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" />
- </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)">
- <span class="pull-right" v-text="(opt.score || 0)+'分'"></span>
- <input :type="qst.questionType==1?'checked':'radio'" :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')" value="1" /><i></i><span v-text="opt.content"></span>
- </lable>
- </div>
- <div class="daan-list" v-else>
- <textarea class="wenjuan-textarea" @keyup="changeContent(qst.question,qst.question.content)" rows="2" v-model="qst.question.content"></textarea>
- </div>
- </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"></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="../../../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 wlyyAgentForDoc=JSON.parse(window.localStorage.getItem('wlyyAgentForDoc'));
- 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']),
- doctorInfo:{code:wlyyAgentForDoc.uid},
- questions:[],
- tizhongRecord:{},
- labelType:5,//问卷筛查labelType=5
- isAgain:(httpData['isAgain'] || 0),
- },
- mounted: function(){
- this.getQuestion();
- this.getHealth();
- 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){
- console.log("selectItem");
- var data={
- qstCode:qst.code,
- type:qst.questionType,
- content:qst.content,
- }
- var options=[];
- if(select){
- options=[{
- optionCode:select.code,
- comment:select.content,
- score:select.score
- }]
- }
- data.options=options;
- var oldLen = this.selectArr.length;
- this.selectArr = _.filter(this.selectArr,function(o) {
- return o.qstCode !=data.qstCode;
- }) || [];
- this.selectArr.push(data);
- var len=this.selectArr.length;
- // var questions=Object.values(this.questions)
- var questions = _.toArray(this.questions)
- var allLen=questions.length;
- var progress=len===allLen?100:((len/allLen)*100);
- this.progress=progress;
- },
- 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){
- if(!content) return ;
- this.selectItem(qst)
- },
- getQuestion:function(){
- var vm=this
- var data={
- surveyTemplateCode: vm.screeningType
- }
- jbscAPI.getAllQuestions(data).then(function(res){
- if(res.status==200){
- var questions = res.data;
- vm.questions = questions
- }
- })
- },
- getHealth:function(){
- var vm=this;
- 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";
- }) || {};
- } else {
- top.layer.msg(res.msg, {icon: 5});
- }
-
- })
- },
- save:function(){
- var vm=this;
- if(vm.progress!=100){
- top.layer.msg('问卷还未全部填写', {icon: 5});
- return ;
- }
- var loadding = top.layer.load(0, {shade: false}); //0代表加载的风格,支持0-2
- var data={
- patientCode:vm.screeningResidents,
- labelType:vm.labelType,
- isAgain:vm.isAgain,
- source:1,
- jsonData:JSON.stringify({
- surveyCode:vm.screeningType,
- questions:vm.selectArr
- })
- }
- jbscAPI.saveAnswer(data).then(function(res){
- top.layer.close(loadding);
- if(res.status == 200) {
- top.layer.open({
- type: 2,
- area: ['820px', '648px'],
- shade: 0.5,
- title: '筛选统计',
- fixed: true, //不固定
- maxmin: true,
- closeBtn:1,
- shift: 5,
- shadeClose: false, //点击遮罩关闭层
- content: '../../jbsc/html/filter_result.html?code='+res.data+'&filter_type='+vm.screeningType
- });
- var index = top.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- top.layer.close(index); //再执行关闭
- } 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>
|