|
@@ -193,24 +193,24 @@
|
193
|
193
|
</template>
|
194
|
194
|
|
195
|
195
|
<script>
|
196
|
|
-import SideBar from "@/pages/layout/SideBar";
|
197
|
|
-import Divider from "vux/src/components/divider/index";
|
198
|
|
-import { getMonitorList, GetAllZone, getPatientMonitors } from "@/api/monitor";
|
199
|
|
-import { parseTime } from "@/utils";
|
200
|
|
-import { Toast } from "vant";
|
|
196
|
+import SideBar from '@/pages/layout/SideBar'
|
|
197
|
+import Divider from 'vux/src/components/divider/index'
|
|
198
|
+import { getMonitorList, GetAllZone, getPatientMonitors } from '@/api/monitor'
|
|
199
|
+import { parseTime } from '@/utils'
|
|
200
|
+import { Toast } from 'vant'
|
201
|
201
|
|
202
|
202
|
export default {
|
203
|
|
- name: "MonitoringIndex",
|
204
|
|
- created() {
|
|
203
|
+ name: 'MonitoringIndex',
|
|
204
|
+ created () {
|
205
|
205
|
this.queryParams.date = this.parseTime(
|
206
|
206
|
new Date().getTime() / 1000,
|
207
|
|
- "{y}-{m}-{d}"
|
208
|
|
- );
|
209
|
|
- this.queryParams.partition = this.partition;
|
210
|
|
- this.getMonitor(this.queryParams);
|
211
|
|
- this.GetAllZone();
|
|
207
|
+ '{y}-{m}-{d}'
|
|
208
|
+ )
|
|
209
|
+ this.queryParams.partition = this.partition
|
|
210
|
+ this.getMonitor(this.queryParams)
|
|
211
|
+ this.GetAllZone()
|
212
|
212
|
},
|
213
|
|
- data() {
|
|
213
|
+ data () {
|
214
|
214
|
return {
|
215
|
215
|
tableData: [
|
216
|
216
|
{
|
|
@@ -321,135 +321,135 @@ export default {
|
321
|
321
|
partition: 0,
|
322
|
322
|
queryParams: {
|
323
|
323
|
date: new Date(),
|
324
|
|
- partition: ""
|
|
324
|
+ partition: ''
|
325
|
325
|
},
|
326
|
|
- patient_keyword: "",
|
|
326
|
+ patient_keyword: '',
|
327
|
327
|
search_page: 1
|
328
|
|
- };
|
|
328
|
+ }
|
329
|
329
|
},
|
330
|
330
|
methods: {
|
331
|
|
- clickfunction: function(val) {
|
|
331
|
+ clickfunction: function (val) {
|
332
|
332
|
this.$router.push({
|
333
|
|
- path: "/details",
|
|
333
|
+ path: '/details',
|
334
|
334
|
query: {
|
335
|
335
|
patient_id: val.patient_id,
|
336
|
336
|
date: val.schedule_date,
|
337
|
337
|
patient_name: val.patient.name
|
338
|
338
|
}
|
339
|
|
- });
|
|
339
|
+ })
|
340
|
340
|
},
|
341
|
|
- getMonitor: function(queryParams) {
|
342
|
|
- this.search_page = 1;
|
343
|
|
- this.patient_keyword = "";
|
|
341
|
+ getMonitor: function (queryParams) {
|
|
342
|
+ this.search_page = 1
|
|
343
|
+ this.patient_keyword = ''
|
344
|
344
|
|
345
|
|
- this.loading = true;
|
346
|
|
- this.finished = false;
|
347
|
|
- this.dialysis_scheduals = [];
|
|
345
|
+ this.loading = true
|
|
346
|
+ this.finished = false
|
|
347
|
+ this.dialysis_scheduals = []
|
348
|
348
|
getMonitorList(queryParams).then(response => {
|
349
|
|
- this.loading = false;
|
350
|
|
- this.finished = true;
|
|
349
|
+ this.loading = false
|
|
350
|
+ this.finished = true
|
351
|
351
|
if (response.data.state == 0) {
|
352
|
|
- return false;
|
|
352
|
+ return false
|
353
|
353
|
} else {
|
354
|
|
- var scheduals = response.data.data.monitor;
|
355
|
|
- var zoneMap = {};
|
356
|
|
- var schedualMap = {};
|
|
354
|
+ var scheduals = response.data.data.monitor
|
|
355
|
+ var zoneMap = {}
|
|
356
|
+ var schedualMap = {}
|
357
|
357
|
|
358
|
358
|
for (let index = 0; index < scheduals.length; index++) {
|
359
|
|
- const schedual = scheduals[index];
|
|
359
|
+ const schedual = scheduals[index]
|
360
|
360
|
if (schedualMap[schedual.device_zone.name] == null) {
|
361
|
|
- schedualMap[schedual.device_zone.name] = [];
|
|
361
|
+ schedualMap[schedual.device_zone.name] = []
|
362
|
362
|
}
|
363
|
|
- schedualMap[schedual.device_zone.name].push(schedual);
|
|
363
|
+ schedualMap[schedual.device_zone.name].push(schedual)
|
364
|
364
|
if (zoneMap[schedual.device_zone.name] == null) {
|
365
|
|
- zoneMap[schedual.device_zone.name] = schedual.device_zone;
|
|
365
|
+ zoneMap[schedual.device_zone.name] = schedual.device_zone
|
366
|
366
|
}
|
367
|
367
|
}
|
368
|
368
|
|
369
|
|
- var zones = [];
|
370
|
|
- zones.push({ value: 0, text: "全部分区" });
|
|
369
|
+ var zones = []
|
|
370
|
+ zones.push({ value: 0, text: '全部分区' })
|
371
|
371
|
for (var zoneName in zoneMap) {
|
372
|
|
- zones.push({ value: zoneMap[zoneName].id, text: zoneName });
|
|
372
|
+ zones.push({ value: zoneMap[zoneName].id, text: zoneName })
|
373
|
373
|
}
|
374
|
|
- zones = zones.sort(function(a, b) {
|
375
|
|
- return a.value > b.value;
|
376
|
|
- });
|
377
|
|
- this.zones = zones;
|
|
374
|
+ zones = zones.sort(function (a, b) {
|
|
375
|
+ return a.value > b.value
|
|
376
|
+ })
|
|
377
|
+ this.zones = zones
|
378
|
378
|
|
379
|
|
- var dialysis_scheduals = [];
|
|
379
|
+ var dialysis_scheduals = []
|
380
|
380
|
for (let index = 0; index < zones.length; index++) {
|
381
|
|
- const zone = zones[index];
|
382
|
|
- var scheduals = schedualMap[zone.text];
|
|
381
|
+ const zone = zones[index]
|
|
382
|
+ var scheduals = schedualMap[zone.text]
|
383
|
383
|
if (scheduals == null) {
|
384
|
|
- continue;
|
|
384
|
+ continue
|
385
|
385
|
}
|
386
|
386
|
dialysis_scheduals.push({
|
387
|
387
|
zone_name: zone.text,
|
388
|
388
|
scheduals: scheduals
|
389
|
|
- });
|
|
389
|
+ })
|
390
|
390
|
}
|
391
|
|
- this.dialysis_scheduals = dialysis_scheduals;
|
392
|
|
- // console.log(this.dialysis_scheduals);
|
|
391
|
+ this.dialysis_scheduals = dialysis_scheduals
|
|
392
|
+ console.log('数据是什么东西', this.dialysis_scheduals)
|
393
|
393
|
}
|
394
|
|
- });
|
|
394
|
+ })
|
395
|
395
|
},
|
396
|
|
- parseTime(time, layout) {
|
397
|
|
- return parseTime(time, layout);
|
|
396
|
+ parseTime (time, layout) {
|
|
397
|
+ return parseTime(time, layout)
|
398
|
398
|
},
|
399
|
|
- openPicker: function() {
|
400
|
|
- this.$refs.date_picker.open();
|
|
399
|
+ openPicker: function () {
|
|
400
|
+ this.$refs.date_picker.open()
|
401
|
401
|
},
|
402
|
|
- handleDateConfirm: function(val) {
|
403
|
|
- this.queryParams.date = this.parseTime(this.date / 1000, "{y}-{m}-{d}");
|
404
|
|
- this.queryParams.partition = this.partition;
|
|
402
|
+ handleDateConfirm: function (val) {
|
|
403
|
+ this.queryParams.date = this.parseTime(this.date / 1000, '{y}-{m}-{d}')
|
|
404
|
+ this.queryParams.partition = this.partition
|
405
|
405
|
|
406
|
|
- this.getMonitor(this.queryParams);
|
|
406
|
+ this.getMonitor(this.queryParams)
|
407
|
407
|
},
|
408
|
|
- partitionName: function(val) {
|
409
|
|
- return typeof this.partitionArr[val] != "undefined" &&
|
410
|
|
- typeof this.partitionArr[val].name != "undefined"
|
|
408
|
+ partitionName: function (val) {
|
|
409
|
+ return typeof this.partitionArr[val] !== 'undefined' &&
|
|
410
|
+ typeof this.partitionArr[val].name !== 'undefined'
|
411
|
411
|
? this.partitionArr[val].name
|
412
|
|
- : "";
|
|
412
|
+ : ''
|
413
|
413
|
},
|
414
|
|
- GetAllZone: function() {
|
|
414
|
+ GetAllZone: function () {
|
415
|
415
|
GetAllZone().then(response => {
|
416
|
416
|
if (response.data.state == 0) {
|
417
|
|
- return false;
|
|
417
|
+ return false
|
418
|
418
|
} else {
|
419
|
|
- this.partitionArr = response.data.data.zone;
|
420
|
|
- this.partitionArr.unshift({ id: 0, name: "全部分区" });
|
|
419
|
+ this.partitionArr = response.data.data.zone
|
|
420
|
+ this.partitionArr.unshift({ id: 0, name: '全部分区' })
|
421
|
421
|
}
|
422
|
|
- });
|
|
422
|
+ })
|
423
|
423
|
},
|
424
|
|
- itemClick: function(id) {
|
425
|
|
- this.partition = id;
|
426
|
|
- this.visible = false;
|
427
|
|
- this.queryParams.date = this.parseTime(this.date / 1000, "{y}-{m}-{d}");
|
428
|
|
- this.queryParams.partition = this.partition;
|
429
|
|
- this.getMonitor(this.queryParams);
|
|
424
|
+ itemClick: function (id) {
|
|
425
|
+ this.partition = id
|
|
426
|
+ this.visible = false
|
|
427
|
+ this.queryParams.date = this.parseTime(this.date / 1000, '{y}-{m}-{d}')
|
|
428
|
+ this.queryParams.partition = this.partition
|
|
429
|
+ this.getMonitor(this.queryParams)
|
430
|
430
|
},
|
431
|
|
- monitorBloodPressureStatus: function(val) {
|
432
|
|
- let status = 0;
|
|
431
|
+ monitorBloodPressureStatus: function (val) {
|
|
432
|
+ let status = 0
|
433
|
433
|
if (val.length == 0) {
|
434
|
|
- return 0;
|
|
434
|
+ return 0
|
435
|
435
|
}
|
436
|
436
|
for (let i = 0; i < val.length; i++) {
|
437
|
|
- //舒张压(低压)(diastolic_blood_pressure) 收缩压(高压)(systolic_blood_pressure)
|
|
437
|
+ // 舒张压(低压)(diastolic_blood_pressure) 收缩压(高压)(systolic_blood_pressure)
|
438
|
438
|
if (
|
439
|
439
|
val[i].systolic_blood_pressure >= 140 ||
|
440
|
440
|
val[i].diastolic_blood_pressure >= 90
|
441
|
441
|
) {
|
442
|
|
- status = 3; //高压
|
|
442
|
+ status = 3 // 高压
|
443
|
443
|
} else if (
|
444
|
444
|
val[i].diastolic_blood_pressure < 60 ||
|
445
|
445
|
val[i].systolic_blood_pressure < 90
|
446
|
446
|
) {
|
447
|
|
- status = 1; //低压
|
|
447
|
+ status = 1 // 低压
|
448
|
448
|
} else if (
|
449
|
449
|
val[i].diastolic_blood_pressure >= 60 ||
|
450
|
450
|
val[i].systolic_blood_pressure < 140
|
451
|
451
|
) {
|
452
|
|
- status = 2; //正常
|
|
452
|
+ status = 2 // 正常
|
453
|
453
|
}
|
454
|
454
|
|
455
|
455
|
// if ( val[i].diastolic_blood_pressure < 60 | val[i].systolic_blood_pressure < 90 ) {
|
|
@@ -467,74 +467,74 @@ export default {
|
467
|
467
|
// }
|
468
|
468
|
}
|
469
|
469
|
|
470
|
|
- return status;
|
|
470
|
+ return status
|
471
|
471
|
},
|
472
|
|
- monitorRateStatus: function(val) {
|
473
|
|
- let status = 0;
|
|
472
|
+ monitorRateStatus: function (val) {
|
|
473
|
+ let status = 0
|
474
|
474
|
if (val.length == 0) {
|
475
|
|
- return 0;
|
|
475
|
+ return 0
|
476
|
476
|
}
|
477
|
477
|
for (let i = 0; i < val.length; i++) {
|
478
|
|
- //舒张压(低压)(diastolic_blood_pressure) 收缩压(高压)(systolic_blood_pressure)
|
|
478
|
+ // 舒张压(低压)(diastolic_blood_pressure) 收缩压(高压)(systolic_blood_pressure)
|
479
|
479
|
if (val[i].pulse_frequency < 60) {
|
480
|
|
- status = 1; //心率过缓
|
|
480
|
+ status = 1 // 心率过缓
|
481
|
481
|
} else if (
|
482
|
482
|
val[i].pulse_frequency >= 60 &&
|
483
|
483
|
val[i].pulse_frequency < 100
|
484
|
484
|
) {
|
485
|
|
- status = 2; //心率正常
|
|
485
|
+ status = 2 // 心率正常
|
486
|
486
|
} else if (val[i].pulse_frequency >= 100) {
|
487
|
|
- status = 3; //心率过快
|
|
487
|
+ status = 3 // 心率过快
|
488
|
488
|
}
|
489
|
489
|
}
|
490
|
|
- return status;
|
|
490
|
+ return status
|
491
|
491
|
},
|
492
|
|
- searchWithKeyword: function(page) {
|
493
|
|
- this.$refs.search_field.blur();
|
|
492
|
+ searchWithKeyword: function (page) {
|
|
493
|
+ this.$refs.search_field.blur()
|
494
|
494
|
if (this.patient_keyword.length == 0) {
|
495
|
|
- this.queryParams.date = this.parseTime(this.date / 1000, "{y}-{m}-{d}");
|
496
|
|
- this.queryParams.partition = this.partition;
|
497
|
|
- this.getMonitor(this.queryParams);
|
498
|
|
- return;
|
|
495
|
+ this.queryParams.date = this.parseTime(this.date / 1000, '{y}-{m}-{d}')
|
|
496
|
+ this.queryParams.partition = this.partition
|
|
497
|
+ this.getMonitor(this.queryParams)
|
|
498
|
+ return
|
499
|
499
|
}
|
500
|
500
|
|
501
|
|
- this.partition = 0;
|
|
501
|
+ this.partition = 0
|
502
|
502
|
|
503
|
|
- this.search_page = page;
|
|
503
|
+ this.search_page = page
|
504
|
504
|
if (page == 1) {
|
505
|
|
- this.dialysis_scheduals = [];
|
|
505
|
+ this.dialysis_scheduals = []
|
506
|
506
|
}
|
507
|
|
- this.loading = true;
|
508
|
|
- this.finished = false;
|
|
507
|
+ this.loading = true
|
|
508
|
+ this.finished = false
|
509
|
509
|
getPatientMonitors({
|
510
|
510
|
keyword: this.patient_keyword,
|
511
|
511
|
page: this.search_page
|
512
|
512
|
}).then(rs => {
|
513
|
|
- this.loading = false;
|
514
|
|
- this.finished = true;
|
515
|
|
- var resp = rs.data;
|
|
513
|
+ this.loading = false
|
|
514
|
+ this.finished = true
|
|
515
|
+ var resp = rs.data
|
516
|
516
|
if (resp.state == 1) {
|
517
|
517
|
if (resp.data.monitor.length > 0) {
|
518
|
518
|
this.dialysis_scheduals.push({
|
519
|
|
- zone_name: "",
|
|
519
|
+ zone_name: '',
|
520
|
520
|
scheduals: resp.data.monitor
|
521
|
|
- });
|
522
|
|
- this.finished = false;
|
|
521
|
+ })
|
|
522
|
+ this.finished = false
|
523
|
523
|
} else {
|
524
|
|
- this.finished = true;
|
|
524
|
+ this.finished = true
|
525
|
525
|
}
|
526
|
526
|
}
|
527
|
|
- });
|
|
527
|
+ })
|
528
|
528
|
},
|
529
|
|
- onLoad: function() {
|
530
|
|
- this.searchWithKeyword(this.search_page + 1);
|
|
529
|
+ onLoad: function () {
|
|
530
|
+ this.searchWithKeyword(this.search_page + 1)
|
531
|
531
|
}
|
532
|
532
|
},
|
533
|
533
|
components: {
|
534
|
534
|
Divider,
|
535
|
535
|
SideBar
|
536
|
536
|
}
|
537
|
|
-};
|
|
537
|
+}
|
538
|
538
|
</script>
|
539
|
539
|
|
540
|
540
|
<style lang="scss" scoped>
|