血透系统pad前端

index.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <template>
  2. <div class="mainBox">
  3. <side-bar :active_index="1"></side-bar>
  4. <div class="mainContent">
  5. <div class="top">
  6. <div class="hospital" style="width:4.2rem;" ><span style="visibility:hidden"></span></div>
  7. <div class="department">
  8. <ul>
  9. <li>透析监控</li>
  10. </ul>
  11. </div>
  12. <div class="search">
  13. <van-field v-model="patient_keyword" ref="search_field" placeholder="透析号/姓名" class="field">
  14. <i class="iconfont" slot="left-icon">&#xe741;</i>
  15. <van-button slot="button" size="small" type="info" style="border: none;" @click="searchWithKeyword(1)">搜索</van-button>
  16. </van-field>
  17. </div>
  18. </div>
  19. <div class="choice">
  20. <ul>
  21. <el-popover
  22. v-model="visible"
  23. placement="bottom"
  24. trigger="click">
  25. <li slot="reference">{{partitionName(partition)}}<span class="iconfont">&#xe74a;</span></li>
  26. <div class="popover-demo-content">
  27. <ul >
  28. <li v-for="item in partitionArr" :key="item.id" @click="itemClick(item.id)" :class="partition == item.id ? 'tick' : ''">{{item.name}}</li>
  29. </ul>
  30. </div>
  31. </el-popover>
  32. <li @click="openPicker">{{parseTime(date.getTime()/1000, "{y}-{m}-{d}")}}<span
  33. class="iconfont">&#xe74a;</span></li>
  34. </ul>
  35. </div>
  36. <van-list
  37. v-model="loading"
  38. :finished="finished"
  39. finished-text="没有更多了"
  40. @load="onLoad"
  41. >
  42. <div class="blueBorder"></div>
  43. <table class="table">
  44. <tr>
  45. <th width="8%">机号</th>
  46. <th width="10%">姓名</th>
  47. <th width="9%">透析号</th>
  48. <th width="13%">排班时间</th>
  49. <th width="10%">透析模式</th>
  50. <th width="9%">脱水量</th>
  51. <th width="14%">体重(透前/透后)</th>
  52. <th width="27%">监控预警</th>
  53. </tr>
  54. </table>
  55. <table class="table" v-for="(items,index) in dialysis_scheduals" :key="index">
  56. <tr v-if="items.zone_name.length > 0">
  57. <td width="8%">{{items.zone_name}}</td>
  58. <td width="10%"></td>
  59. <td width="9%"></td>
  60. <td width="13%"></td>
  61. <td width="10%"></td>
  62. <td width="9%"></td>
  63. <td width="14%"></td>
  64. <td width="27%"></td>
  65. </tr>
  66. <tr v-for="(item,index) in items.scheduals" :key="index" @click="clickfunction(item)">
  67. <td width="8%">{{item.device_number.number}}</td>
  68. <td width="10%">{{item.patient.name}}</td>
  69. <td width="9%">{{item.patient.dialysis_no}}</td>
  70. <td width="13%">{{parseTime(item.schedule_date, "{y}-{m}-{d}")}}</td>
  71. <td width="10%">{{item.treatment_mode.name}}</td>
  72. <td width="9%">{{item.prescription.dewater_amount}}</td>
  73. <td width="14%">
  74. {{item.assessment_before_dislysis.weight_before}}/{{item.assessment_after_dislysis.weight_after}}
  75. </td>
  76. <td width="27%">
  77. <span v-if="monitorBloodPressureStatus(item.monitoring_record) == 1">低压</span>
  78. <span style="background-color: dodgerblue" v-if="monitorBloodPressureStatus(item.monitoring_record) == 2">正常</span>
  79. <span v-if="monitorBloodPressureStatus(item.monitoring_record) == 3">高压</span>
  80. <span v-if="monitorRateStatus(item.monitoring_record) == 1">心率过缓</span>
  81. <span style="background-color: dodgerblue" v-if="monitorRateStatus(item.monitoring_record) == 2">正常</span>
  82. <span v-if="monitorRateStatus(item.monitoring_record) == 3">心率过高</span>
  83. </td>
  84. </tr>
  85. </table>
  86. <div class="NoData" v-show="dialysis_scheduals.length == 0"><img style="margin-top: 50px; margin-bottom: 50px" src="@/assets/login/data.jpg" alt=""></div>
  87. </van-list>
  88. </div>
  89. <mt-datetime-picker
  90. ref="date_picker"
  91. type="date"
  92. @confirm="handleDateConfirm"
  93. :endDate="new Date()"
  94. v-model="date">
  95. </mt-datetime-picker>
  96. </div>
  97. </template>
  98. <script>
  99. import SideBar from "@/pages/layout/SideBar";
  100. import Divider from "vux/src/components/divider/index";
  101. import { getMonitorList, GetAllZone, getPatientMonitors } from "@/api/monitor";
  102. import { parseTime } from "@/utils";
  103. import { Toast } from "vant";
  104. export default {
  105. name: "MonitoringIndex",
  106. created() {
  107. this.queryParams.date = this.parseTime(
  108. new Date().getTime() / 1000,
  109. "{y}-{m}-{d}"
  110. );
  111. this.queryParams.partition = this.partition;
  112. this.getMonitor(this.queryParams);
  113. this.GetAllZone();
  114. },
  115. data() {
  116. return {
  117. loading: false,
  118. finished: false,
  119. dialysis_scheduals: [],
  120. zones: [],
  121. visible: false,
  122. partitionArr: [],
  123. date: new Date(),
  124. partition: 0,
  125. queryParams: {
  126. date: new Date(),
  127. partition: ""
  128. },
  129. patient_keyword: "",
  130. search_page: 1
  131. };
  132. },
  133. methods: {
  134. clickfunction: function(val) {
  135. this.$router.push({
  136. path: "/details",
  137. query: {
  138. patient_id: val.patient_id,
  139. date: val.schedule_date,
  140. patient_name: val.patient.name
  141. }
  142. });
  143. },
  144. getMonitor: function(queryParams) {
  145. this.search_page = 1;
  146. this.patient_keyword = "";
  147. this.loading = true;
  148. this.finished = false;
  149. this.dialysis_scheduals = [];
  150. getMonitorList(queryParams).then(response => {
  151. this.loading = false;
  152. this.finished = true;
  153. if (response.data.state == 0) {
  154. return false;
  155. } else {
  156. var scheduals = response.data.data.monitor;
  157. var zoneMap = {};
  158. var schedualMap = {};
  159. for (let index = 0; index < scheduals.length; index++) {
  160. const schedual = scheduals[index];
  161. if (schedualMap[schedual.device_zone.name] == null) {
  162. schedualMap[schedual.device_zone.name] = [];
  163. }
  164. schedualMap[schedual.device_zone.name].push(schedual);
  165. if (zoneMap[schedual.device_zone.name] == null) {
  166. zoneMap[schedual.device_zone.name] = schedual.device_zone;
  167. }
  168. }
  169. var zones = [];
  170. zones.push({ value: 0, text: "全部分区" });
  171. for (var zoneName in zoneMap) {
  172. zones.push({ value: zoneMap[zoneName].id, text: zoneName });
  173. }
  174. zones = zones.sort(function(a, b) {
  175. return a.value > b.value;
  176. });
  177. this.zones = zones;
  178. var dialysis_scheduals = [];
  179. for (let index = 0; index < zones.length; index++) {
  180. const zone = zones[index];
  181. var scheduals = schedualMap[zone.text];
  182. if (scheduals == null) {
  183. continue;
  184. }
  185. dialysis_scheduals.push({
  186. zone_name: zone.text,
  187. scheduals: scheduals
  188. });
  189. }
  190. this.dialysis_scheduals = dialysis_scheduals;
  191. // console.log(this.dialysis_scheduals);
  192. }
  193. });
  194. },
  195. parseTime(time, layout) {
  196. return parseTime(time, layout);
  197. },
  198. openPicker: function() {
  199. this.$refs.date_picker.open();
  200. },
  201. handleDateConfirm: function(val) {
  202. this.queryParams.date = this.parseTime(this.date / 1000, "{y}-{m}-{d}");
  203. this.queryParams.partition = this.partition;
  204. this.getMonitor(this.queryParams);
  205. },
  206. partitionName: function(val) {
  207. return typeof this.partitionArr[val] != "undefined" &&
  208. typeof this.partitionArr[val].name != "undefined"
  209. ? this.partitionArr[val].name
  210. : "";
  211. },
  212. GetAllZone: function() {
  213. GetAllZone().then(response => {
  214. if (response.data.state == 0) {
  215. return false;
  216. } else {
  217. this.partitionArr = response.data.data.zone;
  218. this.partitionArr.unshift({ id: 0, name: "全部分区" });
  219. }
  220. });
  221. },
  222. itemClick: function(id) {
  223. this.partition = id;
  224. this.visible = false;
  225. this.queryParams.date = this.parseTime(this.date / 1000, "{y}-{m}-{d}");
  226. this.queryParams.partition = this.partition;
  227. this.getMonitor(this.queryParams);
  228. },
  229. monitorBloodPressureStatus: function(val) {
  230. let status = 0;
  231. if (val.length == 0) {
  232. return 0;
  233. }
  234. for (let i = 0; i < val.length; i++) {
  235. //舒张压(低压)(diastolic_blood_pressure) 收缩压(高压)(systolic_blood_pressure)
  236. if (
  237. val[i].diastolic_blood_pressure < 60 ||
  238. val[i].systolic_blood_pressure < 90
  239. ) {
  240. status = 1; //低压
  241. } else if (
  242. val[i].diastolic_blood_pressure >= 60 ||
  243. val[i].systolic_blood_pressure < 140
  244. ) {
  245. status = 2; //正常
  246. } else if (
  247. val[i].diastolic_blood_pressure >= 90 ||
  248. val[i].systolic_blood_pressure >= 140
  249. ) {
  250. status = 3; //高压
  251. }
  252. }
  253. return status;
  254. },
  255. monitorRateStatus: function(val) {
  256. let status = 0;
  257. if (val.length == 0) {
  258. return 0;
  259. }
  260. for (let i = 0; i < val.length; i++) {
  261. //舒张压(低压)(diastolic_blood_pressure) 收缩压(高压)(systolic_blood_pressure)
  262. if (val[i].pulse_frequency < 60) {
  263. status = 1; //心率过缓
  264. } else if (
  265. val[i].pulse_frequency >= 60 &&
  266. val[i].pulse_frequency < 100
  267. ) {
  268. status = 2; //心率正常
  269. } else if (val[i].pulse_frequency >= 100) {
  270. status = 3; //心率过快
  271. }
  272. }
  273. return status;
  274. },
  275. searchWithKeyword: function(page) {
  276. this.$refs.search_field.blur();
  277. if (this.patient_keyword.length == 0) {
  278. this.queryParams.date = this.parseTime(this.date / 1000, "{y}-{m}-{d}");
  279. this.queryParams.partition = this.partition;
  280. this.getMonitor(this.queryParams);
  281. return;
  282. }
  283. this.partition = 0;
  284. this.search_page = page;
  285. if (page == 1) {
  286. this.dialysis_scheduals = [];
  287. }
  288. this.loading = true;
  289. this.finished = false;
  290. getPatientMonitors({
  291. keyword: this.patient_keyword,
  292. page: this.search_page
  293. }).then(rs => {
  294. this.loading = false;
  295. this.finished = true;
  296. var resp = rs.data;
  297. if (resp.state == 1) {
  298. if (resp.data.monitor.length > 0) {
  299. this.dialysis_scheduals.push({
  300. zone_name: "",
  301. scheduals: resp.data.monitor
  302. });
  303. this.finished = false;
  304. } else {
  305. this.finished = true;
  306. }
  307. }
  308. });
  309. },
  310. onLoad: function() {
  311. this.searchWithKeyword(this.search_page + 1);
  312. }
  313. },
  314. components: {
  315. Divider,
  316. SideBar
  317. }
  318. };
  319. </script>
  320. <style style="stylesheet/scss" lang="scss" scoped>
  321. .top {
  322. padding: 0.3rem 0.3rem;
  323. @include text-align;
  324. font-size: 0.36rem;
  325. border-bottom: 1px #e5e5e5 solid;
  326. position: relative;
  327. color: $title-color;
  328. @include display-flex;
  329. @include align-items-center;
  330. @include justify-content-between;
  331. .title {
  332. font-size: 0.3rem;
  333. font-weight: bold;
  334. color: $pgh-color;
  335. }
  336. .iconfont {
  337. font-size: 0.4rem;
  338. color: #a8b3ba;
  339. }
  340. }
  341. .choice {
  342. border-bottom: 1px #e5e5e5 solid;
  343. position: fixed;
  344. top: 63px;
  345. right: 0;
  346. z-index: 66;
  347. left: 1.58rem;
  348. background: #fff;
  349. ul {
  350. @include display-flex;
  351. @include align-items-center;
  352. @include text-align;
  353. @include justify-content-between;
  354. width: 30%;
  355. margin: 0 auto;
  356. font-size: 0.32rem;
  357. color: $pgh-color;
  358. li {
  359. @include display-flex;
  360. @include align-items-center;
  361. @include text-align;
  362. @include justify-content-between;
  363. padding: 0.3rem 0;
  364. .iconfont {
  365. margin: 0 0.1rem;
  366. }
  367. .line {
  368. background: #a8b3ba;
  369. width: 0.2rem;
  370. height: 1px;
  371. margin: 0 0.2rem;
  372. display: inline-block;
  373. }
  374. }
  375. }
  376. }
  377. .table {
  378. width: 100%;
  379. }
  380. .van-list{
  381. padding-top:115px;
  382. background: #fff;
  383. min-height: calc(100vh - 1px);
  384. }
  385. </style>