healthMonitor.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>健康监测</title>
  7. <link rel="stylesheet" type="text/css" href="../../../css/bootstrap.min.css" />
  8. <link rel="stylesheet" type="text/css" href="../../../css/style.min.css" />
  9. <link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
  10. <link rel="stylesheet" href="../../../plugins/toastr/toastr.min.css" />
  11. <link rel="stylesheet" href="../../../plugins/element-ui/element-ui.css" />
  12. <link rel="stylesheet" type="text/css" href="../css/date.css" />
  13. <link rel="stylesheet" href="../css/common.css" />
  14. <style>
  15. #app {
  16. padding: 10px;
  17. font-size: 14px;
  18. }
  19. .body-record-box {
  20. padding: 0 16px;
  21. }
  22. .title {
  23. font-size: 18px;
  24. position: relative;
  25. margin-top: 8px;
  26. }
  27. .title::before {
  28. height: 18px;
  29. position: absolute;
  30. left: -8px;
  31. top: 50%;
  32. transform: translateY(-50%);
  33. content: '';
  34. width: 3px;
  35. background: #17b3ec;
  36. }
  37. .flex {
  38. display: flex;
  39. align-items: center;
  40. }
  41. .body-record-item {
  42. justify-content: space-between;
  43. border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  44. padding: 8px 0;
  45. display: flex;
  46. align-items: center;
  47. cursor: pointer;
  48. }
  49. .ml10 {
  50. margin-left: 10px;
  51. }
  52. .device-box {
  53. padding: 0 16px;
  54. }
  55. .device-item {
  56. display: flex;
  57. justify-content: space-between;
  58. align-items: center;
  59. border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  60. padding: 8px 0;
  61. cursor: pointer;
  62. }
  63. .device-item .device-info {
  64. line-height: 28px;
  65. }
  66. .add-btn {
  67. margin: 20px auto;
  68. }
  69. .health-protect-box {
  70. padding: 0 16px;
  71. }
  72. .health-protect-item {
  73. display: flex;
  74. align-items: center;
  75. justify-content: space-between;
  76. border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  77. padding: 8px 0;
  78. cursor: pointer;
  79. }
  80. .protect-label {
  81. }
  82. .device-title {
  83. font-weight: bold;
  84. font-size: 16px;
  85. }
  86. </style>
  87. </head>
  88. <body>
  89. <div id="app" v-cloak>
  90. <el-tabs v-model="active" type="card">
  91. <el-tab-pane label="体征记录" name="body">
  92. <div class="body-record-box">
  93. <div class="title">慢病体征</div>
  94. <div class="body-record-item" @click="openBodyRecordDetail(0,bodyData.xy.recordDate)" v-if="bodyData.xy">
  95. <div class="record-label">
  96. <div>血压</div>
  97. <div>{{formatDate(bodyData.xy.recordDate)}} {{getRecordType(bodyData.xy.deviceSn)}}</div>
  98. </div>
  99. <div class="record-value flex">
  100. <div>
  101. <div style="text-align: right">{{bodyData.xy.value1}}/{{bodyData.xy.value2}}</div>
  102. <div>脉搏:{{bodyData.xy.value3}}次/分</div>
  103. </div>
  104. <i class="el-icon-arrow-right ml10"></i>
  105. </div>
  106. </div>
  107. <div class="body-record-item" @click="openBodyRecordDetail(1,bodyData.xt.recordDate)" v-if="bodyData.xt">
  108. <div class="record-label">
  109. <div>血糖</div>
  110. <div>{{formatDate(bodyData.xt.recordDate)}} {{bodyData.xt.during}} {{getRecordType(bodyData.xt.deviceSn)}}</div>
  111. </div>
  112. <div class="record-value flex">
  113. <el-tag :type="bodyData.xt.tagType" v-if="bodyData.xt.tagName" style="margin-right: 10px">{{bodyData.xt.tagName}}</el-tag>
  114. <span>{{ bodyData.xt.value1}}</span>
  115. <i class="el-icon-arrow-right ml10"></i>
  116. </div>
  117. </div>
  118. <div class="title">一般检查</div>
  119. <div class="body-record-item" @click="openBodyRecordDetail(2, bodyData.tz.recordDate)" v-if="bodyData.tz">
  120. <div class="record-label">
  121. <div>身高体重</div>
  122. <div>{{formatDate(bodyData.tz.recordDate)}} {{getRecordType(bodyData.tz.deviceSn)}}</div>
  123. </div>
  124. <div class="record-value flex">
  125. <el-tag :type="getTixingType(bodyData.tz.value4)" effect="dark">{{getTixingName(bodyData.tz.value4)}}</el-tag>
  126. <i class="el-icon-arrow-right ml10"></i>
  127. </div>
  128. </div>
  129. <div class="body-record-item" @click="openBodyRecordDetail(3, bodyData.sg.recordDate)" v-if="bodyData.sg">
  130. <div class="record-label">
  131. <div>腰围</div>
  132. <div>{{formatDate(bodyData.sg.recordDate)}} {{getRecordType(bodyData.sg.deviceSn)}}</div>
  133. </div>
  134. <div class="record-value flex">
  135. <span>{{bodyData.sg.value1}}cm</span>
  136. <i class="el-icon-arrow-right ml10"></i>
  137. </div>
  138. </div>
  139. <div class="body-record-item" @click="openBodyRecordDetail(4, bodyData.xl.recordDate)" v-if="bodyData.xl">
  140. <div class="record-label">
  141. <div>心率</div>
  142. <div>{{bodyData.xl.recordDate}} {{getRecordType(bodyData.xl.deviceSn)}}</div>
  143. </div>
  144. <div class="record-value flex">
  145. <span>{{bodyData.xl.value1}}次/分</span>
  146. <i class="el-icon-arrow-right ml10"></i>
  147. </div>
  148. </div>
  149. </div>
  150. </el-tab-pane>
  151. <el-tab-pane label="智能设备" name="device">
  152. <div class="device-box">
  153. <div class="device-item" v-for="(item,i) in deviceList" :key="i" @click="openDeviceDetail(item)">
  154. <div class="flex">
  155. <img :src="item.devicePhoto" alt="" style="width: 100px" />
  156. <div style="margin-left: 16px">
  157. <div class="device-info device-title">{{item.deviceName}}</div>
  158. <div class="device-info">绑定时间:{{formatDate(item.czrq)}}</div>
  159. <div class="device-info" v-if="item.categoryCode != 10 && item.categoryCode != 11">绑定人:{{item.people}}</div>
  160. </div>
  161. </div>
  162. <i class="el-icon-arrow-right ml10"></i>
  163. </div>
  164. <div class="flex" style="justify-content: center">
  165. <el-button class="add-btn" type="primary" @click="addDevice">添加设备</el-button>
  166. </div>
  167. </div>
  168. </el-tab-pane>
  169. <el-tab-pane label="保健记录" name="healthProtect">
  170. <div class="health-protect-box">
  171. <div class="title">保健记录</div>
  172. <div class="health-protect-item" v-for="(item,i) in healthProtectList" :key="i" @click="openHealthProtectDetail(i,item.time)">
  173. <div class="protect-label">
  174. <div>{{item.name}}</div>
  175. <div>{{item.time}} {{item.recordMethod}}</div>
  176. </div>
  177. <div class="flex">
  178. <span>{{item.lastData}}</span>
  179. <i class="el-icon-arrow-right ml10"></i>
  180. </div>
  181. </div>
  182. </div>
  183. </el-tab-pane>
  184. </el-tabs>
  185. </div>
  186. <script type="text/javascript" src="../../../js/vue.js"></script>
  187. <script type="text/javascript" src="../../../js/jquery-2.2.4.js"></script>
  188. <script type="text/javascript" src="../../../js/es6-promise.js" charset="utf-8"></script>
  189. <script type="text/javascript" src="../../../plugins/toastr/toastr.min.js"></script>
  190. <script type="text/javascript" src="../../../plugins/element-ui/element-ui.js"></script>
  191. <script type="text/javascript" src="../../../api/http-request.js"></script>
  192. <script type="text/javascript" src="../../../plugins/layer/layer.min.js"></script>
  193. <script type="text/javascript" src="../../../api/rehabilitation-api.js"></script>
  194. <script type="text/javascript" src="../../../api/recover_api.js"></script>
  195. <script type="text/javascript" src="../../../js/underscore-1.9.1.js"></script>
  196. <script type="text/javascript" src="../../../js/util.js" charset="utf-8"></script>
  197. <script>
  198. new Vue({
  199. el: '#app',
  200. data() {
  201. return {
  202. active: 'body',
  203. deviceList: [],
  204. healthProtectList: [
  205. {
  206. name: '运动',
  207. time: ' ',
  208. recordMethod: ' ',
  209. lastData: ' '
  210. },
  211. {
  212. name: '用药',
  213. time: '',
  214. recordMethod: '',
  215. lastData: ''
  216. },
  217. {
  218. name: '饮食',
  219. time: '',
  220. recordMethod: '',
  221. lastData: ''
  222. }
  223. ],
  224. patient: '',
  225. bodyData: {},
  226. healthProtect: {}
  227. }
  228. },
  229. mounted() {
  230. this.patient = GetRequest().patient
  231. this.getBodyData()
  232. this.getDeviceList()
  233. this.getHealthProtect()
  234. },
  235. methods: {
  236. getBodyData() {
  237. const vm = this
  238. httpRequest.get('doctor/health_index/last', { data: { patient: this.patient } }).then(function (res) {
  239. vm.bodyData = res.data
  240. vm.getXtType(vm.bodyData.xt)
  241. })
  242. },
  243. getDeviceList() {
  244. const vm = this
  245. httpRequest.get('doctor/device/PatientDeviceList', { data: { page: 1, pagesize: 100, patient: this.patient } }).then(function (res) {
  246. vm.deviceList = res.data.map(function (item) {
  247. var bindUser = '患者绑定'
  248. if (!!item.doctor) {
  249. bindUser = item.doctorName
  250. }
  251. item.people = bindUser
  252. return {
  253. ...item,
  254. people: bindUser
  255. }
  256. })
  257. })
  258. },
  259. getHealthProtect() {
  260. const vm = this
  261. httpRequest.get('doctor/health_record/recent', { data: { patient: this.patient } }).then(function (res) {
  262. const healthProtect = res.data
  263. for (let i in healthProtect) {
  264. switch (i) {
  265. case 'sprot':
  266. vm.healthProtectList[0].lastData = healthProtect.sprot.sports
  267. vm.healthProtectList[0].time = healthProtect.sprot.recordDate
  268. vm.healthProtectList[0].recordMethod = vm.getBJRecordType(healthProtect.sprot.source)
  269. break
  270. case 'medication':
  271. vm.healthProtectList[1].lastData = healthProtect.medication.medication
  272. vm.healthProtectList[1].time = healthProtect.medication.recordDate
  273. vm.healthProtectList[1].recordMethod = vm.getBJRecordType(healthProtect.medication.source)
  274. break
  275. case 'diet':
  276. vm.healthProtectList[2].lastData = healthProtect.diet.diet
  277. vm.healthProtectList[2].time = healthProtect.diet.recordDate.substring(0,10)
  278. vm.healthProtectList[2].recordMethod = vm.getBJRecordType(healthProtect.diet.source)
  279. break
  280. }
  281. }
  282. vm.$forceUpdate()
  283. })
  284. },
  285. getBJRecordType(isDevice) {
  286. return isDevice === 0 ? '手动记录' : isDevice == 1 ? '设备上传' : ''
  287. },
  288. openBodyRecordDetail(key, time) {
  289. var title = ''
  290. switch (key) {
  291. case 0:
  292. title = '血压记录'
  293. break
  294. case 1:
  295. title = '血糖记录'
  296. break
  297. case 2:
  298. title = '身高体重'
  299. break
  300. case 3:
  301. title = '腰围'
  302. break
  303. case 4:
  304. title = '心率'
  305. break
  306. }
  307. top.layer.open({
  308. type: 2,
  309. area: ['700px', '700px'],
  310. shade: 0.5,
  311. title: title,
  312. fixed: true, //不固定
  313. maxmin: true,
  314. closeBtn: 1,
  315. // shift: 5,
  316. shadeClose: false, //点击遮罩关闭层
  317. content: `../../rehabilitation/html/healthBodyRecord.html?key=${key}&patient=${this.patient}&time=${time.substring(0, 10)}`
  318. })
  319. },
  320. openHealthProtectDetail(key, time) {
  321. var title = ''
  322. switch (key) {
  323. case 0:
  324. title = '运动记录'
  325. break
  326. case 1:
  327. title = '用药记录'
  328. break
  329. case 2:
  330. title = '饮食记录'
  331. break
  332. }
  333. top.layer.open({
  334. type: 2,
  335. area: ['700px', '700px'],
  336. shade: 0.5,
  337. title: title,
  338. fixed: true, //不固定
  339. maxmin: true,
  340. closeBtn: 1,
  341. // shift: 5,
  342. shadeClose: false, //点击遮罩关闭层
  343. content: `../../rehabilitation/html/healthProtect.html?key=${key}&patient=${this.patient}&time=${time}`
  344. })
  345. },
  346. addDevice() {
  347. var vm = this
  348. top.layer.open({
  349. type: 2,
  350. area: ['700px', '700px'],
  351. shade: 0.5,
  352. title: '新增设备',
  353. fixed: true, //不固定
  354. maxmin: true,
  355. closeBtn: 1,
  356. // shift: 5,
  357. shadeClose: false, //点击遮罩关闭层
  358. content: '../../rehabilitation/html/device.html?patient=' + this.patient,
  359. end: function () {
  360. vm.getDeviceList()
  361. }
  362. })
  363. },
  364. openDeviceDetail(item) {
  365. if (item.categoryCode == '11') {
  366. return
  367. }
  368. var title = ''
  369. switch (item.categoryCode) {
  370. case '2':
  371. title = '血压计'
  372. break
  373. case '4':
  374. title = '智能手表'
  375. break
  376. case '1':
  377. title = '血糖仪'
  378. break
  379. }
  380. top.layer.open({
  381. type: 2,
  382. area: ['700px', '700px'],
  383. shade: 0.5,
  384. title: title,
  385. fixed: true, //不固定
  386. maxmin: true,
  387. closeBtn: 1,
  388. // shift: 5,
  389. shadeClose: false, //点击遮罩关闭层
  390. content: `../../rehabilitation/html/device.html?patient=${this.patient}&deviceId=${item.deviceId}&id=${item.id}`
  391. })
  392. },
  393. getRecordType(isDevice) {
  394. return isDevice === null ? '手动记录' : isDevice != null ? '设备上传' : ''
  395. },
  396. getTixingName(value) {
  397. switch (value) {
  398. case '-1':
  399. return '偏胖'
  400. case '1':
  401. return '偏瘦'
  402. default:
  403. return '正常'
  404. }
  405. },
  406. getTixingType(value) {
  407. switch (value) {
  408. case '-1':
  409. return 'danger'
  410. case '1':
  411. return 'success'
  412. default:
  413. return ''
  414. }
  415. },
  416. getXtType(o) {
  417. var xuetangDuring = ['', '早餐前', '早餐后', '午餐前', '午餐后', '晚餐前', '晚餐后', '睡前']
  418. var duringIndex = o.value2 ? o.value2 : 0
  419. if (o.flag == 2) {
  420. if (duringIndex == 1) {
  421. o.during = '餐前血糖'
  422. } else if (duringIndex == 2) {
  423. o.during = '餐后血糖'
  424. } else if (duringIndex == 3) {
  425. o.during = '随机血糖'
  426. }
  427. } else {
  428. o.during = duringIndex ? xuetangDuring[duringIndex] : ''
  429. }
  430. o.value = o.value1
  431. 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]
  432. o.tagType = this.getLevelClazzType(o.value, levels[0], levels[1])
  433. o.tagName = this.getLevelClazzName(o.value, levels[0], levels[1])
  434. },
  435. getLevelClazzType(value, max, min) {
  436. if (!value || (!max && !min)) {
  437. return ''
  438. }
  439. var value = parseFloat(value)
  440. if (value < min) {
  441. return 'success'
  442. } else if (value > max) {
  443. return 'danger'
  444. } else {
  445. return ''
  446. }
  447. },
  448. getLevelClazzName(value, max, min) {
  449. if (!value || (!max && !min)) {
  450. return ''
  451. }
  452. var value = parseFloat(value)
  453. if (value < min) {
  454. return '偏低'
  455. } else if (value > max) {
  456. return '偏高'
  457. } else {
  458. return '正常'
  459. }
  460. },
  461. getBindUser() {
  462. this.deviceList.forEach(function (item) {
  463. var bindUser = '患者绑定'
  464. if (!!rowData.doctor) {
  465. bindUser = item.doctorName
  466. }
  467. item.people = bindUser
  468. })
  469. },
  470. formatDate(date){
  471. return date.substring(0,16)
  472. }
  473. }
  474. })
  475. </script>
  476. </body>
  477. </html>