Bladeren bron

康复计划服务项确认操作 新增随访计划页面

yht2016 5 jaren geleden
bovenliggende
commit
15017f3a6d
34 gewijzigde bestanden met toevoegingen van 2816 en 679 verwijderingen
  1. 22 0
      api/followup_api.js
  2. 16 0
      api/rehabilitation-api.js
  3. 106 0
      app/followup/css/followup_newplan.css
  4. 202 0
      app/followup/html/followup_newplan.html
  5. BIN
      app/followup/image/shanchujihua_icon.png
  6. BIN
      app/followup/image/tianjia_icon.png
  7. 430 0
      app/followup/js/followup_newplan.js
  8. 4 6
      app/recover/html/medical-records.html
  9. 0 1
      app/recover/html/new_recover.html
  10. 18 5
      app/recover/html/personal-manage.html
  11. 3 1
      app/rehabilitation/css/guide_the_message.css
  12. 367 0
      app/rehabilitation/css/rehabilitation_guidance.css
  13. 54 0
      app/rehabilitation/css/rehabilitation_guidance_preview.css
  14. 3 1
      app/rehabilitation/css/service_item_content.css
  15. 49 19
      app/rehabilitation/html/guide_the_message.html
  16. 47 0
      app/rehabilitation/html/rehabilitation_guidance.html
  17. 43 0
      app/rehabilitation/html/rehabilitation_guidance_preview.html
  18. 1 1
      app/rehabilitation/html/rehabilitation_management.html
  19. 47 17
      app/rehabilitation/html/service_item_content.html
  20. BIN
      app/rehabilitation/images/arrow_icon.png
  21. BIN
      app/rehabilitation/images/shouji_bg_img.682f0e93.png
  22. 457 318
      app/rehabilitation/js/guide_the_message.js
  23. 54 0
      app/rehabilitation/js/rehabilitation_guidance.js
  24. 58 0
      app/rehabilitation/js/rehabilitation_guidance_preview.js
  25. 38 11
      app/rehabilitation/js/rehabilitation_management.js
  26. 456 299
      app/rehabilitation/js/service_item_content.js
  27. 83 0
      component/rehabilitation/guidance-template-panel.js
  28. 24 0
      component/rehabilitation/index-page2.js
  29. 75 0
      component/rehabilitation/nav-tab.js
  30. 157 0
      component/rehabilitation/temp-send-panel.js
  31. 1 0
      plugins/element-ui/element-ui.css
  32. 1 0
      plugins/element-ui/element-ui.js
  33. BIN
      plugins/element-ui/fonts/element-icons.ttf
  34. BIN
      plugins/element-ui/fonts/element-icons.woff

+ 22 - 0
api/followup_api.js

@ -0,0 +1,22 @@
(function(exports) {
    var followUpAPI = {
        /**
         * @api {POST} /doctor/patient_label_info/patient
         * @apiVersion 0.0.1
         * @param {string} patient 居民code
         * @desc 获取居民各详细信息
         */
        getPatientInfo(data) {
            return httpRequest.post('/doctor/patient_label_info/patient',{data:data})
        },
        //获得随访医生的列表
        sign_doctors(data){
            return httpRequest.get('/doctor/patient_group/sign_doctors',{data:data})
        },
        //保存随访
        addFollowupPlan(data){
            return httpRequest.post('/doctor/followup/addFollowupPlan',{data:data})
        }, 
	}
    exports.followUpAPI = followUpAPI;
})(window)

+ 16 - 0
api/rehabilitation-api.js

@ -116,6 +116,22 @@
		// 更新居民专科标签(健康情况、疾病类型、自定义分组)
		updatePatientLabelInfo: function(data){
			return httpRequest.get("doctor/patient_label_info/updatePatientLabelInfo", {data: data})
		},
		// 提醒患者
		sendSpecialistWeixinMessage: function(data){
			return httpRequest.get("doctor/specialist/rehabilitation/sendSpecialistWeixinMessage", {data: data})
		},
		// 十大病种列表
		selectType: function(data){
			return httpRequest.get("doctor/specialist/rehabilitation/selectType", {data: data})
		},
		// 康复指导列表
		selectGuidances: function(data){
			return httpRequest.get("doctor/specialist/rehabilitation/selectGuidances", {data: data})
		},
		// 发送康复指导
		sendGuidance: function(data){
			return httpRequest.get("doctor/specialist/rehabilitation/sendGuidance", {data: data})
		}
	}
    exports.rehaAPI = rehaAPI;

+ 106 - 0
app/followup/css/followup_newplan.css

@ -0,0 +1,106 @@
[v-cloak]{display: none;}
.red{color: red !important;}
.hide{display: none;}
img {
    border: 0;
    font-size: 0;
    vertical-align: top;
}
.c-btn, .c-btn-full, .c-btn-large, .c-btn-big, .c-btn-small, .c-btn-tiny, .c-btn-screenful, .c-btn-icon, .c-btn-label, .c-btn-label-l, .c-btn-label-r {
    display: inline-block;
    vertical-align: baseline;
    outline: none;
    cursor: pointer;
    border: 0;
    background: none;
    text-align: center;
    text-decoration: none;
    padding: 12px 34px;
    color: #fff;
    position: relative;
    font: 14px/1 \5FAE\8F6F\96C5\9ED1,tahoma,arial,\5b8b\4f53;
    line-height: normal !important;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
}
.c-btn-12b7f5 {
    background-color: #12b7f5;
    color: #ffffff;
}
.c-btn-f96565 {
    background-color: #f96565;
}
.c-12b7f5 {
    color: #12b7f5;
}
.flex {
    display: -webkit-flex;
    display: -webkit-box;
    display: flex;
}
.f_g_1 {
    -webkit-flex-grow: 1;
    -webkit-box-flex: 1;
    flex-grow: 1;
}
.f_s_0 {
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}
.newPlan{
    background: #ffffff;
    height: calc(100% - 0px); 
}
.newPlan .listDo .f_s_0{
    height: 28px;line-height: 28px;cursor: pointer;
}
.newPlan .listDo .f_s_0:hover{
    color:#12B7F5;
}
.el-form .el-button {
    border-radius: 2px;
    min-width: 80px;
    padding: 0 12px;
    width: 90px;
    height: 34px;
}
.el-form .el-form-item .el-input__inner{
    border-radius: 2px;
    height: 28px;
    line-height: 28px;
}
.el-form .el-form-item .el-form-item__label {
    font-weight: normal;
    line-height: 28px;
    margin-bottom: 0;
}
.el-form-item__content {
    line-height: 28px;
    position: relative;
    font-size: 14px;
}
.el-input__icon{
    line-height: 28px;
}
.pt7{
    padding-top: 7px;
}
#div_items {
    position:absolute;;
    top:198px;
    left: 119px;
    width: 220px;
    height: 170px;
    border: 1px solid #DCDFE6;
    border-top: 0px;
    overflow: auto;
    z-index: 1000;
    border-radius:2%;
    background-color: #fff;
    display: none;
}
.div_item{
    padding: 5px;
    padding-left: 11px;
}

+ 202 - 0
app/followup/html/followup_newplan.html

@ -0,0 +1,202 @@
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>新建随访计划</title>
		<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/style.min.css" />
		<link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
		<link href="../../../plugins/toastr/toastr.min.css" rel="stylesheet">
        <link rel="stylesheet" type="text/css" href="../css/date.css" />
        <link rel="stylesheet" href="../../../plugins/element-ui/element-ui.css" />
		<link rel="stylesheet" href="../css/followup_newplan.css" />
	</head>
	<body>
		<div id="app" v-cloak>
            <div class="newPlan">
                <div class="pt20 pl20 pr15">
                    <el-form ref="form" :model="followUpItem" label-width="100px">          
                        <el-form-item label="计划类型:" required>
                            <el-select v-model="itemType" placeholder="请选择计划类型" style="width:220px;"  @change="changePlanType" size="mini">
                                <el-option label="随访计划" value="1"></el-option>
                                <el-option label="临时随访" value="2"></el-option>
                                <el-option label="入户访视" value="3" v-show="loginDoctor.hospital.indexOf('350203')>-1||loginDoctor.hospital=='ac02a9b87a3611e69f7c005056850d66'"></el-option>
                            </el-select>
                        </el-form-item> 
                        <el-form-item v-if="itemType!=3" label="选择居民:" prop="patientName" :rules="{required: true, message: '请选择居民', trigger: 'change'}">
                            <el-input  v-model="followUpItem.patientName"  style="width:220px;" readonly>
                            </el-input>
                        </el-form-item>
                        <div v-if="itemType=='1'">
                        <div v-for="(item,index) in followUpItem.planList" :key="index">
                            <el-form-item label="随访次数:">
                                <div class="flex listDo"  style="width:220px;">
                                <div class="f_g_1" style="height: 28px;line-height: 28px;">第{{index+1}}次</div>
                                <div v-if="index==0" class="f_s_0  c-12b7f5" @click="addListItem"><img src="../image/tianjia_icon.png" class="pt7 pr5"/>新增一次计划</div>
                                <div v-else class="f_s_0 c-ff3b30"  @click="removeListItem(index)"><img src="../image/shanchujihua_icon.png" class="pt7 pr5"/>删除本次计划</div>
                            </div>
                        </el-form-item>
                        <el-form-item label="随访时间:" :prop="'planList.' + index + '.date'" :rules="[{required: true, message: '请选择随访时间',trigger:'change'}]">
                            <el-date-picker  style="width:220px;"
                            v-model="item.date"
                            type="datetime"
                            placeholder="选择日期时间"
                            clearable
                            format="yyyy-MM-dd HH:mm"
                            value-format="yyyy-MM-dd HH:mm:ss">
                            </el-date-picker>
                        </el-form-item>
                        <el-form-item label="随访医生:"  :prop="'planList.' + index + '.doctor'" :rules="{required: true, message: '请选择随访医生', trigger: 'change'}">
                            <el-select v-model="item.doctor" placeholder="请选择随访医生"  style="width:220px;">
                                <el-option v-for="(ditem, dindex) in doctorList" :key="dindex" :label="ditem.name" :value="ditem.code"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="随访方式:"  :prop="'planList.' + index + '.type'" :rules="{required: true, message: '请选择随访方式', trigger: 'change'}">
                            <el-select v-model="item.type" placeholder="请选择随访方式"  style="width:220px;">
                                <!-- <el-option label="门诊" value="1"></el-option> -->
                                <el-option label="家庭" value="22"></el-option>
                                <!-- <el-option label="健管师随访" value="10"></el-option> -->
                                <el-option label="电话" value="3"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="随访类型:"  :prop="'planList.' + index + '.followupClass'" :rules="{required: true, message: '请选择随访类型', trigger: 'change'}">
                            <el-select v-model="item.followupClass" placeholder="请选择" style="width:220px;">
                                <el-option label="请选择" value=""></el-option>
                                <el-option label="高血压" value="1"></el-option>
                                <el-option label="糖尿病" value="2"></el-option>
                                <el-option label="高血压,糖尿病" value="1,2"></el-option>
                            </el-select>
                        </el-form-item>
                        </div>            
                        <div class="ml100 pt20">
                            <el-button class="c-btn c-btn-12b7f5" type="primary" @click="addFollowupPlan">保存</el-button>
                            <el-button class="c-btn c-btn-f96565" type="primary" @click="back">取消</el-button>
                        </div>
                        </div>
                        <div  v-if="itemType=='2'">
                        <el-form-item label="随访时间:" prop="date" :rules="{required: true, message: '请选择随访时间', trigger: 'change'}">
                            <el-date-picker  style="width:220px;"
                            v-model="followUpItem.date"
                            type="datetime" 
                            placeholder="选择日期时间"
                            clearable
                            format="yyyy-MM-dd HH:mm"
                            value-format="yyyy-MM-dd HH:mm:ss">
                            </el-date-picker>
                        </el-form-item>
                        <el-form-item label="随访方式:"  prop="followupType" :rules="{required: true, message: '请选择随访方式', trigger: 'change'}">
                            <el-select v-model="followUpItem.followupType" placeholder="请选择随访方式"  style="width:220px;">
                            <el-option label="家庭" value="22"></el-option>
                            <!-- <el-option label="门诊" value="1"></el-option>
                            <el-option label="健管师随访" value="10"></el-option> -->
                            <el-option label="电话" value="3"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="随访类型:"  prop="followupClass" :rules="{required: true, message: '请选择随访类型', trigger: 'change'}">
                            <el-select v-model="followUpItem.followupClass" placeholder="请选择随访类型" style="width:220px;">
                            <el-option label="请选择" value=""></el-option>
                            <el-option label="高血压" value="1"></el-option>
                            <el-option label="糖尿病" value="2"></el-option>
                            <el-option label="高血压,糖尿病" value="1,2"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="随访状态:">
                            <el-select v-model="followUpItem.followupManagerStatus" placeholder="请选择随访状态" style="width:220px;">
                            <el-option label="请选择" value=""></el-option>
                            <el-option v-for="(item, index) in followupManagerStatusList" :key="index" :label="item.value" :value="item.code"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="下次随访:" prop="plandate">
                            <el-date-picker  style="width:220px;"
                            v-model="followUpItem.plandate"
                            type="datetime"
                            placeholder="选择日期时间"
                            clearable
                            format="yyyy-MM-dd HH:mm"
                            value-format="yyyy-MM-dd HH:mm:ss">
                            </el-date-picker>
                        </el-form-item>           
                        <div class="ml100 pt20">
                            <el-button class="c-btn c-btn-12b7f5" type="primary" @click="addFollowup">登记结果</el-button>
                            <el-button class="c-btn c-btn-f96565" type="primary" @click="back">取消</el-button>
                        </div>
                        </div>
                        <div v-if="itemType=='3'">
                        <el-form-item label="随访类型:"  prop="followupClass" :rules="{required: true, message: '请选择随访类型', trigger: 'change'}">
                            <el-select v-model="followUpItem.followupClass" placeholder="请选择随访类型"  style="width:220px;">  <!-- @change="fsClassChange" -->
                                <el-option label="请选择" value=""></el-option>
                                <el-option label="肺结核" value="9"></el-option>
                                <el-option label="孕产妇" value="5"></el-option>
                                <el-option label="新生儿" value="6"></el-option>
                                <el-option label="严重精神障碍患者" value="7"></el-option>
                                <el-option label="80岁以上老人" value="8"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="随访时间:" prop="followupDate"  :rules="{required: true, message: '请选择随访时间', trigger: 'change'}">
                            <el-date-picker  style="width:220px;"
                                v-model="followUpItem.followupDate"
                                type="datetime"
                                placeholder="选择日期时间"
                                clearable
                                format="yyyy-MM-dd HH:mm"
                                value-format="yyyy-MM-dd HH:mm:ss">
                            </el-date-picker>
                        </el-form-item>            
                        <div v-if="true">  <!--followUpItem.followupClass=='7'||followUpItem.followupClass=='8'||followUpItem.followupClass=='9'-->
                            <el-form-item label="选择居民:" prop="patientName" :rules="{required: true, message: '请选择居民', trigger: 'change'}">
                            <el-input readonly v-model="followUpItem.patientName" style="width:220px;">
                            </el-input>
                            </el-form-item>
                            <div id="div_items">
                                <div class="div_item" @click="clicksingleItem(sfPatientList)" v-if="sfPatientList.idCard">
                                <div>{{sfPatientList.sickName}}({{sfPatientList.sex!=1?'男':'女'}} {{sfPatientList.age}}岁)</div>
                                <div>{{sfPatientList.idcardEncrypt}}</div>
                                </div>
                                <div v-else class="div_item" @click="clicksingleItem(sfPatientList)">
                                <div></div>
                                </div>
                            </div>
                        </div>
                        <el-form-item v-else label="选择居民:" prop="patientName" :rules="{required: true, message: '请选择居民', trigger: 'change'}">
                            <el-input placeholder="请选择居民" readonly v-model="followUpItem.patientName"  style="width:220px;" readonly  @click.native="showPatientList">
                            </el-input>
                        </el-form-item>
                        <el-form-item label="随访医生:">
                            <el-input v-model="loginDoctor.name" style="width:220px;" readonly>
                            </el-input>
                        </el-form-item>
                        <el-form-item label="随访方式:"  prop="followupType" :rules="{required: true, message: '请选择随访方式', trigger: 'change'}">
                            <el-select v-model="followUpItem.followupType" placeholder="请选择随访方式"  style="width:220px;">
                            <el-option label="家庭" value="22"></el-option>
                            <!-- <el-option label="门诊" value="1"></el-option>
                            <el-option label="健管师随访" value="10"></el-option> -->
                            <el-option label="电话" value="3"></el-option>
                            </el-select>
                        </el-form-item>
                        <div class="ml100 pt20">
                            <el-button class="c-btn c-btn-12b7f5" type="primary" @click="saveFollowup">保存</el-button>
                            <el-button class="c-btn c-btn-f96565" type="primary" @click="back">取消</el-button>
                        </div>
                        </div>
                    </el-form>
                </div>
            </div>
		</div>
		<script type="text/javascript" src="../../../js/vue.js"></script>
        <script type="text/javascript" src="../../../js/jquery-2.2.4.js"></script>
        <script type="text/javascript" src="../../../plugins/element-ui/element-ui.js"></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="../../../api/http-request.js"></script>
		<script type="text/javascript" src="../../../plugins/layer/layer.min.js"></script>
        <script type="text/javascript" src="../../../api/sign_api.js"></script>
        <script type="text/javascript" src="../../../api/followup_api.js"></script>
		<script type="text/javascript" src="../../../js/underscore-1.9.1.js"></script>
		<script src="../../../js/util.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="../js/followup_newplan.js"></script>
	</body>
</html>

BIN
app/followup/image/shanchujihua_icon.png


BIN
app/followup/image/tianjia_icon.png


+ 430 - 0
app/followup/js/followup_newplan.js

@ -0,0 +1,430 @@
var httpData=GetRequest();
var docInfo = JSON.parse(window.localStorage.getItem('docInfo'));
var loginDoctor = docInfo
var clientHeight =  Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
new Vue({
    el:"#app",
    data:{
        clientHeight: clientHeight,
        planId: httpData['planId'],
        planDetaiId: httpData['planDetaiId'],
        patient: httpData['patient'],
        itemType:"1",   //随访计划
        followUpItem:{
            patientName: '',
            planList:[{date:new Date().format("yyyy-MM-dd HH:mm")+":00",type:"22",doctor:loginDoctor.code,followupClass:'',type1:'1'}],   //计划列表
        },         
        rules: {
        followupPlanDate: [
            { required: true, message: '请选择随访时间', trigger: 'change' },
        ],
        },
        item_1:{patientName: '',planList:[{date:"",type:"22",doctor:loginDoctor.code,type1:'1'}]},   //随访计划列表
        planItem:{date:"",type:"22",doctor:loginDoctor.code,type1:'1'},   //随访计划列表项
        item_2:{
            "patientName": '',
            "date":"",
            "followupType":"22",
            "followupClass":"",
            "followupManagerStatus":"",
            "plandate":"",
            "prescriptioncode":""
        },
        item_3:{
            "patientName": '',
            "followupDate":"",
            "followupPlanDate":"",
            "followupType":"22",
            "followupClass":"",
        },
        patientName: '',
        patientInfo:{},
        loginDoctor: loginDoctor,
        doctorList:[],
        sfPatientList:{},
        followupManagerStatusList:[],   //临时随访状态
        toSelectsfpatient:false,
    },
    mounted: function() {
        this.doctorList.push(loginDoctor)
        this.getDictByDictName("FOLLOWUP_MANAGER_STATUS","followupManagerStatusList")
        if(this.patient){
            this.getPatientInfo()
            this.getDoctorList()
        }
        $("body").click(function () {
            $("#div_items").css('display', 'none');
        });  
        $(".div_item").hover(function () {
            $(this).css('background-color', '#f8f8f8')
        }, function () {
            $(this).css('background-color', 'white')
        });
    },
    methods: {
        //计划类型改变
        changePlanType: function(){
            this.doctorList=[]
            if(this.itemType=="1"){
                this.doctorList.push(loginDoctor)
            }
            this.followUpItem=JSON.parse(JSON.stringify(this["item_"+this.itemType]))
            if(this.itemType=="1"){
                this.followUpItem.planList[0].date=new Date().format("yyyy-MM-dd HH:mm")+":00"
            }else if(this.itemType=="2"){
                this.followUpItem.date=new Date().format("yyyy-MM-dd HH:mm")+":00"
                this.followUpItem.type='2'
            }else if(this.itemType=="3"){
                this.followUpItem.followupDate=new Date().format("yyyy-MM-dd HH:mm")+":00"
            }
            // this.patientInfo = {}
            setTimeout(()=>{
                this.$refs.form.clearValidate()
            },100)        
        },
        fsClassChange: function(){
            // this.patientInfo = {}
            this.followUpItem.patientName=""
            setTimeout(()=>{
                this.$refs.form.clearValidate()
            },100)
        },
        // 选择随访居民
        selectsfPatient: function(){
          var vm=this
          if(this.followUpItem.patientName.length>=15){
              $("#div_items").css('display', 'block'); 
              vm.getsfPatient()
          }else{
              $("#div_items").css('display', 'none');
          }
        },
        // 获取访视居民列表
        getsfPatient: function(){
          var vm=this
          var params={idcard:this.followUpItem.patientName}
             serviceVisitApi.getPatientJWInfo(params).then(res=>{
               if(res.status==200){
                 if(!res.data.data){
                   vm.sfPatientList={}
                 }else{
                   vm.sfPatientList=res.data.data
                 }
               }else{
                  this.$message.error(res.data.msg)
                }
             })
        },
        // 选择访视居民选中单个下拉框
        clicksingleItem: function(sitem){
          var vm=this
          if(!sitem.ssc&&!sitem.patient){
            const h = this.$createElement;
            this.$msgbox({
                title: '系统提示',
                message: h('p', { style: 'text-align: center;padding-top:20px;padding-bottom:40px;color:#333;' }, '此居民暂无社保卡号,不支持为其创建入户访视计划。请居民注册厦门i健康账号后,医生方可创建入户访视计划'),
                showCancelButton: false,
                confirmButtonText: '确定',
                confirmButtonClass:"c-btn-plain c-btn-12b7f5-plain c-btn-w68",
                cancelButtonClass:"c-btn-plain c-btn-d7dce6-plain  c-btn-w68"
            }).then(action => {
            })
            return 
          }
  
          if(!sitem.patient){
          const h = this.$createElement;
          this.$msgbox({
              title: '系统提示',
              message: h('p', { style: 'text-align: center;padding-top:20px;padding-bottom:40px;color:#333;' }, '此居民暂无厦门i健康,若要继续为此居民进行入户访视,系统将为此居民自动创建一个厦门i健康账号,请问您是否确认继续此操作?'),
              showCancelButton: true,
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              confirmButtonClass:"c-btn-plain c-btn-12b7f5-plain c-btn-w68",
              cancelButtonClass:"c-btn-plain c-btn-d7dce6-plain  c-btn-w68"
          }).then(action => {
                var obj={}
                  obj.status=1
                  obj.isCertified=0
                  obj.address=sitem.homeAddress
                  obj.name=sitem.sickName
                  obj.sex=sitem.sickSex
                  obj.idcard=sitem.idCard
                  obj.birthday=sitem.birthday
                  obj.ssc=sitem.ssc
                  obj.age=sitem.age
                var data={
                    jsonData:JSON.stringify(obj)
                }  
                serviceVisitApi.create(data).then(res=>{
               if(res.status==200){
                  $("#div_items").css('display', 'block'); 
                  vm.getsfPatient()
                  vm.toSelectsfpatient=false
               }else{
                  this.$message.error(res.data.msg)
                }
             })
          }).catch(() => {              
          });
          }else{
            vm.patientInfo={}
            vm.followUpItem.patientName=sitem.sickName
            vm.toSelectsfpatient=true
            vm.patientInfo.code=sitem.patient
            vm.patientInfo.name=sitem.sickName
            vm.patientInfo.idcard=sitem.idCard
            vm.patientInfo.age=sitem.age+"岁"
            vm.patientInfo.idcardEncrypt=sitem.idcardEncrypt
            vm.patientInfo.mobile=sitem.mobile
            vm.patientInfo.sex=sitem.sickSex
          }
          
        },
        // 获取居民对应医生列表--随访
        getDoctorList: function() {
            var params = {
                code: this.patient
            }
            followUpAPI.sign_doctors(params).then(function(msg){
                if (msg.status === 200) {
                    var hasThisDoctor=_.find(msg.list,{code:loginDoctor.code})
                    if(hasThisDoctor>-1){   //列表里有当前医生
                        this.doctorList=msg.list
                    }else{
                        this.doctorList.push(loginDoctor)
                    }
                }
            })
        },
        addListItem: function(){
          var listItem=JSON.parse(JSON.stringify(this.planItem))
          listItem.date=new Date().format("yyyy-MM-dd HH:mm")+":00"
          this.followUpItem.planList.push(listItem)
        },
        removeListItem: function(index){  
          const h = this.$createElement;
          this.$msgbox({
              title: '删除提示',
              message: h('p', { style: 'text-align: center;padding-top:20px;padding-bottom:40px;color:#333;' }, '请问您是否确认删除本次计划?'),
              showCancelButton: true,
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              confirmButtonClass:"c-btn-plain c-btn-12b7f5-plain c-btn-w68",
              cancelButtonClass:"c-btn-plain c-btn-d7dce6-plain  c-btn-w68"
          }).then(action => {
              this.followUpItem.planList.splice(index,1)
          }).catch(() => {              
          });
        },
        //创建随访计划
        addFollowupPlan: function(){
          var vm = this  
          this.$refs["form"].validate((valid) => {
            if (valid) {
              var ispass=_.every(this.followUpItem.planList,(item,index)=>{
                var datepass=true
                var typepass=item.type!="3"||this.patientInfo.mobile
                if(typepass){
                  datepass=index==0||(index>0 && this.followUpItem.planList[index-1].date<item.date)//前一次随访时间小于后一次随访时间
                  if(!datepass){
                    this.$message.warning("第"+index+"次随访时间小于第"+(index+1)+"次随访时间")
                  }
                }else{
                  this.$message.warning("该居民无联系方式,不可进行电话随访")
                }
                return typepass && datepass
              })
              if(!ispass){
                return false
              }
              var params={
                patient: this.patientInfo.code,data: JSON.stringify(this.followUpItem.planList)
              }
              // this.$loading('创建随访计划...')
              var loading = layer.load(0, {shade: false})
              followUpAPI.addFollowupPlan(params).then(res=>{
                // this.$loading.close()
                layer.close(loading)
                if(res.status == 200){
                  layer.msg(res.msg, {
                    icon: 1
                  })
                  if(res.data&&res.data.length>0){
                    var relationCode = res.data[0].id
                    window.parent.closeFollowUpLayer(vm.planDetaiId, relationCode)
                  }
                }else{
                  layer.msg(res.msg, {
                    icon: 5
                  })
                }
              })
            } else {
              console.log('error submit!!');
              return false;
            }
          });
        },
        //创建临时随访
        addFollowup: function(){
          var vm = this
          this.$refs["form"].validate((valid) => {
            if (valid) {
              if(this.followUpItem.plandate){
                if(this.followUpItem.plandate<=this.followUpItem.date){
                  this.$message.warning("下次随访时间不可早于随访时间")
                  return false
                }
              }
              if(this.followUpItem.followupType=="3"&&!this.patientInfo.mobile){
                this.$message.warning("该居民无联系方式,不可进行电话随访")
                return false
              }
              var params=JSON.parse(JSON.stringify(this.followUpItem))
              params.patient=this.patientInfo.code
              // this.$loading('创建临时随访...')
              var loading = layer.load(0, {shade: false})
              followUpAPI.addFollowup(params).then(res=>{
                // this.$loading.close()
                layer.close(loading)
                if(res.status == 200){
                  layer.msg(res.msg, {
                    icon: 1
                  })
                  if(res.data&&res.data.length>0){
                    var relationCode = res.data[0].id
                    window.parent.closeFollowUpLayer(vm.planDetaiId, relationCode)
                  }
                }else{
                  layer.msg(res.msg, {
                    icon: 5
                  })
                }
              })
            } else {
              console.log('error submit!!');
              return false;
            }
          });
        },
        //创建入户访视
        saveFollowup: function(){
          var vm = this
          if(!this.patientInfo.code){  //未选中居民
              this.followUpItem.patientName=""
          }
          if(this.followUpItem.followupType=="3"&&!this.patientInfo.mobile){
            this.$message.warning("该居民无联系方式,不可进行电话访视")
            return false
          }
          this.$refs["form"].validate((valid) => {
            if (valid) {
              var params={
                followupDate: this.followUpItem.followupDate,
                followupPlanDate: this.followUpItem.followupDate,
                followupType: this.followUpItem.followupType,
                followupClass: this.followUpItem.followupClass,
                doctorCode: loginDoctor.code,
                doctorName: loginDoctor.name,
                orgCode: loginDoctor.hospital,
                orgName: loginDoctor.hospitalName,
                patientCode: this.patientInfo.code,
                patientName: this.patientInfo.name,
                idcard: this.patientInfo.idcard,
                age:this.patientInfo.age,
                idcardEncrypt:this.patientInfo.idcardEncrypt,
                mobile:this.patientInfo.mobile,
                sex:this.patientInfo.sex,
                dataFrom: "2",
                status: "2",
                createTime: new Date().format("yyyy-MM-dd HH:mm:ss"),
                creater: loginDoctor.code,
                type:'3'  //区分随访计划1、新增随访2、临时随访3、入户随访
              }
              // this.$loading('创建入户访视...')
              var loading = layer.load(0, {shade: false})
              followUpAPI.saveFollowup({jsonFollowup:JSON.stringify(params)}).then(res=>{
                // this.$loading.close()
                layer.close(loading)
                if(res.status == 200){
                  layer.msg(res.msg, {
                    icon: 1
                  })
                  if(res.data&&res.data.length>0){
                    var relationCode = res.data[0].id
                    window.parent.closeFollowUpLayer(vm.planDetaiId, relationCode)
                  }
                }else{
                  layer.msg(res.msg, {
                    icon: 5
                  })
                }
              })
            } else {
              console.log('error submit!!');
              return false;
            }
          });
        },
        getDictByDictName: function(name,itemName) {
            var vm = this
            var params = {
                name: name
            }
            signAPI.getDictByDictName(params).then(function(res){
                var result = res.list
                if (res.status === 200) {
                    vm[itemName] = result
                }
            })
        },
        // 选择居民信息或者获取居民信息
        // getPatientInfo(obj) {
        //   this.patientInfo = obj
        //   this.$set(this.followUpItem,"patientName",obj.name)
        //   if(this.itemType=="1"){
        //     this.getDoctorList()
        //   }
        // },
        // 选择居民信息或者获取居民信息
        getPatientInfo: function() {
          var vm = this
          var params = {
            patient: vm.patient
          }
          followUpAPI.getPatientInfo(params).then(function(res){
            if(res.status == 200){
              vm.patientInfo = res.data?res.data:{}
              vm.followUpItem['patientName'] = vm.patientInfo.name
              vm.item_1['patientName'] = vm.patientInfo.name
              vm.item_2['patientName'] = vm.patientInfo.name
              vm.item_3['patientName'] = vm.patientInfo.name
              vm.patientName = vm.patientInfo.name
            }
          })
        },
        //打开居民列表弹框
        showPatientList: function(){
          if(this.itemType=="3"){
            var ispass=true
            this.$refs["form"].validateField(["followupClass","followupDate"],(valid)=>{
              if(valid){  //有值说明验证未通过
                ispass=false
              }
            })
            if(!ispass){
              return false
            }
          }
          this.$root.bus.$emit('selectPatientAddFUPlan',{type:this.itemType,patientInfo:this.patientInfo,followUpItem:this.followUpItem})
        },
        //关闭弹框
        closeMask: function(){ 
          this.$root.bus.$emit('closeMask')
        },
        back: function(){
          this.$emit("removeTab","newPlan")
        },
    }
})

+ 4 - 6
app/recover/html/medical-records.html

@ -123,8 +123,7 @@
					advice: '',
					doctorCode: docInfo.uid,
					patient: httpData.patient,
					patientName: decodeURI(httpData.patientName),
					isPending: false, // 请求发送中标识 防止重复提交
					patientName: decodeURI(httpData.patientName)
                },
                mounted: function() {
					this.getIcd10Info()
@ -171,8 +170,8 @@
						top.recoverVue.closeMedicalRecords()
					},
					addMedicalRecords: function(){
						var vm = this
						if(this.isPending) return false
						var vm = this,
						loading = layer.load(0, {shade: false})
						if(!this.admissionTime){
							showErrorMessage('请选择入院时间!')
							return false
@ -215,9 +214,8 @@
							patientName: vm.patientName,
							jsonData: JSON.stringify(jsonData)
						}
						this.isPending = true
						rehaAPI.createMedicalRecords(params).then(function(res){
							this.isPending = false
							layer.close(loading)
							if(res.status==200){
								top.recoverVue.completeMedicalRecords(res.data)
							}else{

+ 0 - 1
app/recover/html/new_recover.html

@ -310,7 +310,6 @@
		<script type="text/javascript">
			var doctorType = (JSON.parse(window.localStorage.getItem('wlyyAgent'))||{}).doctorType,
				docInfo = JSON.parse(window.localStorage.getItem('docInfo'))
				console.log('docInfo', docInfo)
			var httpData=GetRequest()
			function showSuccessMessage(msg) {
				layer.msg(msg, {

+ 18 - 5
app/recover/html/personal-manage.html

@ -371,15 +371,28 @@
                		location.href = "../../rehabilitation/html/rehabilitation_management.html?planId=" + plan.id + "&patientCode=" + httpData.patientCode
                	},
					lookProject: function(obj) {
						layer.open({
						var vm = this
						// layer.open({
						// 	type: 2,
						// 	area: ['600px', '500px'],
						// 	shade: 0.5,
						// 	title: '服务项目内容',
						// 	closeBtn: 1,
						// 	shift: 5,
						// 	shadeClose: false, //点击遮罩关闭层
						// 	content: "project-detail.html?planId=" + obj.id
						// });
						top.layer.open({
							type: 2,
							area: ['600px', '500px'],
							area: ['800px', '650px'],
							shade: 0.5,
							title: '服务项目内容',
							closeBtn: 1,
							fixed: true, //不固定
							maxmin: true,
							closeBtn:1,
							shift: 5,
							shadeClose: false, //点击遮罩关闭层
							content: "project-detail.html?planId=" + obj.id
							content: '../../rehabilitation/html/guide_the_message.html?planid='+obj.id+'&pId='+vm.planList[0].planId+'&patient='+httpData.patientCode
						});
					},
					// 获取最新的诊疗消息
@ -537,7 +550,7 @@
						var otherCode = docInfo.code,
						otherName = docInfo.name,
						planDetailId = vm.recentRecoverDetail.id;
						window.location.href = '../../consulting/html/consulting.html?otherCode=' + otherCode + '&otherName=' + encodeURI(otherName) + '&planDetailId=' + planDetailId
						showInfoMessage('请从“消息-患者消息列表”中查看患者的康复咨询记录')
					},
			    	selectType: function(type) {
			    		this.eventType = type

+ 3 - 1
app/rehabilitation/css/guide_the_message.css

@ -40,6 +40,8 @@
.service-address{border-bottom: 1px solid #d7dce6;}
.btn-yuyue{background-color: #02cfb9;color: #fff;}
.btn-yuyue:hover,.btn-yuyue:link{color: #fff;background-color: #01c1ad;}
.btn-disabled{background-color: #eee;color: #999;}
.btn-disabled:hover, .btn-disabled:link{background-color: #eee;color: #999;}
.btn-fuwuma{background-color: #2dbe55;color: #fff;}
.btn-fuwuma:hover,.btn-fuwuma:link{color: #fff;background-color: #209440;}
.btn-zhidao{background-color: #12b7f5;color: #fff;}
@ -50,7 +52,7 @@
.record-list.active{max-height: 999px;}
.record-item{background-color: #f5f5fa;margin-bottom: 10px;padding: 10px;}
.complete-title{font-size: 14px;color: #333;padding: 10px 0;border-bottom: 1px solid #D7DCE6;}
.guanlian-list{border: 1px solid #d7dce6;padding: 3px 5px;}
.guanlian-list{padding: 10px 0 10px 10px;overflow: hidden;border: 1px solid #d7dce6;}
.upload-box{padding: 10px 0 10px 10px;overflow: hidden;border: 1px solid #d7dce6;}
.upload-box li{width: 60px;height: 60px;position: relative;display: block;float: left;margin-right: 10px;}
.upload-box li img{width: 100%;display: block;}

+ 367 - 0
app/rehabilitation/css/rehabilitation_guidance.css

@ -0,0 +1,367 @@
html,body,#app {
	margin: 0;
	padding: 0;
	height: 100%;
	color: #333;
}
ul {
	margin: 0;
	padding: 0;
	list-style-type: none;
}
.clearfix:after {
    visibility: hidden;
    display: block;
    font-size: 0;
    content: ".";
    clear: both;
    height: 0;
}
.clearfix {
    zoom: 1;
}
.fl {
	float: left;
}
.fr {
	float: right;
}
/*.ui-popup-full { width: 50%; }*/
#app>.ui-grid, #app>.ui-grid .ui-grid {
	height: 100%;
}
#app>.ui-grid .ui-col-0 {
	width: 340px;
	border-right: 1px solid #d7dce6;
	position: relative;
}
#app>.ui-grid .ui-col-1 {
	position: relative;
	height: -moz-calc(100%);
	height: -webkit-calc(100%);
	height: calc(100%);
	box-sizing: border-box;
}
ul.nav-tab {
	padding-left: 5px;
}
ul.nav-tab::after {
	content: ' ';
	position: absolute;
	border-bottom: 1px solid #d7dce6;
	height: 35px;
	width: 100%;
	left: 0;
	z-index: -1;
}
ul.nav-tab li {
	display: inline-block;
	line-height: 34px;
	padding-left: 10px;
	padding-right: 10px;
	border: 1px solid #d7dce6;
	margin-left: 3px;
	text-align: center;
	font-size: 14px;
	background-color: #f5f5fa;
	color: #666666;
	cursor: pointer;
}
ul.nav-tab li.active {
	border-bottom: 1px solid #fff;
	color: #12b7f5;
	background-color: #fff;
}
.inp-search {
	width: 100%;
	border: solid 1px #d7dce6;
	margin: 10px auto;
	height: 30px;
	padding-left: 10px;
	box-sizing: border-box;
}
.search-warp {
	position: relative;
}
.search-warp::after {
	content: ' ';
	width: 20px;
	height: 20px;
	position: absolute;
	right: 8px;
	top: 14px;
	display: block;
	background: url(../../../images/sousuo_icon.png) center center / 15px 15px no-repeat;
}
.temp-item  {
	position: relative;
	font-size: 14px;
	line-height: 40px;
	color: #333333;
	border-bottom: 1px solid #d7dce6;
	cursor: pointer;
}
.item-header {
	padding-right: 80px;
}
.list-arrow-r:after,
.list-arrow-d:after {
	position: absolute;
    top: 20px;
    right: 0.75rem;
    margin-top: -0.25rem;
    content: "";
    display: block;
    width: 0.4rem;
    height: 0.4rem;
    border: solid #cdcdcd;
    border-width: 0.1rem 0.1rem 0 0;
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
}
.list-arrow-d:after {
	right: 0.65rem;
    margin-top: -0.4rem;
    -webkit-transform: rotate(135deg);
    transform: rotate(135deg);
}
.temp-item .dropdown-item {
	position: relative;
}
.temp-item .dropdown-item:first-child {
	border-top: 1px dashed #d7dce6;
}
.temp-item .dropdown-item:not(:last-child) {
	border-bottom: 1px dashed #d7dce6;
}
.new-temp {
	font-size: 14px;
	color: #12b7f5;
	position: fixed;
	bottom: 15px;
	left: 105px;
	cursor: pointer;
}
.temp-info {
	border: 1px solid #d7dce6;
}
.temp-name,
.team-name,
.label-name {
	position: relative;
	border-bottom: 1px solid #d7dce6;
}
.temp-name input {
	border: 0;
	width: -moz-calc(100% - 80px);
	width: -webkit-calc(100% - 80px);
	width: calc(100% - 80px);
}
.img-items {
	border: 1px solid #d7dce6;
	padding-left: 10px;
	padding-right: 10px;
	padding-top: 10px;
	overflow: hidden;
}
.img-items img {
	float: left;
	width: 60px;
	height: 60px;
	margin-right: 10px;
	margin-bottom: 10px;
	vertical-align: middle;
}
.img-items img:nth-of-type(4n){
	margin-right: 0;
}
.send-btn, .back-btn {
	display: inline-block;
	width: 120px;
	height: 34px;
	line-height: 34px;
	background-color: #12b7f5;
	border-radius: 2px;
	color: #fff;
	cursor: pointer;
}
.foot-btns {
	text-align: center;
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
}
.template-wrap{
	position: relative;
	padding-bottom: 45px;
	box-sizing: border-box;
	min-height: calc(100%);
}
.preview-btn, .new-btn {
	display: inline-block;
	width: 120px;
	height: 34px;
	line-height: 34px;
	color: #fff;
	cursor: pointer;
}
.back-btn {
	background-color: #12b7f5;
}
.preview-btn {
	background-color: #02cfb9;
}
.new-btn {
	background-color: #12b7f5;
}
.save-btn {
	float: right;
	width: 100px;
	height: 28px; 
	line-height: 28px;
	background-color: #12b7f5; 
	border-radius: 2px;
	color: #fff;
	text-align: center;
	cursor: pointer;
}
.delete-btn {
	float: right;
	width: 100px;
	height: 28px; 
	line-height: 28px;
	background-color: #ff3b30; 
	border-radius: 2px;
	color: #fff;
	text-align: center;
	cursor: pointer;
}
.delete-icon {
	position: absolute;
	top: -8px;
	left: 55px;
	cursor: pointer;
}
.file-upload {
	 width: 65px;
    height: 65px;
    position: absolute;
    opacity: 0;
    font-size: 0;
}
.delete-icon >img {
	background: #fff;
    border-radius: 50%;
}
.label-name .c-list {
	max-height: 100px;
    overflow-y: auto;
}
.c-list .c-list-li {
	height: 28px;
	line-height: 28px;
	float: left;
	display: inline;
	margin: 10px 7px 0 1%;
	padding: 0px 28px;
	border-radius: 15px;
	border: 1px solid #d7dce6;
}
.c-list .active-icon {
	border: 1px solid #12b7f5 ;
}
.item-header.active {
	color: #12b7f5;
}
.preview-wrap {
	height: calc(100% - 50px);
    overflow-y: auto;
}
.cur-pit {
    cursor: pointer;
}
.c-position-r {
	position: relative;
}
.c-position-a {
    position: absolute;
}
.c-border {
	border-width: 0;
	border-color: #e1e1e1;
    border-style: solid;
}
.c-border-all{
	border-width: 1px;
}
.c-border-r {
    border-right-width: 1px;
}
.c-border-l {
    border-left-width: 1px;
}
.c-border-b {
    border-bottom-width: 1px;
}
.downList{
}
.downList .downList-value{
	height: 30px;
	line-height: 30px;
	font-size: 14px;
	background: url(../../../images/tiaozhuan_xia_icon.png) no-repeat no-repeat 96% center;
	background-size: 10px 6px;
	box-sizing: border-box;
}
.downList .downList-inner{
	font-size: 14px;
	width: 100%;
	box-sizing: border-box;
	background-color: #fff;
	z-index: 10;
}
.downList .downList-inner li{
	padding-top: 3px;
	padding-bottom: 3px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

+ 54 - 0
app/rehabilitation/css/rehabilitation_guidance_preview.css

@ -0,0 +1,54 @@
[v-cloak] {
    display: none;
}
.previewBox {
    background: url(../images/shouji_bg_img.682f0e93.png) no-repeat;
    background-size: 100% 100%;
    height: 518px;
    margin: 20px 50px 54px 59px;
    position: relative;
}
.previewBox .contentBox {
    position: absolute;
    width: 220px;
    margin-left: 21px;
    margin-top: 63px;
}
.previewBox .title {
    background-color: #000;
    color: #fff;
    font-size: 14px;
    text-align: center;
    padding: 5px;
}
.previewBox .contentDetail {
    padding: 5px;
    height: 340px;
    overflow-y: auto;
    word-wrap: break-word;
    word-break: normal;
}
.previewBox .contentDetail .detailTitle {
    font-weight: bold;
    padding: 5px 0;
}
_c-btn {
    background-color: #12b7f5;
    width: 90px;
    height: 34px;
    font-size: 14px;
    border: none;
    color: #fff;
    border-radius: 2px;
}
.c-btn-12b7f5 {
    background-color: #12b7f5;
    color: #ffffff;
}
.c-btn-w90 {
    width: 90px;
    height: 34px;
    line-height: 32px;
}

+ 3 - 1
app/rehabilitation/css/service_item_content.css

@ -53,6 +53,8 @@
.service-address{border-bottom: 1px solid #d7dce6;}
.btn-yuyue{background-color: #02cfb9;color: #fff;}
.btn-yuyue:hover,.btn-yuyue:link{color: #fff;background-color: #01c1ad;}
.btn-disabled{background-color: #eee;color: #999;}
.btn-disabled:hover, .btn-disabled:link{background-color: #eee;color: #999;}
.btn-fuwuma{background-color: #2dbe55;color: #fff;}
.btn-fuwuma:hover,.btn-fuwuma:link{color: #fff;background-color: #209440;}
.btn-zhidao{background-color: #12b7f5;color: #fff;}
@ -70,7 +72,7 @@
.service-operation .btn{width: 90px;}
.view-detail{color: #12b7f5;cursor: pointer;}
.complete-title{font-size: 14px;color: #333;padding: 10px 0;border-bottom: 1px solid #D7DCE6;}
.guanlian-list{border: 1px solid #d7dce6;padding: 3px 5px;}
.guanlian-list{padding: 10px 0 10px 10px;overflow: hidden;border: 1px solid #d7dce6;}
.upload-box{padding: 10px 0 10px 10px;overflow: hidden;border: 1px solid #d7dce6;}
.upload-box li{width: 60px;height: 60px;position: relative;display: block;float: left;margin-right: 10px;}
.upload-box li img{width: 100%;display: block;}

+ 49 - 19
app/rehabilitation/html/guide_the_message.html

@ -29,7 +29,7 @@
		    </div>
		    <div class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
		      	<div class="panel-body">
		      		<div class="service-content">{{service.content}}</div>
		      		<div class="service-content">{{service.content}}的服务项目说明</div>
		      		<div class="service-address ptb20">
		      			<div class="flex-box">
		      				<div class="flex-box-item">
@ -70,13 +70,19 @@
		      			</div>
		      			<p class="c-999" style="margin-top: -10px;" v-if="service.messageList && !service.messageList.length">暂无记录</p>
	      			</div>
	      			<div class="flex-box btns-group clearfix" v-if="(service.isMyTask==1 || service.isCreate || service.isCK) && service.planStatus!=0 && service.status!=1">
	      				<button class="btn btn-yuyue" v-if="service.reserve==1 && service.status!=2 && service.isMyTask==1" @click="qwapp">转诊预约</button>
	      				<button class="btn btn-yuyue" v-if="service.type==2 && service.operate!=1 && !service.isZK && service.isMyTask==1" @click="jkjy(service.patient,service.planDetaiId)">健康教育</button>
	      				<button class="btn btn-yuyue" v-if="service.type==3 && service.operate!=1 && !service.isZK && service.isMyTask==1" @click="jkzd(service.planDetaiId,service.patient)">健康指导</button>
	      				<button class="btn btn-yuyue" v-if="service.type==4 && service.operate!=1 && !service.isZK && service.isMyTask==1" @click="qwapp">随访</button>
	      				<button class="btn btn-zhidao" v-if="service.type==1 && service.operate!=1 && service.isMyTask==1" @click="fwm(service.planDetaiId,service.patient)">服务码</button>
	      			</div>
					<!-- operate: 是否完成任务 0 未完成 1 已完成 isMyTask: 0 不是自己的任务 1是自己的任务 status: 0 未完成 1已完成 2已预约-->
					<!-- planStatus:计划的状态 0 已终止 1进行中 2已完成 -->
					<!-- type: 服务项code 1 电话/短信关怀 2康复咨询 3远程健康监测 4 上门服务 5康复指导 6 康复随访 7 复诊-->
					<div class="flex-box btns-group clearfix" v-if="(service.isMyTask==1 || service.isCreate || service.isCK) && service.planStatus!=0 && service.status!=1">
						<!-- <button class="btn btn-yuyue" v-if="service.type==1 && service.operate!=1 && service.isMyTask==1 && oprateType != 1" @click="goToFinish(service.planDetaiId)">确认完成</button> -->
						<button class="btn btn-yuyue" v-if="service.type==4 && service.operate!=1 && service.isMyTask==1" @click="sendSpecialistWeixinMessage(4)">提醒患者</button>
						<button class="btn btn-yuyue" v-if="service.type==5 && service.operate!=1 && service.isMyTask==1" @click="kfzd()">发送指导</button>
						<button class="btn btn-yuyue" v-if="service.type==6 && service.operate!=1 && service.isMyTask==1" @click="qwapp" style="width: auto">创建随访计划</button>
						<button class="btn btn-yuyue" v-if="service.type==7 && service.operate!=1 && service.isMyTask==1 && service.isZK" @click="sendSpecialistWeixinMessage(7)">提醒患者</button>
						<button class="btn btn-disabled" v-if="service.type==7 && service.operate!=1 && service.isMyTask==1 && !service.isZK" @click="qwapp">代预约</button>
						<!-- <button class="btn btn-yuyue" v-if="service.type==5 && service.operate!=1 && service.isMyTask==1" @click="jkjy(service.patient,service.planDetaiId)">健康教育</button> -->  
						<!-- <button class="btn btn-zhidao" v-if="service.type==1 && service.operate!=1 && service.isMyTask==1" @click="fwm(service.planDetaiId,service.patient)">服务码</button> -->
					</div>
	      		</div>
	      		<div class="complete-info" v-if="service.status==1">
	      			<div class="complete-title">完成情况</div>
@ -85,14 +91,14 @@
	      				<p class="f14 mb5"><span class="c-999">执行医生:</span>{{service.operatorDoctorName}}</p>
	      			</div>
	      		</div>
	      		<div class="note-info pt10">
	      		<div class="note-info pt10" v-if="service.type==1">
	      			<p class="f14 c-333">服务完成笔记</p>
	      			<textarea v-if="service.status!=1  && service.isMyTask==1" class="form-control" style="resize: none;" rows="4" placeholder="可备注您的服务记录" v-model="service.node"></textarea>
	      			<div v-if="service.status==1">{{service.node || '暂无服务记录'}}</div>
	      		</div>
	      		<div class="note-info ptb10" v-if="service.isMyTask==1">
	      		<div class="note-info ptb10" v-if="service.type==1">
	      			<p class="f14 c-333">相关记录</p>
	      			<ul class="upload-box"  v-if="service.status!=1">
	      			<ul class="upload-box"  v-if="service.status!=1 && service.isMyTask==1">
	      				<li class="flex-box" v-for="(img,index) in upImgs">
	      					<div class="upload-img-box">      						
		      					<img :src="img.baseUrl" />
@ -114,19 +120,42 @@
	      			<div class="upload-box" v-if="service.status==1 && service.relationRecordImg && !service.relationRecordImg.length">
	      				<p>暂无相关记录</p>
	      			</div>
	      		</div>
	      		<div class="note-info pt10" v-if="(service.type==2 || service.type==3 || service.type==4) && service.relationRecordCode">
	      			<p class="f14 c-333">关联记录</p>
	      			<p class="guanlian-list text-center c-333" @click="viewDetial(service.type,service.relationRecordCode)">
	      				<span class="pull-right"><i class="icon icon-arrow-right"></i></span>{{service.type==2?'健康文章':(service.type==3?'健康指导':'随访记录')}} {{service.completeTimeShort}}
	      			</p>
	      		</div>
				</div>
				<!-- type 服务项 1 电话/短信关怀 2康复咨询 3远程健康监测 4 上门服务 5康复指导 6 康复随访 7 复诊 -->
				<div class="note-info pt10" v-if="(service.type==4 || service.type==5 || service.type==7) && service.operate==1">
					<p class="f14 c-333">关联记录</p>
					<div class="ptb10" v-if="service.type==4&&service.relationList&&service.relationList.length>0">
						<div v-for="(o, i) in service.relationList">
							<p class="f14 mb5"><span class="c-999">服务时间:</span>{{o.patientExpectedServeTime}}</p>
							<p class="f14 mb5"><span class="c-999">服务地址:</span>{{o.serveAddress}}</p>
							<p class="f14 mb5"><span class="c-999">服务描述:</span>{{o.serveDesc}}</p>
							<p class="f14 mb5"><span class="c-999">服务医生:</span>{{o.doctorName}}</p>
						</div>
					</div>
					<div class="pt10" v-if="service.type==5&&service.relationList&&service.relationList.length>0">
						<div v-for="(o, i) in service.relationList" class="ui-grid mb20 pb5" style="border-bottom: 1px solid #D7DCE6;align-items: center;" @click="viewGuidance(o)">
							<div class="ui-col-1 c-666">{{o.attachedTitle}}</div>
							<div class="ui-col-0 c-999">{{o.czrq}}</div>
							<img src="../images/arrow_icon.png" width="7px" height="14px" class="ml10"/>
						</div>
					</div>
					<div class="ptb10" v-if="service.type==7&&service.relationList&&service.relationList.length>0">
						<div v-for="(o, i) in service.relationList">
							<p class="f14 mb5"><span class="c-999">预约医院:</span>{{o.orgName}}</p>
							<p class="f14 mb5"><span class="c-999">预约科室:</span>{{o.deptName}}</p>
							<p class="f14 mb5"><span class="c-999">预约医生:</span>{{o.doctorName}}</p>
							<p class="f14 mb5"><span class="c-999">就诊时间:</span>{{o.startTime}}</p>
							<p class="f14 mb5"><span class="c-999">挂号时间:</span>{{o.czrq}}</p>
						</div>
					</div>
					<div v-if="!service.relationList || service.relationList.length==0" class="guanlian-list c-999">暂无关联记录</div>
				</div>
	      		<div id="outerdiv" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:2;width:100%;height:100%;display:none;">
				    <div id="innerdiv" style="position:absolute;">
				        <img id="bigimg" style="border:5px solid #fff;" src="" />
				    </div>
				</div>
	      		<div class="text-center ptb50" v-if="service.status!=1 && service.isMyTask==1 && (service.operate==1 || service.type==0)">
	      		<div class="text-center ptb50" v-if="service.status!=1 && service.isMyTask==1 && service.operate!=1 && service.type==1">
	      			<button class="btn btn-zhidao" @click="qrwc(service.patient,service.type)">确认完成</button>
	      		</div>
	      	</div>
@ -138,6 +167,7 @@
		<script type="text/javascript" src="../../../api/http-request.js"></script>
		<script type="text/javascript" src="../../../api/rehabilitation-api.js"></script>
		<script src="../../../js/util.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="../../../plugins/layer/layer.min.js" ></script>
		<script type="text/javascript" src="../js/guide_the_message.js"></script>
	</body>
</html>

+ 47 - 0
app/rehabilitation/html/rehabilitation_guidance.html

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
        <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 http-equiv="X-UA-Compatible" content="IE=Edge">
        <title>康复指导</title>
        <meta name="keywords" content="">
        <meta name="description" content="">
        <link rel="shortcut icon" href="../../../favicon.ico">
        <link rel="stylesheet" type="text/css" href="../../../css/cross.css"/>
        <link rel="stylesheet" type="text/css" href="../../../plugins/toastr/toastr.min.css"/>
        <link rel="stylesheet" type="text/css" href="../../../plugins/artDialog/6.0.5/css/ui-dialog.min.css"/>
        <link rel="stylesheet" type="text/css" href="../css/rehabilitation_guidance.css"/>
        <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>
	</head>
	<body>
		<div id="app" >
			<router-view></router-view>
		</div>
		<script src="../../../plugins/layer/layer.min.js"></script>
		<script src="../../../plugins/toastr/toastr.min.js"></script>
		<script src="../../../plugins/artDialog/6.0.5/js/dialog-plus.min.js" type="text/javascript" charset="utf-8"></script>
		<script>
			var EventBus = new Vue();
			Vue.prototype.loading = dialog({contentType:'load', skin:'bk-popup'})
		</script>
		<script src="../../../api/http-request.js"></script>
		<script src="../../../js/underscore.js"></script>
		<script src="../../../api/home-api.js"></script>
		<script src="../../../api/guidance-api.js"></script>
		<script src="../../../api/rehabilitation-api.js"></script>
		<script src="../../../js/vue-router.js"></script>
		<script src="../../../js/util.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../../component/rehabilitation/index-page2.js"></script>
		<script src="../../../component/rehabilitation/nav-tab.js"></script>
		<script src="../../../component/rehabilitation/guidance-template-panel.js"></script>
		<script src="../../../component/guidance/temp-preview-panel.js"></script>
		<script src="../../../component/guidance/preview-panel.js"></script>
		<script src="../../../component/rehabilitation/temp-send-panel.js"></script>
		<script src="../../../component/guidance/img-upload.js"></script>
		<script src="../js/rehabilitation_guidance.js" type="text/javascript" charset="utf-8"></script>
	</body>
</html>

+ 43 - 0
app/rehabilitation/html/rehabilitation_guidance_preview.html

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>模板详情</title>
		<link rel="stylesheet" href="../../../css/bootstrap.min.css" />
	    <link rel="stylesheet" type="text/css" href="../../../css/style.min.css"/>
	    <link rel="stylesheet" type="text/css" href="../../../css/cross.css"/>
	    <link href="../../../plugins/toastr/toastr.min.css" rel="stylesheet">
		<link rel="stylesheet" href="../css/rehabilitation_guidance_preview.css" />
	</head>
	<body>
		<div id="app" v-cloak>
            <div class="previewBox">
                <div class="contentBox">
                    <div class="title">文章详情</div>
                    <div class="contentDetail">
                        <div v-if="modelName" class="detailTitle">{{modelName}}</div>
                        <div  v-if="content" v-html="content"></div>
                        <div v-if="imagesUrls&&imagesUrls.length>0">
                            <div v-for="(url,i) in imagesUrls" :key="i">
                                <img :src="url" width="100%" />
                            </div>
                        </div>
                    </div>
                </div>
                <button @click="onClose" class="_c-btn c-btn-12b7f5 c-btn-w90" style="position: absolute;bottom: -60px;margin-left: 90px;">关 闭</button>
            </div>
	    </div>
		<script type="text/javascript" src="../../../js/vue.js"></script>
		<script>
			var EventBus = new Vue();
		</script>
		<script type="text/javascript" src="../../../js/jquery-2.2.4.js" ></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="../../../api/http-request.js"></script>
		<script type="text/javascript" src="../../../api/rehabilitation-api.js"></script>
		<script src="../../../js/util.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="../../../plugins/layer/layer.min.js" ></script>
		<script type="text/javascript" src="../js/rehabilitation_guidance_preview.js"></script>
	</body>
</html>

+ 1 - 1
app/rehabilitation/html/rehabilitation_management.html

@ -65,7 +65,7 @@
					<a class="icon icon-back icon-16 mr10" href="javascript:history.back();"></a><i class="icon icon-shuaxin icon-16" @click="refreshPage"></i>
				</div>
				<div class="flex-box-item text-center" flex-grow="5">
					<div class="div-kuaisu-task" @click="changeSearch(1)" v-show="tabStatus!=3">快速找任务</div>
					<!-- <div class="div-kuaisu-task" @click="changeSearch(1)" v-show="tabStatus!=3">快速找任务</div> -->
					<div class="pull-right switch-list" v-show="tabStatus!=3">
						<span class="rili" :class="{active:(tabStatus==1)}" @click="tabStatus=1"><i class="icon icon-rili icon-20"></i></span>
						<span class="shijianzhou" :class="{active:(tabStatus==2)}" @click="tabStatus=2"><i class="icon icon-liebiao icon-20"></i></span>

+ 47 - 17
app/rehabilitation/html/service_item_content.html

@ -12,7 +12,7 @@
	<body>
		<div class="panel-group" id="app" v-cloak role="tablist" aria-multiselectable="true">
		  <div class="panelcurPage" v-for="(service,index) in serviceData">
		    <div class="panel-heading"  :class="{active:collapseIndex==index}" role="tab" @click="changeCollapseIndex(index)">
		    <div class="panel-heading"  :class="{active:collapseIndex==index}" role="tab" @click="changeCollapseIndex(index, service)">
		      <div class="panel-title">
		        <a role="button" class="flex-box">
		          <div class="flex-box-item service-top">
@ -29,7 +29,7 @@
		    </div>
		    <div class="panel-collapse collapse" :class="{in:collapseIndex==index}"  role="tabpanel" aria-labelledby="headingOne">
		      	<div class="panel-body">
		      		<div class="service-content">{{service.content}}</div>
		      		<div class="service-content">{{service.content}}的服务项目说明</div>
		      		<div class="service-address ptb20 mb10">
		      			<div class="flex-box">
		      				<div class="flex-box-item">
@ -45,7 +45,7 @@
		      		<div class="service-operation">
		      			<div style="border-bottom: 1px solid #D7D4F0;">
		      				<div class="pb10">
			      				指导与汇报记录&emsp;<span class="view-detail" v-if="service.messageList && service.messageList.length" :class="{active:isCollapse}" @click="chakan"><i class="icon icon-check mr5 icon-16"></i>{{isCollapse?'收起详情':'查看详情'}}</span>
			      				<span class="c-333">指导与汇报记录</span>&emsp;<span class="view-detail" v-if="service.messageList && service.messageList.length" :class="{active:isCollapse}" @click="chakan"><i class="icon icon-check mr5 icon-16"></i>{{isCollapse?'收起详情':'查看详情'}}</span>
			      				<div class="pull-right" v-if="(service.isMyTask==1 || service.isCreate || service.isCK) && service.planStatus!=0 && service.status!=1">
			      					<span class="view-detail" @click="zdly(service)" v-if="service.isCreate && (service.isMyTask!=1)">指导留言</span>
			      					<span class="view-detail" @click="zdly(service)" v-if="service.isCK">查看留言</span>
@ -65,15 +65,20 @@
			      				</div>
		      				</div>
		      				<p class="c-999" style="margin-top: -10px;"  v-if="service.messageList && !service.messageList.length">暂无记录</p>
	      				</div>
						  </div>
						  <!-- operate: 是否完成任务 0 未完成 1 已完成 isMyTask: 0 不是自己的任务 1是自己的任务 status: 0 未完成 1已完成 2已预约-->
						  <!-- planStatus:计划的状态 0 已终止 1进行中 2已完成 -->
						  <!-- itemType: 服务项code 1 电话/短信关怀 2康复咨询 3远程健康监测 4 上门服务 5康复指导 6 康复随访 7 复诊-->
		      			<div class="flex-box btns-group clearfix" v-if="(service.isMyTask==1 || service.isCreate || service.isCK) && service.planStatus!=0 && service.status!=1">
		      				<button class="btn btn-yuyue" v-if="service.reserve==1 && service.status!=2 && service.isMyTask==1" @click="qwapp">转诊预约</button>
		      				<button class="btn btn-yuyue" v-if="service.itemType==2 && service.operate!=1 && !service.isZK && service.isMyTask==1" @click="jkjy(service.patient,service.planDetaiId)">健康教育</button>
		      				<button class="btn btn-yuyue" v-if="service.itemType==3 && service.operate!=1 && !service.isZK && service.isMyTask==1" @click="jkzd(service.planDetaiId,service.patient)">健康指导</button>
		      				<button class="btn btn-yuyue" v-if="service.itemType==4 && service.operate!=1 && !service.isZK && service.isMyTask==1" @click="qwapp">随访</button>
		      				<button class="btn btn-zhidao" v-if="service.itemType==1 && service.operate!=1 && service.isMyTask==1" @click="fwm(service.planDetaiId,service.patient)">服务码</button>
		      				<button class="btn btn-fuwuma" v-if="service.operate==1 && service.isMyTask==1" @click="goToFinish(service.planDetaiId)">记录服务</button>
		      				<button class="btn btn-fuwuma" v-if="service.itemType==0 && service.operate!=1 && service.isMyTask==1" @click="goToFinish(service.planDetaiId)">记录服务</button>
							<button class="btn btn-yuyue" v-if="service.itemType==1 && service.operate!=1 && service.isMyTask==1" @click="goToFinish(service.planDetaiId)">确认完成</button>
							<button class="btn btn-yuyue" v-if="service.itemType==4 && service.operate!=1 && service.isMyTask==1" @click="sendSpecialistWeixinMessage(service.planDetaiId,4)">提醒患者</button>
		      				<button class="btn btn-yuyue" v-if="service.itemType==5 && service.operate!=1 && service.isMyTask==1" @click="kfzd(service.planDetaiId)">发送指导</button>
							<button class="btn btn-yuyue" v-if="service.itemType==6 && service.operate!=1 && service.isMyTask==1" @click="sfjh(service.planDetaiId)" style="width: auto">创建随访计划</button>
							<button class="btn btn-yuyue" v-if="service.itemType==6 && service.operate==1" @click="qwapp" style="width: auto">查看随访结果</button>
							<button class="btn btn-yuyue" v-if="service.itemType==7 && service.operate!=1 && service.isMyTask==1 && service.isZK" @click="sendSpecialistWeixinMessage(service.planDetaiId,7)">提醒患者</button>
							<button class="btn btn-disabled" v-if="service.itemType==7 && service.operate!=1 && service.isMyTask==1 && !service.isZK" @click="qwapp">代预约</button>
							<!-- <button class="btn btn-yuyue" v-if="service.itemType==5 && service.operate!=1 && service.isMyTask==1" @click="jkjy(service.patient,service.planDetaiId)">健康教育</button> -->  
							<!-- <button class="btn btn-zhidao" v-if="service.itemType==1 && service.operate!=1 && service.isMyTask==1" @click="fwm(service.planDetaiId,service.patient)">服务码</button> -->
		      			</div>
		      			<div class="complete-info" v-if="service.status==1">
			      			<div class="complete-title">完成情况</div>
@ -82,11 +87,11 @@
			      				<p class="f14 mb5"><span class="c-999">执行医生:</span>{{service.operatorDoctorName}}</p>
			      			</div>
			      		</div>
			      		<div class="note-info pt10" v-if="service.status==1">
			      		<div class="note-info pt10" v-if="service.itemType==1&&service.status==1">
			      			<p class="f14 c-333">服务完成笔记</p>
			      			<div>{{service.node || '暂无服务记录'}}</div>
			      		</div>
			      		<div class="note-info ptb10" v-if="service.status==1">
			      		<div class="note-info ptb10" v-if="service.itemType==1">
			      			<p class="f14 c-333">相关记录</p>
			      			<ul class="upload-box" v-if="service.status==1 && service.relationRecordImg && service.relationRecordImg.length">
			      				<li class="flex-box" v-for="img in service.relationRecordImg">
@ -99,11 +104,36 @@
			      				<p>暂无相关记录</p>
			      			</div>
			      		</div>
			      		<div class="note-info pt10" v-if="(service.itemType==2 || service.itemType==3 || service.itemType==4) && service.relationRecordCode">
			      		<div class="note-info pt10" v-if="(service.itemType==4 || service.itemType==5 || service.itemType==7) && service.operate==1">
			      			<p class="f14 c-333">关联记录</p>
			      			<p class="guanlian-list text-center c-333" @click="viewDetial(service.itemType,service.relationRecordCode)">
			      				<span class="pull-right"><i class="icon icon-arrow-right"></i></span>{{service.itemType==2?'健康文章':(service.itemType==3?'健康指导':'随访记录')}} {{service.completeTimeShort}}
			      			</p>
			      			<!-- <p class="guanlian-list text-center c-333" @click="viewDetial(service.itemType,service.relationRecordCode)">
			      				<span class="pull-right"><i class="icon icon-arrow-right"></i></span> 暂无关联记录
							  </p> -->
							<div class="ptb10" v-if="service.itemType==4&&service.relationList&&service.relationList.length>0">
								<div v-for="(o, i) in service.relationList">
									<p class="f14 mb5"><span class="c-999">服务时间:</span>{{o.patientExpectedServeTime}}</p>
									<p class="f14 mb5"><span class="c-999">服务地址:</span>{{o.serveAddress}}</p>
									<p class="f14 mb5"><span class="c-999">服务描述:</span>{{o.serveDesc}}</p>
									<p class="f14 mb5"><span class="c-999">服务医生:</span>{{o.doctorName}}</p>
								</div>
							</div>
							<div class="pt10" v-if="service.itemType==5&&service.relationList&&service.relationList.length>0">
								<div v-for="(o, i) in service.relationList" class="ui-grid mb20 pb5" style="border-bottom: 1px solid #D7DCE6;align-items: center;" @click="viewGuidance(o)">
									<div class="ui-col-1 c-666">{{o.attachedTitle}}</div>
									<div class="ui-col-0 c-999">{{o.czrq}}</div>
									<img src="../images/arrow_icon.png" width="7px" height="14px" class="ml10"/>
								</div>
							</div>
							<div class="ptb10" v-if="service.itemType==7&&service.relationList&&service.relationList.length>0">
								<div v-for="(o, i) in service.relationList">
									<p class="f14 mb5"><span class="c-999">预约医院:</span>{{o.orgName}}</p>
									<p class="f14 mb5"><span class="c-999">预约科室:</span>{{o.deptName}}</p>
									<p class="f14 mb5"><span class="c-999">预约医生:</span>{{o.doctorName}}</p>
									<p class="f14 mb5"><span class="c-999">就诊时间:</span>{{o.startTime}}</p>
									<p class="f14 mb5"><span class="c-999">挂号时间:</span>{{o.czrq}}</p>
								</div>
							</div>
							<div v-if="!service.relationList || service.relationList.length==0" class="guanlian-list c-999">暂无关联记录</div>
			      		</div>
		      		</div>
		        </div>

BIN
app/rehabilitation/images/arrow_icon.png


BIN
app/rehabilitation/images/shouji_bg_img.682f0e93.png


+ 457 - 318
app/rehabilitation/js/guide_the_message.js

@ -1,348 +1,487 @@
! function() {
	var httpData = GetRequest();
	new Vue({
		el: "#app",
		data: {
			imgData: {
				accept: 'image/gif, image/jpeg, image/png, image/jpg',
			},
			isCollapse: false,
			upImgs: [],
			upImgArr: [],
			planid: httpData['planid'],
			service: {
				relationRecordImg:{},
				messageList:{}
var httpData = GetRequest();
var docInfo = JSON.parse(window.localStorage.getItem('docInfo'));
var previewLayerIndex, followupLayerIndex, KFZDlayerIndex;
function closeGuidancePreview(){
	layer.close(previewLayerIndex)
}
function closeFollowUpLayer(planDetaiId, relationCode){
	top.rehabilitationGuideVue.updateNoteAndImageRehabilitationOperate(planDetaiId, relationCode)
	layer.close(followupLayerIndex)
}
function closeKFZDlayer(planDetaiId){
	top.rehabilitationGuideVue.saveRehabilitationOperateRecord(planDetaiId, 5)
	layer.close(KFZDlayerIndex)
}
function showSuccessMessage(msg) {
	layer.msg(msg, {
		icon: 1
	})
}
function showErrorMessage(msg) {
	layer.msg(msg, {
		icon: 5
	})
}
top.rehabilitationGuideVue = new Vue({
	el: "#app",
	data: {
		imgData: {
			accept: 'image/gif, image/jpeg, image/png, image/jpg',
		},
		isCollapse: false,
		upImgs: [],
		upImgArr: [],
		planid: httpData['planid'],
		service: {
			relationRecordImg:{},
			messageList:{},
		},
		pId: httpData['pId'],
		oprateType: httpData['oprateType'], // oprateType 1 查看单个服务项
		patient: httpData['patient'],
		layerIndex: undefined
	},
	mounted: function() {
		this.getServiceItem();
	},
	methods: {
		// 提醒患者 num 1康复指导2康复下转3复诊提醒4上门服务提醒5家签提醒
		sendSpecialistWeixinMessage: function(type){
			var vm = this
			var _type = type == 4? 4:type==7?3:''
			var loading = layer.load(0, {shade: false})
			var params = {
				patient: vm.patient,
				doctor: docInfo.code,
				type: _type,
				relationCode: vm.planid,
				planId: vm.pId
			}
			rehaAPI.sendSpecialistWeixinMessage(params).then(function(res){
				layer.close(loading)
				if(res.status == 200){
					showSuccessMessage('提交成功!')
					if(_type == 3 || _type == 4){ // 提醒患者后,即认为是已完成
						vm.saveRehabilitationOperateRecord(vm.planid, type)
					}
				} else {
					showErrorMessage(res.msg)
				}
			})
		},
		mounted: function() {
			this.getServiceItem();
		//健康指导
		kfzd:function(){
			var vm=this
			KFZDlayerIndex = layer.open({
				type: 2,
				//				  offset: ['100px'], //右下角弹出
				area: ['80%', '650px'],
				shade: 0.5,
				title: '康复指导',
				fixed: true, //不固定
				maxmin: true,
				closeBtn: 1,
				shift: 5,
				shadeClose: false, //点击遮罩关闭层
				content:'../../rehabilitation/html/rehabilitation_guidance.html?patient='+vm.patient+'&planDetaiId='+vm.planid+'&planId='+vm.pId,
				end: function() { // 未点击确定按钮,点击关闭按钮  
					this.getServiceItem();   
				}
			});
		},
		methods: {
			zwkf: function() {
				top.layer.msg('此功能暂未开放', {
					icon: 1
				});
			},
			jkjy: function(patient, planId) {
				var vm = this
				top.layer.open({
					type: 2,
					//				  offset: ['100px'], //右下角弹出
					area: ['80%', '648px'],
					shade: 0.5,
					title: '健康教育',
					fixed: true, //不固定
					maxmin: true,
					closeBtn: 1,
					shift: 5,
					shadeClose: false, //点击遮罩关闭层
					content: '../../article/html/article.html?code=' + patient + '&planId=' + planId + '&isReha=true'
				});
			},
			//						健康指导
			jkzd: function(planId,patient) {
				var vm = this
				top.layer.open({
					type: 2,
					//				  offset: ['100px'], //右下角弹出
					area: ['80%', '648px'],
					shade: 0.5,
					title: '健康教育',
					fixed: true, //不固定
					maxmin: true,
					closeBtn: 1,
					shift: 5,
					shadeClose: false, //点击遮罩关闭层
					content: '../../guidance/html/index.html#/person-edit-panel?patient=' + patient + '&planId=' + planId
				});
			},
			qwapp: function() {
				top.layer.msg('请前往app处理', {
					icon: 5
		// 康复随访计划
		sfjh: function(planDetaiId){
			var vm=this
			followupLayerIndex = layer.open({
				type: 2,
				//				  offset: ['100px'], //右下角弹出
				area: ['80%', '650px'],
				shade: 0.5,
				title: '随访计划',
				fixed: true, //不固定
				maxmin: true,
				closeBtn: 1,
				shift: 5,
				shadeClose: false, //点击遮罩关闭层
				content:'../../followup/html/followup_newplan.html?patient='+vm.patient+'&planDetaiId='+planDetaiId+'&planId='+vm.pId,
				end: function() { // 未点击确定按钮,点击关闭按钮  
					this.getServiceItem();    
				}
			});
		},
		zwkf: function() {
			top.layer.msg('此功能暂未开放', {
				icon: 1
			});
		},
		jkjy: function(patient, planId) {
			var vm = this
			top.layer.open({
				type: 2,
				//				  offset: ['100px'], //右下角弹出
				area: ['80%', '648px'],
				shade: 0.5,
				title: '健康教育',
				fixed: true, //不固定
				maxmin: true,
				closeBtn: 1,
				shift: 5,
				shadeClose: false, //点击遮罩关闭层
				content: '../../article/html/article.html?code=' + patient + '&planId=' + planId + '&isReha=true'
			});
		},
		//						健康指导
		jkzd: function(planId,patient) {
			var vm = this
			top.layer.open({
				type: 2,
				//				  offset: ['100px'], //右下角弹出
				area: ['80%', '648px'],
				shade: 0.5,
				title: '健康教育',
				fixed: true, //不固定
				maxmin: true,
				closeBtn: 1,
				shift: 5,
				shadeClose: false, //点击遮罩关闭层
				content: '../../guidance/html/index.html#/person-edit-panel?patient=' + patient + '&planId=' + planId
			});
		},
		qwapp: function() {
			top.layer.msg('请前往app处理', {
				icon: 5
			});
		},
		viewGuidance: function(o){
			var vm = this
			previewLayerIndex = layer.open({
				type: 2,
				area: ['380px', '600px'],
				shade: 0.5,
				title: '预览',
				fixed: true, //不固定
				maxmin: true,
				closeBtn:1,
				shift: 5,
				shadeClose: false, //点击遮罩关闭层
				content: '../../rehabilitation/html/rehabilitation_guidance_preview.html?modelCode='+o.article
			});
		}, 
		getServiceItem: function() {
			var vm = this;
			var loginDoctor = JSON.parse(window.localStorage.getItem('wlyyAgent'));
			var loadding = top.layer.load(0, {
				shade: false
			}); //0代表加载的风格,支持0-2
			rehaAPI.serviceItem({
				planDetailId: vm.planid
			}).then(function(res) {
				top.layer.close(loadding);
				if(res.status == 200) {
					vm.service = res.data;
					var isZK=loginDoctor.doctorType==1?true:false;
					vm.service.isZK=isZK;
					if(vm.service.isMyTask==1){//执行者										
						vm.service.isCK=true;//无法显示按钮
						if(loginDoctor.uid==vm.service.specialistDoctorCode){//说明我自己是创建者
							vm.service.isCK=false;
							vm.service.isCreate=true;
						}
					}else{
						if(loginDoctor.uid==vm.service.specialistDoctorCode){//说明我自己是创建者
							vm.service.isCreate=true;
						}
					}
					if(vm.service.type == 4 || vm.service.type == 5 || vm.service.type == 7){
						vm.getRelationRecord(vm.service.type, vm.planid).then(function(result){
							if(result.status == 200){
								vm.service.relationList = result.data&&result.data.length>0?result.data:undefined
								vm.$forceUpdate()
							}
						})
					}
				} else {
					top.layer.msg(res.msg, {
						icon: 5
					});
				}
				if(vm.service.status==1){
					var index = top.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
					top.layer.title('服务记录详情', index)  //再改变当前层的标题						
				}
			})
		},
		getRelationRecord: function(type, planDetaiId){
			// 1.电话短信 2.康复咨询 3.远程监控检测 4.上门服务 5.康复指导  6 康复随访  7.复诊)
			var vm = this
			var url=''
			if(type==5){
				url='doctor/specialist/rehabilitation/selectByRelationCode'
			}else if(type==7){
				url='third/guahao/selectByRelationCode'
			}else if(type==4){
				url="/doctor/specialist/rehabilitation/selectRelationCode"
			}
			var vm = this
			var params = {
				relationCode: planDetaiId
			}
			return httpRequest.get(url, {data: params})
		},
		zdly: function(data) {
			var vm = this
			var loginDoctor = JSON.parse(window.localStorage.getItem('wlyyAgent'));
			var otherCode, otherName;
			var planDetailId = data.planDetaiId;
			if(loginDoctor.doctorType == 1) {
				otherCode = data.familyDoctorCode;
				otherName = data.familyDoctorName;
			} else {
				otherCode = data.specialistDoctorCode;
				otherName = data.specialistDoctorName;
			}
			top.layer.open({
				type: 2,
				//				  offset: ['100px'], //右下角弹出
				area: ['80%', '600px'],
				shade: 0.5,
				title: '指导留言',
				fixed: true, //不固定
				maxmin: true,
				closeBtn: 1,
				shift: 5,
				shadeClose: false, //点击遮罩关闭层
				content: '../../consulting/html/consulting.html?otherCode=' + otherCode + '&otherName=' + encodeURI(otherName) + '&planDetailId=' + planDetailId,
				end: function() { // 未点击确定按钮,点击关闭按钮  
					      
					vm.getServiceItem();    
				}
			});
		},
		deleteImg: function(idx) {
			console.log(idx)
			this.upImgs.splice(idx, 1)
		},
		chakan: function() {
			this.isCollapse = !this.isCollapse;
		},
		upLoadImgToBase64: function() {
			var vm = this;
			var img1 = event.target.files[0];
			var reader = new FileReader();
			var type = img1.type; //文件的类型,判断是否是图片  
			var size = img1.size; //文件的大小,判断图片的大小  
			if(this.imgData.accept.indexOf(type) == -1) {
				alert('请选择我们支持的图片格式!');
				return false;
			}
			if(size > 3145728) {
				alert('请选择3M以内的图片!');
				return false;
			}
			reader.readAsDataURL(img1);
			reader.onload = function(e) {
				vm.upImgs.push({
					baseUrl: e.target.result
				});
			},
			getServiceItem: function() {
				var vm = this;
				var loginDoctor = JSON.parse(window.localStorage.getItem('wlyyAgent'));
				var loadding = top.layer.load(0, {
					shade: false
				}); //0代表加载的风格,支持0-2
				rehaAPI.serviceItem({
					planDetailId: vm.planid
				}).then(function(res) {
					top.layer.close(loadding);
				vm.upImgArr.push(img1);
				console.log('e', e, 'vm.upImgs', vm.upImgs, 'vm.upImgArr', vm.upImgArr)
				//			             		vm.uploadImg(vm.upImgArr);
			}
		},
		qrwc: function(patient,type) {
			var vm = this;
			vm.saveRehabilitationOperateRecord(vm.planid,type);
		},
		saveRehabilitationOperateRecord:function(planDetailId,type){
			var vm=this, _type;
			if(type==1){
				_type = 8 // 上传附件
			} else {
				_type = type
			}
			var params={
				rehabilitationDetailId: vm.planid,
				node: null,
				patientCode: vm.patient,
				doctorCode: docInfo.code,
				relationRecordType: _type,
				relationRecordCode: '',
				relationRecordImg: null,
				status: 0
			}
			rehaAPI.saveRehabilitationOperateRecord({dataJson:JSON.stringify(params)}).then(function(res){
				if(res.status==200){
					if(type==1){
						vm.uploadImg(vm.upImgArr);
					} else {
						vm.updateNoteAndImageRehabilitationOperate(planDetailId)
					}
				} else {
					layer.msg(res.msg, {
						icon: 5
					});
				}
			})
			
		},
		//上传图片
		uploadImg: function(data) {
			var vm = this;
			var len = data.length;
			if(len==0) {
				vm.updateNoteAndImageRehabilitationOperate(vm.planid)
			} else {
				var file = data[len - 1];
				var formData = new FormData();
				formData.append('file', file);
				rehaAPI.upload(formData).then(function(res) {
					if(res.status == 200) {
						vm.service = res.data;
						var isZK=loginDoctor.doctorType==1?true:false;
						vm.service.isZK=isZK;
						if(vm.service.isMyTask==1){//执行者										
							vm.service.isCK=true;//无法显示按钮
							if(loginDoctor.uid==vm.service.specialistDoctorCode){//说明我自己是创建者
								vm.service.isCK=false;
								vm.service.isCreate=true;
							}
						}else{
							if(loginDoctor.uid==vm.service.specialistDoctorCode){//说明我自己是创建者
								vm.service.isCreate=true;
							}
						}
						vm.upImgs[len - 1].img = res.data;
						data.pop();
						vm.$forceUpdate()
						vm.uploadImg(data);
					} else {
						top.layer.msg(res.msg, {
						layer.msg(res.msg, {
							icon: 5
						});
					}
					if(vm.service.status==1){
						var index = top.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
						top.layer.title('服务记录详情', index)  //再改变当前层的标题						
					}
				})
			},
			zdly: function(data) {
				var vm = this
				var loginDoctor = JSON.parse(window.localStorage.getItem('wlyyAgent'));
				var otherCode, otherName;
				var planDetailId = data.planDetaiId;
				if(loginDoctor.doctorType == 1) {
					otherCode = data.familyDoctorCode;
					otherName = data.familyDoctorName;
				} else {
					otherCode = data.specialistDoctorCode;
					otherName = data.specialistDoctorName;
			}
		},
		updateNoteAndImageRehabilitationOperate: function(planDetailId, relationCode) {
			var vm = this;
			var _image = [];
			$.each(vm.upImgs, function(index, obj){
				_image.push(obj.img);
			})
			var params = {
				planDetailId: planDetailId,
				node: vm.service&&vm.service.node?vm.service.node:null,
				image:JSON.stringify(_image)||''
			}
			if(relationCode){
				params['relationCode'] = relationCode
			}
			var loadding = top.layer.load(0, {
				shade: false
			}); //0代表加载的风格,支持0-2
			rehaAPI.updateNoteAndImageRehabilitationOperate(params).then(function(res) {
				top.layer.close(loadding);
				if(res.status == 200) {
					vm.getServiceItem();
					top.rehabilitationVue.refresh()
				}
			})
		},
		viewDetial:function(type,code){
			var vm=this;
			if(type == 3) {
				top.layer.msg('客户端暂不支持查询健康指导记录');
			} else if(type==4){
				top.layer.msg('客户端暂不支持查询随访记录');
			}else{
				top.layer.open({
					type: 2,
					//				  offset: ['100px'], //右下角弹出
					area: ['80%', '600px'],
					shade: 0.5,
					title: '指导留言',
					title: '指导教育',
					fixed: true, //不固定
					maxmin: true,
					closeBtn: 1,
					shift: 5,
					shadeClose: false, //点击遮罩关闭层
					content: '../../consulting/html/consulting.html?otherCode=' + otherCode + '&otherName=' + encodeURI(otherName) + '&planDetailId=' + planDetailId,
					content: '../../article/html/article-info.html?articleId=' + code,
					end: function() { // 未点击确定按钮,点击关闭按钮  
						      
						vm.getServiceItem();    
					}
				});
			},
			deleteImg: function(idx) {
				console.log(idx)
				this.upImgs.splice(idx, 1)
			},
			chakan: function() {
				this.isCollapse = !this.isCollapse;
			},
			upLoadImgToBase64: function() {
				var vm = this;
				var img1 = event.target.files[0];
				console.log(img1)
				var reader = new FileReader();
				var type = img1.type; //文件的类型,判断是否是图片  
				var size = img1.size; //文件的大小,判断图片的大小  
				if(this.imgData.accept.indexOf(type) == -1) {
					alert('请选择我们支持的图片格式!');
					return false;
				}
				if(size > 3145728) {
					alert('请选择3M以内的图片!');
					return false;
				}
				reader.readAsDataURL(img1);
				reader.onload = function(e) {
					vm.upImgs.push({
						baseUrl: e.target.result
					});
					vm.upImgArr.push(img1);
					//			             		vm.uploadImg(vm.upImgArr);
				}
			},
			qrwc: function(patient,type) {
				var vm = this;
				vm.saveRehabilitationOperateRecord(patient,type);
			},
			saveRehabilitationOperateRecord:function(patient,type){
	        	var vm=this;
	        	var userInfo = JSON.parse(window.localStorage.getItem(httpRequest.agentName)); 
	        	var _type;
	        	if(type==0){
	        		_type=5
	        	}
	        	if(type!=0){
	        		vm.uploadImg(vm.upImgArr, vm.updateNoteAndImageRehabilitationOperate);
	        		return ;//只有上传需要新增
	        	} 
	        	var params={
	        		rehabilitationDetailId:vm.planid,
					node:null,
					patientCode:patient,
					doctorCode:userInfo.uid,
					relationRecordType:_type,
					relationRecordCode:'',
					relationRecordImg:null,
					status:0
	        	}
	        	rehaAPI.saveRehabilitationOperateRecord({dataJson:JSON.stringify(params)}).then(function(res){
	        		var icon=5;
	        		if(res.status==200){
	        			icon=1;
	        			vm.uploadImg(vm.upImgArr, vm.updateNoteAndImageRehabilitationOperate);
	        		}
	        	})
	        	
	        },
			//上传图片
			uploadImg: function(data, cb) {
				var vm = this;
				var len = data.length;
				if(!len) {
					cb && cb();
				} else {
					var file = data[len - 1];
					var formData = new FormData();
					formData.append('file', file);
					rehaAPI.upload(formData).then(function(res) {
						console.log(res)
						if(res.status == 200) {
							console.log(vm.upImgs[len - 1])
							vm.upImgs[len - 1].img = res.data;
							data.pop();
							vm.uploadImg(data, cb);
						}
					})
				}
			},
			viewDetial:function(type,code){
				var vm=this;
				if(type == 3) {
					top.layer.msg('客户端暂不支持查询健康指导记录');
				} else if(type==4){
					top.layer.msg('客户端暂不支持查询随访记录');
				}else{
					top.layer.open({
						type: 2,
						//				  offset: ['100px'], //右下角弹出
						area: ['80%', '600px'],
						shade: 0.5,
						title: '指导教育',
						fixed: true, //不固定
						maxmin: true,
						closeBtn: 1,
						shift: 5,
						shadeClose: false, //点击遮罩关闭层
						content: '../../article/html/article-info.html?articleId=' + code,
						end: function() { // 未点击确定按钮,点击关闭按钮  
							vm.getServiceItem();    
						}
					});
					
				}
			},
			updateNoteAndImageRehabilitationOperate: function() {
				var vm = this;
				var _image = [];
				for(var i in vm.upImgs) {
					_image.push(vm.upImgs[i].img);
				}
				var params = {
					planDetailId: vm.planid,
					node: vm.service.node,
					image: JSON.stringify(_image)
				}
				var loadding = top.layer.load(0, {
					shade: false
				}); //0代表加载的风格,支持0-2
				rehaAPI.updateNoteAndImageRehabilitationOperate(params).then(function(res) {
					top.layer.close(loadding);
					console.log(res)
					if(res.status == 200) {
						vm.getServiceItem();
					}
				})
			},
			getContent: function(value,type) {
				var res=value;
				if(type==2 || type==9){
					res = "<img src='"+httpRequest.getImgUrl(res)+"'>";
				}else if(type==3){
					res = '【语音】';
				}else if(type==19){
					res = '【聊天记录】';
				}else if(type==12){
					res = '【视频】';
				}
				return res;
				
			}
		},
		filters: {
			formatDate: function(value, format) {
				if(!value) return;
				var fmt = format || "yyyy-MM-dd hh:mm";
				var date = new Date(value);
				if(/(y+)/.test(fmt)) {
					fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
				}
				let o = {
					'M+': date.getMonth() + 1,
					'd+': date.getDate(),
					'h+': date.getHours(),
					'm+': date.getMinutes(),
					's+': date.getSeconds()
				};
				for(let k in o) {
					if(new RegExp(`(${k})`).test(fmt)) {
						let str = o[k] + '';
						fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : ('00' + str).substr(str.length));
					}
		getContent: function(value,type) {
			var res=value;
			if(type==2 || type==9){
				res = "<img src='"+httpRequest.getImgUrl(res)+"'>";
			}else if(type==3){
				res = '【语音】';
			}else if(type==19){
				res = '【聊天记录】';
			}else if(type==12){
				res = '【视频】';
			}
			return res;
		}
	},
	filters: {
		formatDate: function(value, format) {
			if(!value) return;
			var fmt = format || "yyyy-MM-dd hh:mm";
			var date = new Date(value);
			if(/(y+)/.test(fmt)) {
				fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
			}
			let o = {
				'M+': date.getMonth() + 1,
				'd+': date.getDate(),
				'h+': date.getHours(),
				'm+': date.getMinutes(),
				's+': date.getSeconds()
			};
			for(let k in o) {
				if(new RegExp(`(${k})`).test(fmt)) {
					let str = o[k] + '';
					fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : ('00' + str).substr(str.length));
				}
				return fmt;
			},
			getImgUrl: function(value) {
				var url = httpRequest.getImgUrl(value);
				return url;
			}
			return fmt;
		},
		getImgUrl: function(value) {
			var url = httpRequest.getImgUrl(value);
			return url;
		}
	})
	$("body").on('click','img',function(){  
        var _this = $(this);//将当前的img元素作为_this传入函数  
        imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);  
    }); 
    function imgShow(outerdiv, innerdiv, bigimg, _this){  
        var src = _this.attr("src");//获取当前点击的pimg元素中的src属性  
        $(bigimg).attr("src", src);//设置#bigimg元素的src属性  
            /*获取当前点击图片的真实大小,并显示弹出层及大图*/  
        $("<img/>").attr("src", src).load(function(){  
            var windowW = $(window).width();//获取当前窗口宽度  
            var windowH = $(window).height();//获取当前窗口高度  
            var realWidth = this.width;//获取图片真实宽度  
            var realHeight = this.height;//获取图片真实高度  
            var imgWidth, imgHeight;  
            var scale = 0.8;//缩放尺寸,当图片真实宽度和高度大于窗口宽度和高度时进行缩放  
              
            if(realHeight>windowH*scale) {//判断图片高度  
                imgHeight = windowH*scale;//如大于窗口高度,图片高度进行缩放  
                imgWidth = imgHeight/realHeight*realWidth;//等比例缩放宽度  
                if(imgWidth>windowW*scale) {//如宽度扔大于窗口宽度  
                    imgWidth = windowW*scale;//再对宽度进行缩放  
                }  
            } else if(realWidth>windowW*scale) {//如图片高度合适,判断图片宽度  
                imgWidth = windowW*scale;//如大于窗口宽度,图片宽度进行缩放  
                            imgHeight = imgWidth/realWidth*realHeight;//等比例缩放高度  
            } else {//如果图片真实高度和宽度都符合要求,高宽不变  
                imgWidth = realWidth;  
                imgHeight = realHeight;  
            }  
                    $(bigimg).css("width",imgWidth);//以最终的宽度对图片缩放  
              
            var w = (windowW-imgWidth)/2;//计算图片与窗口左边距  
            var h = (windowH-imgHeight)/2;//计算图片与窗口上边距  
            $(innerdiv).css({"top":h, "left":w});//设置#innerdiv的top和left属性  
            $(outerdiv).fadeIn("fast");//淡入显示#outerdiv及.pimg  
        });  
        $(outerdiv).click(function(){//再次点击淡出消失弹出层  
            $(this).fadeOut("fast");  
        });  
    }
}();
	}
})
$("body").on('click','img',function(){  
	var _this = $(this);//将当前的img元素作为_this传入函数  
	imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);  
}); 
function imgShow(outerdiv, innerdiv, bigimg, _this){  
	var src = _this.attr("src");//获取当前点击的pimg元素中的src属性  
	$(bigimg).attr("src", src);//设置#bigimg元素的src属性  
		/*获取当前点击图片的真实大小,并显示弹出层及大图*/  
	$("<img/>").attr("src", src).load(function(){  
		var windowW = $(window).width();//获取当前窗口宽度  
		var windowH = $(window).height();//获取当前窗口高度  
		var realWidth = this.width;//获取图片真实宽度  
		var realHeight = this.height;//获取图片真实高度  
		var imgWidth, imgHeight;  
		var scale = 0.8;//缩放尺寸,当图片真实宽度和高度大于窗口宽度和高度时进行缩放  
			
		if(realHeight>windowH*scale) {//判断图片高度  
			imgHeight = windowH*scale;//如大于窗口高度,图片高度进行缩放  
			imgWidth = imgHeight/realHeight*realWidth;//等比例缩放宽度  
			if(imgWidth>windowW*scale) {//如宽度扔大于窗口宽度  
				imgWidth = windowW*scale;//再对宽度进行缩放  
			}  
		} else if(realWidth>windowW*scale) {//如图片高度合适,判断图片宽度  
			imgWidth = windowW*scale;//如大于窗口宽度,图片宽度进行缩放  
						imgHeight = imgWidth/realWidth*realHeight;//等比例缩放高度  
		} else {//如果图片真实高度和宽度都符合要求,高宽不变  
			imgWidth = realWidth;  
			imgHeight = realHeight;  
		}  
				$(bigimg).css("width",imgWidth);//以最终的宽度对图片缩放  
			
		var w = (windowW-imgWidth)/2;//计算图片与窗口左边距  
		var h = (windowH-imgHeight)/2;//计算图片与窗口上边距  
		$(innerdiv).css({"top":h, "left":w});//设置#innerdiv的top和left属性  
		$(outerdiv).fadeIn("fast");//淡入显示#outerdiv及.pimg  
	});  
	$(outerdiv).click(function(){//再次点击淡出消失弹出层  
		$(this).fadeOut("fast");  
	});  
}

+ 54 - 0
app/rehabilitation/js/rehabilitation_guidance.js

@ -0,0 +1,54 @@
var routes = [
	{ path: '/', component: IndexPage2,
	  children: [
	  	{
          path: '/',
          component: TempSendPanel,
          redirect: 'temp-send-panel'
       },
        {
          path: 'temp-send-panel',
          component: TempSendPanel
        },
        {
        	path: 'preview-panel',
          	component: PreviewPanel
        }
      ]
	}
],
router = new VueRouter({
  routes: routes
}),
storage = {
	docInfo: null,
	patient: null, // url中patient,用来来判断是否是"发送"模式
	planId: null
}
var httpData = GetRequest()
new Vue({
    data: {
    },
    router: router,
    created: function() {
    	var vm = this
    	vm.loading.show()
    	homeAPI.baseinfo().then(function(res) {
	  		if(res.status == 200) {
	  			vm.loading.close()
	  			var infoStr = JSON.stringify(res.data);
	  			localStorage.setItem("docInfo", infoStr);
	  			storage.docInfo = res.data
	  			vm.$mount('#app')
	  		} else {
	  			vm.loading.close()
	  			toastr && toastr.error(res.msg)
	  		}
	  	})
    },
    methods: {
        chooseTab: function(val){
            this.selectedTab = val;
        }
    }
})

+ 58 - 0
app/rehabilitation/js/rehabilitation_guidance_preview.js

@ -0,0 +1,58 @@
var httpData = GetRequest();
console.log('httpData',httpData)
var docInfo = JSON.parse(window.localStorage.getItem('docInfo'));
function showSuccessMessage(msg) {
    layer.msg(msg, {
        icon: 1
    })
}
function showErrorMessage(msg) {
    layer.msg(msg, {
        icon: 5
    })
}
new Vue({
    el: "#app",
    data: {
        modelName: '',
        content: '',
        curTemplate: undefined,
        modelCode: httpData['modelCode']||'',
        imagesUrls: []
    },
    mounted: function() {
        this.selectGuidances();
    },
    methods: {
        selectGuidances: function(){
            var vm=this;
            var params={
                type: '',
                id: vm.modelCode,
                title: '',
                page: 1,
                pagesize: 1
            }
            rehaAPI.selectGuidances(params).then(function(res){
                if(res.status==200){
                    if(res.data && res.data.length) {
                        var data = res.data[0]
                        vm.curTemplate = data
                        vm.content = data.content
                        vm.modelName = data.title
                        // vm.imgs = _.map(data.imagesUrls, function(s) {
                        // 	return httpRequest.getImgUrl(s)
                        // })
                    }
                } else {
                    showErrorMessage(res.msg)
                }
            })
        },
        // 关闭窗口
        onClose: function(){
            window.parent.closeGuidancePreview()
        }
    }
})

+ 38 - 11
app/rehabilitation/js/rehabilitation_management.js

@ -12,7 +12,30 @@
		[11.1, 4],
		[7, 4]
	];
	new Vue({
	function showSuccessMessage(msg) {
		layer.msg(msg, {
			icon: 1
		})
	}
	
	function showErrorMessage(msg) {
		layer.msg(msg, {
			icon: 5
		})
	}
	
	function showWarningMessage(msg) {
		layer.msg(msg, {
			icon: 2
		})
	}
	
	function showInfoMessage(msg) {
		layer.msg(msg, {
			icon: 6
		})
	}
	top.rehabilitationVue = new Vue({
		el:"#app",
		data:{
			ynow: currentGMT.getFullYear(),//年份
@ -63,12 +86,16 @@
			this.serviceDoctorList();//获取服务医生列表
			this.bindEvents();
			// 获取最新的诊疗信息1条
            this.findDiagnosisInformationByPlanId()
			this.findDiagnosisInformationByPlanId()
		},
		methods:{
			// 刷新
			refresh: function(){
				this.planSchedule();
				this.timeAxis();
			},
			//获取计划表
			planSchedule:function(){
				
				var vm = this;
				var  params = {
		            planId: this.planId,
@ -184,24 +211,24 @@
					layer.msg('无服务项',{icon:5})
					return ;
				}
				if(status==1 && type==1){
				if(type==1){ // 单个服务项
					top.layer.open({
					  type: 2,
					  area: ['800px', '650px'],
					  area: ['800px', '700px'],
					  shade: 0.5,
					  title: '完成项目确认',
					  title: '服务项目内容',
					  fixed: true, //不固定
					  maxmin: true,
					  closeBtn:1,
					  shift: 5,
					  shadeClose: false, //点击遮罩关闭层
					  content: '../../rehabilitation/html/guide_the_message.html?planid='+planids
					  content: '../../rehabilitation/html/guide_the_message.html?planid='+planids+'&oprateType=1'+'&pId='+httpData['planId']+'&patient='+vm.patientCode
					});
					return ;
				}
				layer.open({
				layer.open({ // 康复计划的所有服务项
				  type: 2,
				  area: ['800px', '650px'],
				  area: ['800px', '700px'],
				  shade: 0.5,
				  title: '服务项目内容',
				  fixed: true, //不固定
@ -209,7 +236,7 @@
				  closeBtn:1,
				  shift: 5,
				  shadeClose: false, //点击遮罩关闭层
				  content: '../../rehabilitation/html/service_item_content.html?planids='+planids,
				  content: '../../rehabilitation/html/service_item_content.html?planids='+planids+'&planId='+httpData['planId']+'&patient='+vm.patientCode,
				  end:function(){
				  	vm.goToLoadData(true);	
				  }
@ -606,7 +633,7 @@
				var otherCode = this.curDoc.code,
				otherName = this.curDoc.name,
				planDetailId = this.planId;
				window.location.href = '../../consulting/html/consulting.html?otherCode=' + otherCode + '&otherName=' + encodeURI(otherName) + '&planDetailId=' + planDetailId
				showInfoMessage('请从“消息-患者消息列表”中查看患者的康复咨询记录')
			},
			//邀请视频聊天
			openVideoChat: function(otherDoc){

+ 456 - 299
app/rehabilitation/js/service_item_content.js

@ -1,316 +1,473 @@
!function(){
		var httpData=GetRequest();
		var userInfo = JSON.parse(window.localStorage.getItem(httpRequest.agentName));  
		new Vue({
					el:"#app",
		data:{
			planids:httpData['planids'],
			serviceData:[
				{
					relationRecordImg:{},
					messageList:{}
var httpData=GetRequest();
var userInfo = JSON.parse(window.localStorage.getItem(httpRequest.agentName));  
var docInfo = JSON.parse(window.localStorage.getItem('docInfo'));
var previewLayerIndex, followupLayerIndex, KFZDlayerIndex;
function closeGuidancePreview(){
	layer.close(previewLayerIndex)
}
function closeFollowUpLayer(planDetaiId, relationCode){
	top.serviceItemVue.updateNoteAndImageRehabilitationOperate(planDetaiId, relationCode)
	layer.close(followupLayerIndex)
}
function closeKFZDlayer(planDetaiId){
	top.serviceItemVue.saveRehabilitationOperateRecord(planDetaiId, 5)
	layer.close(KFZDlayerIndex)
}
function showSuccessMessage(msg) {
	layer.msg(msg, {
		icon: 1
	})
}
function showErrorMessage(msg) {
	layer.msg(msg, {
		icon: 5
	})
}
top.serviceItemVue = new Vue({
			el:"#app",
data:{
	planId: httpData['planId'],
	planids: httpData['planids'],
	patient: httpData['patient'],
	serviceData:[
		{
			relationRecordImg:{},
			messageList:{}
		}
	],
	isCollapse :false,
	collapseIndex:0,
	qrCode:'',
	qrModal:false,
	curDetailId: '',
	layerIndex: undefined
},
mounted:function(){
	this.getServiceItemList();
},
methods:{
	// 提醒患者 num 1康复指导2康复下转3复诊提醒4上门服务提醒5家签提醒
	sendSpecialistWeixinMessage: function(planDetaiId, type){
		var vm = this
		var _type = type == 4? 4:type==7?3:''
		var loading = layer.load(0, {shade: false})
		var params = {
			patient: vm.patient,
			doctor: docInfo.code,
			type: _type,
			relationCode: planDetaiId,
			planId: vm.planId
		}
		rehaAPI.sendSpecialistWeixinMessage(params).then(function(res){
			layer.close(loading)
			if(res.status == 200){
				showSuccessMessage('提交成功!')
				if(_type==3 || _type==4){ // 提醒患者后,即认为是已完成
					vm.saveRehabilitationOperateRecord(planDetaiId, type)
				}
			],
			isCollapse :false,
			collapseIndex:0,
			qrCode:'',
			qrModal:false,
		},
		mounted:function(){
			this.getServiceItemList();
		},
		methods:{
			viewDetial:function(type,code){
				var vm=this;
				if(type==3||type==4){
					var str="";
					if(type==3){
						str="健康指导记录";
					}
					if(type==4){
						str="随访记录"
					}
					top.layer.msg('客户端暂不支持查询'+str);
				}else{
					top.layer.open({
						type: 2,
						//				  offset: ['100px'], //右下角弹出
						area: ['80%', '600px'],
						shade: 0.5,
						title: '指导教育',
						fixed: true, //不固定
						maxmin: true,
						closeBtn: 1,
						shift: 5,
						shadeClose: false, //点击遮罩关闭层
						content: '../../article/html/article-info.html?articleId=' + code,
						end: function() { // 未点击确定按钮,点击关闭按钮  
							vm.getServiceItemList();    
						}
					});
					
			} else {
				showErrorMessage(res.msg)
			}
		})
	},
	viewDetial:function(type,code){
		var vm=this;
		if(type==3||type==4){
			var str="";
			if(type==3){
				str="健康指导记录";
			}
			if(type==4){
				str="随访记录"
			}
			top.layer.msg('客户端暂不支持查询'+str);
		}else{
			top.layer.open({
				type: 2,
				//				  offset: ['100px'], //右下角弹出
				area: ['80%', '600px'],
				shade: 0.5,
				title: '指导教育',
				fixed: true, //不固定
				maxmin: true,
				closeBtn: 1,
				shift: 5,
				shadeClose: false, //点击遮罩关闭层
				content: '../../article/html/article-info.html?articleId=' + code,
				end: function() { // 未点击确定按钮,点击关闭按钮  
					vm.getServiceItemList();    
				}
			},
			chakan:function(){
				this.isCollapse=!this.isCollapse;
			},
			changeCollapseIndex:function(idx){
				this.collapseIndex=idx;
			},
			qwapp:function(){
				layer.msg('请前往app处理',{icon:5});    
			},
			//获取服务列表
			getServiceItemList:function(){
				var vm=this;
				var loginDoctor = JSON.parse(window.localStorage.getItem('wlyyAgent') || '{}');
				var loadding = layer.load(0, {shade: false}); //0代表加载的风格,支持0-2
				rehaAPI.serviceItemList({planDetailIds:vm.planids}).then(function(res){
					layer.close(loadding);
					if(res.status==200){
						var isZK=loginDoctor.doctorType==1?true:false;
						vm.serviceData=_.map(res.data||{},function(o){
							o.isZK=isZK;
							if(o.isMyTask==1){//执行者										
								o.isCK=true;//无法显示按钮
								if(loginDoctor.uid==o.specialistDoctorCode){//说明我自己是创建者
									o.isCK=false;
									o.isCreate=true;
								}
							}else{
								if(loginDoctor.uid==o.specialistDoctorCode){//说明我自己是创建者
									o.isCreate=true;
								}
			});
			
		}
	},
	chakan:function(){
		this.isCollapse=!this.isCollapse;
	},
	changeCollapseIndex:function(idx, o){
		this.collapseIndex=idx;
		this.curDetailId = o.planDetaiId
	},
	qwapp:function(){
		layer.msg('请前往app处理',{icon:5});    
	},
	viewGuidance: function(o){
		var vm = this
		previewLayerIndex = layer.open({
			type: 2,
			area: ['380px', '600px'],
			shade: 0.5,
			title: '预览',
			fixed: true, //不固定
			maxmin: true,
			closeBtn:1,
			shift: 5,
			shadeClose: false, //点击遮罩关闭层
			content: '../../rehabilitation/html/rehabilitation_guidance_preview.html?modelCode='+o.article
		});
	}, 
	//获取服务列表
	getServiceItemList:function(){
		var vm=this;
		var loginDoctor = JSON.parse(window.localStorage.getItem('wlyyAgent') || '{}');
		var loadding = layer.load(0, {shade: false}); //0代表加载的风格,支持0-2
		rehaAPI.serviceItemList({planDetailIds:vm.planids}).then(function(res){
			layer.close(loadding);
			if(res.status==200){
				var isZK=loginDoctor.doctorType==1?true:false;
				vm.serviceData=_.map(res.data||{},function(o, index){
					o.isZK=isZK;
					if(o.isMyTask==1){//执行者										
						o.isCK=true;//无法显示按钮
						if(loginDoctor.uid==o.specialistDoctorCode){//说明我自己是创建者
							o.isCK=false;
							o.isCreate=true;
						}
					}else{
						if(loginDoctor.uid==o.specialistDoctorCode){//说明我自己是创建者
							o.isCreate=true;
						}
					}
					if(o.itemType == 4 || o.itemType == 5 || o.itemType == 7){
						vm.getRelationRecord(index, o.itemType, o.planDetaiId).then(function(result){
							if(result.status == 200){
								o.relationList = result.data&&result.data.length>0?result.data:undefined
								vm.$forceUpdate()
							}
							console.log(o)
							return o
						})
					}else{
						layer.msg(res.msg,{icon:5});
					}
					return o
				})
			},
			//健康教育
			jkjy:function(patient,planId){
				var vm=this
				layer.open({
					type: 2,
					area: ['90%', '600px'],
					shade: 0.5,
					title: '健康教育',
					fixed: true, //不固定
					maxmin: true,
					closeBtn: 1,
					shift: 5,
					shadeClose: false, //点击遮罩关闭层
					content: '../../article/html/article.html?code='+patient+'&planId='+planId+'&isReha=true',
					end: function() { // 未点击确定按钮,点击关闭按钮  
						vm.getServiceItemList();    
					}
				});
			},
//						健康指导
			jkzd:function(planId,patient){
				var vm=this
				layer.open({
					type: 2,
					//				  offset: ['100px'], //右下角弹出
					area: ['80%', '600px'],
					shade: 0.5,
					title: '健康指导',
					fixed: true, //不固定
					maxmin: true,
					closeBtn: 1,
					shift: 5,
					shadeClose: false, //点击遮罩关闭层
					content:'../../guidance/html/index.html#/person-edit-panel?patient='+patient+'&planId='+planId,
					end: function() { // 未点击确定按钮,点击关闭按钮  
						vm.getServiceItemList();    
					}
				});
			},
				if(vm.serviceData.length>0){
					vm.curDetailId = vm.serviceData[0].planDetaiId
				}
			}else{
				layer.msg(res.msg,{icon:5});
			}
		})
	},
	getRelationRecord: function(index, type, planDetaiId){
		// 1.电话短信 2.康复咨询 3.远程监控检测 4.上门服务 5.康复指导  6 康复随访  7.复诊)
		var vm = this
		var url=''
		if(type==5){
			url='doctor/specialist/rehabilitation/selectByRelationCode'
		}else if(type==7){
			url='third/guahao/selectByRelationCode'
		}else if(type==4){
			url="/doctor/specialist/rehabilitation/selectRelationCode"
		}
		var vm = this
		var params = {
			relationCode: planDetaiId
		}
		return httpRequest.get(url, {data: params})
	},
	//健康教育
	jkjy:function(patient,planId){
		var vm=this
		layer.open({
			type: 2,
			area: ['90%', '600px'],
			shade: 0.5,
			title: '健康教育',
			fixed: true, //不固定
			maxmin: true,
			closeBtn: 1,
			shift: 5,
			shadeClose: false, //点击遮罩关闭层
			content: '../../article/html/article.html?code='+patient+'&planId='+planId+'&isReha=true',
			end: function() { // 未点击确定按钮,点击关闭按钮  
				vm.getServiceItemList();    
			}
		});
	},
//			健康指导
	kfzd:function(planDetaiId){
		var vm=this
		KFZDlayerIndex = layer.open({
			type: 2,
			//				  offset: ['100px'], //右下角弹出
			area: ['80%', '650px'],
			shade: 0.5,
			title: '康复指导',
			fixed: true, //不固定
			maxmin: true,
			closeBtn: 1,
			shift: 5,
			shadeClose: false, //点击遮罩关闭层
			content:'../../rehabilitation/html/rehabilitation_guidance.html?patient='+vm.patient+'&planDetaiId='+planDetaiId+'&planId='+vm.planId,
			end: function() { // 未点击确定按钮,点击关闭按钮  
				vm.getServiceItemList();    
			}
		});
	},
	// 康复随访计划
	sfjh: function(planDetaiId){
		var vm=this
		followupLayerIndex = layer.open({
			type: 2,
			//				  offset: ['100px'], //右下角弹出
			area: ['80%', '650px'],
			shade: 0.5,
			title: '随访计划',
			fixed: true, //不固定
			maxmin: true,
			closeBtn: 1,
			shift: 5,
			shadeClose: false, //点击遮罩关闭层
			content:'../../followup/html/followup_newplan.html?patient='+vm.patient+'&planDetaiId='+planDetaiId+'&planId='+vm.planId,
			end: function() { // 未点击确定按钮,点击关闭按钮  
				vm.getServiceItemList();    
			}
		});
	},
	saveRehabilitationOperateRecord:function(planDetailId, type){
		var vm=this;
		var params={
			rehabilitationDetailId: planDetailId,
			node:null,
			patientCode: vm.patient,
			doctorCode: docInfo.code,
			relationRecordType: type,
			relationRecordCode: '',
			relationRecordImg: null,
			status: 0
		}
		rehaAPI.saveRehabilitationOperateRecord({dataJson:JSON.stringify(params)}).then(function(res){
			if(res.status==200){
				vm.updateNoteAndImageRehabilitationOperate(planDetailId)
			}
		})
		
	},
	updateNoteAndImageRehabilitationOperate: function(planDetailId, relationCode) {
		var vm = this;
		var _image = [];
		for(var i in vm.upImgs) {
			_image.push(vm.upImgs[i].img);
		}
		var params = {
			planDetailId: planDetailId,
			node: '',
			image: ''
		}
		if(relationCode){
			params['relationCode'] = relationCode
		}
		var loadding = top.layer.load(0, {
			shade: false
		}); //0代表加载的风格,支持0-2
		rehaAPI.updateNoteAndImageRehabilitationOperate(params).then(function(res) {
			top.layer.close(loadding);
			if(res.status == 200) {
				vm.getServiceItemList();
				top.rehabilitationVue.refresh()
			}
		})
	},
//						暂未开放
			zwkf:function(){
				layer.msg('此功能暂未开放',{icon:1});
			},
			goToFinish:function(planid){
				var vm=this;
				layer.open({
				  type: 2,
	zwkf:function(){
		layer.msg('此功能暂未开放',{icon:1});
	},
	goToFinish:function(planDetaiId){
		var vm=this;
		layer.open({
			type: 2,
//				  offset: ['100px'], //右下角弹出
				  area: ['80%', '600px'],
				  shade: 0.5,
				  title: '完成项目确认',
				  fixed: true, //不固定
				  maxmin: true,
				  closeBtn:1,
				  shift: 5,
				  shadeClose: false, //点击遮罩关闭层
				  content: '../../rehabilitation/html/guide_the_message.html?planid='+planid,
				  end: function() { // 未点击确定按钮,点击关闭按钮  
						vm.getServiceItemList();    
					}
				});
			},
			fwm:function(planid,patient){
				this.loadSocket(planid,patient);
			},
			zdly:function(data){
				var vm = this
				var loginDoctor = JSON.parse(window.localStorage.getItem('wlyyAgent'));
				var otherCode,otherName;
				var planDetailId='';
				
				if(data.specialistDoctorCode==data.executeDoctorCode){
					layer.msg('无法与自己聊天',{icon:5}); 
					return ;
				}
				if(data.isMyTask==1){
					otherCode=data.specialistDoctorCode;
					otherName=data.specialistDoctorName;
				}else{
					planDetailId=data.planDetaiId;
					otherCode=data.executeDoctorCode;
					otherName=data.executeDoctorCode;
				}
				layer.open({
				  type: 2,
			area: ['80%', '650px'],
			shade: 0.5,
			title: '完成项目确认',
			fixed: true, //不固定
			maxmin: true,
			closeBtn:1,
			shift: 5,
			shadeClose: false, //点击遮罩关闭层
			content: '../../rehabilitation/html/guide_the_message.html?planid='+planDetaiId,
			end: function() { // 未点击确定按钮,点击关闭按钮  
				vm.getServiceItemList();    
			}
		});
	},
	fwm:function(planid,patient){
		this.loadSocket(planid,patient);
	},
	zdly:function(data){
		var vm = this
		var loginDoctor = JSON.parse(window.localStorage.getItem('wlyyAgent'));
		var otherCode,otherName;
		var planDetailId='';
		
		if(data.specialistDoctorCode==data.executeDoctorCode){
			layer.msg('无法与自己聊天',{icon:5}); 
			return ;
		}
		if(data.isMyTask==1){
			otherCode=data.specialistDoctorCode;
			otherName=data.specialistDoctorName;
		}else{
			otherCode=data.executeDoctorCode;
			otherName=data.executeDoctorCode;
		}
		planDetailId=data.planDetaiId;
		layer.open({
			type: 2,
//				  offset: ['100px'], //右下角弹出
				  area: ['80%', '600px'],
				  shade: 0.5,
				  title: '指导留言',
				  fixed: true, //不固定
				  maxmin: true,
				  closeBtn:1,
				  shift: 5,
				  shadeClose: false, //点击遮罩关闭层
				  content: '../../consulting/html/consulting.html?otherCode='+otherCode+'&otherName='+encodeURI(otherName)+'&planDetailId='+planDetailId,
				  end:function(){ // 未点击确定按钮,点击关闭按钮  
			      vm.getServiceItemList();
			    }
				});
			},
			loadSocket:function(planid,patient){
				var vm=this;
				var imurl=httpRequest.socketUrl;
			    jQuery.getScript(imurl+"/socket.io/socket.io.js").done(function() {
			        var socket = io.connect(imurl);
			        var sessionId = 'system';
			        socket.emit('login', {userId: userInfo.uid, password: userInfo.uid,sessionId:sessionId,clientType:"doctor"});
			        socket.on('message', function (data) {
			      		console.log(data);
			      		if(data.type==1){
			      			vm.goToFinish(planid);
			      			setTimeout(function(){
								vm.qrModal=false;
							},1000/60)
			      		}
			        });
			
			        socket.on('error', function (data) {
			          console.log(data);
			        });
			
			        socket.on('ack', function (data) {
			          console.log(data);
			          vm.getQRCode(planid);
			        }); 
			        function getLocalTime(nS) {     
			            return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' ');     
			        }    
			    })
			    .fail(function() {
			        layer.msg('服务码创建失败',{icon:5});    
			    });
			},
			getQRCode:function(planid){
				var vm=this;
				var loginDoctor = JSON.parse(window.localStorage.getItem('wlyyAgent'));
				var params={
					planDetailId:planid,
					doctorCode: loginDoctor.uid
			area: ['80%', '600px'],
			shade: 0.5,
			title: '指导留言',
			fixed: true, //不固定
			maxmin: true,
			closeBtn:1,
			shift: 5,
			shadeClose: false, //点击遮罩关闭层
			content: '../../consulting/html/consulting.html?otherCode='+otherCode+'&otherName='+encodeURI(otherName)+'&planDetailId='+planDetailId,
			end:function(){ // 未点击确定按钮,点击关闭按钮  
	      vm.getServiceItemList();
	    }
		});
	},
	loadSocket:function(planid,patient){
		var vm=this;
		var imurl=httpRequest.socketUrl;
		jQuery.getScript(imurl+"/socket.io/socket.io.js").done(function() {
			var socket = io.connect(imurl);
			var sessionId = 'system';
			socket.emit('login', {userId: userInfo.uid, password: userInfo.uid,sessionId:sessionId,clientType:"doctor"});
			socket.on('message', function (data) {
				console.log(data);
				if(data.type==1){
					vm.goToFinish(planid);
					setTimeout(function(){
						vm.qrModal=false;
					},1000/60)
				}
				rehaAPI.createServiceQrCode(params).then(function(res){
					console.log(res);
					if(res.status==200){
						vm.qrCode=res.data;
						setTimeout(function(){
							vm.qrModal=true;
						},1000/60)
					}else{
						layer.msg('服务码获取失败',{icon:5});  
					}
				})
				
			},
			getContent: function(value,type) {
				var res=value;
				if(type==2 || type==9){
					res = "<img src='"+httpRequest.getImgUrl(res)+"' width='100px'>";
				}else if(type==3){
					res = '【语音】';
				}else if(type==19){
					res = '【聊天记录】';
				}else if(type==12){
					res = '【视频】';
				}
				return res;
			},
			previewImg: function(url){
			    var src = httpRequest.getImgUrl(url);
			    imgShow("#outerdiv", "#innerdiv", "#bigimg", src);
			}
		},
		filters:{
		  	formatDate:function(value, format) {
		  		if(!value) return ;
				var d = new Date(value);
				return d.format("yyyy-MM-dd hh:mm:ss");
			},
			getImgUrl: function(value) {
				var url = httpRequest.getImgUrl(value);
				return url;
			});
	
			socket.on('error', function (data) {
				console.log(data);
			});
	
			socket.on('ack', function (data) {
				console.log(data);
				vm.getQRCode(planid);
			}); 
			function getLocalTime(nS) {     
				return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' ');     
			}    
		})
		.fail(function() {
			layer.msg('服务码创建失败',{icon:5});    
		});
	},
	getQRCode:function(planid){
		var vm=this;
		var loginDoctor = JSON.parse(window.localStorage.getItem('wlyyAgent'));
		var params={
			planDetailId:planid,
			doctorCode: loginDoctor.uid
		}
		rehaAPI.createServiceQrCode(params).then(function(res){
			console.log(res);
			if(res.status==200){
				vm.qrCode=res.data;
				setTimeout(function(){
					vm.qrModal=true;
				},1000/60)
			}else{
				layer.msg('服务码获取失败',{icon:5});  
			}
		})
		
	},
	getContent: function(value,type) {
		var res=value;
		if(type==2 || type==9){
			res = "<img src='"+httpRequest.getImgUrl(res)+"' width='100px'>";
		}else if(type==3){
			res = '【语音】';
		}else if(type==19){
			res = '【聊天记录】';
		}else if(type==12){
			res = '【视频】';
		}
	})
		return res;
	},
	previewImg: function(url){
		var src = httpRequest.getImgUrl(url);
		imgShow("#outerdiv", "#innerdiv", "#bigimg", src);
	}
},
filters:{
	formatDate:function(value, format) {
		if(!value) return ;
		var d = new Date(value);
		return d.format("yyyy-MM-dd hh:mm:ss");
	},
	getImgUrl: function(value) {
		var url = httpRequest.getImgUrl(value);
		return url;
	}
}
})
//	$("body").on('click','img',function(){  
//      var _this = $(this);//将当前的img元素作为_this传入函数  
//      imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);  
//  }); 
    function imgShow(outerdiv, innerdiv, bigimg, src){
function imgShow(outerdiv, innerdiv, bigimg, src){
//      var src = _this.attr("src");//获取当前点击的pimg元素中的src属性  
        $(bigimg).attr("src", src);//设置#bigimg元素的src属性  
            /*获取当前点击图片的真实大小,并显示弹出层及大图*/  
        $("<img/>").attr("src", src).load(function(){  
            var windowW = $(window).width();//获取当前窗口宽度  
            var windowH = $(window).height();//获取当前窗口高度  
            var realWidth = this.width;//获取图片真实宽度  
            var realHeight = this.height;//获取图片真实高度  
            var imgWidth, imgHeight;  
            var scale = 0.8;//缩放尺寸,当图片真实宽度和高度大于窗口宽度和高度时进行缩放  
              
            if(realHeight>windowH*scale) {//判断图片高度  
                imgHeight = windowH*scale;//如大于窗口高度,图片高度进行缩放  
                imgWidth = imgHeight/realHeight*realWidth;//等比例缩放宽度  
                if(imgWidth>windowW*scale) {//如宽度扔大于窗口宽度  
                    imgWidth = windowW*scale;//再对宽度进行缩放  
                }  
            } else if(realWidth>windowW*scale) {//如图片高度合适,判断图片宽度  
                imgWidth = windowW*scale;//如大于窗口宽度,图片宽度进行缩放  
                            imgHeight = imgWidth/realWidth*realHeight;//等比例缩放高度  
            } else {//如果图片真实高度和宽度都符合要求,高宽不变  
                imgWidth = realWidth;  
                imgHeight = realHeight;  
            }  
                    $(bigimg).css("width",imgWidth);//以最终的宽度对图片缩放  
              
            var w = (windowW-imgWidth)/2;//计算图片与窗口左边距  
            var h = (windowH-imgHeight)/2;//计算图片与窗口上边距  
            $(innerdiv).css({"top":h, "left":w});//设置#innerdiv的top和left属性  
            $(outerdiv).fadeIn("fast");//淡入显示#outerdiv及.pimg  
        });  
        $(outerdiv).click(function(){//再次点击淡出消失弹出层  
            $(this).fadeOut("fast");  
        }); 
    }
}();
$(bigimg).attr("src", src);//设置#bigimg元素的src属性  
	/*获取当前点击图片的真实大小,并显示弹出层及大图*/  
$("<img/>").attr("src", src).load(function(){  
	var windowW = $(window).width();//获取当前窗口宽度  
	var windowH = $(window).height();//获取当前窗口高度  
	var realWidth = this.width;//获取图片真实宽度  
	var realHeight = this.height;//获取图片真实高度  
	var imgWidth, imgHeight;  
	var scale = 0.8;//缩放尺寸,当图片真实宽度和高度大于窗口宽度和高度时进行缩放  
		
	if(realHeight>windowH*scale) {//判断图片高度  
		imgHeight = windowH*scale;//如大于窗口高度,图片高度进行缩放  
		imgWidth = imgHeight/realHeight*realWidth;//等比例缩放宽度  
		if(imgWidth>windowW*scale) {//如宽度扔大于窗口宽度  
			imgWidth = windowW*scale;//再对宽度进行缩放  
		}  
	} else if(realWidth>windowW*scale) {//如图片高度合适,判断图片宽度  
		imgWidth = windowW*scale;//如大于窗口宽度,图片宽度进行缩放  
					imgHeight = imgWidth/realWidth*realHeight;//等比例缩放高度  
	} else {//如果图片真实高度和宽度都符合要求,高宽不变  
		imgWidth = realWidth;  
		imgHeight = realHeight;  
	}  
			$(bigimg).css("width",imgWidth);//以最终的宽度对图片缩放  
		
	var w = (windowW-imgWidth)/2;//计算图片与窗口左边距  
	var h = (windowH-imgHeight)/2;//计算图片与窗口上边距  
	$(innerdiv).css({"top":h, "left":w});//设置#innerdiv的top和left属性  
	$(outerdiv).fadeIn("fast");//淡入显示#outerdiv及.pimg  
});  
$(outerdiv).click(function(){//再次点击淡出消失弹出层  
	$(this).fadeOut("fast");  
}); 
}

+ 83 - 0
component/rehabilitation/guidance-template-panel.js

@ -0,0 +1,83 @@
Vue.component('guidance-template-panel', {
    template: '<div class="ml20 mr20"">\
					<div ref="innerPanel" style="overflow-y: auto;">\
						<div class="list-arrow-r temp-item" v-for="(o, i) in items">\
							<div @click="showDetail(o)" :class="{\'active\': o == activetemplate}" class="item-header c-nowrap">\
								<span class="c-nowrap">{{o.title}}</span>\
							</div>\
						</div>\
					</div>\
					<div>\
					</div>\
				</div>',
    props: ["activetemplate"],
    data: function() {
        return {
        	pagesize: 20,
        	pageNo: 1,
			items: [],
			downListValue: '',
			searchKey:'',
			guideId: ''
        }
    },
    created: function() {
    	var vm = this
    },
    mounted: function() {
    	var vm = this
    	var el = vm.$refs.innerPanel
    	$(el).height($(window).height() - 140)
    	window.addEventListener('resize', _.debounce(function() {
    		$(el).height($(window).height() - 140)
    	}, 300))
    	
    	el.onscroll = function() {
		    var scrollHeight = el.scrollHeight;
		    var scrollTop = el.scrollTop;
		    var clientHeight = el.clientHeight;
		
		    if (scrollHeight - clientHeight == scrollTop) {
		        vm.selectGuidances()
		    }
		};
    },
    methods: {
    	debounceTempList: _.debounce(function(value, searchKey) {
			var vm = this
    		vm.pageNo = 1
			vm.items = []
			vm.downListValue = value
			vm.searchKey = searchKey
    		this.selectGuidances()
		}, 500, false),
		selectGuidances: function(){
			var vm=this;
			var params={
				type: vm.downListValue,
				id: '',
				title: this.searchKey,
				page: this.pageNo,
				pagesize: this.pagesize
			}
			rehaAPI.selectGuidances(params).then(function(res){
				if(res.status==200){
					if(res.data && res.data.length) {
						vm.pageNo++;
						vm.items = vm.items.concat(res.data)
						if(vm.items.length>0){
							var first = vm.items[0]
							EventBus.$emit('active-template', first)
						}	
					}
				} else {
					layer.msg(res.msg,{icon:5}); 
				}
			})
		},
        showDetail: function(o) {
        	var vm = this
        	EventBus.$emit('active-template', o)
        }
    }
})

+ 24 - 0
component/rehabilitation/index-page2.js

@ -0,0 +1,24 @@
var IndexPage2 = {
    template: '<div class="ui-grid" style="height: calc(100%);">\
    <div class="ui-col-0">\
				<nav-tab>\
				</nav-tab>\
			</div>\
				<div class="ui-col-1 ptb10 plr10" style="overflow-y: auto; height: 100%">\
			  <keep-alive>\
				  <router-view></router-view>\
				</keep-alive>\
		    </div>\
    </div>',
    props: [],
    data: function() {
		return {
		}
    },
    methods: {
    },
    created: function() {
    	var vm = this
    }
}

+ 75 - 0
component/rehabilitation/nav-tab.js

@ -0,0 +1,75 @@
Vue.component('nav-tab', {
	template: '<div style="padding-top: 10px;">\
					<div class="ml20 mr20">\
						<div class="ui-grid" style="align-items: center;">\
							<label class="title c-999 c-f14">病种:</label>\
							<div class="ui-col-1 downList" @click="setDownList">\
								<p class="m0 p0 plr10 c-border cur-pit downList-value c-border-all">{{downListName}}</p>\
								<ul v-if="showDownList" class="m0 p0 c-border-b c-border-l c-border-r c-position-a downList-inner" style="overflow-y: auto; height: 100px;">\
									<li class="plr10 c-border-t cur-pit" v-for="(o, i) in diseaseList" @click.stop="selectDisease(o, i)">{{o.typeName}}</li>\
								</ul>\
							</div>\
						</div>\
						<div class="ui-grid" style="align-items: center;">\
							<label class="title c-999 c-f14">模板:</label>\
							<div class="search-warp ui-col-1">\
								<input class="inp-search" placeholder="请输入康复指导名称查询" v-model="searchKey" @input="onSearch"/>\
							</div>\
						</div>\
					</div>\
	    			<div>\
						<guidance-template-panel ref="guidanceTemplatePanel" :activetemplate="activetemplate"></guidance-template-panel>\
	    			</div>\
    			</div>',
    props: [],
    data: function() {
        return {
        	activetemplate: null,
			isLeader: storage.docInfo.isLeader,
			searchKey:'',
			diseaseList: [{type:'', typeName: '全部'}],
			downListName: '全部',
			downListValue: '',
			showDownList: false
        }
    },
	mounted: function() {
		var vm = this
		EventBus.$on('active-template', function(template) {
			vm.activetemplate = template
		})
		this.$refs.guidanceTemplatePanel.debounceTempList(vm.downListValue,vm.searchKey)
		this.selectType()
	},
    methods: {
		onSearch: function(){
			var vm = this
			this.$refs.guidanceTemplatePanel.debounceTempList(vm.downListValue,vm.searchKey)
		},
		selectDisease: function(o, i){
			var vm = this
			this.downListName = o.typeName
			this.downListValue = o.type
			this.showDownList = false
			this.$refs.guidanceTemplatePanel.debounceTempList(vm.downListValue,vm.searchKey)
		},
		setDownList: function(){
			this.showDownList = !this.showDownList
		},
		// 获取十大病种字典
		selectType: function(){
			var vm=this;
			var params={
			}
			rehaAPI.selectType(params).then(function(res){
				if(res.status==200){
					vm.diseaseList = vm.diseaseList.concat(res.data)
				}else{
					layer.msg(res.msg,{icon:5});  
				}
			})
		},
    }
})

+ 157 - 0
component/rehabilitation/temp-send-panel.js

@ -0,0 +1,157 @@
var httpData = GetRequest()
console.log('httpDatahttpDatahttpData', httpData)
var docInfo = JSON.parse(window.localStorage.getItem("docInfo"));
var previewLayerIndex;
function closeGuidancePreview(){
	layer.close(previewLayerIndex)
}
var TempSendPanel = {
    template: '<div class="template-wrap">\
    			<div style="height: 34px;" >\
		    		指导模板\
		    	</div>\
		    	<div class="temp-info c-f14">\
		    		<div class="temp-name pl10 ptb10">\
		    			模板名称:<input v-model="modelName" placeholder="请输入模板名称( 10字内 )" disabled class="c-f14" />\
		    		</div>\
		    		<div class="c-position-r">\
		    			<textarea @input="countWord" v-model="content" class="ptb10 plr10" disabled style="border: 0;width: 100%;box-sizing: border-box;height: 180px;"></textarea>\
		    			<div class="c-t-right mr10 mb5 c-909090">{{count}}/{{words}}</div>\
		    		</div>\
		    	</div>\
		    	<div v-if="imgs.length>0" class="img-wrap mt20 c-f14">\
	    			<div>插入图片<span class="c-909090">({{imgs.length}}/9)</span></div>\
	    			<div class="img-items mt10">\
						<img v-for="(v,i) in imgs" src="v" />\
	    			</div>\
				</div>\
	    		<div class="foot-btns mt20">\
	    			<a class="preview-btn c-t-center mr15" @click="preViewTemplate">\
		    			预览\
		    		</a>\
		    		<a class="send-btn c-t-center" @click="sendTemplate">\
		    			发送\
		    		</a>\
		    	</div>\
    	</div>',
    props: [],
    data: function() {
        return {
			words: 1000,
			count: 0,
			modelName: '',
			content: '',
			modelCode: '',
			imgs: [],
			curTemplate: undefined,
			previewLayerIndex: undefined,
			planDetaiId: httpData['planDetaiId']
        }
	},
	watch: {
		content: function(){
			this.countWord()
		}
	},
	mounted: function(){
		var vm = this
		EventBus.$on('active-template', function(o){
			vm.modelCode = o.code
			vm.selectGuidances()
		})
	},
	destroyed: function(){
	},
    methods: {
        countWord: function() {
        	if(this.content.length <= this.words) {
        		this.count = this.content.length
        	} else {
        		this.content = this.content.slice(0, this.words)	
        	}
		},
		selectGuidances: function(){
			var vm=this;
			var params={
				type: '',
				id: vm.modelCode,
				title: '',
				page: 1,
				pagesize: 1
			}
			rehaAPI.selectGuidances(params).then(function(res){
				if(res.status==200){
					if(res.data && res.data.length) {
						var data = res.data[0]
						vm.curTemplate = data
						vm.content = data.content
						vm.modelName = data.title
						// vm.imgs = _.map(data.imagesUrls, function(s) {
						// 	return httpRequest.getImgUrl(s)
						// })
					}
				} else {
					layer.msg(res.msg,{icon:5}); 
				}
			})
		},
		preViewTemplate: function(){
			var vm = this
			previewLayerIndex = layer.open({
				type: 2,
				area: ['380px', '600px'],
				shade: 0.5,
				title: '预览',
				fixed: true, //不固定
				maxmin: true,
				closeBtn:1,
				shift: 5,
				shadeClose: false, //点击遮罩关闭层
				content: '../../rehabilitation/html/rehabilitation_guidance_preview.html?modelCode='+vm.modelCode
			});
		}, 
		sendTemplate: function() {
        	var vm = this
            if(!vm.modelName) {
        		toastr && toastr.error("模板名称不能为空")
        		return
        	}
        	if(!vm.content) {
        		toastr && toastr.error("模板内容不能为空")
        		return
			}
			layer.confirm('发出后无法变更,是否确认发送给居民?', { btn: ['继续发送', '取消'], title: "提示" }, function () {
				var loading = layer.load(0, {shade: false})
				var params = [{
					patient: httpData['patient'],
					article: vm.modelCode,
					doctor: docInfo.code,
					attachedContent: vm.content,
					attachedTitle: vm.modelName,
					relationCode: vm.planDetaiId //业务关联
				}]
				rehaAPI.sendGuidance({
					json: JSON.stringify(params),
					planId: httpData['planId']
				}).then(function(res) {
					layer.close(loading)
					if(res.status == 200){
						// 确认完成康复指导
						window.parent.closeKFZDlayer(vm.planDetaiId)
						layer.msg('发送成功', {
							icon: 1
						})
					} else {
						layer.msg(res.msg, {
							icon: 5
						})
					}
				}).catch(function(e) {
					console.error(e)
				})
			})			
	   }
    }
}

File diff suppressed because it is too large
+ 1 - 0
plugins/element-ui/element-ui.css


File diff suppressed because it is too large
+ 1 - 0
plugins/element-ui/element-ui.js


BIN
plugins/element-ui/fonts/element-icons.ttf


BIN
plugins/element-ui/fonts/element-icons.woff