123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402 |
- <!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 {
- font-size: 14px;
- }
- .box {
- height: 640px;
- overflow: auto;
- padding: 8px 16px;
- box-sizing: border-box;
- }
- .item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 8px 0;
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
- }
- .lheight2 {
- line-height: 2;
- }
- .flex {
- display: flex;
- align-items: center;
- }
- .pl8 {
- padding-left: 8px;
- }
- </style>
- </head>
- <body>
- <div id="app" v-cloak>
- <div class="box" v-if="key==0">
- <div class="item" v-for="(item,i) in bloodPressureList" :key="i">
- <div>
- <div class="lheight2">
- 收缩压:{{item.value1}}
- <span class="pl8">
- 舒张压:{{item.value2}}
- <span class="pl8">脉搏:{{item.value3}} 次/分</span>
- </span>
- </div>
- <div class="lheight2">{{item.date}} {{item.recordMethod}}</div>
- </div>
- <el-tag :type="item.tagType" effect="dark">{{item.tagName}}</el-tag>
- </div>
- </div>
- <div class="box" v-else-if="key==1">
- <div class="item" v-for="(item,i) in bloodSugarList" :key="i">
- <div>
- <div class="lheight2">{{item.text}}</div>
- <div class="lheight2">{{item.time}} {{item.recordMethod}}</div>
- </div>
- <div class="flex">
- <el-tag :type="item.tagType" effect="dark">{{item.tagName}}</el-tag>
- <span class="pl8">{{item.value}}</span>
- </div>
- </div>
- </div>
- <div class="box" v-else-if="key==2">
- <div class="item" v-for="(item,i) in heightWeightList" :key="i">
- <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="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.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.value1}} 次/分</div>
- <div class="lheight2">{{item.time}} {{item.recordMethod}}</div>
- </div>
- <el-tag :type="item.tagType" effect="dark">{{item.tagName}}</el-tag>
- </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 {
- 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: {
- 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))
- }
- })
- })
- },
- 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]
- }
- })
- })
- },
- 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
- }
- }
- })
- </script>
- </body>
- </html>
|