XMLWAN 3 years ago
parent
commit
ee3f7d1009
2 changed files with 239 additions and 51 deletions
  1. 21 27
      src/xt_pages/workforce/appointment.vue
  2. 218 24
      src/xt_pages/workforce/components/tableData.vue

+ 21 - 27
src/xt_pages/workforce/appointment.vue View File

@@ -296,7 +296,7 @@
296 296
             return false
297 297
           }
298 298
           var partitions = response.data.data.partitions
299
-          console.log("分区",partitions)
299
+          // console.log("分区",partitions)
300 300
           this.theWeek.thisWeek = response.data.data.theWeek
301 301
           this.theWeek.lastWeek = this.theWeek.thisWeek - 1
302 302
           this.theWeek.nextWeek = this.theWeek.thisWeek + 1
@@ -516,14 +516,13 @@
516 516
             }
517 517
             i++
518 518
           }
519
-          console.log("listw22222222",list)
520 519
             var data = []
521 520
 
522 521
           this.tableList.map(item=>{
523 522
             data.push(Object.values(item))
524 523
 
525 524
           })
526
-          console.log("data",data)
525
+        
527 526
           
528 527
           const filename = '排班模版'
529 528
         
@@ -538,8 +537,6 @@
538 537
           }
539 538
           
540 539
           if(this.export_type == 1){
541
-
542
-            console.log("44444444",this.tableList)
543 540
             //  const multiHeader = [['区号', '机号', '周一'+"("+this.newDay[0]+")" , '', '', '周二'+"("+this.newDay[1]+")", '', '', '周三'+"("+this.newDay[2]+")" , '', '', '周四'+"("+this.newDay[3]+")" , '', '', '周五'+"("+this.newDay[4]+")" , '', '', '周六'+"("+this.newDay[5]+")" , '', '', '周日'+"("+this.newDay[6]+")" , '', '', '周一'+"("+this.days[7]+")" , '', '', '周二'+"("+this.days[8]+")" , '', '', '周三'+"("+this.days[9]+")" , '', '', '周四'+"("+this.days[10]+")" , '', '', '周五'+"("+this.days[11]+")" , '', '', '周六'+"("+this.days[12]+")" , '', '', '周日'+"("+this.days[13]+")", '', '', '周一'+"("+this.days[14]+")", '', '', '周二'+"("+this.days[15]+")", '', '', '周三'+"("+this.days[16]+")", '', '', '周四'+"("+this.days[17]+")", '', '', '周五'+"("+this.days[18]+")", '', '', '周六'+"("+this.days[19]+")", '', '', '周日'+"("+this.days[20]+")", '', '']]
544 541
             //  const header = ['', '', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上']
545 542
             //  const merges = ['A1:A2', 'B1:B2', 'C1:E1', 'F1:H1', 'I1:K1', 'L1:N1', 'O1:Q1', 'R1:T1', 'U1:W1', 'X1:Z1', 'AA1:AC1', 'AD1:AF1', 'AG1:AI1', 'AJ1:AL1', 'AM1:AO1', 'AP1:AR1', 'AS1:AU1', 'AV1:AX1', 'AY1:BA1', 'BB1:BD1', 'BE1:BG1', 'BH1:BJ1', 'BK1:BM1']
@@ -575,7 +572,7 @@
575 572
               data.push(Object.values(item))
576 573
 
577 574
             })
578
-            console.log("data",data)
575
+            // console.log("data",data)
579 576
             
580 577
             const filename = '排班模版'
581 578
            
@@ -602,7 +599,7 @@
602 599
           const merges = ['A1:A2', 'B1:B2', 'C1:E1', 'F1:H1', 'I1:K1', 'L1:N1', 'O1:Q1', 'R1:T1', 'U1:W1', 'X1:Z1', 'AA1:AC1', 'AD1:AF1', 'AG1:AI1', 'AJ1:AL1', 'AM1:AO1', 'AP1:AR1', 'AS1:AU1', 'AV1:AX1', 'AY1:BA1', 'BB1:BD1', 'BE1:BG1', 'BH1:BJ1', 'BK1:BM1']
603 600
 
604 601
           var data = []
605
-          console.log("33333",this.tableList)
602
+          // console.log("33333",this.tableList)
606 603
          
607 604
          this.tableList.map(item=>{
608 605
            data.push(Object.values(item))
@@ -627,10 +624,7 @@
627 624
       formatJson(filterVal, jsonData) {
628 625
         return jsonData.map(v =>
629 626
           filterVal.map(j => {
630
-            console.log(v)
631
-            console.log(j)
632
-            console.log(v[j])
633
-
627
+        
634 628
             if (j === 'timestamp') {
635 629
               return parseTime(v[j])
636 630
             } else {
@@ -2139,11 +2133,11 @@
2139 2133
               partition_id:this.partition_id,
2140 2134
               schedule_type:this.schedule_type
2141 2135
             }
2142
-           console.log("params2222",params)
2136
+          //  console.log("params2222",params)
2143 2137
          getThreeWeekList(params).then(response=>{
2144 2138
            if(response.data.state == 1){
2145 2139
              var partitions =  response.data.data.partitions
2146
-             console.log("数据22222",this.partitions)
2140
+            //  console.log("数据22222",this.partitions)
2147 2141
 
2148 2142
              const merges = ['A1:A2', 'B1:B2', 'C1:E1', 'F1:H1', 'I1:K1', 'L1:N1', 'O1:Q1', 'R1:T1', 'U1:W1', 'X1:Z1', 'AA1:AC1', 'AD1:AF1', 'AG1:AI1', 'AJ1:AL1', 'AM1:AO1', 'AP1:AR1', 'AS1:AU1', 'AV1:AX1', 'AY1:BA1', 'BB1:BD1', 'BE1:BG1', 'BH1:BJ1', 'BK1:BM1']
2149 2143
               var list = []
@@ -2311,16 +2305,16 @@
2311 2305
               var lastWeek = []
2312 2306
               var next_start = this.getNextWeekOne(1)
2313 2307
               var nextstart = this.getTimestamp(next_start) - 28800
2314
-              console.log("下周开始时间",nextstart)
2308
+              // console.log("下周开始时间",nextstart)
2315 2309
               var next_end = this.getNextWeek(1)
2316 2310
               var nextend = this.getTimestamp(next_end) - 28800
2317
-              console.log("下周结束时间",nextend)
2311
+              // console.log("下周结束时间",nextend)
2318 2312
               var last_start = this.getNextWeekOne(2)
2319 2313
               var last_end = this.getNextWeek(2)
2320 2314
               var laststart = this.getTimestamp(last_start) - 28800
2321
-              console.log("下下周数据时间",laststart)
2315
+              // console.log("下下周数据时间",laststart)
2322 2316
               var lastend = this.getTimestamp(last_end) - 28800
2323
-              console.log("下下周数据时间",lastend)
2317
+              // console.log("下下周数据时间",lastend)
2324 2318
                
2325 2319
               if(this.export_type == 0){
2326 2320
                 for(let i = 0;i<scheduleList.length;i++){
@@ -2437,7 +2431,7 @@
2437 2431
               }
2438 2432
              }
2439 2433
 
2440
-             console.log("list5555555555",list)
2434
+            //  console.log("list5555555555",list)
2441 2435
 
2442 2436
              if(nextWeek.length > 0 ){
2443 2437
                for(let i=0;i<list.length;i++){
@@ -2540,7 +2534,7 @@
2540 2534
               }
2541 2535
              }
2542 2536
 
2543
-             console.log("nextWeek",nextWeek)
2537
+            //  console.log("nextWeek",nextWeek)
2544 2538
 
2545 2539
              if(lastWeek.length > 0 ){
2546 2540
                for(let i=0;i<list.length;i++){
@@ -2701,7 +2695,7 @@
2701 2695
       
2702 2696
      
2703 2697
 
2704
-         console.log("33333333",this.newDay)
2698
+        //  console.log("33333333",this.newDay)
2705 2699
          this.export_type = 1
2706 2700
          this.getThreeWeekList()
2707 2701
        },
@@ -2779,16 +2773,16 @@
2779 2773
                 let weekOfday = parseInt(moment().format('d')) 
2780 2774
                 start_time =  this.getTimestamp(moment().subtract(weekOfday + 6, 'days').format('YYYY-MM-DD')) -28800
2781 2775
                 end_time =  this.getTimestamp(moment().subtract(weekOfday, 'days').format('YYYY-MM-DD')) -28800
2782
-                console.log("start",start_time)
2783
-                console.log("end",end_time)
2776
+                // console.log("start",start_time)
2777
+                // console.log("end",end_time)
2784 2778
              }
2785 2779
             
2786 2780
             //本周
2787 2781
              if(this.form.lastweek == "2"){
2788 2782
                 start_time = this.getTimestamp(this.weekDayArr[0])
2789 2783
                 end_time = this.getTimestamp(this.weekDayArr[6])
2790
-                console.log("start",start_time)
2791
-                console.log("end",end_time)
2784
+                // console.log("start",start_time)
2785
+                // console.log("end",end_time)
2792 2786
              }
2793 2787
 
2794 2788
             var label = ""
@@ -2807,7 +2801,7 @@
2807 2801
               copy_startime:copy_startime,
2808 2802
               copy_endtime:copy_endtime,
2809 2803
             }
2810
-           console.log("时间",params)
2804
+         
2811 2805
          
2812 2806
            this.$refs[formName].validate(valid=>{
2813 2807
               if(valid){
@@ -2826,11 +2820,11 @@
2826 2820
     },
2827 2821
     created() {
2828 2822
      var start_time = moment().weekday(1).format('YYYY-MM-DD');
2829
-     console.log("开始时间",start_time)
2823
+   
2830 2824
      this.start_time = start_time
2831 2825
 
2832 2826
      var end_time = this.getNextWeek(2)
2833
-     console.log("结束时间222222",end_time)
2827
+   
2834 2828
      this.end_time = end_time
2835 2829
       this.getWeekPanels()
2836 2830
       this.getInitDate()

+ 218 - 24
src/xt_pages/workforce/components/tableData.vue View File

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <div id="table_data">
3
-    <!-- <div style="margin-bottom:-30px">
3
+    <div style="margin-bottom:-30px;margin-left:300px">
4 4
       <span>分区:</span>
5 5
        <el-select v-model="partition_id" placeholder="请选择" @change="changePartiton">
6 6
         <el-option
@@ -10,7 +10,7 @@
10 10
           :value="item.id">
11 11
          </el-option>
12 12
         </el-select>
13
-       <span style="margin-left:100px">班次:</span>
13
+       <!-- <span style="margin-left:100px">班次:</span>
14 14
        <el-select v-model="schedule_type" placeholder="请选择" @change="changeSchedule_type">
15 15
         <el-option
16 16
           v-for="item in options"
@@ -18,8 +18,8 @@
18 18
           :label="item.name"
19 19
           :value="item.id">
20 20
          </el-option>
21
-       </el-select>
22
-    </div> -->
21
+       </el-select> -->
22
+    </div>
23 23
    
24 24
     <div class="cell clearfix" v-if="weekTime == 'thisWeek' || weekTime == 'nextWeek'  || weekTime == 'nextTwoWeek' ">
25 25
       <el-input
@@ -644,10 +644,10 @@ export default {
644 644
       type: Array,
645 645
       dafault: []
646 646
     },
647
-    scheduleZoneProp: {
648
-      type: Array,
649
-      dafault: []
650
-    },
647
+    // scheduleZoneProp: {
648
+    //   type: Array,
649
+    //   dafault: []
650
+    // },
651 651
     partitionsProp: {
652 652
       type: Object,
653 653
       dafault: {}
@@ -689,7 +689,7 @@ export default {
689 689
       tzDialogVisible: false,
690 690
       msDialogVisible: false,
691 691
       jhDialogVisible: false,
692
-      scheduleZone: this.scheduleZoneProp,
692
+     // scheduleZone: this.scheduleZoneProp,
693 693
       scheduleZoneRow: -1,
694 694
       partitions: [],
695 695
       jihaos: [],
@@ -759,17 +759,24 @@ export default {
759 759
         {id:2,name:"下午"},
760 760
         {id:3,name:"晚上"},
761 761
       ],
762
-      partition_id:"",
762
+      partition_id:0,
763 763
       schedule_type:"",
764 764
       zones:[{id:0,name:"全部"}],
765
-      theType:""
765
+      theType:"",
766
+      scheduleZone:[],
767
+      theWeek: {
768
+        lastWeek: 0,
769
+        thisWeek: 0,
770
+        nextWeek: 0,
771
+        nextTwoWeek: 0
772
+      },
766 773
     };
767 774
   },
768 775
 
769 776
   watch: {
770 777
     weekTime: function() {
771 778
       var theType = this.weekType(this.weekTime);
772
-      console.log("999999999",theType)
779
+      // console.log("999999999",theType)
773 780
       this.theType = theType
774 781
       this.getSchedules();
775 782
     },
@@ -790,6 +797,196 @@ export default {
790 797
     }
791 798
   },
792 799
   methods: {
800
+       getWeekPanels() {
801
+        this.scheduleZone=[]
802
+        getWeekPanels(1,this.partition_id).then(response => {
803
+          if (response.data.state == 0) {
804
+            return false
805
+          }
806
+          var partitions = response.data.data.partitions
807
+          console.log("分区",partitions)
808
+          console.log("scheduleZoneRow",this.scheduleZoneRow)
809
+          this.theWeek.thisWeek = response.data.data.theWeek
810
+          this.theWeek.lastWeek = this.theWeek.thisWeek - 1
811
+          this.theWeek.nextWeek = this.theWeek.thisWeek + 1
812
+          this.theWeek.nextTwoWeek = this.theWeek.thisWeek + 2
813
+          var that = this
814
+          if (partitions.length > 0) {
815
+            partitions.forEach(function(partition) {
816
+              if (partition.jihaos.length == 0) {
817
+                return false
818
+              }
819
+              that.scheduleZoneRow.push(partition.jihaos.length)
820
+
821
+              that.partitions[partition.id] = partition
822
+              
823
+              console.log("partition",partition)
824
+
825
+             
826
+              partition.jihaos.forEach(function(jihao) {
827
+                var thisPa = {
828
+                  area: partition.name,
829
+                  zone_id: partition.id,
830
+                  zone_type: partition.type,
831
+                  cut: jihao.number,
832
+                  jihao_id: jihao.id,
833
+                  Mon_M: {
834
+                    schedule_id: 0,
835
+                    mode_id: 0,
836
+                    mode_name: '',
837
+                    patient_id: 0,
838
+                    patient: ''
839
+                  },
840
+                  Mon_A: {
841
+                    schedule_id: 0,
842
+                    mode_id: 0,
843
+                    mode_name: '',
844
+                    patient_id: 0,
845
+                    patient: ''
846
+                  },
847
+                  Mon_N: {
848
+                    schedule_id: 0,
849
+                    mode_id: 0,
850
+                    mode_name: '',
851
+                    patient_id: 0,
852
+                    patient: ''
853
+                  },
854
+                  Tue_M: {
855
+                    schedule_id: 0,
856
+                    mode_id: 0,
857
+                    mode_name: '',
858
+                    patient_id: 0,
859
+                    patient: ''
860
+                  },
861
+                  Tue_A: {
862
+                    schedule_id: 0,
863
+                    mode_id: 0,
864
+                    mode_name: '',
865
+                    patient_id: 0,
866
+                    patient: ''
867
+                  },
868
+                  Tue_N: {
869
+                    schedule_id: 0,
870
+                    mode_id: 0,
871
+                    mode_name: '',
872
+                    patient_id: 0,
873
+                    patient: ''
874
+                  },
875
+                  Wed_M: {
876
+                    schedule_id: 0,
877
+                    mode_id: 0,
878
+                    mode_name: '',
879
+                    patient_id: 0,
880
+                    patient: ''
881
+                  },
882
+                  Wed_A: {
883
+                    schedule_id: 0,
884
+                    mode_id: 0,
885
+                    mode_name: '',
886
+                    patient_id: 0,
887
+                    patient: ''
888
+                  },
889
+                  Wed_N: {
890
+                    schedule_id: 0,
891
+                    mode_id: 0,
892
+                    mode_name: '',
893
+                    patient_id: 0,
894
+                    patient: ''
895
+                  },
896
+                  Thurs_M: {
897
+                    schedule_id: 0,
898
+                    mode_id: 0,
899
+                    mode_name: '',
900
+                    patient_id: 0,
901
+                    patient: ''
902
+                  },
903
+                  Thurs_A: {
904
+                    schedule_id: 0,
905
+                    mode_id: 0,
906
+                    mode_name: '',
907
+                    patient_id: 0,
908
+                    patient: ''
909
+                  },
910
+                  Thurs_N: {
911
+                    schedule_id: 0,
912
+                    mode_id: 0,
913
+                    mode_name: '',
914
+                    patient_id: 0,
915
+                    patient: ''
916
+                  },
917
+                  Fri_M: {
918
+                    schedule_id: 0,
919
+                    mode_id: 0,
920
+                    mode_name: '',
921
+                    patient_id: 0,
922
+                    patient: ''
923
+                  },
924
+                  Fri_A: {
925
+                    schedule_id: 0,
926
+                    mode_id: 0,
927
+                    mode_name: '',
928
+                    patient_id: 0,
929
+                    patient: ''
930
+                  },
931
+                  Fri_N: {
932
+                    schedule_id: 0,
933
+                    mode_id: 0,
934
+                    mode_name: '',
935
+                    patient_id: 0,
936
+                    patient: ''
937
+                  },
938
+                  Sat_M: {
939
+                    schedule_id: 0,
940
+                    mode_id: 0,
941
+                    mode_name: '',
942
+                    patient_id: 0,
943
+                    patient: ''
944
+                  },
945
+                  Sat_A: {
946
+                    schedule_id: 0,
947
+                    mode_id: 0,
948
+                    mode_name: '',
949
+                    patient_id: 0,
950
+                    patient: ''
951
+                  },
952
+                  Sat_N: {
953
+                    schedule_id: 0,
954
+                    mode_id: 0,
955
+                    mode_name: '',
956
+                    patient_id: 0,
957
+                    patient: ''
958
+                  },
959
+                  Sun_A: {
960
+                    schedule_id: 0,
961
+                    mode_id: 0,
962
+                    mode_name: '',
963
+                    patient_id: 0,
964
+                    patient: ''
965
+                  },
966
+                  Sun_N: {
967
+                    schedule_id: 0,
968
+                    mode_id: 0,
969
+                    mode_name: '',
970
+                    patient_id: 0,
971
+                    patient: ''
972
+                  },
973
+                  Sun_M: {
974
+                    schedule_id: 0,
975
+                    mode_id: 0,
976
+                    mode_name: '',
977
+                    patient_id: 0,
978
+                    patient: ''
979
+                  },
980
+                  total: 0
981
+                }
982
+                // tha.scheduleZone = []
983
+                that.scheduleZone.push(thisPa)
984
+              })
985
+            })
986
+            console.log("分区列表22222222222222",this.scheduleZone)
987
+          }
988
+        })
989
+     },
793 990
     cellClass({ row, column, rowIndex, columnIndex }) {
794 991
       if (columnIndex == 0 || columnIndex == 1 || columnIndex == 23) {
795 992
         return "";
@@ -911,6 +1108,7 @@ export default {
911 1108
           partition_id:this.partition_id,
912 1109
           schedule_type:this.schedule_type,
913 1110
         }
1111
+
914 1112
       getSchedules(params).then(response => {
915 1113
         if (response.data.state == 1) {
916 1114
           this.weekTitle = response.data.data.weekTitle;
@@ -918,7 +1116,8 @@ export default {
918 1116
           this.toDay = response.data.data.today;
919 1117
           var theSchedules = response.data.data.schdules;
920 1118
           
921
-        
1119
+          // console.log("分区2222222222",this.scheduleZone)
1120
+          
922 1121
         
923 1122
           var that = this;
924 1123
           this.scheduleZone.forEach(function(zone, index) {
@@ -1062,7 +1261,7 @@ export default {
1062 1261
                   );
1063 1262
 
1064 1263
                   if (weekPath.length == 2) {
1065
-                    console.log(schedule);
1264
+                   
1066 1265
 
1067 1266
                     var weekPathKey = weekPath[0] + "_" + weekPath[1];
1068 1267
                     that.scheduleZone[index][weekPathKey] = {
@@ -1266,9 +1465,8 @@ export default {
1266 1465
     },
1267 1466
     clickThis(row, column, cell, event) {
1268 1467
       // debugger
1269
-      console.log("aaa",column.property);
1270 1468
       var week = this.weekDay(column.property);
1271
-      console.log("week",week);
1469
+  
1272 1470
 
1273 1471
       if (week[0] == -1 || week[1] == -1) {
1274 1472
         return false;
@@ -1289,7 +1487,6 @@ export default {
1289 1487
       this.currentData.bed_name = row.cut;
1290 1488
       this.currentData.partition_type = row.zone_type;
1291 1489
 
1292
-      console.log(this.currentData);
1293 1490
 
1294 1491
       if (row[column.property].schedule_id > 0) {
1295 1492
         this.currentData.mode_id = row[column.property].mode_id;
@@ -1330,8 +1527,6 @@ export default {
1330 1527
             }
1331 1528
           }
1332 1529
 
1333
-          // console.log(this.scheduleZone)
1334
-
1335 1530
           this.changeSchedule.change_action = "change_device";
1336 1531
           this.changeScheduleActon(formName);
1337 1532
 
@@ -1519,7 +1714,7 @@ export default {
1519 1714
               this.current_devices = this.zone_device_map[this.zone_name];
1520 1715
               this.device_id = this.current_devices[0].id;
1521 1716
             }
1522
-            console.log(this.current_devices);
1717
+         
1523 1718
 
1524 1719
             this.zone_device_options = [
1525 1720
               { values: this.zone_names },
@@ -1527,7 +1722,6 @@ export default {
1527 1722
               { values: this.current_devices }
1528 1723
             ];
1529 1724
 
1530
-            console.log(this.current_devices);
1531 1725
           } else {
1532 1726
           }
1533 1727
         })
@@ -1605,9 +1799,6 @@ export default {
1605 1799
                   if (this.zone_names.length > 0) {
1606 1800
                     this.zone_name = this.zone_names[0];
1607 1801
                     this.current_devices = this.zone_device_map[this.zone_name];
1608
-
1609
-                    console.log(this.zone_device_map[this.zone_name]);
1610
-
1611 1802
                     this.device_id = this.current_devices[0].id;
1612 1803
                   }
1613 1804
                   this.zone_device_options = [
@@ -2007,7 +2198,9 @@ export default {
2007 2198
     changePartiton(val){
2008 2199
      this.$emit('event1', val)
2009 2200
       this.partition_id = val
2201
+      this.getWeekPanels()
2010 2202
       this.getSchedules()
2203
+    
2011 2204
     },
2012 2205
     changeSchedule_type(val){
2013 2206
      this.$emit('event2', val)
@@ -2164,6 +2357,7 @@ let printStr = "<html><head><meta http-equiv='Content-Type' content='text/html;
2164 2357
   //    this.tableContainHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 160
2165 2358
   // },
2166 2359
   created() {
2360
+    this.getWeekPanels()
2167 2361
     this.changeScheduleType(1)
2168 2362
     rowNumber = 0;
2169 2363
     this.modeOptions = this.$store.getters.treatment_mode;