血透系统pad前端

index.vue 20KB

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