Browse Source

Merge branch '20200710_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20200710_pc_vue_new_branch

See999 4 years ago
parent
commit
f2feb94f06
1 changed files with 23 additions and 18 deletions
  1. 23 18
      src/xt_pages/medicalScheduling/index.vue

+ 23 - 18
src/xt_pages/medicalScheduling/index.vue View File

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