|
@@ -188,16 +188,16 @@
|
188
|
188
|
</template>
|
189
|
189
|
|
190
|
190
|
<script>
|
191
|
|
-import SideBar from "@/pages/layout/SideBar";
|
192
|
|
-import { parseTime } from "@/utils";
|
193
|
|
-import { getSchedualDoctors } from "@/api/advice";
|
|
191
|
+import SideBar from '@/pages/layout/SideBar';
|
|
192
|
+import { parseTime } from '@/utils';
|
|
193
|
+import { getSchedualDoctors } from '@/api/advice';
|
194
|
194
|
|
195
|
195
|
export default {
|
196
|
|
- name: "DialysisAdviceTable",
|
|
196
|
+ name: 'DialysisAdviceTable',
|
197
|
197
|
components: {
|
198
|
198
|
SideBar
|
199
|
199
|
},
|
200
|
|
- data() {
|
|
200
|
+ data () {
|
201
|
201
|
return {
|
202
|
202
|
selected_date: new Date(),
|
203
|
203
|
admin_user: [],
|
|
@@ -205,252 +205,155 @@ export default {
|
205
|
205
|
show_sch_type_selector: false,
|
206
|
206
|
schedule_type_selected: 0,
|
207
|
207
|
schedule_types: [
|
208
|
|
- { value: 0, text: "全部班次" },
|
209
|
|
- { value: 1, text: "上午" },
|
210
|
|
- { value: 2, text: "下午" },
|
211
|
|
- { value: 3, text: "晚上" }
|
|
208
|
+ { value: 0, text: '全部班次' },
|
|
209
|
+ { value: 1, text: '上午' },
|
|
210
|
+ { value: 2, text: '下午' },
|
|
211
|
+ { value: 3, text: '晚上' }
|
212
|
212
|
],
|
213
|
213
|
|
214
|
214
|
show_zone_selector: false,
|
215
|
215
|
zone_selected: 0,
|
216
|
216
|
show_patient_type_selector: false,
|
217
|
|
- zones: [{ value: 0, text: "全部分区", select: true }],
|
|
217
|
+ zones: [{ value: 0, text: '全部分区', select: true }],
|
218
|
218
|
|
219
|
219
|
show_advice_type_selector: false,
|
220
|
220
|
advice_type_selected: 0,
|
221
|
221
|
advice_types: [
|
222
|
|
- { value: 0, text: "全部医嘱" },
|
223
|
|
- { value: 1, text: "长期医嘱" },
|
224
|
|
- { value: 3, text: "临时医嘱" }
|
|
222
|
+ { value: 0, text: '全部医嘱' },
|
|
223
|
+ { value: 1, text: '长期医嘱' },
|
|
224
|
+ { value: 3, text: '临时医嘱' }
|
225
|
225
|
],
|
226
|
226
|
|
227
|
227
|
patient_types: [
|
228
|
|
- { value: 0, text: "全部病人" },
|
229
|
|
- { value: 1, text: "我的病人" },
|
230
|
|
- { value: 2, text: "未执行病人" }
|
|
228
|
+ { value: 0, text: '全部病人' },
|
|
229
|
+ { value: 1, text: '我的病人' },
|
|
230
|
+ { value: 2, text: '未执行病人' }
|
231
|
231
|
],
|
232
|
232
|
patient_selected: 0,
|
233
|
233
|
|
234
|
234
|
scheduleMap: {},
|
235
|
|
- tableData: [
|
236
|
|
- {
|
237
|
|
- date: "2016-05-02",
|
238
|
|
- name: "王小虎",
|
239
|
|
- province: "上海",
|
240
|
|
- city: "普陀区",
|
241
|
|
- address: "上海市普陀区金沙江路 1518 弄",
|
242
|
|
- zip: 200333
|
243
|
|
- },
|
244
|
|
- {
|
245
|
|
- date: "2016-05-04",
|
246
|
|
- name: "王小虎",
|
247
|
|
- province: "上海",
|
248
|
|
- city: "普陀区",
|
249
|
|
- address: "上海市普陀区金沙江路 1517 弄",
|
250
|
|
- zip: 200333
|
251
|
|
- },
|
252
|
|
- {
|
253
|
|
- date: "2016-05-01",
|
254
|
|
- name: "王小虎",
|
255
|
|
- province: "上海",
|
256
|
|
- city: "普陀区",
|
257
|
|
- address: "上海市普陀区金沙江路 1519 弄",
|
258
|
|
- zip: 200333
|
259
|
|
- },
|
260
|
|
- {
|
261
|
|
- date: "2016-05-03",
|
262
|
|
- name: "王小虎",
|
263
|
|
- province: "上海",
|
264
|
|
- city: "普陀区",
|
265
|
|
- address: "上海市普陀区金沙江路 1516 弄",
|
266
|
|
- zip: 200333
|
267
|
|
- },
|
268
|
|
- {
|
269
|
|
- date: "2016-05-02",
|
270
|
|
- name: "王小虎",
|
271
|
|
- province: "上海",
|
272
|
|
- city: "普陀区",
|
273
|
|
- address: "上海市普陀区金沙江路 1518 弄",
|
274
|
|
- zip: 200333
|
275
|
|
- },
|
276
|
|
- {
|
277
|
|
- date: "2016-05-04",
|
278
|
|
- name: "王小虎",
|
279
|
|
- province: "上海",
|
280
|
|
- city: "普陀区",
|
281
|
|
- address: "上海市普陀区金沙江路 1517 弄",
|
282
|
|
- zip: 200333
|
283
|
|
- },
|
284
|
|
- {
|
285
|
|
- date: "2016-05-01",
|
286
|
|
- name: "王小虎",
|
287
|
|
- province: "上海",
|
288
|
|
- city: "普陀区",
|
289
|
|
- address: "上海市普陀区金沙江路 1519 弄",
|
290
|
|
- zip: 200333
|
291
|
|
- },
|
292
|
|
- {
|
293
|
|
- date: "2016-05-03",
|
294
|
|
- name: "王小虎",
|
295
|
|
- province: "上海",
|
296
|
|
- city: "普陀区",
|
297
|
|
- address: "上海市普陀区金沙江路 1516 弄",
|
298
|
|
- zip: 200333
|
299
|
|
- },
|
300
|
|
- {
|
301
|
|
- date: "2016-05-02",
|
302
|
|
- name: "王小虎",
|
303
|
|
- province: "上海",
|
304
|
|
- city: "普陀区",
|
305
|
|
- address: "上海市普陀区金沙江路 1518 弄",
|
306
|
|
- zip: 200333
|
307
|
|
- },
|
308
|
|
- {
|
309
|
|
- date: "2016-05-04",
|
310
|
|
- name: "王小虎",
|
311
|
|
- province: "上海",
|
312
|
|
- city: "普陀区",
|
313
|
|
- address: "上海市普陀区金沙江路 1517 弄",
|
314
|
|
- zip: 200333
|
315
|
|
- },
|
316
|
|
- {
|
317
|
|
- date: "2016-05-01",
|
318
|
|
- name: "王小虎",
|
319
|
|
- province: "上海",
|
320
|
|
- city: "普陀区",
|
321
|
|
- address: "上海市普陀区金沙江路 1519 弄",
|
322
|
|
- zip: 200333
|
323
|
|
- },
|
324
|
|
- {
|
325
|
|
- date: "2016-05-03",
|
326
|
|
- name: "王小虎",
|
327
|
|
- province: "上海",
|
328
|
|
- city: "普陀区",
|
329
|
|
- address: "上海市普陀区金沙江路 1516 弄",
|
330
|
|
- zip: 200333
|
331
|
|
- }
|
332
|
|
- ]
|
333
|
|
- };
|
|
235
|
+ tableData: []
|
|
236
|
+ }
|
334
|
237
|
},
|
335
|
238
|
computed: {
|
336
|
|
- selected_date_str: function() {
|
337
|
|
- return parseTime(this.selected_date, "{y}-{m}-{d}");
|
|
239
|
+ selected_date_str: function () {
|
|
240
|
+ return parseTime(this.selected_date, '{y}-{m}-{d}')
|
338
|
241
|
},
|
339
|
|
- filtedScheduals: function() {
|
340
|
|
- var scheduleMap = new Object();
|
|
242
|
+ filtedScheduals: function () {
|
|
243
|
+ var scheduleMap = new Object()
|
341
|
244
|
if (this.zone_selected == 0) {
|
342
|
245
|
for (const key in this.scheduleMap) {
|
343
|
|
- scheduleMap[key] = this.scheduleMap[key];
|
|
246
|
+ scheduleMap[key] = this.scheduleMap[key]
|
344
|
247
|
}
|
345
|
248
|
} else {
|
346
|
|
- var zone_name = this.zones[this.zone_selected].text;
|
347
|
|
- scheduleMap[zone_name] = this.scheduleMap[zone_name];
|
|
249
|
+ var zone_name = this.zones[this.zone_selected].text
|
|
250
|
+ scheduleMap[zone_name] = this.scheduleMap[zone_name]
|
348
|
251
|
}
|
349
|
252
|
|
350
|
253
|
if (this.schedule_type_selected != 0) {
|
351
|
|
- var _scheduleMap = {};
|
|
254
|
+ var _scheduleMap = {}
|
352
|
255
|
for (const key in scheduleMap) {
|
353
|
|
- var origin_schedules = scheduleMap[key];
|
354
|
|
- var schedules = [];
|
|
256
|
+ var origin_schedules = scheduleMap[key]
|
|
257
|
+ var schedules = []
|
355
|
258
|
for (let index = 0; index < origin_schedules.length; index++) {
|
356
|
|
- const schedule = origin_schedules[index];
|
|
259
|
+ const schedule = origin_schedules[index]
|
357
|
260
|
if (schedule.schedule_type == this.schedule_type_selected) {
|
358
|
|
- schedules.push(schedule);
|
|
261
|
+ schedules.push(schedule)
|
359
|
262
|
}
|
360
|
263
|
}
|
361
|
264
|
if (schedules.length > 0) {
|
362
|
|
- _scheduleMap[key] = schedules;
|
|
265
|
+ _scheduleMap[key] = schedules
|
363
|
266
|
}
|
364
|
267
|
}
|
365
|
268
|
|
366
|
|
- scheduleMap = _scheduleMap;
|
|
269
|
+ scheduleMap = _scheduleMap
|
367
|
270
|
}
|
368
|
271
|
for (var key in scheduleMap) {
|
369
|
|
- let mapArr = scheduleMap[key];
|
|
272
|
+ let mapArr = scheduleMap[key]
|
370
|
273
|
for (let i = 0; i < mapArr.length; i++) {
|
371
|
|
- mapArr[i]["new_advice"] = [];
|
|
274
|
+ mapArr[i]['new_advice'] = []
|
372
|
275
|
}
|
373
|
276
|
}
|
374
|
277
|
|
375
|
278
|
for (var key in scheduleMap) {
|
376
|
|
- let mapArr = scheduleMap[key];
|
|
279
|
+ let mapArr = scheduleMap[key]
|
377
|
280
|
for (let i = 0; i < mapArr.length; i++) {
|
378
|
|
- var maps = mapArr[i];
|
379
|
|
- var resp_advices = maps.doctor_advice;
|
|
281
|
+ var maps = mapArr[i]
|
|
282
|
+ var resp_advices = maps.doctor_advice
|
380
|
283
|
if (resp_advices.length > 0) {
|
381
|
|
- var newGroupObject = function() {
|
|
284
|
+ var newGroupObject = function () {
|
382
|
285
|
return Object.assign(
|
383
|
286
|
{},
|
384
|
287
|
{
|
385
|
288
|
group_no: 0,
|
386
|
289
|
advices: []
|
387
|
290
|
}
|
388
|
|
- );
|
|
291
|
+ )
|
389
|
292
|
};
|
390
|
|
- var initGroupBlock = function(group, advice) {
|
391
|
|
- group.group_no = advice.groupno;
|
|
293
|
+ var initGroupBlock = function (group, advice) {
|
|
294
|
+ group.group_no = advice.groupno
|
392
|
295
|
};
|
393
|
296
|
|
394
|
|
- var advice_groups = [];
|
395
|
|
- var group = newGroupObject();
|
|
297
|
+ var advice_groups = []
|
|
298
|
+ var group = newGroupObject()
|
396
|
299
|
for (let index = 0; index < resp_advices.length; index++) {
|
397
|
|
- const advice = resp_advices[index];
|
|
300
|
+ const advice = resp_advices[index]
|
398
|
301
|
if (advice.groupno == 0) {
|
399
|
302
|
// 老版本的医嘱
|
400
|
303
|
if (advice.parent_id > 0) {
|
401
|
304
|
if (advice_groups.length > 0) {
|
402
|
|
- var parent_group = advice_groups[advice_groups.length - 1];
|
|
305
|
+ var parent_group = advice_groups[advice_groups.length - 1]
|
403
|
306
|
if (parent_group.advices.length > 0) {
|
404
|
307
|
if (parent_group.advices[0].id == advice.parent_id) {
|
405
|
|
- parent_group.advices.push(advice);
|
|
308
|
+ parent_group.advices.push(advice)
|
406
|
309
|
}
|
407
|
310
|
}
|
408
|
311
|
}
|
409
|
|
- continue;
|
|
312
|
+ continue
|
410
|
313
|
} else {
|
411
|
314
|
if (group.group_no > 0) {
|
412
|
|
- advice_groups.push(group);
|
413
|
|
- group = newGroupObject();
|
|
315
|
+ advice_groups.push(group)
|
|
316
|
+ group = newGroupObject()
|
414
|
317
|
}
|
415
|
318
|
|
416
|
|
- initGroupBlock(group, advice);
|
417
|
|
- group.advices.push(advice);
|
418
|
|
- advice_groups.push(group);
|
419
|
|
- group = newGroupObject();
|
|
319
|
+ initGroupBlock(group, advice)
|
|
320
|
+ group.advices.push(advice)
|
|
321
|
+ advice_groups.push(group)
|
|
322
|
+ group = newGroupObject()
|
420
|
323
|
continue;
|
421
|
324
|
}
|
422
|
325
|
} else {
|
423
|
326
|
if (group.group_no > 0 && group.group_no != advice.groupno) {
|
424
|
|
- advice_groups.push(group);
|
425
|
|
- group = newGroupObject();
|
|
327
|
+ advice_groups.push(group)
|
|
328
|
+ group = newGroupObject()
|
426
|
329
|
}
|
427
|
330
|
if (group.group_no == 0) {
|
428
|
|
- initGroupBlock(group, advice);
|
|
331
|
+ initGroupBlock(group, advice)
|
429
|
332
|
}
|
430
|
333
|
if (group.group_no == advice.groupno) {
|
431
|
|
- group.advices.push(advice);
|
|
334
|
+ group.advices.push(advice)
|
432
|
335
|
}
|
433
|
336
|
}
|
434
|
337
|
}
|
435
|
338
|
if (group.group_no > 0) {
|
436
|
339
|
// 上述的算法会导致最后一组没有加到advice_groups,这里要手动加上
|
437
|
|
- advice_groups.push(group);
|
|
340
|
+ advice_groups.push(group)
|
438
|
341
|
}
|
439
|
|
- advice_groups = advice_groups;
|
|
342
|
+ advice_groups = advice_groups
|
440
|
343
|
} else {
|
441
|
|
- advice_groups = [];
|
|
344
|
+ advice_groups = []
|
442
|
345
|
}
|
443
|
|
- maps.new_advice = advice_groups;
|
|
346
|
+ maps.new_advice = advice_groups
|
444
|
347
|
}
|
445
|
348
|
}
|
446
|
349
|
|
447
|
|
- console.log(scheduleMap);
|
|
350
|
+ console.log(scheduleMap)
|
448
|
351
|
|
449
|
|
- return scheduleMap;
|
|
352
|
+ return scheduleMap
|
450
|
353
|
}
|
451
|
354
|
},
|
452
|
|
- created() {
|
453
|
|
- this.requestSchedualDoctors();
|
|
355
|
+ created () {
|
|
356
|
+ this.requestSchedualDoctors()
|
454
|
357
|
},
|
455
|
358
|
methods: {
|
456
|
359
|
// getNumber: function (advice,schedule) {
|
|
@@ -464,114 +367,114 @@ export default {
|
464
|
367
|
// }
|
465
|
368
|
//
|
466
|
369
|
// },
|
467
|
|
- clickfunction: function(val) {
|
|
370
|
+ clickfunction: function (val) {
|
468
|
371
|
// console.log(val);
|
469
|
372
|
this.$router.push({
|
470
|
|
- path: "/details",
|
|
373
|
+ path: '/details',
|
471
|
374
|
query: {
|
472
|
375
|
patient_id: val.patient.id,
|
473
|
376
|
date: this.selected_date.getTime() / 1000,
|
474
|
377
|
patient_name: val.patient.name
|
475
|
378
|
}
|
476
|
|
- });
|
|
379
|
+ })
|
477
|
380
|
},
|
478
|
|
- handlePaitentType: function(index) {
|
479
|
|
- this.patient_selected = index;
|
480
|
|
- this.show_patient_type_selector = false;
|
481
|
|
- this.requestSchedualDoctors();
|
|
381
|
+ handlePaitentType: function (index) {
|
|
382
|
+ this.patient_selected = index
|
|
383
|
+ this.show_patient_type_selector = false
|
|
384
|
+ this.requestSchedualDoctors()
|
482
|
385
|
},
|
483
|
|
- openPicker() {
|
484
|
|
- this.$refs.picker.open();
|
|
386
|
+ openPicker () {
|
|
387
|
+ this.$refs.picker.open()
|
485
|
388
|
},
|
486
|
|
- getAdaviceType(type, parent_id) {
|
|
389
|
+ getAdaviceType (type, parent_id) {
|
487
|
390
|
if (parent_id == 0) {
|
488
|
391
|
if (type == 1) {
|
489
|
|
- return "长嘱";
|
|
392
|
+ return '长嘱';
|
490
|
393
|
} else if (type == 2) {
|
491
|
|
- return "临嘱";
|
|
394
|
+ return '临嘱';
|
492
|
395
|
} else if (type == 3) {
|
493
|
|
- return "临嘱";
|
|
396
|
+ return '临嘱';
|
494
|
397
|
}
|
495
|
398
|
}
|
496
|
399
|
},
|
497
|
|
- getName(val) {
|
498
|
|
- console.log(this.admin_user);
|
|
400
|
+ getName (val) {
|
|
401
|
+ console.log(this.admin_user)
|
499
|
402
|
|
500
|
403
|
for (let i = 0; i < this.admin_user.length; i++) {
|
501
|
404
|
if (this.admin_user[i].id == val) {
|
502
|
|
- return this.admin_user[i].name;
|
|
405
|
+ return this.admin_user[i].name
|
503
|
406
|
}
|
504
|
407
|
}
|
505
|
408
|
},
|
506
|
|
- handletimeType: function(index) {
|
507
|
|
- this.schedule_type_selected = index;
|
508
|
|
- this.show_sch_type_selector = false;
|
|
409
|
+ handletimeType: function (index) {
|
|
410
|
+ this.schedule_type_selected = index
|
|
411
|
+ this.show_sch_type_selector = false
|
509
|
412
|
},
|
510
|
|
- handleAdviceType: function(index) {
|
511
|
|
- this.advice_type_selected = index;
|
512
|
|
- this.show_advice_type_selector = false;
|
513
|
|
- this.requestSchedualDoctors();
|
|
413
|
+ handleAdviceType: function (index) {
|
|
414
|
+ this.advice_type_selected = index
|
|
415
|
+ this.show_advice_type_selector = false
|
|
416
|
+ this.requestSchedualDoctors()
|
514
|
417
|
},
|
515
|
|
- handleZoneChange: function(index) {
|
516
|
|
- this.zone_selected = index;
|
517
|
|
- this.show_zone_selector = false;
|
|
418
|
+ handleZoneChange: function (index) {
|
|
419
|
+ this.zone_selected = index
|
|
420
|
+ this.show_zone_selector = false
|
518
|
421
|
},
|
519
|
|
- parseTime: function(time, layout) {
|
|
422
|
+ parseTime: function (time, layout) {
|
520
|
423
|
// console.log(time);
|
521
|
424
|
if (time == 0) {
|
522
|
|
- return "";
|
|
425
|
+ return '';
|
523
|
426
|
}
|
524
|
|
- return parseTime(time, layout);
|
|
427
|
+ return parseTime(time, layout)
|
525
|
428
|
},
|
526
|
|
- requestSchedualDoctors() {
|
|
429
|
+ requestSchedualDoctors () {
|
527
|
430
|
getSchedualDoctors({
|
528
|
431
|
date: this.selected_date_str,
|
529
|
432
|
patient_type: this.patient_selected,
|
530
|
433
|
advice_type: 2
|
531
|
434
|
}).then(rs => {
|
532
|
|
- var resp = rs.data;
|
|
435
|
+ var resp = rs.data
|
533
|
436
|
if (resp.state == 1) {
|
534
|
|
- this.admin_user = resp.data.adminUser;
|
535
|
|
- var schedules = resp.data.scheduals;
|
536
|
|
- var zoneMap = {};
|
537
|
|
- var scheduleMap = {};
|
|
437
|
+ this.admin_user = resp.data.adminUser
|
|
438
|
+ var schedules = resp.data.scheduals
|
|
439
|
+ var zoneMap = {}
|
|
440
|
+ var scheduleMap = {}
|
538
|
441
|
for (let index = 0; index < schedules.length; index++) {
|
539
|
|
- const schedule = schedules[index];
|
|
442
|
+ const schedule = schedules[index]
|
540
|
443
|
if (schedule.doctor_advice.length == 0) {
|
541
|
|
- continue;
|
|
444
|
+ continue
|
542
|
445
|
}
|
543
|
446
|
if (scheduleMap[schedule.device_number.zone.name] == null) {
|
544
|
|
- scheduleMap[schedule.device_number.zone.name] = [];
|
|
447
|
+ scheduleMap[schedule.device_number.zone.name] = []
|
545
|
448
|
}
|
546
|
|
- scheduleMap[schedule.device_number.zone.name].push(schedule);
|
|
449
|
+ scheduleMap[schedule.device_number.zone.name].push(schedule)
|
547
|
450
|
if (zoneMap[schedule.device_number.zone.name] == null) {
|
548
|
451
|
zoneMap[schedule.device_number.zone.name] =
|
549
|
|
- schedule.device_number.zone;
|
|
452
|
+ schedule.device_number.zone
|
550
|
453
|
}
|
551
|
454
|
}
|
552
|
455
|
|
553
|
|
- var zones = [];
|
554
|
|
- zones.push({ value: 0, text: "全部分区" });
|
|
456
|
+ var zones = []
|
|
457
|
+ zones.push({ value: 0, text: '全部分区' })
|
555
|
458
|
for (var zoneName in zoneMap) {
|
556
|
|
- zones.push({ value: zoneMap[zoneName].id, text: zoneName });
|
|
459
|
+ zones.push({ value: zoneMap[zoneName].id, text: zoneName })
|
557
|
460
|
}
|
558
|
461
|
|
559
|
|
- zones = zones.sort(function(a, b) {
|
560
|
|
- return a.value > b.value;
|
561
|
|
- });
|
562
|
|
- this.zones = zones;
|
|
462
|
+ zones = zones.sort(function (a, b) {
|
|
463
|
+ return a.value > b.value
|
|
464
|
+ })
|
|
465
|
+ this.zones = zones
|
563
|
466
|
|
564
|
|
- this.scheduleMap = scheduleMap;
|
|
467
|
+ this.scheduleMap = scheduleMap
|
565
|
468
|
} else {
|
566
|
469
|
this.$toast({
|
567
|
470
|
message: resp.msg
|
568
|
|
- });
|
|
471
|
+ })
|
569
|
472
|
}
|
570
|
|
- });
|
|
473
|
+ })
|
571
|
474
|
},
|
572
|
|
- adviceDesc(advice) {}
|
|
475
|
+ adviceDesc (advice) {}
|
573
|
476
|
}
|
574
|
|
-};
|
|
477
|
+}
|
575
|
478
|
</script>
|
576
|
479
|
|
577
|
480
|
<style style="stylesheet/scss" lang="scss" scoped>
|