|
@ -3,7 +3,7 @@
|
|
|
<head>
|
|
|
<meta charset="UTF-8" />
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
<title>Document</title>
|
|
|
<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" />
|
|
@ -56,15 +56,15 @@
|
|
|
<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}}</div>
|
|
|
<div class="lheight2">{{item.medicines}}</div>
|
|
|
<div class="lheight2">{{item.record_date}} {{}}</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 class="item" v-for="(item,i) in foodList" :key="i" style="cursor: pointer" @click="openFoodDetail(item)">
|
|
|
<div>
|
|
|
<div class="lheight2">{{item.content}}</div>
|
|
|
<div class="lheight2" style="font-size: 16px">{{item.content}}</div>
|
|
|
<div class="lheight2">{{item.record_date}} {{item.recordMethod}}</div>
|
|
|
</div>
|
|
|
<i class="el-icon-arrow-right"></i>
|
|
@ -89,6 +89,7 @@
|
|
|
return {
|
|
|
key: null,
|
|
|
patient: null,
|
|
|
endTime: null,
|
|
|
sportList: [],
|
|
|
medicineList: [],
|
|
|
foodList: []
|
|
@ -97,50 +98,38 @@
|
|
|
mounted() {
|
|
|
this.key = GetRequest().key
|
|
|
this.patient = GetRequest().patient
|
|
|
this.endTime = GetRequest().time
|
|
|
switch (this.key) {
|
|
|
case '0':
|
|
|
this.getSportList()
|
|
|
break
|
|
|
case '1':
|
|
|
this.getMedicineList()
|
|
|
break
|
|
|
case '2':
|
|
|
this.getFoodList()
|
|
|
break
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
getTagType(type) {
|
|
|
switch (type) {
|
|
|
case 0:
|
|
|
return 'success'
|
|
|
case 1:
|
|
|
return ''
|
|
|
case 2:
|
|
|
return 'warning'
|
|
|
case 3:
|
|
|
return 'danger'
|
|
|
}
|
|
|
},
|
|
|
getTagName(type) {
|
|
|
switch (type) {
|
|
|
case 0:
|
|
|
return '轻度运动'
|
|
|
case 1:
|
|
|
return '中度运动'
|
|
|
case 2:
|
|
|
return '稍强运动'
|
|
|
case 3:
|
|
|
return '强度运动'
|
|
|
}
|
|
|
},
|
|
|
openFoodDetail(item){
|
|
|
openFoodDetail(item) {
|
|
|
top.layer.open({
|
|
|
type: 2,
|
|
|
area: ['700px', '700px'],
|
|
|
shade: 0.5,
|
|
|
title: "饮食详情",
|
|
|
title: '饮食详情',
|
|
|
fixed: true, //不固定
|
|
|
maxmin: true,
|
|
|
closeBtn: 1,
|
|
|
// shift: 5,
|
|
|
shadeClose: false, //点击遮罩关闭层
|
|
|
content: `./healthFoodDetail.html?id=${item.id}`
|
|
|
content: `../../rehabilitation/html/healthFoodDetail.html?id=${item.id}`
|
|
|
})
|
|
|
},
|
|
|
getSportList(){
|
|
|
getSportList() {
|
|
|
const vm = this
|
|
|
function getTagType(val){
|
|
|
switch(val) {
|
|
|
function getTagType(val) {
|
|
|
switch (val) {
|
|
|
case '轻度运动':
|
|
|
return 'success'
|
|
|
case '中度运动':
|
|
@ -151,8 +140,15 @@
|
|
|
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){
|
|
|
const params = {
|
|
|
page: 1,
|
|
|
pagesize: 100,
|
|
|
patient: this.patient,
|
|
|
start: this.getDateFromCurrentDate(this.endTime, -2000) + ' 00:00:00',
|
|
|
end: this.endTime + ' 23:59:59'
|
|
|
}
|
|
|
httpRequest.post('doctor/health_record/list_sports', { data: params }).then(function (res) {
|
|
|
vm.sportList = res.list.map(function (item) {
|
|
|
return {
|
|
|
...item,
|
|
|
tagType: getTagType(item.sports_type)
|
|
@ -160,27 +156,49 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
getMedicineList(){
|
|
|
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){
|
|
|
const params = {
|
|
|
page: 1,
|
|
|
pagesize: 100,
|
|
|
patient: this.patient,
|
|
|
start: this.getDateFromCurrentDate(this.endTime, -2000) + ' 00:00:00',
|
|
|
end: this.endTime + ' 23:59:59'
|
|
|
}
|
|
|
httpRequest.post('doctor/health_record/list_medication', { data: params }).then(function (res) {
|
|
|
vm.medicineList = res.list.map(function (item) {
|
|
|
return {
|
|
|
...item,
|
|
|
tagType: getTagType(item.sports_type)
|
|
|
recordMethod: item.source == 0 ? '手动记录' : '设备上传'
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
getFoodList(){
|
|
|
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){
|
|
|
const params = {
|
|
|
page: 1,
|
|
|
pagesize: 100,
|
|
|
patient: this.patient,
|
|
|
start: this.getDateFromCurrentDate(this.endTime, -2000) + ' 00:00:00',
|
|
|
end: this.endTime + ' 23:59:59'
|
|
|
}
|
|
|
httpRequest.post('doctor/health_record/list_diet', { data: params }).then(function (res) {
|
|
|
vm.foodList = res.list.map(function (item) {
|
|
|
return {
|
|
|
...item,
|
|
|
recordMethod: item.deviceSn?'设备上传':'手动上传'
|
|
|
recordMethod: item.deviceSn ? '设备上传' : '手动上传'
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
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
|
|
|
}
|
|
|
}
|
|
|
})
|