血透系统pad前端

index.vue 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. <template>
  2. <div class="mainBox">
  3. <div class="mainContent">
  4. <div class="top">
  5. <div class="hospital" style="width:4.2rem;display:none">
  6. <span style="visibility:hidden"></span>
  7. </div>
  8. <!-- <div class="department">
  9. <ul>
  10. <li>透析监控</li>
  11. </ul>
  12. </div>
  13. <div class="search">
  14. <van-field
  15. v-model="patient_keyword"
  16. ref="search_field"
  17. placeholder="透析号/姓名"
  18. class="field"
  19. >
  20. <i class="iconfont" slot="left-icon">&#xe741;</i>
  21. <van-button
  22. slot="button"
  23. size="small"
  24. type="info"
  25. style="border: none;"
  26. @click="searchWithKeyword(1)"
  27. >搜索</van-button>
  28. </van-field>
  29. </div>-->
  30. <div class="newSearch1">
  31. <el-input
  32. prefix-icon="el-icon-search"
  33. v-model="patient_keyword"
  34. ref="search_field"
  35. placeholder="透析号/姓名"
  36. ></el-input>
  37. <p class="searchBtn" @click="searchWithKeyword(1)">搜索</p>
  38. </div>
  39. </div>
  40. <div class="choice">
  41. <ul>
  42. <el-popover v-model="visible" placement="bottom" trigger="click">
  43. <li slot="reference">
  44. {{ partitionName(partition) }}
  45. <span class="iconfont">&#xe74a;</span>
  46. </li>
  47. <div class="popover-demo-content">
  48. <ul>
  49. <li
  50. v-for="item in partitionArr"
  51. :key="item.id"
  52. @click="itemClick(item.id)"
  53. :class="partition == item.id ? 'tick' : ''"
  54. >
  55. {{ item.name }}
  56. </li>
  57. </ul>
  58. </div>
  59. </el-popover>
  60. <li @click="openPicker">
  61. {{ parseTime(date.getTime() / 1000, "{y}-{m}-{d}") }}
  62. <span class="iconfont">&#xe74a;</span>
  63. </li>
  64. </ul>
  65. </div>
  66. <van-list
  67. v-model="loading"
  68. :finished="finished"
  69. finished-text=" "
  70. @load="onLoad"
  71. >
  72. <div class="blueBorder"></div>
  73. <div class="monitoringTable">
  74. <table class="table">
  75. <tr>
  76. <th width="8%">姓名</th>
  77. <th width="6%">机号</th>
  78. <th width="9%">透析号</th>
  79. <th width="10%">排班时间</th>
  80. <th width="10%">透析模式</th>
  81. <th width="9%">脱水量</th>
  82. <th width="10%">体重(透前/透后)</th>
  83. <th width="28%">监控预警(血压/心率)</th>
  84. </tr>
  85. </table>
  86. <table
  87. class="table"
  88. v-for="(items, index) in dialysis_scheduals"
  89. :key="index"
  90. >
  91. <tr v-if="items.zone_name.length > 0">
  92. <td width="8%">{{ items.zone_name }}</td>
  93. <td width="6%"></td>
  94. <td width="9%"></td>
  95. <td width="10%"></td>
  96. <td width="10%"></td>
  97. <td width="9%"></td>
  98. <td width="10%"></td>
  99. <td width="28%"></td>
  100. </tr>
  101. <tr
  102. v-for="(item, index) in items.scheduals"
  103. :key="index"
  104. @click="clickfunction(item)"
  105. >
  106. <td width="8%" style="color:#409eff;">{{ item.patient.name }}</td>
  107. <td width="6%">
  108. {{
  109. item.dialysis_order.device_number.number.length > 0
  110. ? item.dialysis_order.device_number.number
  111. : item.device_number.number
  112. }}
  113. </td>
  114. <td width="9%">{{ item.patient.dialysis_no }}</td>
  115. <td width="10%">
  116. {{ parseTime(item.schedule_date, "{y}-{m}-{d}") }}
  117. </td>
  118. <td width="10%">{{ item.treatment_mode.name }}</td>
  119. <td width="9%">
  120. {{
  121. item.prescription.dewater_amount
  122. ? item.prescription.dewater_amount
  123. : ""
  124. }}
  125. </td>
  126. <td width="10%">
  127. {{
  128. item.assessment_before_dislysis.weight_before
  129. ? item.assessment_before_dislysis.weight_before
  130. : ""
  131. }}/{{
  132. item.assessment_after_dislysis.weight_after
  133. ? item.assessment_after_dislysis.weight_after
  134. : ""
  135. }}
  136. </td>
  137. <td width="28%">
  138. <span
  139. v-if="monitorBloodPressureStatus(item.monitoring_record) == 1"
  140. >低压</span
  141. >
  142. <span
  143. v-if="monitorBloodPressureStatus(item.monitoring_record) == 2"
  144. >正常</span
  145. >
  146. <span
  147. v-if="monitorBloodPressureStatus(item.monitoring_record) == 3"
  148. >高压</span
  149. >
  150. <span v-if="monitorRateStatus(item.monitoring_record) == 1"
  151. >心率过缓</span
  152. >
  153. <span v-if="monitorRateStatus(item.monitoring_record) == 2"
  154. >正常</span
  155. >
  156. <span v-if="monitorRateStatus(item.monitoring_record) == 3"
  157. >心率过高</span
  158. >
  159. </td>
  160. </tr>
  161. </table>
  162. <div class="NoData" v-show="dialysis_scheduals.length == 0">
  163. <img
  164. style="margin-top: 50px; margin-bottom: 50px"
  165. src="@/assets/login/data.jpg"
  166. alt
  167. />
  168. </div>
  169. </div>
  170. </van-list>
  171. <!-- <div class="monitoringTable">
  172. <el-table :data="tableData" border style="width: 100%" class="newTable">
  173. <el-table-column fixed prop="name" label="姓名" width="80" align="center">
  174. <template slot-scope="scope">{{scope.row.patient.name}}</template>
  175. </el-table-column>
  176. <el-table-column prop="date" label="机号" width="60" align="center">
  177. <template slot-scope="scope">
  178. {{
  179. scope.row.dialysis_order.device_number.number.length > 0
  180. ? scope.row.dialysis_order.device_number.number
  181. : scope.row.device_number.number
  182. }}
  183. </template>
  184. </el-table-column>
  185. <el-table-column prop="province" label="透析号" width="80" align="center">
  186. <template slot-scope="scope">{{scope.row.patient.dialysis_no}}</template>
  187. </el-table-column>
  188. <el-table-column prop="city" label="排班时间" width="100" align="center">
  189. <template slot-scope="scope">{{parseTime(scope.row.schedule_date,"{y}-{m}-{d}")}}</template>
  190. </el-table-column>
  191. <el-table-column prop="address" label="透析模式" width="100" align="center">
  192. <template slot-scope="scope">{{ scope.row.treatment_mode.name}}</template>
  193. </el-table-column>
  194. <el-table-column prop="zip" label="脱水量" width="100" align="center">
  195. <template slot-scope="scope">
  196. {{
  197. scope.row.prescription.dewater_amount
  198. ? scope.row.prescription.dewater_amount
  199. : ""
  200. }}
  201. </template>
  202. </el-table-column>
  203. <el-table-column prop="zip" label="体重(透前/透后)" width="150" align="center">
  204. <template slot-scope="scope">
  205. {{
  206. scope.row.assessment_before_dislysis.weight_before
  207. ? scope.row.assessment_before_dislysis.weight_before
  208. : ""
  209. }}/{{
  210. scope.row.assessment_after_dislysis.weight_after
  211. ? scope.row.assessment_after_dislysis.weight_after
  212. : ""
  213. }}
  214. </template>
  215. </el-table-column>
  216. <el-table-column prop="zip" label="监控预警(血压/心率)" width="200" align="center">
  217. <template slot-scope="scope">
  218. <span v-if="monitorBloodPressureStatus(scope.row.monitoring_record) == 1">低压</span>
  219. <span v-if="monitorBloodPressureStatus(scope.row.monitoring_record) == 2">正常</span>
  220. <span v-if="monitorBloodPressureStatus(scope.row.monitoring_record) == 3">高压</span>
  221. <span v-if="monitorRateStatus(scope.row.monitoring_record) == 1">心率过缓</span>
  222. <span v-if="monitorRateStatus(scope.row.monitoring_record) == 2">正常</span>
  223. <span v-if="monitorRateStatus(scope.row.monitoring_record) == 3">心率过高</span>
  224. </template>
  225. </el-table-column>
  226. </el-table>
  227. </div>-->
  228. </div>
  229. <side-bar :active_index="1"></side-bar>
  230. <mt-datetime-picker
  231. ref="date_picker"
  232. type="date"
  233. @confirm="handleDateConfirm"
  234. :endDate="new Date()"
  235. v-model="date"
  236. ></mt-datetime-picker>
  237. </div>
  238. </template>
  239. <script>
  240. import SideBar from "@/pages/layout/SideBar";
  241. import Divider from "vux/src/components/divider/index";
  242. import { getMonitorList, GetAllZone, getPatientMonitors } from "@/api/monitor";
  243. import { parseTime } from "@/utils";
  244. import { Toast } from "vant";
  245. export default {
  246. name: "MonitoringIndex",
  247. created() {
  248. this.queryParams.date = this.parseTime(
  249. new Date().getTime() / 1000,
  250. "{y}-{m}-{d}"
  251. );
  252. this.queryParams.partition = this.partition;
  253. this.getMonitor(this.queryParams);
  254. this.GetAllZone();
  255. },
  256. data() {
  257. return {
  258. loading: false,
  259. finished: false,
  260. dialysis_scheduals: [],
  261. zones: [],
  262. visible: false,
  263. partitionArr: [],
  264. date: new Date(),
  265. partition: 0,
  266. queryParams: {
  267. date: new Date(),
  268. partition: ""
  269. },
  270. patient_keyword: "",
  271. search_page: 1
  272. };
  273. },
  274. methods: {
  275. clickfunction: function(val) {
  276. this.$router.push({
  277. path: "/details",
  278. query: {
  279. patient_id: val.patient_id,
  280. date: val.schedule_date,
  281. patient_name: val.patient.name
  282. }
  283. });
  284. },
  285. getMonitor: function(queryParams) {
  286. this.search_page = 1;
  287. this.patient_keyword = "";
  288. this.loading = true;
  289. this.finished = false;
  290. this.dialysis_scheduals = [];
  291. getMonitorList(queryParams).then(response => {
  292. this.loading = false;
  293. this.finished = true;
  294. if (response.data.state == 0) {
  295. return false;
  296. } else {
  297. var scheduals = response.data.data.monitor;
  298. var zoneMap = {};
  299. var schedualMap = {};
  300. for (let index = 0; index < scheduals.length; index++) {
  301. const schedual = scheduals[index];
  302. if (schedualMap[schedual.device_zone.name] == null) {
  303. schedualMap[schedual.device_zone.name] = [];
  304. }
  305. schedualMap[schedual.device_zone.name].push(schedual);
  306. if (zoneMap[schedual.device_zone.name] == null) {
  307. zoneMap[schedual.device_zone.name] = schedual.device_zone;
  308. }
  309. }
  310. var zones = [];
  311. zones.push({ value: 0, text: "全部分区" });
  312. for (var zoneName in zoneMap) {
  313. zones.push({ value: zoneMap[zoneName].id, text: zoneName });
  314. }
  315. zones = zones.sort(function(a, b) {
  316. return a.value > b.value;
  317. });
  318. this.zones = zones;
  319. var dialysis_scheduals = [];
  320. for (let index = 0; index < zones.length; index++) {
  321. const zone = zones[index];
  322. var scheduals = schedualMap[zone.text];
  323. if (scheduals == null) {
  324. continue;
  325. }
  326. dialysis_scheduals.push({
  327. zone_name: zone.text,
  328. scheduals: scheduals
  329. });
  330. }
  331. this.dialysis_scheduals = dialysis_scheduals;
  332. // console.log(this.dialysis_scheduals);
  333. }
  334. });
  335. },
  336. parseTime(time, layout) {
  337. return parseTime(time, layout);
  338. },
  339. openPicker: function() {
  340. this.$refs.date_picker.open();
  341. },
  342. handleDateConfirm: function(val) {
  343. this.queryParams.date = this.parseTime(this.date / 1000, "{y}-{m}-{d}");
  344. this.queryParams.partition = this.partition;
  345. this.getMonitor(this.queryParams);
  346. },
  347. partitionName: function(val) {
  348. for (let i = 0; i < this.partitionArr.length; i++) {
  349. if (this.partitionArr[i].id == val) {
  350. return this.partitionArr[i].name;
  351. }
  352. }
  353. },
  354. GetAllZone: function() {
  355. GetAllZone().then(response => {
  356. if (response.data.state == 0) {
  357. return false;
  358. } else {
  359. this.partitionArr = response.data.data.zone;
  360. this.partitionArr.unshift({ id: 0, name: "全部分区" });
  361. }
  362. });
  363. },
  364. itemClick: function(id) {
  365. this.partition = id;
  366. this.visible = false;
  367. this.queryParams.date = this.parseTime(this.date / 1000, "{y}-{m}-{d}");
  368. this.queryParams.partition = this.partition;
  369. this.getMonitor(this.queryParams);
  370. },
  371. monitorBloodPressureStatus: function(val) {
  372. let status = 0;
  373. if (val.length == 0) {
  374. return 0;
  375. }
  376. for (let i = 0; i < val.length; i++) {
  377. //舒张压(低压)(diastolic_blood_pressure) 收缩压(高压)(systolic_blood_pressure)
  378. if (
  379. val[i].systolic_blood_pressure >= 140 ||
  380. val[i].diastolic_blood_pressure >= 90
  381. ) {
  382. status = 3; //高压
  383. } else if (
  384. val[i].diastolic_blood_pressure < 60 ||
  385. val[i].systolic_blood_pressure < 90
  386. ) {
  387. status = 1; //低压
  388. } else if (
  389. val[i].diastolic_blood_pressure >= 60 ||
  390. val[i].systolic_blood_pressure < 140
  391. ) {
  392. status = 2; //正常
  393. }
  394. // if ( val[i].diastolic_blood_pressure < 60 | val[i].systolic_blood_pressure < 90 ) {
  395. // status = 1; //低压
  396. // } else if (
  397. // val[i].diastolic_blood_pressure >= 60 ||
  398. // val[i].systolic_blood_pressure < 140
  399. // ) {
  400. // status = 2; //正常
  401. // } else if (
  402. // val[i].diastolic_blood_pressure >= 90 ||
  403. // val[i].systolic_blood_pressure >= 140
  404. // ) {
  405. // status = 3; //高压
  406. // }
  407. }
  408. return status;
  409. },
  410. monitorRateStatus: function(val) {
  411. let status = 0;
  412. if (val.length == 0) {
  413. return 0;
  414. }
  415. for (let i = 0; i < val.length; i++) {
  416. //舒张压(低压)(diastolic_blood_pressure) 收缩压(高压)(systolic_blood_pressure)
  417. if (val[i].pulse_frequency < 60) {
  418. status = 1; //心率过缓
  419. } else if (
  420. val[i].pulse_frequency >= 60 &&
  421. val[i].pulse_frequency < 100
  422. ) {
  423. status = 2; //心率正常
  424. } else if (val[i].pulse_frequency >= 100) {
  425. status = 3; //心率过快
  426. }
  427. }
  428. return status;
  429. },
  430. searchWithKeyword: function(page) {
  431. this.$refs.search_field.blur();
  432. if (this.patient_keyword.length == 0) {
  433. this.queryParams.date = this.parseTime(this.date / 1000, "{y}-{m}-{d}");
  434. this.queryParams.partition = this.partition;
  435. this.getMonitor(this.queryParams);
  436. return;
  437. }
  438. this.partition = 0;
  439. this.search_page = page;
  440. if (page == 1) {
  441. this.dialysis_scheduals = [];
  442. }
  443. this.loading = true;
  444. this.finished = false;
  445. getPatientMonitors({
  446. keyword: this.patient_keyword,
  447. page: this.search_page
  448. }).then(rs => {
  449. this.loading = false;
  450. this.finished = true;
  451. var resp = rs.data;
  452. if (resp.state == 1) {
  453. if (resp.data.monitor.length > 0) {
  454. this.dialysis_scheduals.push({
  455. zone_name: "",
  456. scheduals: resp.data.monitor
  457. });
  458. this.finished = false;
  459. } else {
  460. this.finished = true;
  461. }
  462. }
  463. });
  464. },
  465. onLoad: function() {
  466. this.searchWithKeyword(this.search_page + 1);
  467. }
  468. },
  469. components: {
  470. Divider,
  471. SideBar
  472. }
  473. };
  474. </script>
  475. <style lang="scss" scoped>
  476. .mainBox {
  477. height: 100%;
  478. }
  479. .top {
  480. padding: 0.3rem 0.3rem;
  481. @include text-align;
  482. font-size: 0.36rem;
  483. /*border-bottom: 1px #e5e5e5 solid;*/
  484. position: relative;
  485. color: $title-color;
  486. @include display-flex;
  487. @include align-items-center;
  488. @include justify-content-between;
  489. background: #258ffc;
  490. .title {
  491. font-size: 0.3rem;
  492. font-weight: bold;
  493. color: $pgh-color;
  494. }
  495. .iconfont {
  496. font-size: 0.4rem;
  497. color: #a8b3ba;
  498. @media only screen and (max-width: 812px) {
  499. margin-right: 0 !important;
  500. }
  501. }
  502. }
  503. .choice {
  504. border-bottom: 1px #e5e5e5 solid;
  505. position: fixed;
  506. top: 47px;
  507. right: 0;
  508. z-index: 66;
  509. left: 0;
  510. background: #258ffc;
  511. /*@media only screen and (max-width: 415px) {*/
  512. /*top: 38px !important;*/
  513. /*}*/
  514. /*@media only screen and (min-width: 813px) and (max-width: 1024px) {*/
  515. /*top: 38px !important;*/
  516. /*}*/
  517. @media only screen and (min-width: 768px) {
  518. top: 80px !important;
  519. }
  520. ul {
  521. @include display-flex;
  522. @include align-items-center;
  523. @include text-align;
  524. @include justify-content-between;
  525. width: 55%;
  526. margin: 0 auto;
  527. font-size: 0.45rem;
  528. /*// color: $pgh-color;*/
  529. color: #fff;
  530. li {
  531. @include display-flex;
  532. @include align-items-center;
  533. @include text-align;
  534. @include justify-content-between;
  535. padding: 0 0 0.3rem;
  536. .iconfont {
  537. margin: 0 0.1rem;
  538. color: #fff;
  539. }
  540. .line {
  541. background: #a8b3ba;
  542. width: 0.2rem;
  543. height: 1px;
  544. margin: 0 0.2rem;
  545. display: inline-block;
  546. }
  547. }
  548. }
  549. }
  550. .table {
  551. width: 1000px;
  552. @media only screen and (min-width: 768px) {
  553. width: 1600px;
  554. }
  555. }
  556. .van-list {
  557. padding-top: 76px;
  558. background: #fff;
  559. min-height: calc(100vh - 1px);
  560. @media only screen and (min-width: 376px) and (max-width: 737px) {
  561. padding-top: 80px !important;
  562. }
  563. @media only screen and (min-width: 768px) {
  564. padding-top: 120px !important;
  565. }
  566. }
  567. .mainBox {
  568. height: 100%;
  569. display: flex;
  570. flex-direction: column;
  571. overflow: hidden;
  572. > :first-child {
  573. flex: 1;
  574. overflow: auto;
  575. }
  576. }
  577. </style>
  578. <style lang="scss">
  579. .newSearch1 {
  580. height: 1rem;
  581. width: 100%;
  582. background: #fff;
  583. border-radius: 30px;
  584. overflow: hidden;
  585. .searchBtn {
  586. width: 14%;
  587. float: right;
  588. height: 1rem;
  589. line-height: 1rem;
  590. text-align: center;
  591. font-size: 0.45rem;
  592. color: #258ffc;
  593. vertical-align: middle;
  594. }
  595. .el-input {
  596. height: 100%;
  597. width: 85% !important;
  598. float: left;
  599. }
  600. .el-input__inner {
  601. height: 100%;
  602. line-height: 1rem;
  603. width: 100%;
  604. border-radius: 30px;
  605. border: none;
  606. font-size: 0.45rem;
  607. vertical-align: middle;
  608. @media only screen and (min-width: 768px) {
  609. padding-left: 0.9rem;
  610. }
  611. }
  612. .el-input__icon {
  613. line-height: 1rem;
  614. font-size: 0.45rem;
  615. margin-top: 0.02rem;
  616. padding-left: 0.1rem;
  617. }
  618. .el-input__prefix {
  619. @media only screen and (min-width: 768px) {
  620. left: 10px;
  621. }
  622. }
  623. }
  624. .monitoringTable {
  625. width: 100%;
  626. overflow: auto;
  627. /*// .el-table {*/
  628. /*// width: 99.9% !important;*/
  629. /*// }*/
  630. /*// .newTable {*/
  631. /*// margin-top: 80px;*/
  632. /*// @media only screen and (min-width: 768px) {*/
  633. /*// margin-top: 140px !important;*/
  634. /*// }*/
  635. /*// }*/
  636. /*// .el-table td {*/
  637. /*// padding: 0;*/
  638. /*// }*/
  639. /*// .el-table th {*/
  640. /*// padding: 6px 0;*/
  641. /*// }*/
  642. }
  643. </style>