|
@@ -0,0 +1,169 @@
|
|
1
|
+<template>
|
|
2
|
+ <div v-loading="loading" element-loading-text="加载中">
|
|
3
|
+ <el-menu class="el-menu-demo" mode="horizontal" >
|
|
4
|
+ <el-menu-item >{{orgname}}</el-menu-item>
|
|
5
|
+ <el-menu-item :class="rightItem">{{week}}</el-menu-item>
|
|
6
|
+ <el-menu-item :class="rightItem">{{today}}</el-menu-item>
|
|
7
|
+ </el-menu>
|
|
8
|
+ <el-table
|
|
9
|
+ id="board-table-data"
|
|
10
|
+ :data="boardData"
|
|
11
|
+ border
|
|
12
|
+ style="width: 100%">
|
|
13
|
+ <el-table-column
|
|
14
|
+ align="center"
|
|
15
|
+ prop="date"
|
|
16
|
+ label="姓名"
|
|
17
|
+ width="180">
|
|
18
|
+ <template slot-scope="scope">{{scope.row.patient.name}}</template>
|
|
19
|
+ </el-table-column>
|
|
20
|
+ <el-table-column
|
|
21
|
+ align="center"
|
|
22
|
+ prop="name"
|
|
23
|
+ label="透析号"
|
|
24
|
+ width="180">
|
|
25
|
+ <template slot-scope="scope">{{scope.row.patient.dialysis_no}}</template>
|
|
26
|
+ </el-table-column>
|
|
27
|
+ <el-table-column
|
|
28
|
+ align="center"
|
|
29
|
+ prop="address"
|
|
30
|
+ label="模式">
|
|
31
|
+ <template slot-scope="scope">{{modeName(scope.row.mode_id)}}</template>
|
|
32
|
+ </el-table-column>
|
|
33
|
+ <el-table-column
|
|
34
|
+ align="center"
|
|
35
|
+ prop="address"
|
|
36
|
+ label="分区">
|
|
37
|
+ <template slot-scope="scope">{{scope.row.device_zone?scope.row.device_zone.name:''}}</template>
|
|
38
|
+ </el-table-column>
|
|
39
|
+ <el-table-column
|
|
40
|
+ align="center"
|
|
41
|
+ prop="address"
|
|
42
|
+ label="床位">
|
|
43
|
+ <template slot-scope="scope">{{scope.row.device_number?scope.row.device_number.number:''}}</template>
|
|
44
|
+ </el-table-column>
|
|
45
|
+ <el-table-column
|
|
46
|
+ align="center"
|
|
47
|
+ prop="address"
|
|
48
|
+ label="状态">
|
|
49
|
+ <template slot-scope="scope">{{boradData(scope.row)}}</template>
|
|
50
|
+ </el-table-column>
|
|
51
|
+ <el-table-column
|
|
52
|
+ align="center"
|
|
53
|
+ prop="address"
|
|
54
|
+ label="下次透析时间">
|
|
55
|
+ <template slot-scope="scope">{{nextSchedule(scope.row.next_schedules)}}</template>
|
|
56
|
+ </el-table-column>
|
|
57
|
+ </el-table>
|
|
58
|
+ </div>
|
|
59
|
+</template>
|
|
60
|
+
|
|
61
|
+<script>
|
|
62
|
+import { getBoards } from "@/api/board";
|
|
63
|
+import { parseTime } from "@/utils";
|
|
64
|
+
|
|
65
|
+export default {
|
|
66
|
+ name: 'bulletinboard',
|
|
67
|
+ data(){
|
|
68
|
+ return {
|
|
69
|
+ orgname: '',
|
|
70
|
+ today:'今天',
|
|
71
|
+ week:'--',
|
|
72
|
+ rightItem:'board-right-menu-item',
|
|
73
|
+ boardData: [],
|
|
74
|
+ showTime:10,
|
|
75
|
+ currentPage:0,
|
|
76
|
+ loading:true,
|
|
77
|
+ weekDay:['周日','周一','周二','周三','周四','周五','周六',],
|
|
78
|
+ roonOptions:{1:'上午', 2:'下午', 3:'晚上'},
|
|
79
|
+ modeOptions: {},
|
|
80
|
+ }
|
|
81
|
+ },
|
|
82
|
+ created() {
|
|
83
|
+ // this.orgname = xtuser.org.org_name;
|
|
84
|
+ this.orgname = "遂溪方济医院";
|
|
85
|
+ this.modeOptions = this.$store.getters.treatment_mode;
|
|
86
|
+ this.initData();
|
|
87
|
+ // this.currentPage++;
|
|
88
|
+ // this.getBoards();
|
|
89
|
+ },
|
|
90
|
+ methods:{
|
|
91
|
+ fullscreenboard:function(){
|
|
92
|
+ let routeData = this.$router.resolve({ path: '/fullscreenboard'});
|
|
93
|
+ window.open(routeData.href, '_blank');
|
|
94
|
+ },
|
|
95
|
+ initData:function() {
|
|
96
|
+ var _this = this;
|
|
97
|
+ var timeOut = this.showTime * 1000;
|
|
98
|
+ this.currentPage++;
|
|
99
|
+ console.log("initData this.currentPage", this.currentPage);
|
|
100
|
+ this.getBoards();
|
|
101
|
+
|
|
102
|
+ setTimeout(function(){
|
|
103
|
+ _this.initData();
|
|
104
|
+ }, timeOut);
|
|
105
|
+ },
|
|
106
|
+ getBoards:function(){
|
|
107
|
+ getBoards(this.currentPage).then(response=>{
|
|
108
|
+ this.loading = false;
|
|
109
|
+ var r = response.data;
|
|
110
|
+ if (r.state == 0) {
|
|
111
|
+ this.$message.error(r.msg);
|
|
112
|
+ return false;
|
|
113
|
+ } else {
|
|
114
|
+ if(r.data.boards.length==0) {
|
|
115
|
+ console.log("getBoards this.currentPage", this.currentPage);
|
|
116
|
+ this.currentPage = 1;
|
|
117
|
+ this.getBoards();
|
|
118
|
+ }else {
|
|
119
|
+ this.today = r.data.today;
|
|
120
|
+ this.week = (r.data.week in this.weekDay)?this.weekDay[r.data.week]:'--';
|
|
121
|
+ this.boardData = r.data.boards;
|
|
122
|
+ }
|
|
123
|
+ }
|
|
124
|
+ })
|
|
125
|
+ },
|
|
126
|
+ modeName:function(mode_id) {
|
|
127
|
+ return (mode_id in this.modeOptions)? this.modeOptions[mode_id].name:'';
|
|
128
|
+ },
|
|
129
|
+ boradData:function(record) {
|
|
130
|
+ if(record.dialysis_order) {
|
|
131
|
+ if(record.dialysis_order.stage == 2) {
|
|
132
|
+ return '已下机';
|
|
133
|
+ }else {
|
|
134
|
+ return '透析中';
|
|
135
|
+ }
|
|
136
|
+ }else if(record.sign) {
|
|
137
|
+ return '已签到';
|
|
138
|
+ }else {
|
|
139
|
+ return '未签到';
|
|
140
|
+ }
|
|
141
|
+ },
|
|
142
|
+ nextSchedule:function(nextlist){
|
|
143
|
+ if(nextlist.length==0) {
|
|
144
|
+ return '——';
|
|
145
|
+ }
|
|
146
|
+ var dayTime = parseTime(nextlist[0].schedule_date, '{m}月{d}日');
|
|
147
|
+ var noon = (nextlist[0].schedule_type in this.roonOptions) ? ' ' + this.roonOptions[nextlist[0].schedule_type]:'';
|
|
148
|
+ return dayTime + noon;
|
|
149
|
+ }
|
|
150
|
+ }
|
|
151
|
+}
|
|
152
|
+</script>
|
|
153
|
+<style lang="scss">
|
|
154
|
+#board-table-data th{
|
|
155
|
+ background:#f5f7fa;
|
|
156
|
+}
|
|
157
|
+</style>
|
|
158
|
+
|
|
159
|
+<style lang="scss" scoped>
|
|
160
|
+.board-right-menu-item{
|
|
161
|
+ float: right !important;
|
|
162
|
+}
|
|
163
|
+.el-menu--horizontal>.el-menu-item {
|
|
164
|
+ color: #000 !important;
|
|
165
|
+}
|
|
166
|
+.el-menu--horizontal {
|
|
167
|
+ border-bottom: 0px !important;
|
|
168
|
+}
|
|
169
|
+</style>
|