Samson Mutunga 2 anos atrás
pai
commit
4d5d9d01fb

+ 6 - 6
resources/views/app/patient/segment-templates/omega_pe/edit.blade.php

@@ -369,7 +369,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
   (function() {
     function initPE() {
       let model = <?= $contentData ? json_encode($contentData) : '{}' ?>;
-      let form = $('#edit-univ_physical_exam-container').closest('form');
+      let form = $('#edit-omega-pe').closest('form');
       new Vue({
         el: '#edit-omega-pe',
         delimiters: ["@{{", "}}"],
@@ -379,9 +379,9 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
         },
         watch: {
           $data: {
-            // handler: function(val, oldVal) {
-            //   this.autoSaveForm();
-            // },
+            handler: function(val, oldVal) {
+              this.autoSaveForm();
+            },
             deep: true
           }
         },
@@ -411,7 +411,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
             $.post(url, dataArray, function(response) {}, 'json');
           },
           _autoSaveForm: function() {
-            let parent = $('#edit-univ_physical_exam-container').closest('form');
+            let parent = $('#edit-omega-pe').closest('form');
             parent.find('[name="data"]').val(JSON.stringify(this.data));
 
             // autosave on change
@@ -427,7 +427,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
 
     }
     window.segmentInitializers.omega_pe = initPE;
-    addMCInitializer('init-pe-{{$note->id}}', initPE, '#edit-univ_physical_exam-container');
+    addMCInitializer('init-pe-{{$note->id}}', initPE, '#edit-omega-pe');
 
   }).call(window);
 </script>