Преглед изворни кода

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

csx пре 4 година
родитељ
комит
c0d9ca2cc5

+ 1 - 26
src/xt_pages/medicalScheduling/class.vue Прегледај датотеку

@@ -380,7 +380,6 @@ export default {
380 380
            getDoctorScheduleList(params).then(response=>{
381 381
               if(response.data.state == 1){
382 382
                  var schedules = response.data.data.schedules
383
-                  console.log("schedules",schedules)
384 383
                  for(let i=0;i<schedules.length;i++){
385 384
                     if(schedules[i].class_attributes == 1){
386 385
                         schedules[i].class_attributes ="出勤"
@@ -429,7 +428,6 @@ export default {
429 428
         getScheduleDetail(id).then(response=>{
430 429
            if(response.data.state == 1){
431 430
              var scheduleDetail = response.data.data.scheduleDetail
432
-             console.log("scheduledetail",scheduleDetail)
433 431
              this.form.id = scheduleDetail.id
434 432
              this.form.class_name = scheduleDetail.class_name
435 433
              this.form.class_attributes = scheduleDetail.class_attributes
@@ -546,9 +544,6 @@ export default {
546 544
         },
547 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 547
         var longtime = 0
553 548
         var timeone = 0
554 549
         var timetwo = 0
@@ -564,7 +559,7 @@ export default {
564 559
           var timeone =  this.timeDifference(this.form.timeone_start,oneHours)
565 560
          timeone = timeone
566 561
         }
567
-       console.log("时间选择1时长",this.timeStamp(timeone))
562
+     
568 563
                 
569 564
         //时间选择2的时间差
570 565
         if(this.form.timetwo_type == 1){
@@ -578,18 +573,12 @@ export default {
578 573
             var timetwo =  this.timeDifference(this.form.timetwo_start,oneHours)
579 574
             timetwo = timetwo
580 575
         }
581
-          console.log("timetwo",timetwo)
582
-          console.log("时间选择2时长",this,this.timeStamp(timetwo))
583 576
                   
584 577
         longtime = timeone + timetwo
585
-        console.log("longtime",longtime)
586 578
         this.form.work_time = this.timeStamp(longtime)
587 579
      },
588 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 582
         var longtime = 0
594 583
         var timeone = 0
595 584
         var timetwo = 0
@@ -605,7 +594,6 @@ export default {
605 594
           var timeone =  this.timeDifference(this.form.timeone_start,oneHours)
606 595
          timeone = timeone
607 596
         }
608
-       console.log("时间选择1时长",this.timeStamp(timeone))
609 597
                 
610 598
         //时间选择2的时间差
611 599
         if(this.form.timetwo_type == 1){
@@ -619,11 +607,8 @@ export default {
619 607
             var timetwo =  this.timeDifference(this.form.timetwo_start,oneHours)
620 608
             timetwo = timetwo
621 609
         }
622
-          console.log("timetwo",timetwo)
623
-          console.log("时间选择2时长",this,this.timeStamp(timetwo))
624 610
                   
625 611
         longtime = timeone + timetwo
626
-        console.log("longtime",longtime)
627 612
         this.form.work_time = this.timeStamp(longtime) 
628 613
      }
629 614
     },
@@ -631,16 +616,6 @@ export default {
631 616
         //获取班种列表
632 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 620
 </script>
646 621
 <style scoped>

+ 19 - 26
src/xt_pages/medicalScheduling/index.vue Прегледај датотеку

@@ -40,7 +40,7 @@
40 40
             </div>
41 41
             <div class="schedulingTable" style="display:flex;justify-content: space-between;">
42 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 44
                         <el-table-column prop="name" label="医护姓名" style="width:16%" align="center">
45 45
                             <template slot-scope="scope">
46 46
                                  {{scope.row.user_name}}
@@ -51,7 +51,7 @@
51 51
                                 <div @click="hangdleClick(scope.row,scope.$index,0)">
52 52
                                     <el-dropdown trigger="click" @command="changeSchedule">
53 53
                                         <span class="el-dropdown-link">
54
-                                        {{ getClass(scope.row.user_name,1) }}<i class="el-icon-arrow-down el-icon--right"></i>
54
+                                        {{ getClass(scope.row.user_name,1) }}<i v-if="getTimestamp(weekDayArr[0])>=timeNow?true:false" class="el-icon-arrow-down el-icon--right"></i>
55 55
                                         </span>
56 56
                                         <el-dropdown-menu slot="dropdown" >
57 57
                                             <el-dropdown-item  :command="item.id" icon="el-icon-plus" :disabled="getTimestamp(weekDayArr[0])<timeNow?true:false" v-for="(item,index) in schedulelist" :key="index">{{item.class_name}}</el-dropdown-item>
@@ -65,7 +65,7 @@
65 65
                                 <div @click="hangdleClick(scope.row,scope.$index,1)">
66 66
                                     <el-dropdown trigger="click" @command="changeSchedule">
67 67
                                         <span class="el-dropdown-link">
68
-                                        {{ getClass(scope.row.user_name,2) }}<i class="el-icon-arrow-down el-icon--right"></i>
68
+                                        {{ getClass(scope.row.user_name,2) }}<i v-if="getTimestamp(weekDayArr[1])>=timeNow?true:false" class="el-icon-arrow-down el-icon--right"></i>
69 69
                                         </span>
70 70
                                         <el-dropdown-menu slot="dropdown" >
71 71
                                             <el-dropdown-item  :command="item.id" icon="el-icon-plus" :disabled="getTimestamp(weekDayArr[1])<timeNow?true:false" v-for="(item,index) in schedulelist" :key="index">{{item.class_name}}</el-dropdown-item>
@@ -79,7 +79,7 @@
79 79
                                 <div @click="hangdleClick(scope.row,scope.$index,2)">
80 80
                                     <el-dropdown trigger="click" @command="changeSchedule">
81 81
                                         <span class="el-dropdown-link">
82
-                                        {{ getClass(scope.row.user_name,3) }}<i class="el-icon-arrow-down el-icon--right"></i>
82
+                                        {{ getClass(scope.row.user_name,3) }}<i v-if="getTimestamp(weekDayArr[2])>=timeNow?true:false" class="el-icon-arrow-down el-icon--right"></i>
83 83
                                         </span>
84 84
                                         <el-dropdown-menu slot="dropdown" >
85 85
                                             <el-dropdown-item  :command="item.id" icon="el-icon-plus" :disabled="getTimestamp(weekDayArr[2])<timeNow?true:false" v-for="(item,index) in schedulelist" :key="index">{{item.class_name}}</el-dropdown-item>
@@ -93,7 +93,7 @@
93 93
                                 <div @click="hangdleClick(scope.row,scope.$index,3)">
94 94
                                     <el-dropdown trigger="click" @command="changeSchedule">
95 95
                                         <span class="el-dropdown-link">
96
-                                        {{ getClass(scope.row.user_name,4) }}<i class="el-icon-arrow-down el-icon--right"></i>
96
+                                        {{ getClass(scope.row.user_name,4) }}<i v-if="getTimestamp(weekDayArr[3])>=timeNow?true:false" class="el-icon-arrow-down el-icon--right"></i>
97 97
                                         </span>
98 98
                                         <el-dropdown-menu slot="dropdown" >
99 99
                                             <el-dropdown-item  :command="item.id" icon="el-icon-plus" :disabled="getTimestamp(weekDayArr[3])<timeNow?true:false" v-for="(item,index) in schedulelist" :key="index">{{item.class_name}}</el-dropdown-item>
@@ -107,7 +107,7 @@
107 107
                                 <div @click="hangdleClick(scope.row,scope.$index,4)">
108 108
                                     <el-dropdown trigger="click" @command="changeSchedule">
109 109
                                         <span class="el-dropdown-link">
110
-                                        {{ getClass(scope.row.user_name,5) }}<i class="el-icon-arrow-down el-icon--right"></i>
110
+                                        {{ getClass(scope.row.user_name,5) }}<i v-if="getTimestamp(weekDayArr[4])>=timeNow?true:false" class="el-icon-arrow-down el-icon--right"></i>
111 111
                                         </span>
112 112
                                         <el-dropdown-menu slot="dropdown" >
113 113
                                             <el-dropdown-item  :command="item.id" icon="el-icon-plus" :disabled="getTimestamp(weekDayArr[4])<timeNow?true:false" v-for="(item,index) in schedulelist" :key="index">{{item.class_name}}</el-dropdown-item>
@@ -121,7 +121,7 @@
121 121
                                 <div @click="hangdleClick(scope.row,scope.$index,5)">
122 122
                                     <el-dropdown trigger="click" @command="changeSchedule">
123 123
                                         <span class="el-dropdown-link">
124
-                                        {{ getClass(scope.row.user_name,6) }}<i class="el-icon-arrow-down el-icon--right"></i>
124
+                                        {{ getClass(scope.row.user_name,6) }}<i v-if="getTimestamp(weekDayArr[5])>=timeNow?true:false" class="el-icon-arrow-down el-icon--right"></i>
125 125
                                         </span>
126 126
                                         <el-dropdown-menu slot="dropdown" >
127 127
                                             <el-dropdown-item  :command="item.id" icon="el-icon-plus" :disabled="getTimestamp(weekDayArr[5])<timeNow?true:false" v-for="(item,index) in schedulelist" :key="index">{{item.class_name}}</el-dropdown-item>
@@ -135,7 +135,7 @@
135 135
                                 <div @click="hangdleClick(scope.row,scope.$index,6)">
136 136
                                     <el-dropdown trigger="click" @command="changeSchedule">
137 137
                                         <span class="el-dropdown-link">
138
-                                        {{ getClass(scope.row.user_name,0) }}<i class="el-icon-arrow-down el-icon--right"></i>
138
+                                        {{ getClass(scope.row.user_name,0) }}<i v-if="getTimestamp(weekDayArr[6])>=timeNow?true:false" class="el-icon-arrow-down el-icon--right"></i>
139 139
                                         </span>
140 140
                                         <el-dropdown-menu slot="dropdown" >
141 141
                                             <el-dropdown-item  :command="item.id" icon="el-icon-plus" :disabled="getTimestamp(weekDayArr[6])<timeNow?true:false" v-for="(item,index) in schedulelist" :key="index">{{item.class_name}}</el-dropdown-item>
@@ -244,7 +244,7 @@ export default {
244 244
         search(){},
245 245
         toPrint(){
246 246
             this.$router.push({
247
-                path: '/medicalScheduling/schedule/print?starttime='+this.getTimestamp(this.weekDayArr[0])+"&endtime="+this.getTimestamp(this.weekDayArr[6]),
247
+                path: '/medicalScheduling/schedule/print?starttime='+this.getTimestamp(this.weekDayArr[0])+"&endtime="+this.getTimestamp(this.weekDayArr[6])+"&weekArr="+ this.weekDayArr,
248 248
                 // query: { date: date }
249 249
             })
250 250
         },
@@ -450,7 +450,6 @@ 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)
454 453
                     for(let i=0;i<staffList.length;i++){
455 454
                     if(staffList[i].schedule_week == 0){
456 455
                         staffList[i].class_index = 0
@@ -474,7 +473,6 @@ export default {
474 473
                         staffList[i].class_index = 6
475 474
                     }
476 475
                     }
477
-                    console.log("staffList--------",staffList)
478 476
                     let tempArr = [], newArr = []
479 477
                     for (let i = 0; i < staffList.length; i++) {
480 478
                         if (tempArr.indexOf(staffList[i].user_name) === -1) {
@@ -501,7 +499,6 @@ export default {
501 499
                     
502 500
                       }else{
503 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 504
                     console.log("arr=======",arr)
@@ -626,7 +623,6 @@ export default {
626 623
                             // console.log("arr",arr)
627 624
                           }
628 625
                         })
629
-                        console.log("全部=======",arr)
630 626
                         arr.sort(this.compare('user_type'))
631 627
                         this.tableData = arr
632 628
                     }
@@ -675,8 +671,6 @@ export default {
675 671
         })
676 672
         },
677 673
         toSearch(){
678
-            console.log("医护人员姓名",this.keywords)
679
-            
680 674
             const params = {
681 675
             user_name: this.keywords,
682 676
             start_time:this.getTimestamp(this.weekDayArr[0]),
@@ -685,7 +679,6 @@ export default {
685 679
             toSearchScheduleList(params).then(response=>{
686 680
                 if(response.data.state == 1){
687 681
                     var staffList =  response.data.data.staffList
688
-                    console.log("stafflist",staffList)
689 682
                     let tempArr = [], newArr = []
690 683
                     for (let i = 0; i < staffList.length; i++) {
691 684
                         if (tempArr.indexOf(staffList[i].user_name) === -1) {
@@ -729,7 +722,6 @@ export default {
729 722
             start_time:this.getTimestamp(this.weekDayArr[0]),
730 723
             end_time:this.getTimestamp(this.weekDayArr[6])
731 724
             }
732
-            console.log("params",params)
733 725
             this.$confirm(
734 726
             '是否要清除当周排班? <br>清除后,信息将无法恢复',
735 727
             '删除提示',
@@ -780,7 +772,6 @@ export default {
780 772
             UpdateContinusSchedule(params).then(response=>{
781 773
                 if(response.data.state == 1){
782 774
                 var schedule =  response.data.data.schedule
783
-                console.log("schedule",schedule)
784 775
                 this.$message.success("保存成功")
785 776
                 }
786 777
             })
@@ -798,8 +789,6 @@ export default {
798 789
             this.currentFirstDate1 = num + 1
799 790
         },
800 791
         submitAction(formName){
801
-            console.log("数据",this.typeOptions)
802
-            console.log("2222",this.timeOptions)
803 792
             var label = ""
804 793
             for(let i=0;i<this.timeOptions.length;i++){
805 794
                if(this.form.copyWeek == this.timeOptions[i].value){
@@ -808,9 +797,7 @@ export default {
808 797
             }
809 798
            var start = label.split('~')
810 799
            var copy_startime = this.getTimestamp(start[0])   
811
-           console.log("copy_startime",copy_startime)   
812 800
            var copy_endtime = this.getTimestamp(start[1]) 
813
-           console.log("copy_endtime",copy_endtime)
814 801
 
815 802
             const params = {
816 803
               start_time:this.getTimestamp(this.weekDayArr[0]),
@@ -818,13 +805,11 @@ export default {
818 805
               copy_startime:copy_startime,
819 806
               copy_endtime:copy_endtime,
820 807
             }
821
-            console.log("params",params)
822 808
            this.$refs[formName].validate(valid=>{
823 809
               if(valid){
824 810
                 copyStaffSchedule(params).then(response=>{
825 811
                    if(response.data.state == 1){
826 812
                      var msg = response.data.data.msg
827
-                     console.log("msg",msg)
828 813
                      this.$message.success("复制成功")
829 814
                      this.newVisible = false
830 815
                    }else{
@@ -841,6 +826,16 @@ export default {
841 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 840
     created(){
846 841
         //获取医护人员
@@ -877,9 +872,7 @@ export default {
877 872
             
878 873
         }
879 874
       var now = moment().locale('zh-cn').format('YYYY-MM-DD 00:00:00')
880
-      console.log('now',now)
881 875
       this.timeNow = this.getTimestamp(now)
882
-      console.log("timenow",this.timeNow)
883 876
       
884 877
     }
885 878
 }

+ 24 - 15
src/xt_pages/medicalScheduling/medical_print.vue Прегледај датотеку

@@ -22,13 +22,13 @@
22 22
                             <thead>
23 23
                                 <tr>
24 24
                                     <td width="120">医护姓名</td>
25
-                                    <td width="120">周一</td>
26
-                                    <td width="120">周二</td>
27
-                                    <td width="120">周三</td>
28
-                                    <td width="120">周四</td>
29
-                                    <td width="120">周五</td>
30
-                                    <td width="120">周六</td>
31
-                                    <td width="120">周日</td>
25
+                                    <td width="120">周一<br />({{ weekArr[0] }})</td>
26
+                                    <td width="120">周二<br />({{ weekArr[1] }})</td>
27
+                                    <td width="120">周三<br />({{ weekArr[2] }})</td>
28
+                                    <td width="120">周四<br />({{ weekArr[3] }})</td>
29
+                                    <td width="120">周五<br />({{ weekArr[4] }})</td>
30
+                                    <td width="120">周六<br />({{ weekArr[5] }})</td>
31
+                                    <td width="120">周日<br />({{ weekArr[6] }})</td>
32 32
                                 </tr>
33 33
                             </thead>
34 34
                             <tbody>
@@ -74,7 +74,7 @@ export default {
74 74
     },
75 75
     methods:{
76 76
       printAction: function() {
77
-          const style = '@media print { .print_main_content { background-color: white; width:960px;  margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 20px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 18px; padding: 10px 5px; } .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
77
+          const style = '@media print { .print_main_content { background-color: white; width:960px;  margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 10px 5px; white-space: pre-line;} .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
78 78
 
79 79
           printJS({
80 80
           printable: 'print_content',
@@ -87,7 +87,6 @@ export default {
87 87
       getDoctorList(){
88 88
         getDoctorList().then(response=>{
89 89
           var list =  response.data.data.list
90
-          console.log("医护列表",list)
91 90
           this.doctorlist = list
92 91
           this.getStaffScheduleList()
93 92
         })
@@ -101,7 +100,6 @@ export default {
101 100
          getStaffScheduleList(params).then(response=>{
102 101
             if(response.data.state == 1){
103 102
               var staffList = response.data.data.staffList
104
-              console.log("staffList",staffList)
105 103
 
106 104
               let tempArr = [], newArr = []
107 105
               for (let i = 0; i < staffList.length; i++) {
@@ -129,10 +127,10 @@ export default {
129 127
               
130 128
                 }else{
131 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 132
               arr.sort(this.compare('user_type'))
133
+              console.log("表哥数据----------",arr)
136 134
               this.tableData = arr
137 135
               
138 136
             }
@@ -152,7 +150,18 @@ export default {
152 150
               } 
153 151
             }
154 152
           })
155
-          return newClass
153
+          if(newClass.indexOf("(") > -1){
154
+            let num = newClass.indexOf("(")
155
+            let a = newClass.slice(0, num) + '\n' + newClass.slice(num)
156
+            return a
157
+          }else if(newClass.indexOf("(") > -1) {
158
+            let num = newClass.indexOf("(")
159
+            let a = newClass.slice(0, num) + '\n' + newClass.slice(num)
160
+            return a
161
+          }else{
162
+            return newClass
163
+          }
164
+          
156 165
         }
157 166
       },
158 167
       getNowFormatDate() {
@@ -180,11 +189,10 @@ export default {
180 189
     },
181 190
     created(){
182 191
       var starttime =  this.$route.query.starttime
183
-      console.log("starttime",starttime)
184 192
       this.start_time = starttime
185 193
       var endtime =  this.$route.query.endtime
186
-      console.log("endtime",endtime)
187 194
       this.end_time = endtime
195
+      this.weekArr = this.$route.query.weekArr.split(',')
188 196
       //获取该机构所有医护人员
189 197
       this.getDoctorList()
190 198
     }
@@ -214,6 +222,7 @@ export default {
214 222
       border: 1px solid;
215 223
       border-collapse: collapse;
216 224
       padding: 2px;
225
+      
217 226
 
218 227
       thead {
219 228
         tr {
@@ -232,7 +241,7 @@ export default {
232 241
             text-align: center;
233 242
             font-size: 18px;
234 243
             padding: 10px 5px;
235
-
244
+            white-space: pre-line;
236 245
             .proj {
237 246
               padding: 5px 0;
238 247
               text-align: left;