血透系统pad前端

index.vue 12KB

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