index.vue 20KB

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