浏览代码

医护管理

XMLWAN 4 年前
父节点
当前提交
0110f2c4a5

+ 1 - 26
src/xt_pages/medicalScheduling/class.vue 查看文件

380
            getDoctorScheduleList(params).then(response=>{
380
            getDoctorScheduleList(params).then(response=>{
381
               if(response.data.state == 1){
381
               if(response.data.state == 1){
382
                  var schedules = response.data.data.schedules
382
                  var schedules = response.data.data.schedules
383
-                  console.log("schedules",schedules)
384
                  for(let i=0;i<schedules.length;i++){
383
                  for(let i=0;i<schedules.length;i++){
385
                     if(schedules[i].class_attributes == 1){
384
                     if(schedules[i].class_attributes == 1){
386
                         schedules[i].class_attributes ="出勤"
385
                         schedules[i].class_attributes ="出勤"
429
         getScheduleDetail(id).then(response=>{
428
         getScheduleDetail(id).then(response=>{
430
            if(response.data.state == 1){
429
            if(response.data.state == 1){
431
              var scheduleDetail = response.data.data.scheduleDetail
430
              var scheduleDetail = response.data.data.scheduleDetail
432
-             console.log("scheduledetail",scheduleDetail)
433
              this.form.id = scheduleDetail.id
431
              this.form.id = scheduleDetail.id
434
              this.form.class_name = scheduleDetail.class_name
432
              this.form.class_name = scheduleDetail.class_name
435
              this.form.class_attributes = scheduleDetail.class_attributes
433
              this.form.class_attributes = scheduleDetail.class_attributes
546
         },
544
         },
547
      changtime(){
545
      changtime(){
548
          //计算时长
546
          //计算时长
549
-        console.log("timeone",this.form.timeone_start)
550
-        console.log("timeonend",this.form.timeone_end)
551
-        console.log("timeonetype",this.form.timeone_type)
552
         var longtime = 0
547
         var longtime = 0
553
         var timeone = 0
548
         var timeone = 0
554
         var timetwo = 0
549
         var timetwo = 0
564
           var timeone =  this.timeDifference(this.form.timeone_start,oneHours)
559
           var timeone =  this.timeDifference(this.form.timeone_start,oneHours)
565
          timeone = timeone
560
          timeone = timeone
566
         }
561
         }
567
-       console.log("时间选择1时长",this.timeStamp(timeone))
562
+     
568
                 
563
                 
569
         //时间选择2的时间差
564
         //时间选择2的时间差
570
         if(this.form.timetwo_type == 1){
565
         if(this.form.timetwo_type == 1){
578
             var timetwo =  this.timeDifference(this.form.timetwo_start,oneHours)
573
             var timetwo =  this.timeDifference(this.form.timetwo_start,oneHours)
579
             timetwo = timetwo
574
             timetwo = timetwo
580
         }
575
         }
581
-          console.log("timetwo",timetwo)
582
-          console.log("时间选择2时长",this,this.timeStamp(timetwo))
583
                   
576
                   
584
         longtime = timeone + timetwo
577
         longtime = timeone + timetwo
585
-        console.log("longtime",longtime)
586
         this.form.work_time = this.timeStamp(longtime)
578
         this.form.work_time = this.timeStamp(longtime)
587
      },
579
      },
588
      changtimeTwo(){
580
      changtimeTwo(){
589
            //计算时长
581
            //计算时长
590
-        console.log("timeone",this.form.timeone_start)
591
-        console.log("timeonend",this.form.timeone_end)
592
-        console.log("timeonetype",this.form.timeone_type)
593
         var longtime = 0
582
         var longtime = 0
594
         var timeone = 0
583
         var timeone = 0
595
         var timetwo = 0
584
         var timetwo = 0
605
           var timeone =  this.timeDifference(this.form.timeone_start,oneHours)
594
           var timeone =  this.timeDifference(this.form.timeone_start,oneHours)
606
          timeone = timeone
595
          timeone = timeone
607
         }
596
         }
608
-       console.log("时间选择1时长",this.timeStamp(timeone))
609
                 
597
                 
610
         //时间选择2的时间差
598
         //时间选择2的时间差
611
         if(this.form.timetwo_type == 1){
599
         if(this.form.timetwo_type == 1){
619
             var timetwo =  this.timeDifference(this.form.timetwo_start,oneHours)
607
             var timetwo =  this.timeDifference(this.form.timetwo_start,oneHours)
620
             timetwo = timetwo
608
             timetwo = timetwo
621
         }
609
         }
622
-          console.log("timetwo",timetwo)
623
-          console.log("时间选择2时长",this,this.timeStamp(timetwo))
624
                   
610
                   
625
         longtime = timeone + timetwo
611
         longtime = timeone + timetwo
626
-        console.log("longtime",longtime)
627
         this.form.work_time = this.timeStamp(longtime) 
612
         this.form.work_time = this.timeStamp(longtime) 
628
      }
613
      }
629
     },
614
     },
631
         //获取班种列表
616
         //获取班种列表
632
         this.getList()
617
         this.getList()
633
     },
618
     },
634
-    watch: {
635
-    //  监听对象数据变化
636
-    work_time: {
637
-      handler(newVal, oldVal) {
638
-        console.log(newVal)
639
-        console,log(oldVal)
640
-      },
641
-      deep: true  // 非常非常重要,这个是深度监听,默认是false。true的时候才能监听到对象的变化
642
-    }
643
-   }
644
 }
619
 }
645
 </script>
620
 </script>
646
 <style scoped>
621
 <style scoped>

+ 11 - 18
src/xt_pages/medicalScheduling/index.vue 查看文件

40
             </div>
40
             </div>
41
             <div class="schedulingTable" style="display:flex;justify-content: space-between;">
41
             <div class="schedulingTable" style="display:flex;justify-content: space-between;">
42
                 <div style="width: 70%">
42
                 <div style="width: 70%">
43
-                    <el-table :data="tableData" border :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}" :row-style="{ color: '#303133' }"  @cell-click="clickThis">
43
+                    <el-table :data="tableData" border :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}" :row-style="{ color: '#303133' }"  @cell-click="clickThis" :cell-style="tableCellStyle">
44
                         <el-table-column prop="name" label="医护姓名" style="width:16%" align="center">
44
                         <el-table-column prop="name" label="医护姓名" style="width:16%" align="center">
45
                             <template slot-scope="scope">
45
                             <template slot-scope="scope">
46
                                  {{scope.row.user_name}}
46
                                  {{scope.row.user_name}}
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)
454
                     for(let i=0;i<staffList.length;i++){
453
                     for(let i=0;i<staffList.length;i++){
455
                     if(staffList[i].schedule_week == 0){
454
                     if(staffList[i].schedule_week == 0){
456
                         staffList[i].class_index = 0
455
                         staffList[i].class_index = 0
474
                         staffList[i].class_index = 6
473
                         staffList[i].class_index = 6
475
                     }
474
                     }
476
                     }
475
                     }
477
-                    console.log("staffList--------",staffList)
478
                     let tempArr = [], newArr = []
476
                     let tempArr = [], newArr = []
479
                     for (let i = 0; i < staffList.length; i++) {
477
                     for (let i = 0; i < staffList.length; i++) {
480
                         if (tempArr.indexOf(staffList[i].user_name) === -1) {
478
                         if (tempArr.indexOf(staffList[i].user_name) === -1) {
501
                     
499
                     
502
                       }else{
500
                       }else{
503
                         arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
501
                         arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
504
-                        // console.log("arr",arr)
505
                       }
502
                       }
506
                     })
503
                     })
507
                     console.log("arr=======",arr)
504
                     console.log("arr=======",arr)
626
                             // console.log("arr",arr)
623
                             // console.log("arr",arr)
627
                           }
624
                           }
628
                         })
625
                         })
629
-                        console.log("全部=======",arr)
630
                         arr.sort(this.compare('user_type'))
626
                         arr.sort(this.compare('user_type'))
631
                         this.tableData = arr
627
                         this.tableData = arr
632
                     }
628
                     }
675
         })
671
         })
676
         },
672
         },
677
         toSearch(){
673
         toSearch(){
678
-            console.log("医护人员姓名",this.keywords)
679
-            
680
             const params = {
674
             const params = {
681
             user_name: this.keywords,
675
             user_name: this.keywords,
682
             start_time:this.getTimestamp(this.weekDayArr[0]),
676
             start_time:this.getTimestamp(this.weekDayArr[0]),
685
             toSearchScheduleList(params).then(response=>{
679
             toSearchScheduleList(params).then(response=>{
686
                 if(response.data.state == 1){
680
                 if(response.data.state == 1){
687
                     var staffList =  response.data.data.staffList
681
                     var staffList =  response.data.data.staffList
688
-                    console.log("stafflist",staffList)
689
                     let tempArr = [], newArr = []
682
                     let tempArr = [], newArr = []
690
                     for (let i = 0; i < staffList.length; i++) {
683
                     for (let i = 0; i < staffList.length; i++) {
691
                         if (tempArr.indexOf(staffList[i].user_name) === -1) {
684
                         if (tempArr.indexOf(staffList[i].user_name) === -1) {
729
             start_time:this.getTimestamp(this.weekDayArr[0]),
722
             start_time:this.getTimestamp(this.weekDayArr[0]),
730
             end_time:this.getTimestamp(this.weekDayArr[6])
723
             end_time:this.getTimestamp(this.weekDayArr[6])
731
             }
724
             }
732
-            console.log("params",params)
733
             this.$confirm(
725
             this.$confirm(
734
             '是否要清除当周排班? <br>清除后,信息将无法恢复',
726
             '是否要清除当周排班? <br>清除后,信息将无法恢复',
735
             '删除提示',
727
             '删除提示',
780
             UpdateContinusSchedule(params).then(response=>{
772
             UpdateContinusSchedule(params).then(response=>{
781
                 if(response.data.state == 1){
773
                 if(response.data.state == 1){
782
                 var schedule =  response.data.data.schedule
774
                 var schedule =  response.data.data.schedule
783
-                console.log("schedule",schedule)
784
                 this.$message.success("保存成功")
775
                 this.$message.success("保存成功")
785
                 }
776
                 }
786
             })
777
             })
798
             this.currentFirstDate1 = num + 1
789
             this.currentFirstDate1 = num + 1
799
         },
790
         },
800
         submitAction(formName){
791
         submitAction(formName){
801
-            console.log("数据",this.typeOptions)
802
-            console.log("2222",this.timeOptions)
803
             var label = ""
792
             var label = ""
804
             for(let i=0;i<this.timeOptions.length;i++){
793
             for(let i=0;i<this.timeOptions.length;i++){
805
                if(this.form.copyWeek == this.timeOptions[i].value){
794
                if(this.form.copyWeek == this.timeOptions[i].value){
808
             }
797
             }
809
            var start = label.split('~')
798
            var start = label.split('~')
810
            var copy_startime = this.getTimestamp(start[0])   
799
            var copy_startime = this.getTimestamp(start[0])   
811
-           console.log("copy_startime",copy_startime)   
812
            var copy_endtime = this.getTimestamp(start[1]) 
800
            var copy_endtime = this.getTimestamp(start[1]) 
813
-           console.log("copy_endtime",copy_endtime)
814
 
801
 
815
             const params = {
802
             const params = {
816
               start_time:this.getTimestamp(this.weekDayArr[0]),
803
               start_time:this.getTimestamp(this.weekDayArr[0]),
818
               copy_startime:copy_startime,
805
               copy_startime:copy_startime,
819
               copy_endtime:copy_endtime,
806
               copy_endtime:copy_endtime,
820
             }
807
             }
821
-            console.log("params",params)
822
            this.$refs[formName].validate(valid=>{
808
            this.$refs[formName].validate(valid=>{
823
               if(valid){
809
               if(valid){
824
                 copyStaffSchedule(params).then(response=>{
810
                 copyStaffSchedule(params).then(response=>{
825
                    if(response.data.state == 1){
811
                    if(response.data.state == 1){
826
                      var msg = response.data.data.msg
812
                      var msg = response.data.data.msg
827
-                     console.log("msg",msg)
828
                      this.$message.success("复制成功")
813
                      this.$message.success("复制成功")
829
                      this.newVisible = false
814
                      this.newVisible = false
830
                    }else{
815
                    }else{
841
                 return value2 - value1;
826
                 return value2 - value1;
842
             }
827
             }
843
         },
828
         },
829
+       tableCellStyle (row, rowIndex, column) {
830
+         var week = (row.column.label).split('');
831
+         var weeks = week[4]+week[5]+week[6]+week[7]+week[8]+week[9]+week[10]+week[11]+week[12]
832
+        //  console.log("week",week)
833
+         console.log("weeks",weeks)
834
+         var weekdate =  this.getTimestamp(weeks)
835
+         if(weekdate  < this.timeNow){
836
+           return 'background-color:#e5e5e5;'
837
+          }
838
+       },
844
     },
839
     },
845
     created(){
840
     created(){
846
         //获取医护人员
841
         //获取医护人员
877
             
872
             
878
         }
873
         }
879
       var now = moment().locale('zh-cn').format('YYYY-MM-DD 00:00:00')
874
       var now = moment().locale('zh-cn').format('YYYY-MM-DD 00:00:00')
880
-      console.log('now',now)
881
       this.timeNow = this.getTimestamp(now)
875
       this.timeNow = this.getTimestamp(now)
882
-      console.log("timenow",this.timeNow)
883
       
876
       
884
     }
877
     }
885
 }
878
 }

+ 1 - 5
src/xt_pages/medicalScheduling/medical_print.vue 查看文件

87
       getDoctorList(){
87
       getDoctorList(){
88
         getDoctorList().then(response=>{
88
         getDoctorList().then(response=>{
89
           var list =  response.data.data.list
89
           var list =  response.data.data.list
90
-          console.log("医护列表",list)
91
           this.doctorlist = list
90
           this.doctorlist = list
92
           this.getStaffScheduleList()
91
           this.getStaffScheduleList()
93
         })
92
         })
101
          getStaffScheduleList(params).then(response=>{
100
          getStaffScheduleList(params).then(response=>{
102
             if(response.data.state == 1){
101
             if(response.data.state == 1){
103
               var staffList = response.data.data.staffList
102
               var staffList = response.data.data.staffList
104
-              console.log("staffList",staffList)
105
 
103
 
106
               let tempArr = [], newArr = []
104
               let tempArr = [], newArr = []
107
               for (let i = 0; i < staffList.length; i++) {
105
               for (let i = 0; i < staffList.length; i++) {
129
               
127
               
130
                 }else{
128
                 }else{
131
                   arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
129
                   arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
132
-                  // console.log("arr",arr)
133
                 }
130
                 }
134
               })
131
               })
135
               arr.sort(this.compare('user_type'))
132
               arr.sort(this.compare('user_type'))
136
-              
133
+              console.log("表哥数据----------",arr)
137
               this.tableData = arr
134
               this.tableData = arr
138
               
135
               
139
             }
136
             }
196
       var endtime =  this.$route.query.endtime
193
       var endtime =  this.$route.query.endtime
197
       this.end_time = endtime
194
       this.end_time = endtime
198
       this.weekArr = this.$route.query.weekArr.split(',')
195
       this.weekArr = this.$route.query.weekArr.split(',')
199
-      console.log(22222222222,this.$route.query.weekArr.split(','))
200
       //获取该机构所有医护人员
196
       //获取该机构所有医护人员
201
       this.getDoctorList()
197
       this.getDoctorList()
202
     }
198
     }