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

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

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