Browse Source

历史排班周

XMLWAN 2 years ago
parent
commit
e86adb288d
1 changed files with 74 additions and 10 deletions
  1. 74 10
      src/xt_pages/workforce/components/historyWeekTable.vue

+ 74 - 10
src/xt_pages/workforce/components/historyWeekTable.vue View File

@@ -749,12 +749,12 @@ export default {
749 749
       var theType = this.weekType(this.weekTime);
750 750
       // console.log("999999999",theType)
751 751
       this.theType = theType
752
-      this.getgetSchedules()
752
+      this.getSchedules()
753 753
     },
754 754
     scheduleZoneRow: function() {
755 755
       var theType = this.weekType(this.weekTime);
756 756
       this.theType = theType
757
-      this.getgetSchedules()
757
+      this.getSchedules()
758 758
     },
759 759
     tableHeight(val) {
760 760
       if (!this.timer) {
@@ -2783,7 +2783,7 @@ export default {
2783 2783
     getAllZones() {
2784 2784
       getAllZones().then(response => {
2785 2785
         if (response.data.state == 1) {
2786
-          console.log('getAllZones的数据',response.data.data);
2786
+          // console.log('getAllZones的数据',response.data.data);
2787 2787
           var zones = response.data.data.zones
2788 2788
           for (let i = 0; i < zones.length; i++) {
2789 2789
             this.zoneIdList.push(zones[i].id)
@@ -2802,13 +2802,13 @@ export default {
2802 2802
       this.partition_id = val
2803 2803
       // this.getWeekPanels()
2804 2804
       
2805
-      this.getgetSchedules()
2805
+      this.getSchedules()
2806 2806
     },
2807 2807
     changeSchedule_type(val) {
2808 2808
       this.$emit('event2', val)
2809 2809
       this.schedule_type = val
2810 2810
      
2811
-      this.getgetSchedules()
2811
+      this.getSchedules()
2812 2812
     },
2813 2813
     changeWeekDay(val) {
2814 2814
       this.$emit('event3', val)
@@ -3124,8 +3124,6 @@ export default {
3124 3124
         is_before:1,
3125 3125
         start_time: this.start_time + " 00:00:00",
3126 3126
         end_time:this.end_time + ' 23:59:59',
3127
-        // start_time: "2023-03-20" + " 00:00:00",
3128
-        // end_time:"2023-03-26" + "23:59:59",
3129 3127
         weekTime: this.theType,
3130 3128
         patitionid: str,
3131 3129
         schedule_type: this.schedule_type,
@@ -3133,18 +3131,64 @@ export default {
3133 3131
       
3134 3132
       getSchedulesOne(params).then(response => {
3135 3133
         if (response.data.state == 1) {
3136
-          this.weekTitle = response.data.data.weekTitle;
3134
+          this.weekTitle = []
3135
+          
3136
+   
3137
+
3138
+
3139
+          var first = this.getTimestamp(this.start_time) 
3140
+          var first_day =  this.getTime(first, "{y}-{m}-{d}")
3141
+          this.weekTitle.push(first_day)
3142
+
3143
+
3144
+          var second = this.getTimestamp(this.start_time) + 86400
3145
+          var soncond_day =  this.getTime(second, "{y}-{m}-{d}")
3146
+           this.weekTitle.push(soncond_day)
3147
+
3148
+          var three = this.getTimestamp(this.start_time) + 172800
3149
+          var three_day =  this.getTime(three, "{y}-{m}-{d}")
3150
+          this.weekTitle.push(three_day)
3151
+
3152
+
3153
+          var four = this.getTimestamp(this.start_time) + 259200
3154
+          var four_day =  this.getTime(four, "{y}-{m}-{d}")
3155
+
3156
+           this.weekTitle.push(four_day)
3157
+
3158
+          var five = this.getTimestamp(this.start_time) + 345600
3159
+          var five_day =  this.getTime(five, "{y}-{m}-{d}")
3160
+
3161
+          this.weekTitle.push(five_day)
3162
+          
3163
+          var six = this.getTimestamp(this.start_time) + 432000
3164
+          var six_day =  this.getTime(six, "{y}-{m}-{d}")
3165
+
3166
+          this.weekTitle.push(six_day)
3137 3167
 
3168
+
3169
+          var seven = this.getTimestamp(this.start_time) + 518400
3170
+          var seven_day =  this.getTime(seven, "{y}-{m}-{d}")
3171
+
3172
+          this.weekTitle.push(seven_day)
3173
+
3174
+
3175
+        
3176
+        
3177
+          console.log("this.weekTitle",this.weekTitle)
3178
+
3179
+
3180
+        
3138 3181
           this.weekDays = response.data.data.days;
3182
+         
3139 3183
           this.toDay = response.data.data.today;
3140 3184
           var theSchedules = response.data.data.schdules;
3141 3185
           var schedulesGroup = response.data.data.schedulesGroup
3142 3186
           this.schedulesGroup = schedulesGroup
3143 3187
             
3144 3188
           var that = this;
3145
-         console.log("历史周2332222😯o-----------",response.data.data.schdules)
3189
+         
3146 3190
          this.scheduleZone.forEach(function (zone, index) {
3147
-            console.log("之心3222222222222222222")
3191
+           
3148 3192
             that.scheduleZone[index].Mon_M = {
3149 3193
               mode_id: 0,
3150 3194
               mode_name: "",
@@ -3380,6 +3424,26 @@ export default {
3380 3424
         }
3381 3425
       });
3382 3426
     },
3427
+    getTimestamp(time) {
3428
+      //把时间日期转成时间戳
3429
+      console.log("日期", new Date(time));
3430
+      return new Date(time).getTime() / 1000;
3431
+    },
3432
+  
3433
+    getTimestampToTime (timestamp) {
3434
+      let date = new Date(timestamp)
3435
+      let Y = date.getFullYear() + '-'
3436
+      let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
3437
+      let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate())
3438
+      let time = Y + M + D
3439
+      return time
3440
+   },
3441
+    getTime(value, temp) {
3442
+      if (value != undefined) {
3443
+        return uParseTime(value, temp)
3444
+      }
3445
+      return ''
3446
+    },
3383 3447
   },
3384 3448
   components: {
3385 3449
     ScheduleItem