Sfoglia il codice sorgente

康复管理-健康监测

hd 1 mese fa
parent
commit
0607147f8e

+ 476 - 9
app/rehabilitation/html/device.html

@ -1,11 +1,478 @@
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>设备</title>
</head>
<body>
  
</body>
</html>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>新增设备</title>
    <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 rel="stylesheet" href="../../../plugins/toastr/toastr.min.css" />
    <link rel="stylesheet" href="../../../plugins/element-ui/element-ui.css" />
    <link rel="stylesheet" type="text/css" href="../css/date.css" />
    <link rel="stylesheet" href="../css/common.css" />
    <style>
      #app {
        padding: 20px;
        position: relative;
        height: 100%;
      }
      .box {
        display: flex;
        flex-wrap: wrap;
        padding: 12px;
      }
      .item {
        display: flex;
        flex-direction: column;
        align-items: center;
      }
      .item .img-box {
        width: 200px;
        height: 200px;
        background-color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .item img {
        width: 100px;
      }
      .device-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 18px;
      }
      .device-info img {
        width: 180px;
        margin: 10px 0;
      }
      .form-item {
        display: flex;
        align-items: center;
        margin-bottom: 10px;
      }
      .form-item .form-label {
        width: 70px;
      }
      .title {
        font-size: 18px;
        position: relative;
        margin-left: 6px;
        margin-bottom: 10px;
      }
      .title::before {
        content: '';
        width: 3px;
        height: 14px;
        position: absolute;
        left: -8px;
        top: 50%;
        transform: translateY(-50%);
        background-color: #17b3ec;
      }
      .ml6 {
        margin-left: 6px;
      }
      .add-device-btn {
        position: absolute;
        bottom: 28px;
        left: 50%;
        transform: translateX(-50%);
        width: 400px;
      }
    </style>
  </head>
  <body>
    <div id="app" v-cloak>
      <template v-if="step==1">
        <el-tabs v-model="active" type="card" @tab-click="tabChange">
          <el-tab-pane label="血压计" name="xueya" class="box">
            <div v-for="item in xueyaList" :id="item.id" class="item" @click="selectItem(item)">
              <div class="img-box">
                <img :src="item.photo" alt="" v-if="item.photo!=''" />
                <img src="../../../images/img.png" alt="" v-else />
              </div>
              <span>{{item.name}}</span>
            </div>
          </el-tab-pane>
          <el-tab-pane label="智能手表" name="watch">
            <div v-for="item in watchList" :id="item.id" class="item" @click="selectItem(item)">
              <div class="img-box">
                <img :src="item.photo" alt="" v-if="item.photo!=''" />
                <img src="../../../images/img.png" alt="" v-else />
              </div>
              <span>{{item.name}}</span>
            </div>
          </el-tab-pane>
          <el-tab-pane label="血糖仪" name="xuetang">
            <div v-for="item in xuetangList" :id="item.id" class="item" @click="selectItem(item)">
              <div class="img-box">
                <img :src="item.photo" alt="" v-if="item.photo!=''" />
                <img src="../../../images/img.png" alt="" v-else />
              </div>
              <span>{{item.name}}</span>
            </div>
          </el-tab-pane>
        </el-tabs>
      </template>
      <template v-else>
        <div class="device-info">
          <span>{{deviceObj.name}}</span>
          <img :src="deviceObj.photo" alt="" />
        </div>
        <div v-if="deviceObj.categoryCode == 2">
          <div class="form-item">
            <div class="form-label">SN码</div>
            <el-input v-model="query.device_sn" placeholder="请输入设备唯一码"></el-input>
          </div>
          <div class="form-item" v-if="deviceObj.deviceId == 6">
            <div class="form-label">SIM码</div>
            <el-input v-model="query.sim" placeholder="请输入SIM码"></el-input>
          </div>
          <div class="title">绑定快捷键</div>
          <el-radio v-model="query.userType" label="1" class="ml6">A</el-radio>
          <br />
          <el-radio v-model="query.userType" label="2" class="ml6">B</el-radio>
          <br />
          绑定后,从该快捷键上传的数据将导入您的健康记录中!
        </div>
        <div v-else-if="deviceObj.categoryCode == 4">
          <div class="form-item">
            <div class="form-label">IMEI码</div>
            <el-input v-model="query.deviceSn" placeholder="请输入设备唯一码"></el-input>
          </div>
          绑定后,智能手表监测的心率数据将自动同步导入您的健康记录中!
        </div>
        <div v-else>
          <div class="form-item">
            <div class="form-label">SN码</div>
            <el-input v-model="query.device_sn" placeholder="请输入设备唯一码"></el-input>
          </div>
          绑定后,血氧仪测量的数据将自动同步导入您的健康记录中!
        </div>
        <el-button class="add-device-btn" type="primary" @click="bindDeviceFn">立即绑定</el-button>
      </template>
    </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="../../../js/es6-promise.js" charset="utf-8"></script>
    <script type="text/javascript" src="../../../plugins/toastr/toastr.min.js"></script>
    <script type="text/javascript" src="../../../plugins/element-ui/element-ui.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/rehabilitation-api.js"></script>
    <script type="text/javascript" src="../../../api/recover_api.js"></script>
    <script type="text/javascript" src="../../../js/underscore-1.9.1.js"></script>
    <script type="text/javascript" src="../../../js/util.js" charset="utf-8"></script>
    <script>
      new Vue({
        el: '#app',
        data() {
          return {
            active: 'xueya',
            patient: '',
            step: 1,
            query: {},
            xueyaList: [
              {
                'id': 2,
                'categoryCode': '1',
                'photo': 'http://f1.yihuimg.com/TFS/upfile/doctor_honor/2016-07-12/497280_1468291541996.png',
                'brands': '康为',
                'model': 'G-426-3',
                'isMultiUser': '0',
                'multiUser': '{"默认":"-1"}',
                'name': '康为G-426-3',
                'czrq': '2016-09-08',
                'del': '1',
                'authorizationTime': null
              },
              {
                'id': 3,
                'categoryCode': '1',
                'photo': 'http://f1.yihuimg.com/TFS/upfile/doctor_honor/2016-07-12/497276_1468291512115.png',
                'brands': '爱奥乐',
                'model': 'G-777G',
                'isMultiUser': '0',
                'multiUser': '{"默认":"-1"}',
                'name': '爱奥乐G-777G',
                'czrq': '2016-09-08',
                'del': '1',
                'authorizationTime': null
              },
              {
                'id': 5,
                'categoryCode': '1',
                'photo': 'http://www.xmtyw.cn/group1/M00/00/30/Cl8WjFonog2Af6nAAAFuhkn1vlY658.png',
                'brands': '三诺',
                'model': '亲智',
                'isMultiUser': '0',
                'multiUser': '{"默认":"-1"}',
                'name': '三诺亲智',
                'czrq': '2017-12-06',
                'del': '1',
                'authorizationTime': null
              },
              {
                'id': 8,
                'categoryCode': '1',
                'photo': '',
                'brands': '弈拓',
                'model': 'YTSE-1606',
                'isMultiUser': '',
                'multiUser': '',
                'name': '自助体检一体机',
                'czrq': '2019-01-27',
                'del': '1',
                'authorizationTime': null
              }
            ],
            watchList: [],
            xuetangList: [],
            deviceObj: {}
          }
        },
        methods: {
          tabChange(val) {
            switch (val) {
              case 'xueya':
                this.getXueyaList()
                break
              case 'watch':
                this.getWatchList()
                break
              case 'xuetang':
                this.getXuetangList()
                break
            }
          },
          getXueyaList() {
            const vm = this
            httpRequest.get('common/device/DeviceList', { data: { category_code: 2 } }).then(function (res) {
              vm.xueyaList = res.data
            })
          },
          getWatchList() {
            const vm = this
            httpRequest.get('common/device/DeviceList', { data: { category_code: 4 } }).then(function (res) {
              vm.watchList = res.data
            })
          },
          getXuetangList() {
            const vm = this
            httpRequest.get('common/device/DeviceList', { data: { category_code: 1 } }).then(function (res) {
              vm.xuetangList = res.data
            })
          },
          selectItem(item) {
            const vm = this
            httpRequest.get('common/device/DeviceInfo', { data: { id: item.id } }).then(function (res) {
              vm.step++
              vm.deviceObj = { ...res.data, categoryCode: 4 }
              vm.query = {}
            })
          },
          bindDeviceFn() {
            return
            const vm = this
            var b = /^[0-9a-zA-Z]*$/g
            if (!b.test(this.device_sn)) {
              this.$message.warning('对不起,您输入的SN有误,请重新输入')
            }
            let params = {
              device_sn: this.query.device_sn,
              patient: this.patient,
              type: this.deviceObj.categoryCode
            }
            httpRequest.get('doctor/device/PatientDeviceIdcard', { data: params }).then(function (res) {
              if (res.data.length == 0) {
                checkSuccess(snCode)
                return
              }
              //遍历绑定信息
              var isbind = false //是否绑定
              var bindnum = 0
              var showTitle = ''
              var fatherData = null
              var montherData = null
              //循环取出爸爸妈妈健的数据
              for (var j in res.data) {
                var data = res.data[j] //取出设置
                var dataType = data['type'] //按键类型1.爸爸建2.妈妈键
                var others = data['others'] //others==1为被别人绑定
                if (dataType == 1) {
                  fatherData = data
                  if (others == 1) {
                    bindnum += 1
                    if (vm.userType == 1) vm.userType = 0 //被绑定
                  }
                } else {
                  montherData = data
                  if (others == 1) {
                    if (vm.userType == 2) vm.userType = 0 //被绑定
                    $('.monther').attr('data-click', '0') //设置键2无法点击
                    $('.montherbf').html('已经被' + data['name'] + '绑定') //设置绑定信息
                    $('.div-monther-band').show() //显示绑定信息
                    bindnum += 1
                    if ($('.monther').hasClass('active')) {
                      //用户已经选择了爸爸建,就重置
                      $('.monther').removeClass('active')
                      showTitle = '该快捷键已经被' + data['name'] + '绑定,若要绑定该快捷键,需' + data['name'] + '先解绑设备'
                    }
                  }
                }
              }
              if (bindnum == 2) {
                mui.confirm('该设备所有快捷键已被绑定,解绑快捷键后,方可再次绑定!', '', ['我知道了'], function (e) {
                  return
                })
                $('#bang-btn').addClass('active')
                return false
              } else if (bindnum == 1 && showTitle != '') {
                //被绑定的按键选项
                mui.confirm(showTitle, '', ['我知道了'], function (e) {
                  return
                })
                $('#bang-btn').addClass('active')
                return false
              }
              if (fatherData != null) {
                var others = fatherData['others'] //others==1为被别人绑定
                if (others != 1) {
                  //被别人绑定了
                  //被自己绑定
                  if (dataId == null) {
                    //新增的时候输入被自己绑定的SN码
                    $('.father').attr('data-click', '-1') //设置爸爸妈妈键不能点击
                    $('.monther').attr('data-click', '-1')
                    if ($('.father').hasClass('active')) {
                      //用户已经选择了爸爸建,就重置
                      $('.father').removeClass('active')
                    }
                    mui.confirm('对不起,该居民已绑定过该设备,解绑后方可继续操作', '', ['我知道了'], function (e) {
                      return
                    })
                    $('#bang-btn').addClass('active')
                    return false //直接退出不保存
                  } else {
                    if (!checkSuccess) {
                      //界面初始化的时候没有校验成功回调
                      userType = 1
                      //选中爸爸键
                      $('.father').addClass('active')
                    } else if (oldSn != snCode) {
                      $('.father').attr('data-click', '-1') //设置爸爸妈妈键不能点击
                      $('.monther').attr('data-click', '-1')
                      if ($('.father').hasClass('active')) {
                        //用户已经选择了爸爸建,就重置
                        $('.father').removeClass('active')
                      }
                      mui.confirm('对不起,该居民已绑定过该设备,解绑后方可继续操作', '', ['我知道了'], function (e) {
                        return
                      })
                      $('#bang-btn').addClass('active')
                      return false //直接退出不保存
                    }
                  }
                }
              }
              if (montherData != null) {
                var others = montherData['others'] //others==1为被别人绑定
                if (others != 1) {
                  //被自己绑定
                  if (dataId == null) {
                    //新增的时候输入被自己绑定的SN码
                    $('.father').attr('data-click', '-1') //设置爸爸妈妈键不能点击
                    $('.monther').attr('data-click', '-1')
                    //$(".monther").addClass("active");//自己绑定了的键设置高亮
                    if ($('.monther').hasClass('active')) {
                      //用户已经选择了爸爸建,就重置
                      $('.monther').removeClass('active')
                    }
                    mui.confirm('对不起,该居民已绑定过该设备,解绑后方可继续操作', '', ['我知道了'], function (e) {
                      return
                    })
                    $('#bang-btn').addClass('active')
                    return false //直接退出不保存
                  } else {
                    if (!suc) {
                      userType = 2
                      //选中妈妈键
                      $('.monther').addClass('active')
                    } else if (oldSn != snCode) {
                      $('.father').attr('data-click', '-1') //设置爸爸妈妈键不能点击
                      $('.monther').attr('data-click', '-1')
                      //$(".monther").addClass("active");//自己绑定了的键设置高亮
                      if ($('.monther').hasClass('active')) {
                        //用户已经选择了爸爸建,就重置
                        $('.monther').removeClass('active')
                      }
                      mui.confirm('对不起,该居民已绑定过该设备,解绑后方可继续操作', '', ['我知道了'], function (e) {
                        return
                      })
                      $('#bang-btn').addClass('active')
                      return false //直接退出不保存
                    }
                  }
                }
              }
                checkSuccess(snCode)
            })
          },
          checkSuccess(snCode) {
            if (userType == 0) {
              mui.toast('请选择要绑定的快捷键!')
              $('#bang-btn').addClass('active')
              return false
            }
            var name1 = '血压计-' + name
            var params = {}
            params.deviceId = deviceId //设备ID
            params.deviceName = name1 //设备名称
            params.deviceSn = snCode //设备SN码
            params.categoryCode = type //设备分类 血糖仪1   血压计 2
            params.userType = userType //是否多用户,1.爸爸建,2.妈妈键
            params.user = patient
            if (rowData.id) {
              params.id = rowData.id
            }
            if (deviceId == 6) {
              params.sim = $('#simcode').val()
            }
            //增加绑定信息
            var docInfo = JSON.parse(plus.storage.getItem('docInfo'))
            params.hospital = docInfo.hospital
            params.hospitalName = docInfo.hospitalName
            params.checkDoctorName = docInfo.name
            sendPost(
              'doctor/device/SavePatientDevice',
              { 'data': JSON.stringify(params) },
              function (res) {
                mui.toast('设备绑定失败!')
                $('#bang-btn').addClass('active')
              },
              function (res) {
                if (res.status == '200') {
                  mui.toast('设备绑定成功')
                  openwdsb()
                } else {
                  $('#bang-btn').addClass('active')
                  mui.toast(res.msg)
                }
              }
            )
          }
        },
        mounted() {
          // this.getXueyaList()
          this.patient = GetRequest().patient
        }
      })
    </script>
  </body>
</html>

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

@ -146,7 +146,7 @@
						<button class="btn btn-12b7f5" v-if="service.type==6 && service.status!=1 && service.isMyTask==1 && service.operate==1" @click="openRecordForm" style="width: auto">记录随访表单</button>
						<button class="btn btn-12b7f5" v-if="service.type==6 && service.status==1" @click="openFollowResult" style="width: auto">查看随访结果</button>
						<button class="btn btn-yuyue" v-if="service.type==7 && service.status!=1 && service.isMyTask==1 && selectCheckTyperadio!=1 && !service.appointmentTime" @click="sendSpecialistWeixinMessage(7)">提醒患者</button>
						<button class="btn btn-12b7f5" v-if="service.type==7 && service.status!=1 && service.isMyTask==1 && selectCheckTyperadio==0 && !service.appointmentTime" @click="qwapp">代预约</button>
						<button class="btn btn-12b7f5" v-if="service.type==7 && service.status!=1 && service.isMyTask==1 && selectCheckTyperadio==0 && !service.appointmentTime" @click="rehabilitationReservation()">代预约</button>
						<button class="btn btn-12b7f5" v-if="selectCheckTyperadio==1 && showAppointHelpCheckBtn" @click="$refs.datePicker.pickerVisible = true">预约协诊</button>
						<div class="setPicker" style="visibility: hidden;">
							<el-date-picker

+ 288 - 155
app/rehabilitation/html/healthBodyRecord.html

@ -13,12 +13,13 @@
    <link rel="stylesheet" href="../css/common.css" />
    <style>
      #app {
        padding: 8px 16px;
        font-size: 14px;
      }
      .box {
        height: 642px;
        height: 640px;
        overflow: auto;
        padding: 8px 16px;
        box-sizing: border-box;
      }
      .item {
        display: flex;
@ -45,12 +46,15 @@
        <div class="item" v-for="(item,i) in bloodPressureList" :key="i">
          <div>
            <div class="lheight2">
              收缩压:{{item.systolic}}
              <span class="pl8">舒张压:{{item.diastolic}}</span>
              收缩压:{{item.value1}}
              <span class="pl8">
                舒张压:{{item.value2}}
                <span class="pl8">脉搏:{{item.value3}} 次/分</span>
              </span>
            </div>
            <div class="lheight2">{{item.time}} {{item.recordMethod}}</div>
            <div class="lheight2">{{item.date}} {{item.recordMethod}}</div>
          </div>
          <el-tag :type="getTagType(item.condition)">{{getTagName(item.condition)}}</el-tag>
          <el-tag :type="item.tagType" effect="dark">{{item.tagName}}</el-tag>
        </div>
      </div>
      <div class="box" v-else-if="key==1">
@ -60,7 +64,7 @@
            <div class="lheight2">{{item.time}} {{item.recordMethod}}</div>
          </div>
          <div class="flex">
            <el-tag :type="getTagType(item.condition)">{{getTagName(item.condition)}}</el-tag>
            <el-tag :type="item.tagType" effect="dark">{{item.tagName}}</el-tag>
            <span class="pl8">{{item.value}}</span>
          </div>
        </div>
@ -68,29 +72,32 @@
      <div class="box" v-else-if="key==2">
        <div class="item" v-for="(item,i) in heightWeightList" :key="i">
          <div>
            <div class="lheight2">身高:{{item.height}} <span class="pl8">体重:{{item.weight}}</span> </div>
            <div class="lheight2 ">{{item.time}} {{item.recordMethod}}</div>
            <div class="lheight2">
              身高:{{item.value2}}cm
              <span class="pl8">体重:{{item.value1}}kg</span>
            </div>
            <div class="lheight2">{{item.time}} {{item.recordMethod}}</div>
          </div>
          <div class="flex">
            <el-tag :type="getTagType(item.condition)">{{getHeightName(item.condition)}}</el-tag>
            <el-tag :type="item.tagType" effect="dark">{{item.tagName}}</el-tag>
          </div>
        </div>
      </div>
      <div class="box" v-else-if="key == 3">
        <div class="item" v-for="(item,i) in waistList" :key="i">
          <div>
            <div class="lheight2">{{item.circumference}} cm</div>
            <div class="lheight2 ">{{item.time}} {{item.recordMethod}}</div>
            <div class="lheight2">{{item.value1}} cm</div>
            <div class="lheight2">{{item.time}} {{item.recordMethod}}</div>
          </div>
        </div>
      </div>
      <div class="box" v-else>
        <div class="item" v-for="(item,i) in heartRateList" :key="i">
          <div>
            <div class="lheight2">{{item.rate}} 次/分</div>
            <div class="lheight2 ">{{item.time}} {{item.recordMethod}}</div>
            <div class="lheight2">{{item.value1}} 次/分</div>
            <div class="lheight2">{{item.time}} {{item.recordMethod}}</div>
          </div>
          <el-tag :type="getTagType(item.condition)">{{getTagName(item.condition)}}</el-tag>
          <el-tag :type="item.tagType" effect="dark">{{item.tagName}}</el-tag>
        </div>
      </div>
    </div>
@ -110,157 +117,283 @@
        el: '#app',
        data() {
          return {
            key: "",
            bloodPressureList: [
              {
                systolic: '111',
                diastolic: '67',
                time: '2024-10-14 20:21',
                recordMethod: '手动记录',
                condition: 1
              },
              {
                systolic: '69',
                diastolic: '45',
                time: '2024-10-14 20:21',
                recordMethod: '手动记录',
                condition: -1
              },
              {
                systolic: '100',
                diastolic: '89',
                time: '2024-10-14 20:21',
                recordMethod: '设备上传',
                condition: 0
              }
            ],
            bloodSugarList: [
              {
                text: '早餐前',
                time: '2024-10-14 10:21',
                recordMethod: '手动记录',
                condition: 1,
                value: 18.5
              },
              {
                text: '早餐后',
                time: '2024-10-14 10:21',
                recordMethod: '手动记录',
                condition: -1,
                value: 13.6
              },
              {
                text: '午餐前',
                time: '2024-10-14 10:21',
                recordMethod: '设备上传',
                condition: 0,
                value: 15.7
              },
              {
                text: '午餐后',
                time: '2024-10-14 10:21',
                recordMethod: '设备上传',
                condition: 1,
                value: 18.5
              }
            ],
            heightWeightList: [
              {
                height: '170',
                weight: '65',
                time: '2024-10-14 10:21',
                recordMethod: '设备上传',
                condition: 0
              },
              {
                height: '170',
                weight: '40',
                time: '2024-10-14 10:21',
                recordMethod: '设备上传',
                condition: -1
              },
              {
                height: '170',
                weight: '100',
                time: '2024-10-14 10:21',
                recordMethod: '设备上传',
                condition: 1
              }
            ],
            waistList: [
              {
                circumference: '60',
                time: '2024-10-14 10:21',
                recordMethod: '设备上传'
              },
              {
                circumference: '56',
                time: '2024-10-14 10:21',
                recordMethod: '手动记录'
              },
              {
                circumference: '65',
                time: '2024-10-14 10:21',
                recordMethod: '手动记录'
              }
            ],
            heartRateList: [
              {
                rate: '109',
                time: '2024-10-14 10:21',
                recordMethod: '设备上传',
                condition: 1
              },
              {
                rate: '45',
                time: '2024-10-14 10:21',
                recordMethod: '手动记录',
                condition: -1
              },
              {
                rate: '70',
                time: '2024-10-14 10:21',
                recordMethod: '手动记录',
                condition: 0
              }
            ]
            key: '',
            patient: '',
            endDate: '',
            pager: {
              num: 1,
              size: 15
            },
            bloodPressureList: [],
            bloodPressureDisabled: false,
            bloodSugarList: [],
            heightWeightList: [],
            waistList: [],
            heartRateList: []
          }
        },
        mounted() {
          this.key = GetRequest().key
          this.patient = GetRequest().patient
          this.endDate = GetRequest().time
          console.log(GetRequest());
          
          switch (this.key) {
            case '0':
              this.getBloodPressureList()
              break
            case '1':
              this.getBloodSugarList()
              break
            case '2':
              this.getHeightWeightList()
              break
            case '3':
              this.getWaistList()
              break
            case '4':
              this.getHeartRateList()
              break
          }
        },
        methods: {
          getTagType(type) {
            console.log(type);
            
            switch (type) {
              case -1:
                return 'success'
              case 0:
                return ''
              case 1:
                return 'danger'
          getRecordType(isDevice) {
            return isDevice === null ? '手动记录' : isDevice != null ? '设备上传' : ''
          },
          getLevelClazz(value, max, min) {
            if (!value || (!max && !min)) {
              return ''
            }
            var value = parseFloat(value)
            if (value < min) {
              return '-1'
            } else if (value > max) {
              return '1'
            } else {
              return ''
            }
          },
          getBloodPressureList() {
            const vm = this
            function getTagInfo(type, val1, val2) {
              switch (type) {
                case 'type':
                  if (val1 > 0 || val2 > 0) {
                    return 'danger'
                  }
                  if (val1 < 0 || val2 < 0) {
                    return 'success'
                  }
                  return ''
                case 'name':
                  if (val1 > 0 || val2 > 0) {
                    return '偏高'
                  }
                  if (val1 < 0 || val2 < 0) {
                    return '偏低'
                  }
                  return '正常'
              }
            }
                     
            const params = { 
              type: 2, 
              page: 1, 
              pagesize: 100, 
              patient: this.patient,
              begin: this.getDateFromCurrentDate(this.endDate, -2000) + " 00:00:00",
              end: this.endDate + " 23:59:59"
            }
            httpRequest.post('doctor/health_index/list', { data: params }).then(function (res) {
              vm.bloodPressureList = res.list.data.map(function (item) {
                return {
                  ...item,
                  recordMethod: vm.getRecordType(item.deviceSn),
                  tagType: getTagInfo('type', vm.getLevelClazz(item.value1, 139, 90), vm.getLevelClazz(item.value2, 89, 60)),
                  tagName: getTagInfo('name', vm.getLevelClazz(item.value1, 139, 90), vm.getLevelClazz(item.value2, 89, 60))
                }
              })
            })
          },
          getTagName(type) {
            switch (type) {
              case -1:
                return '偏低'
              case 0:
                return '正常'
              case 1:
                return '偏高'
          getBloodSugarList() {
            const vm = this
            function getText(dataType) {
              switch (dataType) {
                case '1':
                  return '早餐前'
                case '2':
                  return '早餐后'
                case '3':
                  return '午餐前'
                case '4':
                  return '午餐后'
                case '5':
                  return '晚餐前'
                case '6':
                  return '晚餐后'
                case '7':
                  return '睡前'
              }
            }
            function getDevice(device) {
              return device == '' ? '手动记录' : '设备上传'
            }
            function getTagInfo(type, val, dataType) {
              var levels = [[], [7.0, 3.9], [11.1, 4.0], [7.0, 3.9], [11.1, 4.0], [7.0, 3.9], [11.1, 4.0], [7.0, 3.9]][dataType]
              switch (type) {
                case 'name':
                  if (vm.getLevelClazz(val, levels[0], levels[1]) > 0) {
                    return '偏高'
                  } else if (vm.getLevelClazz(val, levels[0], levels[1]) < 0) {
                    return '偏低'
                  } else {
                    return '正常'
                  }
                case 'type':
                  if (vm.getLevelClazz(val, levels[0], levels[1]) > 0) {
                    return 'danger'
                  } else if (vm.getLevelClazz(val, levels[0], levels[1]) < 0) {
                    return 'success'
                  } else {
                    return ''
                  }
              }
            }
            const params = { 
              type: 1, 
              page: 1, 
              pagesize: 100, 
              patient: this.patient,
              begin: this.getDateFromCurrentDate(this.endDate, -2000) + " 00:00:00",
              end: this.endDate + " 23:59:59"
            }
            httpRequest.post('doctor/health_index/list', { data: params }).then(function (res) {
              vm.bloodSugarList = res.list.data.map(function (item) {
                return {
                  ...item,
                  text: getText(item.dataType),
                  tagType: getTagInfo('type', item['value' + item.dataType], item.dataType),
                  tagName: getTagInfo('name', item['value' + item.dataType], item.dataType),
                  recordMethod: getDevice(item['deviceSn' + item.dataType]),
                  value: item['value' + item.dataType],
                  time: item['time' + item.dataType]
                }
              })
            })
          },
          getHeightName(type) {
            switch (type) {
              case -1:
                return '偏瘦'
              case 0:
                return '正常'
              case 1:
                return '偏重'
          getHeightWeightList() {
            const vm = this
            function getTixingInfo(type, val) {
              switch (type) {
                case 'name':
                  if (val > 0) {
                    return '偏瘦'
                  } else if (val < 0) {
                    return '偏重'
                  } else {
                    return '正常'
                  }
                case 'type':
                  if (val > 0) {
                    return 'success'
                  } else if (val < 0) {
                    return 'danger'
                  } else {
                    return ''
                  }
              }
            }
            const params = { 
              type: 3, 
              page: 1, 
              pagesize: 100, 
              patient: this.patient,
              begin: this.getDateFromCurrentDate(this.endDate, -2000) + " 00:00:00",
              end: this.endDate + " 23:59:59"
            }
            httpRequest.post('doctor/health_index/list', { data: params }).then(function (res) {
              vm.heightWeightList = res.list.data.map(function (item) {
                return {
                  ...item,
                  tagName: getTixingInfo('name', item.value4 * 1),
                  tagType: getTixingInfo('type', item.value4 * 1),
                  recordMethod: item.deviceSn == '' ? '手动记录' : '设备上传',
                  time: item.czrq.substring(0, 16)
                }
              })
            })
          },
          getWaistList() {
            const vm = this
            const params = { 
              type: 4, 
              page: 1, 
              pagesize: 100, 
              patient: this.patient,
              begin: this.getDateFromCurrentDate(this.endDate, -2000) + " 00:00:00",
              end: this.endDate + " 23:59:59"
            }
            httpRequest.post('doctor/health_index/list', { data: params }).then(function (res) {
              vm.waistList = res.list.data.map(function (item) {
                return {
                  ...item,
                  recordMethod: item.deviceSn == '' ? '手动记录' : '设备上传',
                  time: item.czrq.substring(0, 16)
                }
              })
            })
          },
          getHeartRateList() {
            const vm = this
            function getRateInfo(type, val) {
              switch (type) {
                case 'name':
                  if (val > 100) {
                    return '过快'
                  } else if (val < 60) {
                    return '过缓'
                  } else {
                    return '正常'
                  }
                case 'type':
                  if (val > 100) {
                    return 'danger'
                  } else if (val < 60) {
                    return 'success'
                  } else {
                    return ''
                  }
              }
            }
            const params = { 
              type: 5, 
              page: 1, 
              pagesize: 100, 
              patient: this.patient,
              begin: this.getDateFromCurrentDate(this.endDate, -2000) + " 00:00:00",
              end: this.endDate + " 23:59:59"
            }
            httpRequest.post('doctor/health_index/list', { data: params }).then(function (res) {
              vm.heartRateList = res.list.data.map(function (item) {
                return {
                  ...item,
                  recordMethod: item.deviceSn == '' ? '手动记录' : '设备上传',
                  tagName: getRateInfo('name', item.value1),
                  tagType: getRateInfo('type', item.value1),
                  time: item.czrq.substring(0, 16)
                }
              })
            })
          },
          getDateFromCurrentDate(fromDate, dayInterval) {
            var curDate = new Date(Date.parse(fromDate.replace(/-/g, '/')))
            curDate.setDate(curDate.getDate() + dayInterval)
            var year = curDate.getFullYear()
            var month = curDate.getMonth() + 1 < 10 ? '0' + (curDate.getMonth() + 1) : curDate.getMonth() + 1
            var day = curDate.getDate() < 10 ? '0' + curDate.getDate() : curDate.getDate()
            return year + '-' + month + '-' + day
          }
        }
      })

+ 110 - 120
app/rehabilitation/html/healthFoodDetail.html

@ -1,128 +1,118 @@
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>饮食详情</title>
  <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 rel="stylesheet" href="../../../plugins/toastr/toastr.min.css" />
  <link rel="stylesheet" href="../../../plugins/element-ui/element-ui.css" />
  <link rel="stylesheet" type="text/css" href="../css/date.css" />
  <link rel="stylesheet" href="../css/common.css" />
  <style>
    #app{
      padding: 8px 16px;
      font-size: 14px;
    }
    .food-info{
      font-size: 16px;
      padding-bottom: 12px;
      border-bottom: 1px solid rgba(0, 0, 0, .1);
    }
    .tip{
      color: #11B7F5;
      padding: 12px 0;
    }
    .flex{
      display: flex;
      align-items: center;
    }
    .food-item{
      margin-bottom: 10px;
    }
    .pl8{
      padding-left: 8px;
    }
    .food-component{
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid rgba(0, 0, 0, .1);
      padding: 8px 0;
      margin-left: 20px;
    }
  </style>
</head>
<body>
  <div id="app" v-cloak>
    <div class="food-info">
      <div class="lheight2">2024-10-14 10:21</div>
      <div class="lheight2" style="margin-bottom: 8px;">黄瓜、草莓</div>
      <img src="../../../images/img.png" alt="">
    </div>
    <div class="tip">以下食物热量和营养价值仅供参考</div>
    <div class="food-list">
      <div class="food-item" v-for="(item,i) in foodList" :key="i">
        <div class="flex">
          <img src="../../../images/img.png" alt="">
          <div class="pl8">
            <div>{{item.name}} <span class="pl8">{{item.weight}}</span> </div>
            <div>{{item.heat}} 千卡热量</div>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>饮食详情</title>
    <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 rel="stylesheet" href="../../../plugins/toastr/toastr.min.css" />
    <link rel="stylesheet" href="../../../plugins/element-ui/element-ui.css" />
    <link rel="stylesheet" type="text/css" href="../css/date.css" />
    <link rel="stylesheet" href="../css/common.css" />
    <style>
      #app {
        padding: 8px 16px;
        font-size: 14px;
      }
      .food-info {
        font-size: 16px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
      }
      .tip {
        color: #11b7f5;
        padding: 12px 0;
      }
      .flex {
        display: flex;
        align-items: center;
      }
      .food-item {
        margin-bottom: 10px;
      }
      .pl8 {
        padding-left: 8px;
      }
      .food-component {
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        padding: 8px 0;
        margin-left: 20px;
      }
    </style>
  </head>
  <body>
    <div id="app" v-cloak>
      <div class="food-info">
        <div class="lheight2">{{dietDetail.time}}</div>
        <div class="lheight2" style="margin-bottom: 8px">{{dietDetail.content}}</div>
        <img src="../../../images/img.png" alt="" />
      </div>
      <div class="tip">以下食物热量和营养价值仅供参考</div>
      <div class="food-list">
        <div class="food-item" v-for="(item,i) in foodList" :key="i">
          <div class="flex">
            <img src="../../../images/img.png" alt="" />
            <div class="pl8">
              <div>
                {{item.name}}
                <span class="pl8">{{item.weight}}</span>
              </div>
              <div>{{item.hot}} 千卡热量</div>
            </div>
          </div>
          <div class="food-component" v-for="(val,key) in item.component">
            <div>{{key}}</div>
            <div>{{val}} 克</div>
          </div>
        </div>
        <div class="food-component" v-for="com in item.component">
          <div>{{com.name}}</div>
          <div>{{com.value}} 克</div>
        </div>
      </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="../../../js/es6-promise.js" charset="utf-8"></script>
  <script type="text/javascript" src="../../../plugins/toastr/toastr.min.js"></script>
  <script type="text/javascript" src="../../../plugins/element-ui/element-ui.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/rehabilitation-api.js"></script>
  <script type="text/javascript" src="../../../api/recover_api.js"></script>
  <script type="text/javascript" src="../../../js/underscore-1.9.1.js"></script>
  <script type="text/javascript" src="../../../js/util.js" charset="utf-8"></script>
  <script>
    new Vue({
      el: '#app',
      data() {
        return {
          foodList: [
            {
              name: '草莓',
              weight: "300g/6两",
              heat: '90',
              component: [
                {
                  name: '碳水化合物',
                  value: '21'
                },
                {
                  name: '蛋白质',
                  value: '1'
                }
              ]
            },
            {
              name: '黄瓜',
              weight: "300g/6两",
              heat: '90',
              component: [
                {
                  name: '碳水化合物',
                  value: '21'
                },
                {
                  name: '蛋白质',
                  value: '1'
    <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="../../../js/es6-promise.js" charset="utf-8"></script>
    <script type="text/javascript" src="../../../plugins/toastr/toastr.min.js"></script>
    <script type="text/javascript" src="../../../plugins/element-ui/element-ui.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/rehabilitation-api.js"></script>
    <script type="text/javascript" src="../../../api/recover_api.js"></script>
    <script type="text/javascript" src="../../../js/underscore-1.9.1.js"></script>
    <script type="text/javascript" src="../../../js/util.js" charset="utf-8"></script>
    <script>
      new Vue({
        el: '#app',
        data() {
          return {
            id: '',
            dietDetail:{},
            foodList: []
          }
        },
        methods: {
          getFoodDetail() {
            const vm  = this
            httpRequest.get('common/device/DeviceList', { data: { id: this.id } }).then(function (res) {
              vm.dietDetail = res.dietDetail
              vm.dietDetail.time = vm.dietDetail.recordDate.substring(0,10)
              vm.foodList = res.foodCompList.map(function(item){
                return {
                  ...item,
                  component: JSON.parse(item.component)
                }
              ]
            }
          ]
              })
            })
          }
        },
        mounted() {
          this.id = GetRequest().id
          this.getFoodDetail()
        }
      },
      methods: {
        
      },
    })
  </script>
</body>
</html>
      })
    </script>
  </body>
</html>

+ 202 - 73
app/rehabilitation/html/healthMonitor.html

@ -78,6 +78,10 @@
      }
      .protect-label {
      }
      .device-title {
        font-weight: bold;
        font-size: 16px;
      }
    </style>
  </head>
  <body>
@ -86,58 +90,58 @@
        <el-tab-pane label="体征记录" name="body">
          <div class="body-record-box">
            <div class="title">慢病体征</div>
            <div class="body-record-item" @click="openBodyRecordDetail(0)">
            <div class="body-record-item" @click="openBodyRecordDetail(0,bodyData.xy.recordDate)" v-if="bodyData.xy">
              <div class="record-label">
                <div>血压</div>
                <div>2024-10-14 10:21 设备上传</div>
                <div>{{bodyData.xy.recordDate}} {{getRecordType(bodyData.xy.deviceSn)}}</div>
              </div>
              <div class="record-value flex">
                <div>
                  <div style="text-align: right">122/71</div>
                  <div>脉搏:56次/分</div>
                  <div style="text-align: right">{{bodyData.xy.value1}}/{{bodyData.xy.value2}}</div>
                  <div>脉搏:{{bodyData.xy.value3}}次/分</div>
                </div>
                <i class="el-icon-arrow-right ml10"></i>
              </div>
            </div>
            <div class="body-record-item" @click="openBodyRecordDetail(1)">
            <div class="body-record-item" @click="openBodyRecordDetail(1,bodyData.xt.recordDate)" v-if="bodyData.xt">
              <div class="record-label">
                <div>血糖</div>
                <div>2024-10-14 10:21 设备上传</div>
                <div>{{bodyData.xt.recordDate}} {{bodyData.xt.during}} {{getRecordType(bodyData.xt.deviceSn)}}</div>
              </div>
              <div class="record-value flex">
                <el-tag type="danger">偏高</el-tag>
                <span>18.5</span>
                <el-tag :type="bodyData.xt.tagType" v-if="bodyData.xt.tagName">{{bodyData.xt.tagName}}</el-tag>
                <span>{{ bodyData.xt.value1}}</span>
                <i class="el-icon-arrow-right ml10"></i>
              </div>
            </div>
            <div class="title">一般检查</div>
            <div class="body-record-item" @click="openBodyRecordDetail(2)">
            <div class="body-record-item" @click="openBodyRecordDetail(2, bodyData.tz.recordDate)" v-if="bodyData.tz">
              <div class="record-label">
                <div>身高体重</div>
                <div>2024-10-14 10:21 手动记录</div>
                <div>{{bodyData.tz.recordDate}} {{getRecordType(bodyData.tz.deviceSn)}}</div>
              </div>
              <div class="record-value flex">
                <el-tag>正常</el-tag>
                <el-tag :type="getTixingType(bodyData.tz.value4)" effect="dark">{{getTixingName(bodyData.tz.value4)}}</el-tag>
                <i class="el-icon-arrow-right ml10"></i>
              </div>
            </div>
            <div class="body-record-item" @click="openBodyRecordDetail(3)">
            <div class="body-record-item" @click="openBodyRecordDetail(3, bodyData.sg.recordDate)" v-if="bodyData.sg">
              <div class="record-label">
                <div>腰围</div>
                <div>2024-10-14 10:21 手动记录</div>
                <div>{{bodyData.sg.recordDate}} {{getRecordType(bodyData.sg.deviceSn)}}</div>
              </div>
              <div class="record-value flex">
                <span>56cm</span>
                <span>{{bodyData.sg.value1}}cm</span>
                <i class="el-icon-arrow-right ml10"></i>
              </div>
            </div>
            <div class="body-record-item" @click="openBodyRecordDetail(4)">
            <div class="body-record-item" @click="openBodyRecordDetail(4, bodyData.xl.recordDate)" v-if="bodyData.xl">
              <div class="record-label">
                <div>心率</div>
                <div>2024-10-14 10:21 设备上传</div>
                <div>{{bodyData.xl.recordDate}} {{getRecordType(bodyData.xl.deviceSn)}}</div>
              </div>
              <div class="record-value flex">
                <span>88次/分</span>
                <span>{{bodyData.xl.value1}}次/分</span>
                <i class="el-icon-arrow-right ml10"></i>
              </div>
            </div>
@ -147,11 +151,11 @@
          <div class="device-box">
            <div class="device-item" v-for="(item,i) in deviceList" :key="i">
              <div class="flex">
                <img src="../../../images/img.png" alt="" />
                <div style="margin-left: 16px;">
                  <div class="device-info">{{item.name}}</div>
                  <div class="device-info">{{item.time}}</div>
                  <div class="device-info">{{item.people}}</div>
                <img :src="item.devicePhoto" alt="" style="width: 100px" />
                <div style="margin-left: 16px">
                  <div class="device-info device-title">{{item.deviceName}}</div>
                  <div class="device-info">绑定时间:{{item.czrq}}</div>
                  <div class="device-info" v-if="item.categoryCode != 10 && item.categoryCode != 11">绑定人:{{item.people}}</div>
                </div>
              </div>
              <i class="el-icon-arrow-right ml10"></i>
@ -164,10 +168,10 @@
        <el-tab-pane label="保健记录" name="healthProtect">
          <div class="health-protect-box">
            <div class="title">保健记录</div>
            <div class="health-protect-item" v-for="(item,i) in healthProtectList" :key="i" @click="openHealthProtectDetail(i)">
            <div class="health-protect-item" v-for="(item,i) in healthProtectList" :key="i" @click="openHealthProtectDetail(i,item.time)">
              <div class="protect-label">
                <div>{{item.name}}</div>
                <div>{{item.time}} {{item.recordMehtd}}</div>
                <div>{{item.time}} {{item.recordMethod}}</div>
              </div>
              <div class="flex">
                <span>{{item.lastData}}</span>
@ -195,60 +199,107 @@
        data() {
          return {
            active: 'body',
            deviceList: [
              {
                name: '脉搏仪',
                time: '2023-11-13 10:50:14',
                people: '患者绑定'
              },
              {
                name: '华米手表',
                time: '2023-11-13 10:50:14',
                people: '患者绑定'
              }
            ],
            deviceList: [],
            healthProtectList: [
              {
                name: '运动',
                time: '2024-10-14 10:21',
                recordMehtd: '手动记录',
                lastData: '跑步'
                time: ' ',
                recordMethod: ' ',
                lastData: ' '
              },
              {
                name: '用药',
                time: '2024-10-14 10:21',
                recordMehtd: '手动记录',
                lastData: '阿司匹林'
                time: '',
                recordMethod: '',
                lastData: ''
              },
              {
                name: '饮食',
                time: '2024-10-14 10:21',
                recordMehtd: '设备上传',
                lastData: '黄瓜'
                time: '',
                recordMethod: '',
                lastData: ''
              }
            ]
            ],
            patient: '',
            bodyData: {},
            healthProtect: {}
          }
        },
        mounted() {
          this.patient = GetRequest().patient
          this.getBodyData()
          this.getDeviceList()
          this.getHealthProtect()
        },
        methods: {
          openBodyRecordDetail(key) {
            var title = ""
            switch (key){
          getBodyData() {
            const vm = this
            httpRequest.get('doctor/health_index/last', { data: { patient: this.patient } }).then(function (res) {
              vm.bodyData = res.data
              
              vm.getXtType(res.data.xt)
            })
          },
          getDeviceList() {
            const vm = this
            httpRequest.get('doctor/device/PatientDeviceList', { data: { page: 1, pagesize: 100, patient: this.patient } }).then(function (res) {
              vm.deviceList = res.data
              vm.getBindUser()
            })
          },
          getHealthProtect() {
            const vm = this
            
            httpRequest.get('doctor/health_record/recent', { data: { patient: this.patient } }).then(function (res) {
              const healthProtect = res.data
              
              for (let i in healthProtect) {
                switch (i) {
                  case 'sprot':
                    vm.healthProtectList[0].lastData = healthProtect.sprot.sports
                    vm.healthProtectList[0].time = healthProtect.sprot.recordDate
                    vm.healthProtectList[0].recordMethod = vm.getBJRecordType(healthProtect.sprot.source)
                    break
                  case 'medication':
                    vm.healthProtectList[1].lastData = healthProtect.medication.medication
                    vm.healthProtectList[1].time = healthProtect.medication.recordDate
                    vm.healthProtectList[1].recordMethod = vm.getBJRecordType(healthProtect.medication.source)
                    break
                  case 'diet':
                    vm.healthProtectList[2].lastData = healthProtect.diet.diet
                    vm.healthProtectList[2].time = healthProtect.diet.recordDate
                    vm.healthProtectList[2].recordMethod = vm.getBJRecordType(healthProtect.diet.source)
                    break
                }
              }
              
              vm.$forceUpdate()
            })
          },
          getBJRecordType(isDevice) {
            return isDevice === 0 ? '手动记录' : isDevice == 1 ? '设备上传' : ''
          },
          openBodyRecordDetail(key,time) {
            var title = ''
            switch (key) {
              case 0:
                title = "血压记录"
                break;
                title = '血压记录'
                break
              case 1:
                title = "血糖记录"
                break;
                title = '血糖记录'
                break
              case 2:
                title = "身高体重"
                break;
                title = '身高体重'
                break
              case 3:
                title = "腰围"
                break;
                title = '腰围'
                break
              case 4:
                title = "心率"
                break;
                title = '心率'
                break
            }
            console.log(`rehabilitation/html/healthBodyRecord.html?key=${key}&patient=${this.patient}&time=${time.substring(0, 10)}`);
            
            top.layer.open({
              type: 2,
              area: ['700px', '700px'],
@ -259,21 +310,21 @@
              closeBtn: 1,
              // shift: 5,
              shadeClose: false, //点击遮罩关闭层
              content: './healthBodyRecord.html?key='+key
              content: `../../rehabilitation/html/healthBodyRecord.html?key=${key}&patient=${this.patient}&time=${time.substring(0, 10)}`
            })
          },
          openHealthProtectDetail(key){
            var title = ""
            switch(key){
          openHealthProtectDetail(key,time) {
            var title = ''
            switch (key) {
              case 0:
                title = "运动记录"
                break;
                title = '运动记录'
                break
              case 1:
                title = "用药记录"
                break;
                title = '用药记录'
                break
              case 2:
                title = "饮食记录"
                break;
                title = '饮食记录'
                break
            }
            top.layer.open({
              type: 2,
@ -285,21 +336,99 @@
              closeBtn: 1,
              // shift: 5,
              shadeClose: false, //点击遮罩关闭层
              content: './healthProtect.html?key='+key
              content: `../../rehabilitation/html/healthProtect.html?key=${key}&patient=${this.patient}&time=${time}`
            })
          },
          addDevice(){
          addDevice() {
            top.layer.open({
              type: 2,
              area: ['700px', '700px'],
              shade: 0.5,
              title: "新增设备",
              title: '新增设备',
              fixed: true, //不固定
              maxmin: true,
              closeBtn: 1,
              // shift: 5,
              shadeClose: false, //点击遮罩关闭层
              content: './device.html'
              content: '../../rehabilitation/html/device.html?patient=' + this.patient
            })
          },
          getRecordType(isDevice) {
            return isDevice === null ? '手动记录' : isDevice != null ? '设备上传' : ''
          },
          getTixingName(value) {
            switch (value) {
              case '-1':
                return '偏胖'
              case '1':
                return '偏瘦'
              default:
                return '正常'
            }
          },
          getTixingType(value) {
            switch (value) {
              case '-1':
                return 'danger'
              case '1':
                return 'success'
              default:
                return ''
            }
          },
          getXtType(o) {
            var duringIndex = o.value2 ? o.value2 : 0
            if (o.flag == 2) {
              if (duringIndex == 1) {
                o.during = '餐前血糖'
              } else if (duringIndex == 2) {
                o.during = '餐后血糖'
              } else if (duringIndex == 3) {
                o.during = '随机血糖'
              }
            } else {
              o.during = duringIndex ? xuetangDuring[duringIndex] : ''
            }
            o.value = o.value1
            var levels = [[], [7.0, 3.9], [11.1, 4.0], [7.0, 3.9], [11.1, 4.0], [7.0, 3.9], [11.1, 4.0], [7.0, 3.9]][duringIndex]
            o.tagType = getLevelClazzType(o.value, levels[0], levels[1])
            o.tagName = getLevelClazzName(o.value, levels[0], levels[1])
          },
          getLevelClazzType(value, max, min) {
            if (!value || (!max && !min)) {
              return ''
            }
            var value = parseFloat(value)
            if (value < min) {
              return 'success'
            } else if (value > max) {
              return 'error'
            } else {
              return ''
            }
          },
          getLevelClazzName(value, max, min) {
            if (!value || (!max && !min)) {
              return ''
            }
            var value = parseFloat(value)
            if (value < min) {
              return '偏低'
            } else if (value > max) {
              return '偏高'
            } else {
              return ''
            }
          },
          getBindUser() {
            this.deviceList.forEach(function (item) {
              var bindUser = '患者绑定'
              if (!!rowData.doctor) {
                bindUser = item.doctorName
              }
              item.people = bindUser
            })
          }
        }

+ 59 - 68
app/rehabilitation/html/healthProtect.html

@ -45,27 +45,27 @@
        <div class="item" v-for="(item,i) in sportList" :key="i">
          <div>
            <div class="lheight2">
              运动:{{item.name}}
              <span class="pl8">时长:{{item.duration}}</span>
              运动:{{item.sports}}
              <span class="pl8">时长:{{item.sports_time}}h</span>
            </div>
            <div class="lheight2">{{item.time}} {{item.recordMethod}}</div>
            <div class="lheight2">{{item.record_date}}</div>
          </div>
          <el-tag :type="getTagType(item.condition)">{{getTagName(item.condition)}}</el-tag>
          <el-tag :type="item.tagType">{{item.sports_type}}</el-tag>
        </div>
      </div>
      <div class="box" v-else-if="key == 1">
        <div class="item" v-for="(item,i) in medicineList" :key="i">
          <div>
            <div class="lheight2">{{item.name}}</div>
            <div class="lheight2">{{item.time}} {{item.recordMethod}}</div>
            <div class="lheight2">{{item.time}}</div>
          </div>
        </div>
      </div>
      <div class="box" v-else>
        <div class="item" v-for="(item,i) in foodList" :key="i" style="cursor: pointer;" @click="openFoodDetail(item)">
          <div>
            <div class="lheight2">{{item.name}}</div>
            <div class="lheight2">{{item.time}} {{item.recordMethod}}</div>
            <div class="lheight2">{{item.content}}</div>
            <div class="lheight2">{{item.record_date}} {{item.recordMethod}}</div>
          </div>
          <i class="el-icon-arrow-right"></i>
        </div>
@ -88,69 +88,15 @@
        data() {
          return {
            key: null,
            sportList: [
              {
                name: '跑步',
                duration: '1',
                time: '2024-10-14 10:21',
                recordMethod: '手动记录',
                condition: 1
              },
              {
                name: '跑步',
                duration: '0.5',
                time: '2024-10-14 10:21',
                recordMethod: '手动记录',
                condition: 0
              },
              {
                name: '跑步',
                duration: '2',
                time: '2024-10-14 10:21',
                recordMethod: '设备上传',
                condition: 2
              },
              {
                name: '跑步',
                duration: '4',
                time: '2024-10-14 10:21',
                recordMethod: '设备上传',
                condition: 3
              }
            ],
            medicineList: [
              {
                name: '阿司匹林',
                time: '2024-10-14 10:21',
                recordMethod: '手动记录',
              },
              {
                name: '阿司匹林',
                time: '2024-10-14 10:21',
                recordMethod: '手动记录'
              }
            ],
            foodList: [
              {
                name: '黄瓜',
                time: '2024-10-14 10:21',
                recordMethod: '手动记录'
              },
              {
                name: '鸡蛋、牛肉',
                time: '2024-10-14 10:21',
                recordMethod: '手动记录'
              },
              {
                name: '黄瓜、草莓',
                time: '2024-10-14 10:21',
                recordMethod: '设备上传'
              }
            ]
            patient: null,
            sportList: [],
            medicineList: [],
            foodList: []
          }
        },
        mounted() {
          this.key = GetRequest().key
          this.patient = GetRequest().patient
        },
        methods: {
          getTagType(type) {
@ -177,7 +123,7 @@
                return '强度运动'
            }
          },
          openFoodDetail(){
          openFoodDetail(item){
            top.layer.open({
              type: 2,
              area: ['700px', '700px'],
@ -188,7 +134,52 @@
              closeBtn: 1,
              // shift: 5,
              shadeClose: false, //点击遮罩关闭层
              content: './healthFoodDetail.html'
              content: `./healthFoodDetail.html?id=${item.id}`
            })
          },
          getSportList(){
            const vm = this
            function getTagType(val){
              switch(val) {
                case '轻度运动':
                  return 'success'
                case '中度运动':
                  return ''
                case '稍强运动':
                  return 'warning'
                case '强度运动':
                  return 'error'
              }
            }
            httpRequest.post('doctor/health_record/list_sports',{page:1,pagesize:100,patient: this.patient}).then(function(res){
              vm.sportList = res.data.list.map(function(item){
                return {
                  ...item,
                  tagType: getTagType(item.sports_type)
                }
              })
            })
          },
          getMedicineList(){
            const vm = this
            httpRequest.post('doctor/health_record/list_sports',{page:1,pagesize:100,patient: this.patient}).then(function(res){
              vm.sportList = res.data.list.map(function(item){
                return {
                  ...item,
                  tagType: getTagType(item.sports_type)
                }
              })
            })
          },
          getFoodList(){
            const vm = this
            httpRequest.post('doctor/health_record/list_diet',{page:1,pageSize: 100,patient:this.patient}).then(function(res){
              vm.foodList = res.list.map(function(item){
                return {
                  ...item,
                  recordMethod: item.deviceSn?'设备上传':'手动上传'
                }
              })
            })
          }
        }

+ 45 - 0
app/rehabilitation/html/toDoorService.html

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>上门服务代预约</title>
  <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 rel="stylesheet" href="../../../plugins/toastr/toastr.min.css" />
  <link rel="stylesheet" href="../../../plugins/element-ui/element-ui.css" />
  <link rel="stylesheet" type="text/css" href="../css/date.css" />
  <link rel="stylesheet" href="../css/common.css" />
</head>
<body>
  <div id="app" v-cloak>
    <el-form>
      <el-form-item label="本次预定的服务">
        
      </el-form-item>
    </el-form>
  </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="../../../js/es6-promise.js" charset="utf-8"></script>
  <script type="text/javascript" src="../../../plugins/toastr/toastr.min.js"></script>
  <script type="text/javascript" src="../../../plugins/element-ui/element-ui.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/rehabilitation-api.js"></script>
  <script type="text/javascript" src="../../../api/recover_api.js"></script>
  <script type="text/javascript" src="../../../js/underscore-1.9.1.js"></script>
  <script type="text/javascript" src="../../../js/util.js" charset="utf-8"></script>
  <script>
    new Vue({
      el: '#app',
      data() {
        return {
          
        }
      },
    })
  </script>
</body>
</html>

+ 9 - 0
app/rehabilitation/js/guide_the_message.js

@ -247,6 +247,15 @@ top.rehabilitationGuideVue = new Vue({
				content: '../html/followResult.html'
			})
		},
		rehabilitationReservation(){
			top.layer.open({
        type: 2,
        closeBtn: 1, // 显示关闭按钮
        area: ['800px', '90%'],
        title: '预约挂号',
        content: '../../jbsc/html/appointment/appoint-select.html?patient=' + this.patient + '&surveyCode='
      })
		},
		openFollowRecordForm(){
			top.layer.open({
				type: 2,

+ 1 - 2
app/rehabilitation/js/rehabilitation_management.js

@ -645,7 +645,6 @@
				})
			},
			viewServerItemsDetail: function(o){
				console.log(o);
				
				if(o.code=='2'){
					showInfoMessage('请从“消息-患者消息列表”中查看患者的康复咨询记录')
@ -662,7 +661,7 @@
						closeBtn: 1,
						// shift: 5,
						shadeClose: false, //点击遮罩关闭层
						content: '../html/healthMonitor.html'
						content: '../html/healthMonitor.html?patient=' + this.patientCode
					})
					return
				}