浏览代码

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

see999 4 年前
父节点
当前提交
98e7edf88a
共有 2 个文件被更改,包括 239 次插入51 次删除
  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 查看文件

@@ -290,7 +290,7 @@
290 290
             return false
291 291
           }
292 292
           var partitions = response.data.data.partitions
293
-          console.log("分区",partitions)
293
+          // console.log("分区",partitions)
294 294
           this.theWeek.thisWeek = response.data.data.theWeek
295 295
           this.theWeek.lastWeek = this.theWeek.thisWeek - 1
296 296
           this.theWeek.nextWeek = this.theWeek.thisWeek + 1
@@ -510,14 +510,13 @@
510 510
             }
511 511
             i++
512 512
           }
513
-          console.log("listw22222222",list)
514 513
             var data = []
515 514
 
516 515
           this.tableList.map(item=>{
517 516
             data.push(Object.values(item))
518 517
 
519 518
           })
520
-          console.log("data",data)
519
+        
521 520
           
522 521
           const filename = '排班模版'
523 522
         
@@ -532,8 +531,6 @@
532 531
           }
533 532
           
534 533
           if(this.export_type == 1){
535
-
536
-            console.log("44444444",this.tableList)
537 534
             //  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]+")", '', '']]
538 535
             //  const header = ['', '', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上']
539 536
             //  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']
@@ -569,7 +566,7 @@
569 566
               data.push(Object.values(item))
570 567
 
571 568
             })
572
-            console.log("data",data)
569
+            // console.log("data",data)
573 570
             
574 571
             const filename = '排班模版'
575 572
            
@@ -596,7 +593,7 @@
596 593
           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']
597 594
 
598 595
           var data = []
599
-          console.log("33333",this.tableList)
596
+          // console.log("33333",this.tableList)
600 597
          
601 598
          this.tableList.map(item=>{
602 599
            data.push(Object.values(item))
@@ -621,10 +618,7 @@
621 618
       formatJson(filterVal, jsonData) {
622 619
         return jsonData.map(v =>
623 620
           filterVal.map(j => {
624
-            console.log(v)
625
-            console.log(j)
626
-            console.log(v[j])
627
-
621
+        
628 622
             if (j === 'timestamp') {
629 623
               return parseTime(v[j])
630 624
             } else {
@@ -2133,11 +2127,11 @@
2133 2127
               partition_id:this.partition_id,
2134 2128
               schedule_type:this.schedule_type
2135 2129
             }
2136
-           console.log("params2222",params)
2130
+          //  console.log("params2222",params)
2137 2131
          getThreeWeekList(params).then(response=>{
2138 2132
            if(response.data.state == 1){
2139 2133
              var partitions =  response.data.data.partitions
2140
-             console.log("数据22222",this.partitions)
2134
+            //  console.log("数据22222",this.partitions)
2141 2135
 
2142 2136
              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']
2143 2137
               var list = []
@@ -2305,16 +2299,16 @@
2305 2299
               var lastWeek = []
2306 2300
               var next_start = this.getNextWeekOne(1)
2307 2301
               var nextstart = this.getTimestamp(next_start) - 28800
2308
-              console.log("下周开始时间",nextstart)
2302
+              // console.log("下周开始时间",nextstart)
2309 2303
               var next_end = this.getNextWeek(1)
2310 2304
               var nextend = this.getTimestamp(next_end) - 28800
2311
-              console.log("下周结束时间",nextend)
2305
+              // console.log("下周结束时间",nextend)
2312 2306
               var last_start = this.getNextWeekOne(2)
2313 2307
               var last_end = this.getNextWeek(2)
2314 2308
               var laststart = this.getTimestamp(last_start) - 28800
2315
-              console.log("下下周数据时间",laststart)
2309
+              // console.log("下下周数据时间",laststart)
2316 2310
               var lastend = this.getTimestamp(last_end) - 28800
2317
-              console.log("下下周数据时间",lastend)
2311
+              // console.log("下下周数据时间",lastend)
2318 2312
                
2319 2313
               if(this.export_type == 0){
2320 2314
                 for(let i = 0;i<scheduleList.length;i++){
@@ -2431,7 +2425,7 @@
2431 2425
               }
2432 2426
              }
2433 2427
 
2434
-             console.log("list5555555555",list)
2428
+            //  console.log("list5555555555",list)
2435 2429
 
2436 2430
              if(nextWeek.length > 0 ){
2437 2431
                for(let i=0;i<list.length;i++){
@@ -2534,7 +2528,7 @@
2534 2528
               }
2535 2529
              }
2536 2530
 
2537
-             console.log("nextWeek",nextWeek)
2531
+            //  console.log("nextWeek",nextWeek)
2538 2532
 
2539 2533
              if(lastWeek.length > 0 ){
2540 2534
                for(let i=0;i<list.length;i++){
@@ -2695,7 +2689,7 @@
2695 2689
       
2696 2690
      
2697 2691
 
2698
-         console.log("33333333",this.newDay)
2692
+        //  console.log("33333333",this.newDay)
2699 2693
          this.export_type = 1
2700 2694
          this.getThreeWeekList()
2701 2695
        },
@@ -2773,16 +2767,16 @@
2773 2767
                 let weekOfday = parseInt(moment().format('d')) 
2774 2768
                 start_time =  this.getTimestamp(moment().subtract(weekOfday + 6, 'days').format('YYYY-MM-DD')) -28800
2775 2769
                 end_time =  this.getTimestamp(moment().subtract(weekOfday, 'days').format('YYYY-MM-DD')) -28800
2776
-                console.log("start",start_time)
2777
-                console.log("end",end_time)
2770
+                // console.log("start",start_time)
2771
+                // console.log("end",end_time)
2778 2772
              }
2779 2773
             
2780 2774
             //本周
2781 2775
              if(this.form.lastweek == "2"){
2782 2776
                 start_time = this.getTimestamp(this.weekDayArr[0])
2783 2777
                 end_time = this.getTimestamp(this.weekDayArr[6])
2784
-                console.log("start",start_time)
2785
-                console.log("end",end_time)
2778
+                // console.log("start",start_time)
2779
+                // console.log("end",end_time)
2786 2780
              }
2787 2781
 
2788 2782
             var label = ""
@@ -2801,7 +2795,7 @@
2801 2795
               copy_startime:copy_startime,
2802 2796
               copy_endtime:copy_endtime,
2803 2797
             }
2804
-           console.log("时间",params)
2798
+         
2805 2799
          
2806 2800
            this.$refs[formName].validate(valid=>{
2807 2801
               if(valid){
@@ -2820,11 +2814,11 @@
2820 2814
     },
2821 2815
     created() {
2822 2816
      var start_time = moment().weekday(1).format('YYYY-MM-DD');
2823
-     console.log("开始时间",start_time)
2817
+   
2824 2818
      this.start_time = start_time
2825 2819
 
2826 2820
      var end_time = this.getNextWeek(2)
2827
-     console.log("结束时间222222",end_time)
2821
+   
2828 2822
      this.end_time = end_time
2829 2823
       this.getWeekPanels()
2830 2824
       this.getInitDate()

+ 218 - 24
src/xt_pages/workforce/components/tableData.vue 查看文件

@@ -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
@@ -643,10 +643,10 @@ export default {
643 643
       type: Array,
644 644
       dafault: []
645 645
     },
646
-    scheduleZoneProp: {
647
-      type: Array,
648
-      dafault: []
649
-    },
646
+    // scheduleZoneProp: {
647
+    //   type: Array,
648
+    //   dafault: []
649
+    // },
650 650
     partitionsProp: {
651 651
       type: Object,
652 652
       dafault: {}
@@ -688,7 +688,7 @@ export default {
688 688
       tzDialogVisible: false,
689 689
       msDialogVisible: false,
690 690
       jhDialogVisible: false,
691
-      scheduleZone: this.scheduleZoneProp,
691
+     // scheduleZone: this.scheduleZoneProp,
692 692
       scheduleZoneRow: -1,
693 693
       partitions: [],
694 694
       jihaos: [],
@@ -758,17 +758,24 @@ export default {
758 758
         {id:2,name:"下午"},
759 759
         {id:3,name:"晚上"},
760 760
       ],
761
-      partition_id:"",
761
+      partition_id:0,
762 762
       schedule_type:"",
763 763
       zones:[{id:0,name:"全部"}],
764
-      theType:""
764
+      theType:"",
765
+      scheduleZone:[],
766
+      theWeek: {
767
+        lastWeek: 0,
768
+        thisWeek: 0,
769
+        nextWeek: 0,
770
+        nextTwoWeek: 0
771
+      },
765 772
     };
766 773
   },
767 774
 
768 775
   watch: {
769 776
     weekTime: function() {
770 777
       var theType = this.weekType(this.weekTime);
771
-      console.log("999999999",theType)
778
+      // console.log("999999999",theType)
772 779
       this.theType = theType
773 780
       this.getSchedules();
774 781
     },
@@ -789,6 +796,196 @@ export default {
789 796
     }
790 797
   },
791 798
   methods: {
799
+       getWeekPanels() {
800
+        this.scheduleZone=[]
801
+        getWeekPanels(1,this.partition_id).then(response => {
802
+          if (response.data.state == 0) {
803
+            return false
804
+          }
805
+          var partitions = response.data.data.partitions
806
+          console.log("分区",partitions)
807
+          console.log("scheduleZoneRow",this.scheduleZoneRow)
808
+          this.theWeek.thisWeek = response.data.data.theWeek
809
+          this.theWeek.lastWeek = this.theWeek.thisWeek - 1
810
+          this.theWeek.nextWeek = this.theWeek.thisWeek + 1
811
+          this.theWeek.nextTwoWeek = this.theWeek.thisWeek + 2
812
+          var that = this
813
+          if (partitions.length > 0) {
814
+            partitions.forEach(function(partition) {
815
+              if (partition.jihaos.length == 0) {
816
+                return false
817
+              }
818
+              that.scheduleZoneRow.push(partition.jihaos.length)
819
+
820
+              that.partitions[partition.id] = partition
821
+              
822
+              console.log("partition",partition)
823
+
824
+             
825
+              partition.jihaos.forEach(function(jihao) {
826
+                var thisPa = {
827
+                  area: partition.name,
828
+                  zone_id: partition.id,
829
+                  zone_type: partition.type,
830
+                  cut: jihao.number,
831
+                  jihao_id: jihao.id,
832
+                  Mon_M: {
833
+                    schedule_id: 0,
834
+                    mode_id: 0,
835
+                    mode_name: '',
836
+                    patient_id: 0,
837
+                    patient: ''
838
+                  },
839
+                  Mon_A: {
840
+                    schedule_id: 0,
841
+                    mode_id: 0,
842
+                    mode_name: '',
843
+                    patient_id: 0,
844
+                    patient: ''
845
+                  },
846
+                  Mon_N: {
847
+                    schedule_id: 0,
848
+                    mode_id: 0,
849
+                    mode_name: '',
850
+                    patient_id: 0,
851
+                    patient: ''
852
+                  },
853
+                  Tue_M: {
854
+                    schedule_id: 0,
855
+                    mode_id: 0,
856
+                    mode_name: '',
857
+                    patient_id: 0,
858
+                    patient: ''
859
+                  },
860
+                  Tue_A: {
861
+                    schedule_id: 0,
862
+                    mode_id: 0,
863
+                    mode_name: '',
864
+                    patient_id: 0,
865
+                    patient: ''
866
+                  },
867
+                  Tue_N: {
868
+                    schedule_id: 0,
869
+                    mode_id: 0,
870
+                    mode_name: '',
871
+                    patient_id: 0,
872
+                    patient: ''
873
+                  },
874
+                  Wed_M: {
875
+                    schedule_id: 0,
876
+                    mode_id: 0,
877
+                    mode_name: '',
878
+                    patient_id: 0,
879
+                    patient: ''
880
+                  },
881
+                  Wed_A: {
882
+                    schedule_id: 0,
883
+                    mode_id: 0,
884
+                    mode_name: '',
885
+                    patient_id: 0,
886
+                    patient: ''
887
+                  },
888
+                  Wed_N: {
889
+                    schedule_id: 0,
890
+                    mode_id: 0,
891
+                    mode_name: '',
892
+                    patient_id: 0,
893
+                    patient: ''
894
+                  },
895
+                  Thurs_M: {
896
+                    schedule_id: 0,
897
+                    mode_id: 0,
898
+                    mode_name: '',
899
+                    patient_id: 0,
900
+                    patient: ''
901
+                  },
902
+                  Thurs_A: {
903
+                    schedule_id: 0,
904
+                    mode_id: 0,
905
+                    mode_name: '',
906
+                    patient_id: 0,
907
+                    patient: ''
908
+                  },
909
+                  Thurs_N: {
910
+                    schedule_id: 0,
911
+                    mode_id: 0,
912
+                    mode_name: '',
913
+                    patient_id: 0,
914
+                    patient: ''
915
+                  },
916
+                  Fri_M: {
917
+                    schedule_id: 0,
918
+                    mode_id: 0,
919
+                    mode_name: '',
920
+                    patient_id: 0,
921
+                    patient: ''
922
+                  },
923
+                  Fri_A: {
924
+                    schedule_id: 0,
925
+                    mode_id: 0,
926
+                    mode_name: '',
927
+                    patient_id: 0,
928
+                    patient: ''
929
+                  },
930
+                  Fri_N: {
931
+                    schedule_id: 0,
932
+                    mode_id: 0,
933
+                    mode_name: '',
934
+                    patient_id: 0,
935
+                    patient: ''
936
+                  },
937
+                  Sat_M: {
938
+                    schedule_id: 0,
939
+                    mode_id: 0,
940
+                    mode_name: '',
941
+                    patient_id: 0,
942
+                    patient: ''
943
+                  },
944
+                  Sat_A: {
945
+                    schedule_id: 0,
946
+                    mode_id: 0,
947
+                    mode_name: '',
948
+                    patient_id: 0,
949
+                    patient: ''
950
+                  },
951
+                  Sat_N: {
952
+                    schedule_id: 0,
953
+                    mode_id: 0,
954
+                    mode_name: '',
955
+                    patient_id: 0,
956
+                    patient: ''
957
+                  },
958
+                  Sun_A: {
959
+                    schedule_id: 0,
960
+                    mode_id: 0,
961
+                    mode_name: '',
962
+                    patient_id: 0,
963
+                    patient: ''
964
+                  },
965
+                  Sun_N: {
966
+                    schedule_id: 0,
967
+                    mode_id: 0,
968
+                    mode_name: '',
969
+                    patient_id: 0,
970
+                    patient: ''
971
+                  },
972
+                  Sun_M: {
973
+                    schedule_id: 0,
974
+                    mode_id: 0,
975
+                    mode_name: '',
976
+                    patient_id: 0,
977
+                    patient: ''
978
+                  },
979
+                  total: 0
980
+                }
981
+                // tha.scheduleZone = []
982
+                that.scheduleZone.push(thisPa)
983
+              })
984
+            })
985
+            console.log("分区列表22222222222222",this.scheduleZone)
986
+          }
987
+        })
988
+     },
792 989
     cellClass({ row, column, rowIndex, columnIndex }) {
793 990
       if (columnIndex == 0 || columnIndex == 1 || columnIndex == 23) {
794 991
         return "";
@@ -910,6 +1107,7 @@ export default {
910 1107
           partition_id:this.partition_id,
911 1108
           schedule_type:this.schedule_type,
912 1109
         }
1110
+
913 1111
       getSchedules(params).then(response => {
914 1112
         if (response.data.state == 1) {
915 1113
           this.weekTitle = response.data.data.weekTitle;
@@ -917,7 +1115,8 @@ export default {
917 1115
           this.toDay = response.data.data.today;
918 1116
           var theSchedules = response.data.data.schdules;
919 1117
           
920
-        
1118
+          // console.log("分区2222222222",this.scheduleZone)
1119
+          
921 1120
         
922 1121
           var that = this;
923 1122
           console.log('that.scheduleZonethat.scheduleZone',that.scheduleZone)
@@ -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] = {
@@ -1268,9 +1467,8 @@ export default {
1268 1467
     },
1269 1468
     clickThis(row, column, cell, event) {
1270 1469
       // debugger
1271
-      console.log("aaa",column.property);
1272 1470
       var week = this.weekDay(column.property);
1273
-      console.log("week",week);
1471
+  
1274 1472
 
1275 1473
       if (week[0] == -1 || week[1] == -1) {
1276 1474
         return false;
@@ -1291,7 +1489,6 @@ export default {
1291 1489
       this.currentData.bed_name = row.cut;
1292 1490
       this.currentData.partition_type = row.zone_type;
1293 1491
 
1294
-      console.log(this.currentData);
1295 1492
 
1296 1493
       if (row[column.property].schedule_id > 0) {
1297 1494
         this.currentData.mode_id = row[column.property].mode_id;
@@ -1332,8 +1529,6 @@ export default {
1332 1529
             }
1333 1530
           }
1334 1531
 
1335
-          // console.log(this.scheduleZone)
1336
-
1337 1532
           this.changeSchedule.change_action = "change_device";
1338 1533
           this.changeScheduleActon(formName);
1339 1534
 
@@ -1521,7 +1716,7 @@ export default {
1521 1716
               this.current_devices = this.zone_device_map[this.zone_name];
1522 1717
               this.device_id = this.current_devices[0].id;
1523 1718
             }
1524
-            console.log(this.current_devices);
1719
+         
1525 1720
 
1526 1721
             this.zone_device_options = [
1527 1722
               { values: this.zone_names },
@@ -1529,7 +1724,6 @@ export default {
1529 1724
               { values: this.current_devices }
1530 1725
             ];
1531 1726
 
1532
-            console.log(this.current_devices);
1533 1727
           } else {
1534 1728
           }
1535 1729
         })
@@ -1607,9 +1801,6 @@ export default {
1607 1801
                   if (this.zone_names.length > 0) {
1608 1802
                     this.zone_name = this.zone_names[0];
1609 1803
                     this.current_devices = this.zone_device_map[this.zone_name];
1610
-
1611
-                    console.log(this.zone_device_map[this.zone_name]);
1612
-
1613 1804
                     this.device_id = this.current_devices[0].id;
1614 1805
                   }
1615 1806
                   this.zone_device_options = [
@@ -2009,7 +2200,9 @@ export default {
2009 2200
     changePartiton(val){
2010 2201
      this.$emit('event1', val)
2011 2202
       this.partition_id = val
2203
+      this.getWeekPanels()
2012 2204
       this.getSchedules()
2205
+    
2013 2206
     },
2014 2207
     changeSchedule_type(val){
2015 2208
      this.$emit('event2', val)
@@ -2042,6 +2235,7 @@ export default {
2042 2235
   //    this.tableContainHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 160
2043 2236
   // },
2044 2237
   created() {
2238
+    this.getWeekPanels()
2045 2239
     this.changeScheduleType(1)
2046 2240
     rowNumber = 0;
2047 2241
     this.modeOptions = this.$store.getters.treatment_mode;