|
@@ -252,7 +252,7 @@ export default {
|
252
|
252
|
getDoctorList().then(response=>{
|
253
|
253
|
if(response.data.state == 1){
|
254
|
254
|
var list = response.data.data.list
|
255
|
|
- console.log("医护列表",list)
|
|
255
|
+ // console.log("医护列表",list)
|
256
|
256
|
this.tableData = list
|
257
|
257
|
this.doctorlist = list
|
258
|
258
|
//获取班种列表
|
|
@@ -264,7 +264,7 @@ export default {
|
264
|
264
|
getScheduleList().then(response=>{
|
265
|
265
|
if(response.data.state == 1){
|
266
|
266
|
var schedulelist = response.data.data.scheduleList
|
267
|
|
- console.log("schedulelist",schedulelist)
|
|
267
|
+ // console.log("schedulelist",schedulelist)
|
268
|
268
|
for(let i=0;i<schedulelist.length;i++){
|
269
|
269
|
if(schedulelist[i].timeone_type == 1){
|
270
|
270
|
schedulelist[i].timeone_type = "当日"
|
|
@@ -284,7 +284,7 @@ export default {
|
284
|
284
|
})
|
285
|
285
|
},
|
286
|
286
|
hangdleClick(val,index,num){
|
287
|
|
- console.log("val",val)
|
|
287
|
+ // console.log("val",val)
|
288
|
288
|
this.docobj = val
|
289
|
289
|
if(this.getTimestamp(this.weekDayArr[num]) < this.timeNow){
|
290
|
290
|
this.$message.warning("过去日期不可以编辑")
|
|
@@ -297,7 +297,7 @@ export default {
|
297
|
297
|
// console.log("日期",this.weekDayArr)
|
298
|
298
|
var week = (column.label).split('');
|
299
|
299
|
var weeks = week[0]+week[1]
|
300
|
|
- console.log("weeks",weeks)
|
|
300
|
+ // console.log("weeks",weeks)
|
301
|
301
|
if(weeks == "周日"){
|
302
|
302
|
this.schedule_week = 0
|
303
|
303
|
this.schedule_date = this.weekDayArr[6]
|
|
@@ -335,14 +335,14 @@ export default {
|
335
|
335
|
}
|
336
|
336
|
}
|
337
|
337
|
let arr = [...this.tableData]
|
338
|
|
- console.log("arr===",arr)
|
|
338
|
+ // console.log("arr===",arr)
|
339
|
339
|
for(let i=0;i<arr.length;i++){
|
340
|
340
|
if(this.docobj.id == arr[i].id){
|
341
|
341
|
arr[i].class_name = class_name
|
342
|
342
|
arr[i].class_index = this.schedule_week
|
343
|
343
|
}
|
344
|
344
|
}
|
345
|
|
- console.log("arr",arr)
|
|
345
|
+ // console.log("arr",arr)
|
346
|
346
|
this.tableData = arr
|
347
|
347
|
const params = {
|
348
|
348
|
doctor_id:this.docobj.admin_user_id,
|
|
@@ -353,12 +353,12 @@ export default {
|
353
|
353
|
end_time:this.getTimestamp(this.weekDayArr[6]),
|
354
|
354
|
schedule_date:this.getTimestamp(this.schedule_date)
|
355
|
355
|
}
|
356
|
|
- console.log("params",params)
|
|
356
|
+ // console.log("params",params)
|
357
|
357
|
|
358
|
358
|
addSchedule(params).then(response=>{
|
359
|
359
|
if(response.data.state == 1){
|
360
|
360
|
var schedule = response.data.data.schedule
|
361
|
|
- console.log("schedule",schedule)
|
|
361
|
+ // console.log("schedule",schedule)
|
362
|
362
|
this.$message.success("保存成功")
|
363
|
363
|
this.getStaffScheduleList()
|
364
|
364
|
}
|
|
@@ -450,7 +450,7 @@ export default {
|
450
|
450
|
getStaffScheduleList(params).then(response=>{
|
451
|
451
|
if(response.data.state == 1){
|
452
|
452
|
var staffList = response.data.data.staffList
|
453
|
|
- console.log("所有排班数据",staffList)
|
|
453
|
+ console.log("所有排班数据",staffList)
|
454
|
454
|
for(let i=0;i<staffList.length;i++){
|
455
|
455
|
if(staffList[i].schedule_week == 0){
|
456
|
456
|
staffList[i].class_index = 0
|
|
@@ -478,7 +478,6 @@ export default {
|
478
|
478
|
let tempArr = [], newArr = []
|
479
|
479
|
for (let i = 0; i < staffList.length; i++) {
|
480
|
480
|
if (tempArr.indexOf(staffList[i].user_name) === -1) {
|
481
|
|
- console.log("触发了没")
|
482
|
481
|
newArr.push({
|
483
|
482
|
user_name: staffList[i].user_name,
|
484
|
483
|
admin_user_id:staffList[i].admin_user_id,
|
|
@@ -487,10 +486,9 @@ export default {
|
487
|
486
|
})
|
488
|
487
|
tempArr.push(staffList[i].user_name);
|
489
|
488
|
} else {
|
490
|
|
- console.log("hheh")
|
491
|
489
|
for (let j = 0; j < newArr.length; j++) {
|
492
|
490
|
if (newArr[j].user_name == staffList[i].user_name) {
|
493
|
|
- newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week})
|
|
491
|
+ newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type})
|
494
|
492
|
}
|
495
|
493
|
}
|
496
|
494
|
}
|
|
@@ -502,10 +500,12 @@ export default {
|
502
|
500
|
if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
|
503
|
501
|
|
504
|
502
|
}else{
|
505
|
|
- arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: []})
|
|
503
|
+ arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
|
506
|
504
|
// console.log("arr",arr)
|
507
|
505
|
}
|
508
|
506
|
})
|
|
507
|
+ console.log("arr=======",arr)
|
|
508
|
+ arr.sort(this.compare('user_type'))
|
509
|
509
|
this.tableData = arr
|
510
|
510
|
|
511
|
511
|
|
|
@@ -555,13 +555,14 @@ export default {
|
555
|
555
|
newArr.push({
|
556
|
556
|
user_name: staffList[i].user_name,
|
557
|
557
|
admin_user_id:staffList[i].admin_user_id,
|
|
558
|
+ user_type:staffList[i].doctor_type,
|
558
|
559
|
list: [{class_name:staffList[i].class_name,schedule_week:staffList[i].schedule_week}]
|
559
|
560
|
})
|
560
|
561
|
tempArr.push(staffList[i].user_name);
|
561
|
562
|
} else {
|
562
|
563
|
for (let j = 0; j < newArr.length; j++) {
|
563
|
564
|
if (newArr[j].user_name == staffList[i].user_name) {
|
564
|
|
- newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week})
|
|
565
|
+ newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week, user_type:staffList[i].doctor_type,})
|
565
|
566
|
}
|
566
|
567
|
}
|
567
|
568
|
}
|
|
@@ -573,10 +574,11 @@ export default {
|
573
|
574
|
if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
|
574
|
575
|
|
575
|
576
|
}else{
|
576
|
|
- arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: []})
|
|
577
|
+ arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
|
577
|
578
|
// console.log("arr",arr)
|
578
|
579
|
}
|
579
|
580
|
})
|
|
581
|
+ arr.sort(this.compare('user_type'))
|
580
|
582
|
this.tableData = arr
|
581
|
583
|
}
|
582
|
584
|
})
|
|
@@ -597,6 +599,7 @@ export default {
|
597
|
599
|
for (let i = 0; i < staffList.length; i++) {
|
598
|
600
|
if (tempArr.indexOf(staffList[i].user_name) === -1) {
|
599
|
601
|
newArr.push({
|
|
602
|
+ user_type:staffList[i].doctor_type,
|
600
|
603
|
user_name: staffList[i].user_name,
|
601
|
604
|
admin_user_id:staffList[i].admin_user_id,
|
602
|
605
|
list: [{class_name:staffList[i].class_name,schedule_week:staffList[i].schedule_week}]
|
|
@@ -605,7 +608,7 @@ export default {
|
605
|
608
|
} else {
|
606
|
609
|
for (let j = 0; j < newArr.length; j++) {
|
607
|
610
|
if (newArr[j].user_name == staffList[i].user_name) {
|
608
|
|
- newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week})
|
|
611
|
+ newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week, user_type:staffList[i].doctor_type})
|
609
|
612
|
}
|
610
|
613
|
}
|
611
|
614
|
}
|
|
@@ -619,10 +622,12 @@ export default {
|
619
|
622
|
if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
|
620
|
623
|
|
621
|
624
|
}else{
|
622
|
|
- arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: []})
|
|
625
|
+ arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
|
623
|
626
|
// console.log("arr",arr)
|
624
|
627
|
}
|
625
|
628
|
})
|
|
629
|
+ console.log("全部=======",arr)
|
|
630
|
+ arr.sort(this.compare('user_type'))
|
626
|
631
|
this.tableData = arr
|
627
|
632
|
}
|
628
|
633
|
if(id == 2){
|
|
@@ -833,7 +838,7 @@ export default {
|
833
|
838
|
return function(a,b){
|
834
|
839
|
var value1 = a[property];
|
835
|
840
|
var value2 = b[property];
|
836
|
|
- return value1 - value2;
|
|
841
|
+ return value2 - value1;
|
837
|
842
|
}
|
838
|
843
|
},
|
839
|
844
|
},
|