healthMonitor.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  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>{{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>{{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">{{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>{{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>{{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">绑定时间:{{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(res.data.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
  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. top.layer.open({
  348. type: 2,
  349. area: ['700px', '700px'],
  350. shade: 0.5,
  351. title: '新增设备',
  352. fixed: true, //不固定
  353. maxmin: true,
  354. closeBtn: 1,
  355. // shift: 5,
  356. shadeClose: false, //点击遮罩关闭层
  357. content: '../../rehabilitation/html/device.html?patient=' + this.patient
  358. })
  359. },
  360. openDeviceDetail(item){
  361. if(item.categoryCode=='11'){
  362. return
  363. }
  364. var title = ""
  365. switch(item.categoryCode){
  366. case '2':
  367. title = "血压计"
  368. break
  369. case '4':
  370. title = "智能手表"
  371. break
  372. case '1':
  373. title = "血糖仪"
  374. break
  375. }
  376. top.layer.open({
  377. type: 2,
  378. area: ['700px', '700px'],
  379. shade: 0.5,
  380. title: title,
  381. fixed: true, //不固定
  382. maxmin: true,
  383. closeBtn: 1,
  384. // shift: 5,
  385. shadeClose: false, //点击遮罩关闭层
  386. content: `../../rehabilitation/html/device.html?patient=${this.patient}&deviceId=${item.deviceId}&id=${item.id}`
  387. })
  388. },
  389. getRecordType(isDevice) {
  390. return isDevice === null ? '手动记录' : isDevice != null ? '设备上传' : ''
  391. },
  392. getTixingName(value) {
  393. switch (value) {
  394. case '-1':
  395. return '偏胖'
  396. case '1':
  397. return '偏瘦'
  398. default:
  399. return '正常'
  400. }
  401. },
  402. getTixingType(value) {
  403. switch (value) {
  404. case '-1':
  405. return 'danger'
  406. case '1':
  407. return 'success'
  408. default:
  409. return ''
  410. }
  411. },
  412. getXtType(o) {
  413. var duringIndex = o.value2 ? o.value2 : 0
  414. if (o.flag == 2) {
  415. if (duringIndex == 1) {
  416. o.during = '餐前血糖'
  417. } else if (duringIndex == 2) {
  418. o.during = '餐后血糖'
  419. } else if (duringIndex == 3) {
  420. o.during = '随机血糖'
  421. }
  422. } else {
  423. o.during = duringIndex ? xuetangDuring[duringIndex] : ''
  424. }
  425. o.value = o.value1
  426. 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]
  427. o.tagType = getLevelClazzType(o.value, levels[0], levels[1])
  428. o.tagName = getLevelClazzName(o.value, levels[0], levels[1])
  429. },
  430. getLevelClazzType(value, max, min) {
  431. if (!value || (!max && !min)) {
  432. return ''
  433. }
  434. var value = parseFloat(value)
  435. if (value < min) {
  436. return 'success'
  437. } else if (value > max) {
  438. return 'error'
  439. } else {
  440. return ''
  441. }
  442. },
  443. getLevelClazzName(value, max, min) {
  444. if (!value || (!max && !min)) {
  445. return ''
  446. }
  447. var value = parseFloat(value)
  448. if (value < min) {
  449. return '偏低'
  450. } else if (value > max) {
  451. return '偏高'
  452. } else {
  453. return ''
  454. }
  455. },
  456. getBindUser() {
  457. this.deviceList.forEach(function (item) {
  458. var bindUser = '患者绑定'
  459. if (!!rowData.doctor) {
  460. bindUser = item.doctorName
  461. }
  462. item.people = bindUser
  463. })
  464. }
  465. }
  466. })
  467. </script>
  468. </body>
  469. </html>