Browse Source

Merge branch 'vue_statistics_branch'

csx 4 years ago
parent
commit
64993db360
2 changed files with 30 additions and 2 deletions
  1. 28 2
      src/xt_pages/user/inspection.vue
  2. 2 0
      src/xt_pages/workforce/appointment.vue

+ 28 - 2
src/xt_pages/user/inspection.vue View File

671
             var inspections = response.data.data.inspections;
671
             var inspections = response.data.data.inspections;
672
             this.total = response.data.data.total;
672
             this.total = response.data.data.total;
673
             this.itemDate = response.data.data.date.split(" ")[0];
673
             this.itemDate = response.data.data.date.split(" ")[0];
674
-            console.log("1111"+this.itemDate)
675
             this.inspections = response.data.data.inspections;
674
             this.inspections = response.data.data.inspections;
676
             if (inspections == null) {
675
             if (inspections == null) {
677
               this.inspections = [];
676
               this.inspections = [];
680
             var inspectionsMap = {};
679
             var inspectionsMap = {};
681
             this.inspectionsMap = {};
680
             this.inspectionsMap = {};
682
             for (var index in inspections) {
681
             for (var index in inspections) {
682
+              console.log(inspections[index])
683
               inspectionsMap[inspections[index].item_id] = inspections[index];
683
               inspectionsMap[inspections[index].item_id] = inspections[index];
684
+
684
               this.inspectionsMap[inspections[index].item_id] =
685
               this.inspectionsMap[inspections[index].item_id] =
685
                 inspections[index];
686
                 inspections[index];
686
             }
687
             }
687
             var items = this.project.inspection_reference;
688
             var items = this.project.inspection_reference;
689
+
690
+            console.log(items)
691
+            console.log(inspectionsMap)
692
+
693
+
694
+
688
             for (var index in items) {
695
             for (var index in items) {
696
+
689
               if (
697
               if (
690
                 items[index].id in inspectionsMap ||
698
                 items[index].id in inspectionsMap ||
691
                 items[index].item_id in inspectionsMap
699
                 items[index].item_id in inspectionsMap
692
               ) {
700
               ) {
701
+
702
+
693
                 var item = {};
703
                 var item = {};
694
                 for (var key in items[index]) {
704
                 for (var key in items[index]) {
695
                   item[key] = items[index][key];
705
                   item[key] = items[index][key];
696
                 }
706
                 }
707
+                console.log(item.item_id);
708
+
697
                 if (item.item_id > 0) {
709
                 if (item.item_id > 0) {
710
+                  console.log(item)
711
+                  console.log(items[index].item_id)
712
+                  console.log(inspectionsMap)
713
+
714
+                  console.log(inspectionsMap[parseInt(items[index].item_id)].inspect_value)
715
+
698
                   item.value =
716
                   item.value =
699
                     inspectionsMap[items[index].item_id].inspect_value;
717
                     inspectionsMap[items[index].item_id].inspect_value;
718
+
719
+
700
                 } else {
720
                 } else {
721
+
701
                   item.value = inspectionsMap[items[index].id].inspect_value;
722
                   item.value = inspectionsMap[items[index].id].inspect_value;
702
                 }
723
                 }
724
+
703
                 item.value_direction = "";
725
                 item.value_direction = "";
704
                 if (item.range_type == 1) {
726
                 if (item.range_type == 1) {
727
+
705
                   var value = parseFloat(item.value);
728
                   var value = parseFloat(item.value);
706
                   var range_min = parseFloat(item.range_min);
729
                   var range_min = parseFloat(item.range_min);
707
                   var range_max = parseFloat(item.range_max);
730
                   var range_max = parseFloat(item.range_max);
712
                   }
735
                   }
713
                 }
736
                 }
714
                 this.items.push(item);
737
                 this.items.push(item);
738
+
715
               }
739
               }
740
+
716
             }
741
             }
717
-            console.log(this.items);
742
+
743
+
718
           }
744
           }
719
         })
745
         })
720
         .catch(v => {});
746
         .catch(v => {});

+ 2 - 0
src/xt_pages/workforce/appointment.vue View File

210
 
210
 
211
       },
211
       },
212
       getWeekPanels() {
212
       getWeekPanels() {
213
+        this.scheduleZoneRow = []
214
+        this.scheduleZone = []
213
         getWeekPanels(1).then(response => {
215
         getWeekPanels(1).then(response => {
214
           if (response.data.state == 0) {
216
           if (response.data.state == 0) {
215
             return false
217
             return false