Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

monitor.vue 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. </div>
  6. <div class="app-container">
  7. <div class="page_process">
  8. <new-nav activeName="monitor"></new-nav>
  9. <div class="cell clearfix">
  10. <el-form :inline="true">
  11. <el-form-item label>
  12. <el-autocomplete
  13. class="checkSearch"
  14. popper-class="my-autocomplete"
  15. v-model="search_value"
  16. :fetch-suggestions="querySearchAsync"
  17. :trigger-on-focus="false"
  18. placeholder="请输入病人名字"
  19. @select="handleSelect"
  20. >
  21. <i class="el-icon-search el-input__icon" slot="suffix"></i>
  22. <template slot-scope="{ item }">
  23. <div class="name">{{ item.name }}</div>
  24. </template>
  25. </el-autocomplete>
  26. </el-form-item>
  27. </el-form>
  28. <el-select v-model="query.statistics_type" placeholder="请选择" style="width:110px;margin-right:10px" @change="changeProject">
  29. <el-option
  30. v-for="item in options"
  31. :key="item.value"
  32. :label="item.name"
  33. :value="item.value"
  34. ></el-option>
  35. </el-select>
  36. <label class="title">
  37. <span class="name">日期查询</span> :
  38. </label>
  39. <el-date-picker
  40. v-model="query.start_time"
  41. prefix-icon="el-icon-date"
  42. @change="changeTime"
  43. :editable="false"
  44. style="width: 150px;"
  45. type="date"
  46. :picker-options="pickerOptions"
  47. placeholder="选择日期时间"
  48. align="right"
  49. format="yyyy-MM-dd"
  50. value-format="yyyy-MM-dd"
  51. ></el-date-picker>
  52. <span class>-</span>
  53. <el-date-picker
  54. v-model="query.end_time"
  55. prefix-icon="el-icon-date"
  56. @change="changeEndTime"
  57. :editable="false"
  58. :picker-options="pickerOptions"
  59. style="width: 150px;"
  60. type="date"
  61. placeholder="选择日期时间"
  62. align="right"
  63. format="yyyy-MM-dd"
  64. value-format="yyyy-MM-dd"
  65. ></el-date-picker>
  66. </div>
  67. <el-container>
  68. <div style="width:150px">
  69. <div class="tableTitle">患者列表</div>
  70. <el-table :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }"
  71. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  72. highlight-current-row
  73. @current-change="handleChange">
  74. <el-table-column prop="dialysis_no" label="透析号" width="80">
  75. <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
  76. </el-table-column>
  77. <el-table-column prop="name" label="姓名" width="80">
  78. <template slot-scope="scope">{{ scope.row.name }}</template>
  79. </el-table-column>
  80. </el-table>
  81. </div>
  82. <div style="padding-left:10px;flex:1">
  83. <div class="tableTitle">指标趋势</div>
  84. <div>
  85. <line-chart :options="chart"></line-chart>
  86. </div>
  87. <div class="tableTitle">统计表</div>
  88. <div>
  89. <el-table :data="tableData" style="width: 100%" :height="tableHeight" v-loading="loading">
  90. <el-table-column fixed label="监测时间" align="center">
  91. <template slot-scope="scope">
  92. <!--{{getTime(scope.row.operate_time)}}-->
  93. {{scope.row.operate_time | parseTime("{y}-{m}-{d} {h}:{i}") }}
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="收缩压" align="center">
  97. <template slot-scope="scope">
  98. {{scope.row.systolic_blood_pressure?scope.row.systolic_blood_pressure:''}}
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="舒张压" align="center">
  102. <template slot-scope="scope">
  103. {{scope.row.diastolic_blood_pressure?scope.row.diastolic_blood_pressure:''}}
  104. </template>
  105. </el-table-column>
  106. <el-table-column label="脉搏" align="center">
  107. <template slot-scope="scope">
  108. {{scope.row.pulse_frequency?scope.row.pulse_frequency:''}}
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="呼吸" align="center">
  112. <template slot-scope="scope">
  113. {{scope.row.breathing_rate?scope.row.breathing_rate:''}}
  114. </template>
  115. </el-table-column>
  116. <el-table-column label="体温" align="center">
  117. <template slot-scope="scope">
  118. {{ scope.row.temperature?scope.row.temperature:''}}
  119. </template>
  120. </el-table-column>
  121. <el-table-column label="血流量" align="center">
  122. <template slot-scope="scope">
  123. {{ scope.row.blood_flow_volume?scope.row.blood_flow_volume:''}}
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="静脉压" align="center">
  127. <template slot-scope="scope">
  128. {{ scope.row.venous_pressure?scope.row.venous_pressure:''}}
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="动脉压" align="center">
  132. <template slot-scope="scope">
  133. {{ scope.row.arterial_pressure?scope.row.arterial_pressure:''}}
  134. </template>
  135. </el-table-column>
  136. <el-table-column label="跨膜压" align="center">
  137. <template slot-scope="scope">
  138. {{ scope.row.transmembrane_pressure?scope.row.transmembrane_pressure:''}}
  139. </template>
  140. </el-table-column>
  141. <el-table-column label="透析液温度" align="center">
  142. <template slot-scope="scope">
  143. {{ scope.row.dialysate_temperature?scope.row.dialysate_temperature:''}}
  144. </template>
  145. </el-table-column>
  146. <el-table-column label="超滤率" align="center">
  147. <template slot-scope="scope">
  148. {{ scope.row.ultrafiltration_rate?scope.row.ultrafiltration_rate:''}}
  149. </template>
  150. </el-table-column>
  151. <el-table-column label="超滤量" align="center">
  152. <template slot-scope="scope">
  153. {{ scope.row.ultrafiltration_volume?scope.row.ultrafiltration_volume:''}}
  154. </template>
  155. </el-table-column>
  156. </el-table>
  157. <el-pagination
  158. align="right"
  159. @size-change="handleSizeChange"
  160. @current-change="handleCurrentChange"
  161. :current-page="query.page"
  162. :page-sizes="[10, 20, 50, 100]"
  163. :page-size="10"
  164. background
  165. style="margin-top:20px;"
  166. layout="total, sizes, prev, pager, next, jumper"
  167. :total="total"
  168. ></el-pagination>
  169. </div>
  170. </div>
  171. </el-container>
  172. </div>
  173. </div>
  174. </div>
  175. </template>
  176. <script>
  177. import echarts from 'echarts'
  178. import NewNav from '../indicatorControlAnalysis/components/NewNav'
  179. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  180. import LineChart from '../../qcd/components/LineChart'
  181. import { getCurrentOrgPatients } from "@/api/common/common";
  182. import {
  183. GetDefalutPatient,
  184. GetDialysisWatchChartData,
  185. GetDialysisWatchTableData
  186. } from '@/api/common/statistics'
  187. import {
  188. PostSearch
  189. } from '@/api/patient'
  190. import { uParseTime } from "@/utils/tools";
  191. import { getDataConfig } from "@/utils/data";
  192. export default {
  193. components: {
  194. LineChart,
  195. BreadCrumb,
  196. NewNav
  197. },
  198. data() {
  199. return {
  200. pickerOptions: {
  201. disabledDate(time) {
  202. let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
  203. return time.getTime() > Date.now() || time.getTime() < threeMonths;;
  204. }
  205. },
  206. patientsData:[],
  207. tableData: [
  208. ],
  209. loading: false,
  210. search_value: '',
  211. total: '',
  212. query: {
  213. patient_id: '',
  214. statistics_type: 1,
  215. start_time: '',
  216. end_time: '',
  217. limit: 10,
  218. page: 1
  219. },
  220. options: [
  221. { value: 1, name: '收缩压' },
  222. { value: 2, name: '舒张压' },
  223. { value: 3, name: '脉搏' },
  224. { value: 4, name: '呼吸' },
  225. { value: 5, name: '体温' },
  226. { value: 6, name: '血流量' },
  227. { value: 7, name: '静脉压' },
  228. { value: 8, name: '动脉压' },
  229. { value: 9, name: '跨膜压' },
  230. { value: 10, name: '透析液温度' },
  231. { value: 11, name: '超滤率' },
  232. { value: 12, name: '超滤量' },
  233. ],
  234. crumbs: [
  235. { path: false, name: '科室质控' },
  236. { path: false, name: '指标评估统计' },
  237. { path: false, name: '透析过程指标统计' }
  238. ],
  239. tableData: [],
  240. tableData1: [],
  241. chart: {
  242. title: {
  243. text: 'ECharts 入门示例'
  244. },
  245. tooltip: {},
  246. legend: {
  247. data: [],
  248. left: 0
  249. },
  250. xAxis: {
  251. data: []
  252. },
  253. yAxis: {
  254. axisLabel: {
  255. formatter: '{value} %'
  256. },
  257. show: false
  258. },
  259. series: [
  260. {
  261. name: '',
  262. type: 'line',
  263. data: [],
  264. barWidth: 30,
  265. label: {
  266. normal: {
  267. show: true,
  268. position: 'top',
  269. formatter: '{c}'
  270. }
  271. },
  272. //配置样式
  273. itemStyle: {
  274. //通常情况下:
  275. //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
  276. normal: {
  277. color: function(params) {
  278. //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
  279. var colorList = [
  280. ['#A9E0F3', '#9FBDFC'],
  281. ['#FFD7C0', '#FF9994']
  282. ]
  283. var index = params.dataIndex
  284. if (params.dataIndex >= colorList.length) {
  285. index = params.dataIndex % colorList.length
  286. }
  287. return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  288. { offset: 0, color: colorList[index][0] },
  289. // { offset: 0.5, color: colorList[index][1] },
  290. { offset: 1, color: colorList[index][1] }
  291. ])
  292. },
  293. barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
  294. },
  295. //鼠标悬停时:
  296. emphasis: {
  297. shadowBlur: 10,
  298. shadowOffsetX: 0,
  299. shadowColor: 'rgba(0, 0, 0, 0.5)'
  300. }
  301. }
  302. }
  303. ]
  304. },
  305. bar: {
  306. title: {
  307. text: 'ECharts 入门示例'
  308. },
  309. tooltip: {},
  310. legend: {
  311. data: [],
  312. left: 0
  313. },
  314. xAxis: {
  315. data: []
  316. },
  317. yAxis: {
  318. axisLabel: {
  319. formatter: '{value} %'
  320. },
  321. show: false
  322. },
  323. series: [
  324. {
  325. name: '',
  326. type: 'bar',
  327. data: [],
  328. barWidth: 30,
  329. label: {
  330. normal: {
  331. show: true,
  332. position: 'top',
  333. formatter: '{c}次'
  334. }
  335. },
  336. //配置样式
  337. itemStyle: {
  338. //通常情况下:
  339. //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
  340. normal: {
  341. color: function(params) {
  342. //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
  343. var colorList = [
  344. ['#A9E0F3', '#9FBDFC'],
  345. ['#FFD7C0', '#FF9994']
  346. ]
  347. var index = params.dataIndex
  348. if (params.dataIndex >= colorList.length) {
  349. index = params.dataIndex % colorList.length
  350. }
  351. return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  352. { offset: 0, color: colorList[index][0] },
  353. // { offset: 0.5, color: colorList[index][1] },
  354. { offset: 1, color: colorList[index][1] }
  355. ])
  356. },
  357. barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
  358. },
  359. //鼠标悬停时:
  360. emphasis: {
  361. shadowBlur: 10,
  362. shadowOffsetX: 0,
  363. shadowColor: 'rgba(0, 0, 0, 0.5)'
  364. }
  365. }
  366. }
  367. ]
  368. }
  369. }
  370. },
  371. methods: {
  372. changeProject(val){
  373. this.query.statistics_type = val
  374. this.query.page = 1
  375. this.GetDialysisWatchChartData(this.query)
  376. },
  377. handleChange(val){
  378. this.query.patient_id = val.id
  379. this.query.page = 1
  380. this.GetDialysisWatchTableData(this.query)
  381. this.GetDialysisWatchChartData(this.query)
  382. },
  383. handleSizeChange(limit) {
  384. this.query.limit = limit;
  385. },
  386. handleCurrentChange(page) {
  387. this.query.page = page;
  388. },
  389. changeTime(val) {
  390. var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
  391. if (time > 0) {
  392. this.$message.error("结束时间不能小于开始时间");
  393. this.query.start_time = "";
  394. } else {
  395. // this.getDialysisList()
  396. this.query.page = 1;
  397. this.GetDialysisWatchChartData(this.query)
  398. this.GetDialysisWatchTableData(this.query)
  399. }
  400. },
  401. changeEndTime(val) {
  402. var time =
  403. this.getTimestamp(val) - this.getTimestamp(this.query.start_time);
  404. if (time < 0) {
  405. this.$message.error("结束时间不能小于开始时间");
  406. this.query.end_time = "";
  407. } else {
  408. this.query.page = 1;
  409. this.GetDialysisWatchChartData(this.query)
  410. this.GetDialysisWatchTableData(this.query)
  411. }
  412. },
  413. getTimestamp(time) {
  414. // 把时间日期转成时间戳
  415. return new Date(time).getTime() / 1000;
  416. },
  417. QueryOperaById: function(val) {
  418. let vascular_access_desc_name = "";
  419. let vascular_access_desc = getDataConfig(
  420. "hemodialysis",
  421. "vascular_access_desc"
  422. );
  423. for (let i = 0; i < vascular_access_desc.length; i++) {
  424. if (vascular_access_desc[i].id == val) {
  425. vascular_access_desc_name = vascular_access_desc[i].name;
  426. }
  427. }
  428. return vascular_access_desc_name;
  429. },
  430. GetAnticoagulantById: function (val) {
  431. let anticoagulan_name = ''
  432. var anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
  433. let anticoagulant = anticoagulantsConfitTwo
  434. for (let keys in anticoagulant) {
  435. if (anticoagulant[keys].id == val) {
  436. anticoagulan_name = anticoagulant[keys].name
  437. }
  438. }
  439. return anticoagulan_name
  440. },
  441. getModeName(mode_id){
  442. return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name: ""
  443. },
  444. changeTime() {
  445. }, changeEndTime() {
  446. }, GetDialysisWatchTableData(params) {
  447. this.loading = true
  448. this.tableData = []
  449. GetDialysisWatchTableData(params)
  450. .then(rs => {
  451. var resp = rs.data
  452. if (resp.state == 1) {
  453. this.loading = false
  454. for (let i = 0; i < resp.data.data.length; i++) {
  455. this.tableData.push(resp.data.data[i])
  456. }
  457. } else {
  458. this.loading = false
  459. }
  460. })
  461. .catch(error => {
  462. })
  463. },
  464. GetDialysisWatchChartData(params) {
  465. this.chart.xAxis.data = []
  466. this.chart.series[0].data = []
  467. this.bar.xAxis.data = []
  468. this.bar.series[0].data = []
  469. GetDialysisWatchChartData(params)
  470. .then(rs => {
  471. var resp = rs.data
  472. if (resp.state == 1) {
  473. if (this.query.statistics_type != 9 && this.query.statistics_type != 10) {
  474. for (let i = 0; i < resp.data.data.length; i++) {
  475. this.chart.xAxis.data.push(resp.data.data[i].date)
  476. this.chart.series[0].data.push(resp.data.data[i].value)
  477. }
  478. } else {
  479. for (let i = 0; i < resp.data.data.length; i++) {
  480. this.bar.xAxis.data.push(resp.data.data[i].name)
  481. this.bar.series[0].data.push(resp.data.data[i].total)
  482. }
  483. }
  484. } else {
  485. }
  486. })
  487. .catch(error => {
  488. })
  489. },
  490. handleSelect(val) {
  491. this.query.patient_id = val.id
  492. this.query.page = 1
  493. this.GetDialysisWatchTableData(this.query)
  494. this.GetDialysisWatchChartData(this.query)
  495. },
  496. querySearchAsync(keyword, cb) {
  497. let key = ''
  498. if (keyword != undefined) {
  499. key = keyword
  500. }
  501. let searchArray = []
  502. PostSearch(key).then(response => {
  503. if (response.data.state == 1) {
  504. searchArray = response.data.data.patient
  505. cb(searchArray)
  506. } else {
  507. cb([])
  508. }
  509. })
  510. },
  511. chooseWay(way) {
  512. this.wayType = way
  513. }, getCurrentOrgPatients(){
  514. getCurrentOrgPatients().then(response=>{
  515. if(response.data.state == 1){
  516. var patients = response.data.data.patients
  517. this.patientsData = patients
  518. }
  519. })
  520. },
  521. }, created() {
  522. var date = new Date()
  523. var year = date.getFullYear() //获取完整的年份(4位)
  524. var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
  525. var day = date.getDate() < 0 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
  526. var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
  527. this.query.patient_id = 0
  528. this.query.end_time = year + '-' + month + '-' + day
  529. this.query.start_time = year + '-' + last_month + '-' + day
  530. this.query.statistics_type = 1
  531. this.GetDialysisWatchChartData(this.query)
  532. this.GetDialysisWatchTableData(this.query)
  533. this.getCurrentOrgPatients()
  534. }
  535. }
  536. </script>
  537. <style lang="scss" scoped>
  538. .tableTitle {
  539. font-size: 16px;
  540. color: #000;
  541. font-weight: bold;
  542. margin-bottom: 10px;
  543. }
  544. </style>
  545. <style lang="scss">
  546. .page_process {
  547. .el-button--medium {
  548. padding: 10px 8px;
  549. }
  550. .el-form-item {
  551. margin-bottom: 0;
  552. }
  553. }
  554. </style>