|
@@ -0,0 +1,459 @@
|
|
1
|
+<template>
|
|
2
|
+ <div class="main-contain">
|
|
3
|
+ <div class="position">
|
|
4
|
+ <bread-crumb :crumbs='crumbs'></bread-crumb>
|
|
5
|
+ <el-button size="small" icon="el-icon-printer" :disabled="selecting_schs.length == 0" @click="batchPrintAction" type="primary">打印</el-button>
|
|
6
|
+ </div>
|
|
7
|
+ <div class="app-container">
|
|
8
|
+ <!-- <div class="filter-container">
|
|
9
|
+ <el-input style="width: 400px;" v-model="searchKey" class="filter-item"/>
|
|
10
|
+ <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
|
|
11
|
+ </div>-->
|
|
12
|
+ <div class="cell clearfix">
|
|
13
|
+ <label class="title">
|
|
14
|
+ <span class="name">{{ search_mode == 1 ? "日期查询" : "病人查询" }}</span> :
|
|
15
|
+ </label>
|
|
16
|
+ <el-date-picker
|
|
17
|
+ v-show="search_mode == 1"
|
|
18
|
+ v-model="time"
|
|
19
|
+ prefix-icon="el-icon-date"
|
|
20
|
+ @change="changeTime"
|
|
21
|
+ :editable="false"
|
|
22
|
+ style="width: 250px;"
|
|
23
|
+ type="date"
|
|
24
|
+ placeholder="选择日期时间"
|
|
25
|
+ align="right"
|
|
26
|
+ :picker-options="pickerOptions1"
|
|
27
|
+ format="yyyy-MM-dd"
|
|
28
|
+ value-format="timestamp"
|
|
29
|
+ ></el-date-picker>
|
|
30
|
+ <el-input
|
|
31
|
+ v-show="search_mode == 2"
|
|
32
|
+ v-model="patient_search_keyword"
|
|
33
|
+ style="width: 250px;"
|
|
34
|
+ placeholder="病人名字、透析号"
|
|
35
|
+ >
|
|
36
|
+ <el-button
|
|
37
|
+ slot="append"
|
|
38
|
+ style="background-color: #409EFF; color: white; border-radius: 0;"
|
|
39
|
+ icon="el-icon-search"
|
|
40
|
+ @click="searchPatientAction"
|
|
41
|
+ ></el-button>
|
|
42
|
+ </el-input>
|
|
43
|
+ <el-button
|
|
44
|
+ type="primary"
|
|
45
|
+ @click="changeSearchMode"
|
|
46
|
+ >{{ search_mode == 1 ? "改为病人查询" : "改为日期查询" }}</el-button>
|
|
47
|
+ <!-- <el-button type="primary" :disabled="selecting_schs.length == 0" @click="batchPrintAction">打印</el-button> -->
|
|
48
|
+ </div>
|
|
49
|
+ <div class="cell clearfix">
|
|
50
|
+ <label class="title">
|
|
51
|
+ <span class="name">排班班次</span> :
|
|
52
|
+ </label>
|
|
53
|
+ <div class="time">
|
|
54
|
+ <ul class>
|
|
55
|
+ <li
|
|
56
|
+ :class="item.value==schedulType?'active':''"
|
|
57
|
+ @click="selectSchedulType(item.value)"
|
|
58
|
+ v-for="item in schedulArr"
|
|
59
|
+ :key="item.value"
|
|
60
|
+ >{{item.label}}</li>
|
|
61
|
+ </ul>
|
|
62
|
+ </div>
|
|
63
|
+ </div>
|
|
64
|
+ <div class="cell clearfix">
|
|
65
|
+ <label class="title">
|
|
66
|
+ <span class="name">分区</span> :
|
|
67
|
+ </label>
|
|
68
|
+ <div class="time">
|
|
69
|
+ <ul class>
|
|
70
|
+ <li
|
|
71
|
+ :class="item.id==partitionType?'active':''"
|
|
72
|
+ @click="selectPartitionType(item.id)"
|
|
73
|
+ v-for="item in partitionArr"
|
|
74
|
+ :key="item.id"
|
|
75
|
+ >{{item.name}}</li>
|
|
76
|
+ </ul>
|
|
77
|
+ </div>
|
|
78
|
+ </div>
|
|
79
|
+
|
|
80
|
+ <el-table
|
|
81
|
+ :data="SchedualPatientsTableData"
|
|
82
|
+ style="width: 100%"
|
|
83
|
+ v-loading="loading"
|
|
84
|
+ @current-change="handleSelectionChange"
|
|
85
|
+ :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
|
|
86
|
+ >
|
|
87
|
+ <el-table-column type="selection" width="45" align="center"></el-table-column>
|
|
88
|
+ <el-table-column prop="number" label="机号" align="center"></el-table-column>
|
|
89
|
+ <el-table-column label="排班日期" prop="sch_time" align="center" width="120"></el-table-column>
|
|
90
|
+ <el-table-column prop="dialysis_no" label="透析号" align="center"></el-table-column>
|
|
91
|
+ <el-table-column prop="name" label="姓名" align="center"></el-table-column>
|
|
92
|
+
|
|
93
|
+ <el-table-column prop="mode_name" label="透析模式" align="center"></el-table-column>
|
|
94
|
+
|
|
95
|
+ <el-table-column prop="dialysis_before_weight" label="透前体重 (kg)" align="center"></el-table-column>
|
|
96
|
+ <el-table-column prop="dialysis_after_weight" label="透后体重 (kg)" align="center"></el-table-column>
|
|
97
|
+ <el-table-column label="透中血压">
|
|
98
|
+ <el-table-column v-for="(item, index) in labelArr" :key="index" :label="item">
|
|
99
|
+ <!-- 数据的遍历 scope.row就代表数据的每一个对象-->
|
|
100
|
+ <template slot-scope="scope">
|
|
101
|
+ <!--<span>{{scope.row.bp[index].value}}</span>-->
|
|
102
|
+ <span>{{getValue(scope.row.bp[index])}}</span>
|
|
103
|
+ </template>
|
|
104
|
+ </el-table-column>
|
|
105
|
+ </el-table-column>
|
|
106
|
+ </el-table>
|
|
107
|
+
|
|
108
|
+ <el-pagination
|
|
109
|
+ align="right"
|
|
110
|
+ @current-change="handleCurrentChange"
|
|
111
|
+ :page-sizes="[10]"
|
|
112
|
+ :page-size="10"
|
|
113
|
+ background
|
|
114
|
+ style="margin-top:20px;"
|
|
115
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
116
|
+ :total="total"
|
|
117
|
+ ></el-pagination>
|
|
118
|
+ </div>
|
|
119
|
+ </div>
|
|
120
|
+</template>
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+<script>
|
|
124
|
+import { getSchedualPatient, GetAllZone } from "@/api/dialysis";
|
|
125
|
+import { parseTime } from "@/utils";
|
|
126
|
+import BreadCrumb from "@/xt_pages/components/bread-crumb";
|
|
127
|
+
|
|
128
|
+export default {
|
|
129
|
+ name: "Patient",
|
|
130
|
+ data() {
|
|
131
|
+ return {
|
|
132
|
+ crumbs:[
|
|
133
|
+ {path:false, name:'透析管理'},
|
|
134
|
+ {path:false, name:'透析监测'},
|
|
135
|
+ ],
|
|
136
|
+ loading: false,
|
|
137
|
+ time: "",
|
|
138
|
+
|
|
139
|
+ search_mode: 1, // 搜索模式 1.日期搜索 2.病人搜索
|
|
140
|
+ patient_search_keyword: "",
|
|
141
|
+
|
|
142
|
+ SchedualPatientsTableData: [],
|
|
143
|
+ active: true,
|
|
144
|
+ schedulType: 0,
|
|
145
|
+ schedulArr: [
|
|
146
|
+ { value: 0, label: "全部" },
|
|
147
|
+ { value: 1, label: "上午" },
|
|
148
|
+ { value: 2, label: "下午" },
|
|
149
|
+ { value: 3, label: "晚上" }
|
|
150
|
+ ],
|
|
151
|
+
|
|
152
|
+ partitionType: 0,
|
|
153
|
+
|
|
154
|
+ labelArr: ["第1次", "第2次", "第3次", "第4次", "第5次", "第6次", "第7次"],
|
|
155
|
+
|
|
156
|
+ pickerOptions1: {
|
|
157
|
+ shortcuts: [
|
|
158
|
+ {
|
|
159
|
+ text: "今天",
|
|
160
|
+ onClick(picker) {
|
|
161
|
+ picker.$emit("pick", new Date());
|
|
162
|
+ }
|
|
163
|
+ },
|
|
164
|
+ {
|
|
165
|
+ text: "昨天",
|
|
166
|
+ onClick(picker) {
|
|
167
|
+ const date = new Date();
|
|
168
|
+ date.setTime(date.getTime() - 3600 * 1000 * 24);
|
|
169
|
+ picker.$emit("pick", date);
|
|
170
|
+ }
|
|
171
|
+ },
|
|
172
|
+ {
|
|
173
|
+ text: "一周前",
|
|
174
|
+ onClick(picker) {
|
|
175
|
+ const date = new Date();
|
|
176
|
+ date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
|
|
177
|
+ picker.$emit("pick", date);
|
|
178
|
+ }
|
|
179
|
+ },
|
|
180
|
+ {
|
|
181
|
+ text: "清空",
|
|
182
|
+ onClick(picker) {
|
|
183
|
+ picker.$emit("pick");
|
|
184
|
+ }
|
|
185
|
+ }
|
|
186
|
+ ]
|
|
187
|
+ },
|
|
188
|
+
|
|
189
|
+ total: 0,
|
|
190
|
+ listQuery: {
|
|
191
|
+ page: 1,
|
|
192
|
+ limit: 10,
|
|
193
|
+ schedul_type: 0,
|
|
194
|
+ partition_type: 0,
|
|
195
|
+ schedul_time: "",
|
|
196
|
+ keywords: ""
|
|
197
|
+ },
|
|
198
|
+ selecting_schs: [],
|
|
199
|
+ partitionArr: []
|
|
200
|
+ };
|
|
201
|
+ },
|
|
202
|
+ created() {
|
|
203
|
+ var date = new Date();
|
|
204
|
+ this.time = date;
|
|
205
|
+ var year = date.getFullYear();
|
|
206
|
+ var month = date.getMonth() + 1;
|
|
207
|
+ var day = date.getDate();
|
|
208
|
+ if (month < 10) {
|
|
209
|
+ month = "0" + month;
|
|
210
|
+ }
|
|
211
|
+ if (day < 10) {
|
|
212
|
+ day = "0" + day;
|
|
213
|
+ }
|
|
214
|
+ var nowDate = year + "-" + month + "-" + day;
|
|
215
|
+ var date = new Date(nowDate + " 00:00:00");
|
|
216
|
+ this.listQuery.schedul_time = date.getTime();
|
|
217
|
+ this.getAllZone();
|
|
218
|
+ this.getSchedualPatientList();
|
|
219
|
+ },
|
|
220
|
+ methods: {
|
|
221
|
+ clickCurrent(val) {
|
|
222
|
+ console.log(val);
|
|
223
|
+ this.$router.push({
|
|
224
|
+ path: "/dialysis/details",
|
|
225
|
+ query: { patient_id: val.patient_id, date: val.sch_time_int }
|
|
226
|
+ });
|
|
227
|
+ },
|
|
228
|
+ handleSelectionChange(val) {
|
|
229
|
+ console.log(val);
|
|
230
|
+ this.selecting_schs = val;
|
|
231
|
+ console.log(this.selecting_schs,this.selecting_schs.length);
|
|
232
|
+ },
|
|
233
|
+
|
|
234
|
+ selectSchedulType(scheduleType) {
|
|
235
|
+ // alert(scheduleType);/
|
|
236
|
+ this.schedulType = scheduleType;
|
|
237
|
+ this.listQuery.schedul_type = scheduleType;
|
|
238
|
+ this.getSchedualPatientList();
|
|
239
|
+ },
|
|
240
|
+ selectPartitionType(partitionType) {
|
|
241
|
+ this.partitionType = partitionType;
|
|
242
|
+ this.listQuery.partition_type = partitionType;
|
|
243
|
+ this.getSchedualPatientList();
|
|
244
|
+ },
|
|
245
|
+
|
|
246
|
+ changeTime() {
|
|
247
|
+ console.log(this.time);
|
|
248
|
+ this.listQuery.schedul_time = this.time;
|
|
249
|
+ this.getSchedualPatientList();
|
|
250
|
+ },
|
|
251
|
+ getAllZone: function() {
|
|
252
|
+ GetAllZone().then(response => {
|
|
253
|
+ if (response.data.state == 0) {
|
|
254
|
+ this.$message.error(response.data.msg);
|
|
255
|
+ return false;
|
|
256
|
+ } else {
|
|
257
|
+ this.partitionArr = response.data.data.zone;
|
|
258
|
+ this.partitionArr.unshift({ id: 0, name: "全部" });
|
|
259
|
+ }
|
|
260
|
+ });
|
|
261
|
+ },
|
|
262
|
+ getSchedualPatientList: function() {
|
|
263
|
+ this.loading = true;
|
|
264
|
+ if (this.search_mode == 1) {
|
|
265
|
+ this.listQuery.keywords = "";
|
|
266
|
+ } else {
|
|
267
|
+ this.listQuery.schedul_time = "";
|
|
268
|
+ }
|
|
269
|
+ this.SchedualPatientsTableData = [];
|
|
270
|
+ getSchedualPatient(this.listQuery).then(response => {
|
|
271
|
+ if (response.data.state == 0) {
|
|
272
|
+ this.loading = false;
|
|
273
|
+ this.$message.error(response.data.msg);
|
|
274
|
+ return false;
|
|
275
|
+ } else {
|
|
276
|
+ this.loading = false;
|
|
277
|
+ this.total = response.data.data.total;
|
|
278
|
+ // console.log(response.data.data)
|
|
279
|
+ for (let i = 0; i < response.data.data.schedule.length; i++) {
|
|
280
|
+ if (response.data.data.schedule[i].patient.id > 0) {
|
|
281
|
+ let SchedualPatientsTable = {
|
|
282
|
+ bp: []
|
|
283
|
+ };
|
|
284
|
+
|
|
285
|
+ SchedualPatientsTable["sch_id"] = response.data.data.schedule[i].id
|
|
286
|
+ SchedualPatientsTable["sch_time_int"] =
|
|
287
|
+ response.data.data.schedule[i].schedule_date;
|
|
288
|
+ SchedualPatientsTable["sch_time"] = parseTime(
|
|
289
|
+ response.data.data.schedule[i].schedule_date,
|
|
290
|
+ "{y}-{m}-{d}"
|
|
291
|
+ );
|
|
292
|
+ SchedualPatientsTable["dialysis_no"] =
|
|
293
|
+ response.data.data.schedule[i].patient.dialysis_no;
|
|
294
|
+ SchedualPatientsTable["name"] =
|
|
295
|
+ response.data.data.schedule[i].patient.name;
|
|
296
|
+ SchedualPatientsTable["number"] =
|
|
297
|
+ response.data.data.schedule[i].device_number.number;
|
|
298
|
+ SchedualPatientsTable["gender"] =
|
|
299
|
+ response.data.data.schedule[i].patient.gender;
|
|
300
|
+ SchedualPatientsTable["source"] =
|
|
301
|
+ response.data.data.schedule[i].patient.source;
|
|
302
|
+ SchedualPatientsTable["patient_id"] =
|
|
303
|
+ response.data.data.schedule[i].patient_id;
|
|
304
|
+ SchedualPatientsTable["mode_name"] =
|
|
305
|
+ response.data.data.schedule[i].treatment_mode.name;
|
|
306
|
+ if (
|
|
307
|
+ response.data.data.schedule[i].assessment_before_dislysis.id > 0
|
|
308
|
+ ) {
|
|
309
|
+ SchedualPatientsTable["dialysis_before_weight"] =
|
|
310
|
+ response.data.data.schedule[
|
|
311
|
+ i
|
|
312
|
+ ].assessment_before_dislysis.weight_before;
|
|
313
|
+ }
|
|
314
|
+ if (
|
|
315
|
+ response.data.data.schedule[i].assessment_after_dislysis.id > 0
|
|
316
|
+ ) {
|
|
317
|
+ SchedualPatientsTable["dialysis_after_weight"] =
|
|
318
|
+ response.data.data.schedule[
|
|
319
|
+ i
|
|
320
|
+ ].assessment_after_dislysis.weight_after;
|
|
321
|
+ }
|
|
322
|
+
|
|
323
|
+ SchedualPatientsTable.bp = [];
|
|
324
|
+ for (
|
|
325
|
+ let a = 0;
|
|
326
|
+ a < response.data.data.schedule[i].monitoring_record.length;
|
|
327
|
+ a++
|
|
328
|
+ ) {
|
|
329
|
+ let bp = {};
|
|
330
|
+ bp["value"] =
|
|
331
|
+ response.data.data.schedule[i].monitoring_record[
|
|
332
|
+ a
|
|
333
|
+ ].systolic_blood_pressure.toString() +
|
|
334
|
+ "/" +
|
|
335
|
+ response.data.data.schedule[i].monitoring_record[
|
|
336
|
+ a
|
|
337
|
+ ].diastolic_blood_pressure.toString();
|
|
338
|
+
|
|
339
|
+ SchedualPatientsTable.bp.unshift(bp);
|
|
340
|
+ }
|
|
341
|
+
|
|
342
|
+ this.SchedualPatientsTableData.push(SchedualPatientsTable);
|
|
343
|
+ }
|
|
344
|
+ }
|
|
345
|
+ }
|
|
346
|
+ });
|
|
347
|
+ },
|
|
348
|
+ getValue: function(val) {
|
|
349
|
+ if (val != undefined) {
|
|
350
|
+ return val.value;
|
|
351
|
+ } else {
|
|
352
|
+ return "";
|
|
353
|
+ }
|
|
354
|
+ },
|
|
355
|
+ handleCurrentChange(val) {
|
|
356
|
+ this.listQuery.page = val;
|
|
357
|
+ this.getSchedualPatientList();
|
|
358
|
+ },
|
|
359
|
+ changeSearchMode: function() {
|
|
360
|
+ if (this.search_mode == 1) {
|
|
361
|
+ this.search_mode = 2;
|
|
362
|
+ } else {
|
|
363
|
+ this.search_mode = 1;
|
|
364
|
+ }
|
|
365
|
+ },
|
|
366
|
+ searchPatientAction: function() {
|
|
367
|
+ this.listQuery.keywords = this.patient_search_keyword;
|
|
368
|
+ console.log(this.patient_search_keyword);
|
|
369
|
+ if (this.patient_search_keyword.length == 0) {
|
|
370
|
+ return;
|
|
371
|
+ }
|
|
372
|
+ this.getSchedualPatientList();
|
|
373
|
+ },
|
|
374
|
+ batchPrintAction: function() {
|
|
375
|
+ var sch_ids = []
|
|
376
|
+ for (let index = 0; index < this.selecting_schs.length; index++) {
|
|
377
|
+ sch_ids.push(this.selecting_schs[index].sch_id)
|
|
378
|
+ }
|
|
379
|
+ this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids)
|
|
380
|
+ this.$router.push({ path: "/dialysis/print/batch" });
|
|
381
|
+ }
|
|
382
|
+ },
|
|
383
|
+ components: {
|
|
384
|
+ BreadCrumb
|
|
385
|
+ }
|
|
386
|
+};
|
|
387
|
+</script>
|
|
388
|
+
|
|
389
|
+<style rel="stylesheet/scss" lang="scss" scoped>
|
|
390
|
+.app-container {
|
|
391
|
+// margin: 20px;
|
|
392
|
+ font-size: 15px;
|
|
393
|
+ .filter-container {
|
|
394
|
+ padding-bottom: 5px;
|
|
395
|
+ }
|
|
396
|
+ .cqd-dataTitle{
|
|
397
|
+ color: #303133;
|
|
398
|
+ font-size: 14px;
|
|
399
|
+ border-bottom: 2px #E4E7ED solid;
|
|
400
|
+ height: 36px;
|
|
401
|
+ line-height: 36px;
|
|
402
|
+ margin: 0 0 25px 0;
|
|
403
|
+ position: relative;
|
|
404
|
+ }
|
|
405
|
+ .cqd-dataTitle::before {
|
|
406
|
+ position: absolute;
|
|
407
|
+ left: 0;
|
|
408
|
+ bottom: -2px;
|
|
409
|
+ content: "";
|
|
410
|
+ width: 42px;
|
|
411
|
+ height: 2px;
|
|
412
|
+ background: #409eff;
|
|
413
|
+ }
|
|
414
|
+ .search-component {
|
|
415
|
+ width: 500px;
|
|
416
|
+ .searchBox {
|
|
417
|
+ width: 300px;
|
|
418
|
+ height: 36px;
|
|
419
|
+ line-height: 36px;
|
|
420
|
+ padding-left: 15px;
|
|
421
|
+ border: 1px #dcdfe6 solid;
|
|
422
|
+ border-right: none;
|
|
423
|
+ outline: none;
|
|
424
|
+ float: left;
|
|
425
|
+ border-radius: 6px 0 0 6px;
|
|
426
|
+ font-size: 14px;
|
|
427
|
+ color: #333;
|
|
428
|
+ background: #fff;
|
|
429
|
+ box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
|
|
430
|
+ }
|
|
431
|
+ .searchBtn {
|
|
432
|
+ background-color: #409eff;
|
|
433
|
+ color: #fff;
|
|
434
|
+ font-size: 15px;
|
|
435
|
+ text-align: center;
|
|
436
|
+ height: 36px;
|
|
437
|
+ line-height: 36px;
|
|
438
|
+ float: left;
|
|
439
|
+ outline: none;
|
|
440
|
+ width: 70px;
|
|
441
|
+ border: none;
|
|
442
|
+ border-radius: 0 6px 6px 0;
|
|
443
|
+ font-family: "Microsoft Yahei";
|
|
444
|
+ cursor: pointer;
|
|
445
|
+ }
|
|
446
|
+ }
|
|
447
|
+ .amount {
|
|
448
|
+ font-weight: normal;
|
|
449
|
+ padding: 10px 0 0 0;
|
|
450
|
+ color: #606266;
|
|
451
|
+ font-size: 14px;
|
|
452
|
+ span {
|
|
453
|
+ color: #ef2525;
|
|
454
|
+ font-family: "Arial";
|
|
455
|
+ padding: 0 2px;
|
|
456
|
+ }
|
|
457
|
+ }
|
|
458
|
+}
|
|
459
|
+</style>
|