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

weightDetails.vue 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <el-button type="primary" @click="$router.back(-1)">返回</el-button>
  6. </div>
  7. <div class="app-container">
  8. <div class="page_weightDetails">
  9. <div class="cell clearfix" style="margin:0">
  10. <el-form :inline="true" :model="listQuery">
  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. </div>
  29. <el-container>
  30. <div style="width:150px">
  31. <div class="tableTitle">患者列表</div>
  32. <div class="tableTitle">当前患者: {{patient_name}}</div>
  33. <el-table ref="table" :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }"
  34. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  35. highlight-current-row
  36. @current-change="handleChange">
  37. <el-table-column prop="dialysis_no" label="透析号" width="80">
  38. <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
  39. </el-table-column>
  40. <el-table-column prop="name" label="姓名" width="80">
  41. <template slot-scope="scope">{{ scope.row.name }}</template>
  42. </el-table-column>
  43. </el-table>
  44. </div>
  45. <div class="containerRight" style="flex:1;overflow: hidden">
  46. <div class="cell clearfix">
  47. <label class="title" style="text-align:left">
  48. <span class="name">体重类型</span> :
  49. </label>
  50. <el-select v-model="query.statistics_type" placeholder="请选择" style="width:110px;margin-right:10px" @change="changeProject">
  51. <el-option
  52. v-for="item in options"
  53. :key="item.value"
  54. :label="item.name"
  55. :value="item.value"
  56. ></el-option>
  57. </el-select>
  58. <label class="title">
  59. <span class="name">日期查询</span> :
  60. </label>
  61. <el-date-picker
  62. v-model="query.start_time"
  63. prefix-icon="el-icon-date"
  64. @change="changeTime"
  65. :editable="false"
  66. style="width: 150px;"
  67. type="date"
  68. :picker-options="pickerOptions"
  69. placeholder="选择日期时间"
  70. align="right"
  71. format="yyyy-MM-dd"
  72. value-format="yyyy-MM-dd"
  73. ></el-date-picker>
  74. <span class>-</span>
  75. <el-date-picker
  76. v-model="query.end_time"
  77. prefix-icon="el-icon-date"
  78. @change="changeEndTime"
  79. :editable="false"
  80. :picker-options="pickerOptions"
  81. style="width: 150px;"
  82. type="date"
  83. placeholder="选择日期时间"
  84. align="right"
  85. format="yyyy-MM-dd"
  86. value-format="yyyy-MM-dd"
  87. ></el-date-picker>
  88. </div>
  89. <div class="tableTitle">指标趋势</div>
  90. <div>
  91. <line-chart :options="chart"></line-chart>
  92. </div>
  93. <div class="tableTitle">统计表</div>
  94. <div>
  95. <el-table :data="tableData" style="width: 100%" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
  96. <el-table-column fixed label="日期" align="center">
  97. <template slot-scope="scope">
  98. {{scope.row.assessment_date | parseTime("{y}-{m}-{d}") }}
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="姓名" align="center">
  102. <template slot-scope="scope">
  103. {{scope.row.patient.name}}
  104. </template>
  105. </el-table-column>
  106. <el-table-column label="干体重" align="center">
  107. <template slot-scope="scope">
  108. {{scope.row.dry_weight?scope.row.dry_weight:''}}
  109. <!--{{// scope.row.patient.lapseto == 1 ? '留治':'转出'}}-->
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="前次透后体重" align="center">
  113. <template slot-scope="scope">
  114. {{scope.row.last_after_weight?scope.row.last_after_weight:''}}
  115. <!--<div v-if="scope.row.before.systolic_blood_pressure">{{scope.row.before.systolic_blood_pressure}} / {{scope.row.before.diastolic_blood_pressure}}</div>-->
  116. </template>
  117. </el-table-column>
  118. <el-table-column label="透前体重" align="center">
  119. <template slot-scope="scope">
  120. {{scope.row.weight_before?scope.row.weight_before:''}}
  121. <!--<div v-if="scope.row.min_monitor.systolic_blood_pressure">{{ scope.row.min_monitor.systolic_blood_pressure}} /{{ scope.row.min_monitor.diastolic_blood_pressure}}</div>-->
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="透后体重" align="center">
  125. <template slot-scope="scope">
  126. <!--<div v-if="scope.row.max_monitor.systolic_blood_pressure">{{ scope.row.max_monitor.systolic_blood_pressure}} /{{ scope.row.max_monitor.diastolic_blood_pressure}}</div>-->
  127. {{scope.row.after.weight_after?scope.row.after.weight_after:''}}
  128. </template>
  129. </el-table-column>
  130. <el-table-column label="体重增加" align="center">
  131. <template slot-scope="scope">
  132. <div v-if="scope.row.weight_before && scope.row.last_after_weight">{{(scope.row.weight_before - scope.row.last_after_weight).toFixed(1)}}</div>
  133. <!--{{scope.row.weight_before - scope.row.last_after_weight}}-->
  134. <!--<div v-if="scope.row.after.systolic_blood_pressure"> {{ scope.row.after.systolic_blood_pressure}} /{{scope.row.after.diastolic_blood_pressure}}</div>-->
  135. </template>
  136. </el-table-column>
  137. </el-table>
  138. <el-pagination
  139. align="right"
  140. @size-change="handleSizeChange"
  141. @current-change="handleCurrentChange"
  142. :current-page="query.page"
  143. :page-sizes="[10, 20, 50, 100]"
  144. :page-size="10"
  145. background
  146. style="margin-top:20px;"
  147. layout="total, sizes, prev, pager, next, jumper"
  148. :total="total"
  149. ></el-pagination>
  150. </div>
  151. </div>
  152. </el-container>
  153. </div>
  154. </div>
  155. </div>
  156. </template>
  157. <script>
  158. import echarts from "echarts";
  159. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  160. import LineChart from "../../qcd/components/LineChart";
  161. import { getCurrentOrgPatients } from "@/api/common/common";
  162. import {GetDialysisPatientWeightChartData,GetDialysisWeightTableData} from "@/api/common/statistics"
  163. import { PostSearch } from '@/api/patient'
  164. import { uParseTime } from "@/utils/tools";
  165. export default {
  166. components: {
  167. LineChart,
  168. BreadCrumb
  169. },
  170. data() {
  171. return {
  172. pickerOptions: {
  173. disabledDate(time) {
  174. let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
  175. return time.getTime() > Date.now() || time.getTime() < threeMonths;;
  176. }
  177. },
  178. patientsData:[],
  179. tableData: [],
  180. loading: false,
  181. search_value: '',
  182. total: 0,
  183. patient_name:'',
  184. query: {
  185. patient_id: '',
  186. statistics_type: 1,
  187. start_time: '',
  188. end_time: '',
  189. limit: 10,
  190. page: 1
  191. },
  192. options: [
  193. { value: 1, name: '干体重' },
  194. { value: 2, name: '透前体重' },
  195. { value: 3, name: '体重增加' },
  196. { value: 4, name: '透后体重' },
  197. ],
  198. crumbs: [
  199. { path: false, name: "质控管理" },
  200. { path: false, name: "患者血压详情" }
  201. ],
  202. chart: {
  203. title: {
  204. text: "ECharts 入门示例"
  205. },
  206. tooltip: {},
  207. legend: {
  208. data: [],
  209. left: 0
  210. },
  211. xAxis: {
  212. data: []
  213. },
  214. yAxis: {
  215. axisLabel: {
  216. formatter: "{value} %"
  217. },
  218. show: false
  219. },
  220. series: [
  221. {
  222. name: "",
  223. type: "line",
  224. data: [
  225. ],
  226. barWidth: 30,
  227. label: {
  228. normal: {
  229. show: true,
  230. position: "top",
  231. formatter: "{c}"
  232. }
  233. },
  234. //配置样式
  235. itemStyle: {
  236. normal: {
  237. color: "#5b98ff", //折点颜色
  238. lineStyle: {
  239. color: "#5b98ff" //折线颜色
  240. }
  241. }
  242. }
  243. },
  244. ],
  245. dataZoom: [
  246. {
  247. // Y轴固定,让内容滚动
  248. type: 'slider',
  249. show: false,
  250. xAxisIndex: [0],
  251. start: 1,
  252. end: 20, // 设置X轴刻度之间的间隔(根据数据量来调整)
  253. zoomLock: true // 锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
  254. },
  255. {
  256. type: 'inside',
  257. xAxisIndex: [0],
  258. start: 1,
  259. end: 20,
  260. zoomLock: true // 锁定区域禁止缩放
  261. }
  262. ]
  263. },
  264. };
  265. },
  266. methods: {
  267. chooseMonth(month) {
  268. this.monthType = month;
  269. },
  270. clickQuality(index) {
  271. this.quality = index;
  272. }, changeProject(val){
  273. this.query.statistics_type = val
  274. this.query.page = 1
  275. this.GetDialysisPatientWeightChartData(this.query)
  276. },
  277. handleChange(val){
  278. this.patient_name = val.name
  279. this.query.patient_id = val.id
  280. this.query.page = 1
  281. this.GetDialysisWeightTableData(this.query)
  282. this.GetDialysisPatientWeightChartData(this.query)
  283. },
  284. handleSizeChange(limit) {
  285. this.query.limit = limit;
  286. this.GetDialysisWeightTableData(this.query)
  287. },
  288. handleCurrentChange(page) {
  289. this.query.page = page;
  290. this.GetDialysisWeightTableData(this.query)
  291. },
  292. changeTime(val) {
  293. var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
  294. if (time > 0) {
  295. this.$message.error("结束时间不能小于开始时间");
  296. this.query.start_time = "";
  297. } else {
  298. // this.getDialysisList()
  299. this.query.page = 1;
  300. this.GetDialysisPatientWeightChartData(this.query)
  301. this.GetDialysisWeightTableData(this.query)
  302. }
  303. },
  304. changeEndTime(val) {
  305. var time =
  306. this.getTimestamp(val) - this.getTimestamp(this.query.start_time);
  307. if (time < 0) {
  308. this.$message.error("结束时间不能小于开始时间");
  309. this.query.end_time = "";
  310. } else {
  311. this.query.page = 1;
  312. this.GetDialysisPatientWeightChartData(this.query)
  313. this.GetDialysisWeightTableData(this.query)
  314. }
  315. },
  316. getTimestamp(time) {
  317. // 把时间日期转成时间戳
  318. return new Date(time).getTime() / 1000;
  319. },GetDialysisWeightTableData(params) {
  320. this.loading = true
  321. GetDialysisWeightTableData(params)
  322. .then(rs => {
  323. var resp = rs.data
  324. if (resp.state == 1) {
  325. this.loading = false
  326. this.tableData = []
  327. for (let i = 0; i < resp.data.data.length; i++) {
  328. this.tableData.push(resp.data.data[i])
  329. }
  330. this.total = resp.data.total
  331. } else {
  332. this.loading = false
  333. }
  334. })
  335. .catch(error => {
  336. })
  337. },
  338. GetDialysisPatientWeightChartData(params) {
  339. this.chart.xAxis.data = []
  340. this.chart.series[0].data = []
  341. GetDialysisPatientWeightChartData(params)
  342. .then(rs => {
  343. var resp = rs.data
  344. if (resp.state == 1) {
  345. for (let i = 0; i < resp.data.data.length; i++) {
  346. this.chart.xAxis.data.push(resp.data.data[i].date)
  347. this.chart.series[0].data.push(parseFloat(resp.data.data[i].value).toFixed(1))
  348. }
  349. this.getArrLength(this.chart.xAxis.data)
  350. } else {
  351. }
  352. })
  353. .catch(error => {
  354. })
  355. },
  356. handleSelect(val) {
  357. this.query.patient_id = val.id
  358. this.query.page = 1
  359. this.patient_name = val.name
  360. this.GetDialysisPatientWeightChartData(this.query)
  361. this.GetDialysisWeightTableData(this.query)
  362. for (let i = 0;i < this.patientsData.length; i++){
  363. if (this.patientsData[i].id == val.id){
  364. this.$refs.table.setCurrentRow(this.patientsData[i])
  365. }
  366. }
  367. },
  368. querySearchAsync(keyword, cb) {
  369. let key = ''
  370. if (keyword != undefined) {
  371. key = keyword
  372. }
  373. let searchArray = []
  374. PostSearch(key).then(response => {
  375. if (response.data.state == 1) {
  376. searchArray = response.data.data.patient
  377. cb(searchArray)
  378. } else {
  379. cb([])
  380. }
  381. })
  382. }, getCurrentOrgPatients(){
  383. getCurrentOrgPatients().then(response=>{
  384. if(response.data.state == 1){
  385. var patients = response.data.data.patients
  386. this.patientsData = patients
  387. for (let i = 0;i < this.patientsData.length; i++){
  388. if (this.patientsData[i].id == this.query.patient_id){
  389. this.patient_name = this.patientsData[i].name
  390. this.$refs.table.setCurrentRow(this.patientsData[i])
  391. }
  392. }
  393. }
  394. })
  395. },
  396. getArrLength(result){
  397. if(result.length > 10){
  398. var dataZoom_end = (10/result.length)*100;
  399. this.chart.dataZoom[0].end = dataZoom_end
  400. }else{
  401. var dataZoom_end = 100;
  402. this.chart.dataZoom[0].end = dataZoom_end
  403. }
  404. }
  405. },created() {
  406. var date = new Date()
  407. var year = date.getFullYear() //获取完整的年份(4位)
  408. var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
  409. var day = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
  410. var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
  411. this.query.patient_id = this.$route.query.id
  412. this.query.end_time = year + '-' + month + '-' + day
  413. this.query.start_time = year + '-' + last_month + '-' + day
  414. this.query.statistics_type = 1
  415. this.GetDialysisPatientWeightChartData(this.query)
  416. this.GetDialysisWeightTableData(this.query)
  417. this.getCurrentOrgPatients()
  418. }
  419. };
  420. </script>
  421. <style lang="scss" scoped>
  422. .containerRight {
  423. padding-left: 10px;
  424. }
  425. .tableTitle {
  426. font-size: 16px;
  427. color: #000;
  428. font-weight: bold;
  429. margin-bottom: 10px;
  430. margin-top: 8px;
  431. }
  432. </style>
  433. <style lang="scss">
  434. .page_weightDetails {
  435. .cell {
  436. text-align: center;
  437. }
  438. .el-form-item {
  439. margin-bottom: 0;
  440. }
  441. ::-webkit-scrollbar{
  442. height: 15px !important;
  443. }
  444. }
  445. </style>