healthBodyRecord.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  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. font-size: 14px;
  17. }
  18. .box {
  19. height: 640px;
  20. overflow: auto;
  21. padding: 8px 16px;
  22. box-sizing: border-box;
  23. }
  24. .item {
  25. display: flex;
  26. align-items: center;
  27. justify-content: space-between;
  28. padding: 8px 0;
  29. border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  30. }
  31. .lheight2 {
  32. line-height: 2;
  33. }
  34. .flex {
  35. display: flex;
  36. align-items: center;
  37. }
  38. .pl8 {
  39. padding-left: 8px;
  40. }
  41. </style>
  42. </head>
  43. <body>
  44. <div id="app" v-cloak>
  45. <div class="box" v-if="key==0">
  46. <div class="item" v-for="(item,i) in bloodPressureList" :key="i">
  47. <div>
  48. <div class="lheight2">
  49. 收缩压:{{item.value1}}
  50. <span class="pl8">
  51. 舒张压:{{item.value2}}
  52. <span class="pl8">脉搏:{{item.value3}} 次/分</span>
  53. </span>
  54. </div>
  55. <div class="lheight2">{{item.date}} {{item.recordMethod}}</div>
  56. </div>
  57. <el-tag :type="item.tagType" effect="dark">{{item.tagName}}</el-tag>
  58. </div>
  59. </div>
  60. <div class="box" v-else-if="key==1">
  61. <div class="item" v-for="(item,i) in bloodSugarList" :key="i">
  62. <div>
  63. <div class="lheight2">{{item.text}}</div>
  64. <div class="lheight2">{{item.time}} {{item.recordMethod}}</div>
  65. </div>
  66. <div class="flex">
  67. <el-tag :type="item.tagType" effect="dark">{{item.tagName}}</el-tag>
  68. <span class="pl8">{{item.value}}</span>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="box" v-else-if="key==2">
  73. <div class="item" v-for="(item,i) in heightWeightList" :key="i">
  74. <div>
  75. <div class="lheight2">
  76. 身高:{{item.value2}}cm
  77. <span class="pl8">体重:{{item.value1}}kg</span>
  78. </div>
  79. <div class="lheight2">{{item.time}} {{item.recordMethod}}</div>
  80. </div>
  81. <div class="flex">
  82. <el-tag :type="item.tagType" effect="dark">{{item.tagName}}</el-tag>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="box" v-else-if="key == 3">
  87. <div class="item" v-for="(item,i) in waistList" :key="i">
  88. <div>
  89. <div class="lheight2">{{item.value1}} cm</div>
  90. <div class="lheight2">{{item.time}} {{item.recordMethod}}</div>
  91. </div>
  92. </div>
  93. </div>
  94. <div class="box" v-else>
  95. <div class="item" v-for="(item,i) in heartRateList" :key="i">
  96. <div>
  97. <div class="lheight2">{{item.value1}} 次/分</div>
  98. <div class="lheight2">{{item.time}} {{item.recordMethod}}</div>
  99. </div>
  100. <el-tag :type="item.tagType" effect="dark">{{item.tagName}}</el-tag>
  101. </div>
  102. </div>
  103. </div>
  104. <script type="text/javascript" src="../../../js/vue.js"></script>
  105. <script type="text/javascript" src="../../../js/jquery-2.2.4.js"></script>
  106. <script type="text/javascript" src="../../../js/es6-promise.js" charset="utf-8"></script>
  107. <script type="text/javascript" src="../../../plugins/toastr/toastr.min.js"></script>
  108. <script type="text/javascript" src="../../../plugins/element-ui/element-ui.js"></script>
  109. <script type="text/javascript" src="../../../api/http-request.js"></script>
  110. <script type="text/javascript" src="../../../plugins/layer/layer.min.js"></script>
  111. <script type="text/javascript" src="../../../api/rehabilitation-api.js"></script>
  112. <script type="text/javascript" src="../../../api/recover_api.js"></script>
  113. <script type="text/javascript" src="../../../js/underscore-1.9.1.js"></script>
  114. <script type="text/javascript" src="../../../js/util.js" charset="utf-8"></script>
  115. <script>
  116. new Vue({
  117. el: '#app',
  118. data() {
  119. return {
  120. key: '',
  121. patient: '',
  122. endDate: '',
  123. pager: {
  124. num: 1,
  125. size: 15
  126. },
  127. bloodPressureList: [],
  128. bloodPressureDisabled: false,
  129. bloodSugarList: [],
  130. heightWeightList: [],
  131. waistList: [],
  132. heartRateList: []
  133. }
  134. },
  135. mounted() {
  136. this.key = GetRequest().key
  137. this.patient = GetRequest().patient
  138. this.endDate = GetRequest().time
  139. console.log(GetRequest());
  140. switch (this.key) {
  141. case '0':
  142. this.getBloodPressureList()
  143. break
  144. case '1':
  145. this.getBloodSugarList()
  146. break
  147. case '2':
  148. this.getHeightWeightList()
  149. break
  150. case '3':
  151. this.getWaistList()
  152. break
  153. case '4':
  154. this.getHeartRateList()
  155. break
  156. }
  157. },
  158. methods: {
  159. getRecordType(isDevice) {
  160. return isDevice === null ? '手动记录' : isDevice != null ? '设备上传' : ''
  161. },
  162. getLevelClazz(value, max, min) {
  163. if (!value || (!max && !min)) {
  164. return ''
  165. }
  166. var value = parseFloat(value)
  167. if (value < min) {
  168. return '-1'
  169. } else if (value > max) {
  170. return '1'
  171. } else {
  172. return ''
  173. }
  174. },
  175. getBloodPressureList() {
  176. const vm = this
  177. function getTagInfo(type, val1, val2) {
  178. switch (type) {
  179. case 'type':
  180. if (val1 > 0 || val2 > 0) {
  181. return 'danger'
  182. }
  183. if (val1 < 0 || val2 < 0) {
  184. return 'success'
  185. }
  186. return ''
  187. case 'name':
  188. if (val1 > 0 || val2 > 0) {
  189. return '偏高'
  190. }
  191. if (val1 < 0 || val2 < 0) {
  192. return '偏低'
  193. }
  194. return '正常'
  195. }
  196. }
  197. const params = {
  198. type: 2,
  199. page: 1,
  200. pagesize: 100,
  201. patient: this.patient,
  202. begin: this.getDateFromCurrentDate(this.endDate, -2000) + " 00:00:00",
  203. end: this.endDate + " 23:59:59"
  204. }
  205. httpRequest.post('doctor/health_index/list', { data: params }).then(function (res) {
  206. vm.bloodPressureList = res.list.data.map(function (item) {
  207. return {
  208. ...item,
  209. recordMethod: vm.getRecordType(item.deviceSn),
  210. tagType: getTagInfo('type', vm.getLevelClazz(item.value1, 139, 90), vm.getLevelClazz(item.value2, 89, 60)),
  211. tagName: getTagInfo('name', vm.getLevelClazz(item.value1, 139, 90), vm.getLevelClazz(item.value2, 89, 60))
  212. }
  213. })
  214. })
  215. },
  216. getBloodSugarList() {
  217. const vm = this
  218. function getText(dataType) {
  219. switch (dataType) {
  220. case '1':
  221. return '早餐前'
  222. case '2':
  223. return '早餐后'
  224. case '3':
  225. return '午餐前'
  226. case '4':
  227. return '午餐后'
  228. case '5':
  229. return '晚餐前'
  230. case '6':
  231. return '晚餐后'
  232. case '7':
  233. return '睡前'
  234. }
  235. }
  236. function getDevice(device) {
  237. return device == '' ? '手动记录' : '设备上传'
  238. }
  239. function getTagInfo(type, val, dataType) {
  240. 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]
  241. switch (type) {
  242. case 'name':
  243. if (vm.getLevelClazz(val, levels[0], levels[1]) > 0) {
  244. return '偏高'
  245. } else if (vm.getLevelClazz(val, levels[0], levels[1]) < 0) {
  246. return '偏低'
  247. } else {
  248. return '正常'
  249. }
  250. case 'type':
  251. if (vm.getLevelClazz(val, levels[0], levels[1]) > 0) {
  252. return 'danger'
  253. } else if (vm.getLevelClazz(val, levels[0], levels[1]) < 0) {
  254. return 'success'
  255. } else {
  256. return ''
  257. }
  258. }
  259. }
  260. const params = {
  261. type: 1,
  262. page: 1,
  263. pagesize: 100,
  264. patient: this.patient,
  265. begin: this.getDateFromCurrentDate(this.endDate, -2000) + " 00:00:00",
  266. end: this.endDate + " 23:59:59"
  267. }
  268. httpRequest.post('doctor/health_index/list', { data: params }).then(function (res) {
  269. vm.bloodSugarList = res.list.data.map(function (item) {
  270. return {
  271. ...item,
  272. text: getText(item.dataType),
  273. tagType: getTagInfo('type', item['value' + item.dataType], item.dataType),
  274. tagName: getTagInfo('name', item['value' + item.dataType], item.dataType),
  275. recordMethod: getDevice(item['deviceSn' + item.dataType]),
  276. value: item['value' + item.dataType],
  277. time: item['time' + item.dataType]
  278. }
  279. })
  280. })
  281. },
  282. getHeightWeightList() {
  283. const vm = this
  284. function getTixingInfo(type, val) {
  285. switch (type) {
  286. case 'name':
  287. if (val > 0) {
  288. return '偏瘦'
  289. } else if (val < 0) {
  290. return '偏重'
  291. } else {
  292. return '正常'
  293. }
  294. case 'type':
  295. if (val > 0) {
  296. return 'success'
  297. } else if (val < 0) {
  298. return 'danger'
  299. } else {
  300. return ''
  301. }
  302. }
  303. }
  304. const params = {
  305. type: 3,
  306. page: 1,
  307. pagesize: 100,
  308. patient: this.patient,
  309. begin: this.getDateFromCurrentDate(this.endDate, -2000) + " 00:00:00",
  310. end: this.endDate + " 23:59:59"
  311. }
  312. httpRequest.post('doctor/health_index/list', { data: params }).then(function (res) {
  313. vm.heightWeightList = res.list.data.map(function (item) {
  314. return {
  315. ...item,
  316. tagName: getTixingInfo('name', item.value4 * 1),
  317. tagType: getTixingInfo('type', item.value4 * 1),
  318. recordMethod: item.deviceSn == '' ? '手动记录' : '设备上传',
  319. time: item.czrq.substring(0, 16)
  320. }
  321. })
  322. })
  323. },
  324. getWaistList() {
  325. const vm = this
  326. const params = {
  327. type: 4,
  328. page: 1,
  329. pagesize: 100,
  330. patient: this.patient,
  331. begin: this.getDateFromCurrentDate(this.endDate, -2000) + " 00:00:00",
  332. end: this.endDate + " 23:59:59"
  333. }
  334. httpRequest.post('doctor/health_index/list', { data: params }).then(function (res) {
  335. vm.waistList = res.list.data.map(function (item) {
  336. return {
  337. ...item,
  338. recordMethod: item.deviceSn == '' ? '手动记录' : '设备上传',
  339. time: item.czrq.substring(0, 16)
  340. }
  341. })
  342. })
  343. },
  344. getHeartRateList() {
  345. const vm = this
  346. function getRateInfo(type, val) {
  347. switch (type) {
  348. case 'name':
  349. if (val > 100) {
  350. return '过快'
  351. } else if (val < 60) {
  352. return '过缓'
  353. } else {
  354. return '正常'
  355. }
  356. case 'type':
  357. if (val > 100) {
  358. return 'danger'
  359. } else if (val < 60) {
  360. return 'success'
  361. } else {
  362. return ''
  363. }
  364. }
  365. }
  366. const params = {
  367. type: 5,
  368. page: 1,
  369. pagesize: 100,
  370. patient: this.patient,
  371. begin: this.getDateFromCurrentDate(this.endDate, -2000) + " 00:00:00",
  372. end: this.endDate + " 23:59:59"
  373. }
  374. httpRequest.post('doctor/health_index/list', { data: params }).then(function (res) {
  375. vm.heartRateList = res.list.data.map(function (item) {
  376. return {
  377. ...item,
  378. recordMethod: item.deviceSn == '' ? '手动记录' : '设备上传',
  379. tagName: getRateInfo('name', item.value1),
  380. tagType: getRateInfo('type', item.value1),
  381. time: item.czrq.substring(0, 16)
  382. }
  383. })
  384. })
  385. },
  386. getDateFromCurrentDate(fromDate, dayInterval) {
  387. var curDate = new Date(Date.parse(fromDate.replace(/-/g, '/')))
  388. curDate.setDate(curDate.getDate() + dayInterval)
  389. var year = curDate.getFullYear()
  390. var month = curDate.getMonth() + 1 < 10 ? '0' + (curDate.getMonth() + 1) : curDate.getMonth() + 1
  391. var day = curDate.getDate() < 10 ? '0' + curDate.getDate() : curDate.getDate()
  392. return year + '-' + month + '-' + day
  393. }
  394. }
  395. })
  396. </script>
  397. </body>
  398. </html>