Sfoglia il codice sorgente

Visit UI - surgical hx - custom item fix

Vijayakrishnan 3 anni fa
parent
commit
931a56b53f

+ 15 - 26
resources/views/app/patient/segment-templates/history_surgical/edit.blade.php

@@ -41,14 +41,14 @@ if(!$contentData) {
     ];
 }
 
-for ($i = 0; $i < count($fields); $i++) {
+/*for ($i = 0; $i < count($fields); $i++) {
     foreach($fields[$i] as $head => $values) {
         for($k = 0; $k < count($values); $k++) {
             $fName = $head . '_' . sanitize_field_name($values[$k]);
             if(!isset($contentData["common"][$fName])) $contentData["common"][$fName] = null;
         }
     }
-}
+}*/
 
 ?>
 
@@ -72,19 +72,19 @@ for ($i = 0; $i < count($fields); $i++) {
                                     @for($k = 0; $k < count($values); $k++)
                                         <?php $fName = $head . '_' . sanitize_field_name($values[$k]); ?>
                                         <label class="d-flex align-items-start mb-1">
-                                            <input type="checkbox" name="{{ $fName }}" class="m-0"
+                                            <input type="checkbox" name="{{ $fName }}" class="mx-0 mt-1"
                                                    v-model="common['{{$fName}}']">
                                             <div class="ml-2">
                                                 <div>
                                                     <span class="mr-2">{{ $values[$k] }}</span>
-                                                    <div moe no-mask>
+                                                    <div moe no-mask v-show="common['{{$fName}}']" >
                                                         <a href="#" start show>
-                                                            <i v-show="common['{{$fName}}']" class="fa-comment" :class="common['{{$fName}}__comments'] ? 'fas' : 'far'"></i>
+                                                            <i class="fa-comment" :class="common['{{$fName}}__comments'] ? 'fas' : 'far'"></i>
                                                         </a>
                                                         <div url="/nop">
                                                             <div class="mb-2">
-                                                    <textarea class="form-control form-control-sm ns-custom-comment min-width-200px"
-                                                              v-model="common['{{$fName}}__comments']"></textarea>
+                                                                <textarea class="form-control form-control-sm ns-custom-comment min-width-200px"
+                                                                          v-model="common['{{$fName}}__comments']"></textarea>
                                                             </div>
                                                             <div class="">
                                                                 <button type="button" class="btn btn-sm btn-primary" cancel>Close
@@ -96,7 +96,7 @@ for ($i = 0; $i < count($fields); $i++) {
                                                 <span v-show="common['{{$fName}}'] && common['{{$fName}}__comments']"
                                                       v-html="common['{{$fName}}__comments']"
                                                       class="text-sm text-secondary">
-                                    </span>
+                                                </span>
                                             </div>
                                         </label>
                                     @endfor
@@ -132,16 +132,16 @@ for ($i = 0; $i < count($fields); $i++) {
                         <div class="d-flex align-items-start flex-wrap custom-items-container">
                             <div class="w-25" v-for="item in customFields">
                                 <label class="d-flex align-items-start mb-1">
-                                    <input type="checkbox" class="m-0"
+                                    <input type="checkbox" class="mx-0 mt-1"
                                            v-model="item.value">
-                                    <div class="ml-2">
+                                    <div class="ml-2 pr-3">
                                         <div>
                                             <span class="mr-2">@{{ item.label }}</span>
-                                            <div moe no-mask>
+                                            <div moe no-mask v-show="item.value" >
                                                 <a href="#" start show>
-                                                    <i v-show="item.value" class="fa-comment" :class="item.comments ? 'fas' : 'far'"></i>
+                                                    <i class="fa-comment" :class="item.comments ? 'fas' : 'far'"></i>
                                                 </a>
-                                                <div url="/nop">
+                                                <div url="/nop" right>
                                                     <div class="mb-2">
                                                         <textarea class="form-control form-control-sm ns-custom-comment min-width-200px" v-model="item.comments"></textarea>
                                                     </div>
@@ -154,7 +154,7 @@ for ($i = 0; $i < count($fields); $i++) {
                                         <span v-show="item.value && item.comments"
                                               v-html="item.comments"
                                               class="text-sm text-secondary">
-                            </span>
+                                        </span>
                                     </div>
                                 </label>
                             </div>
@@ -228,9 +228,9 @@ for ($i = 0; $i < count($fields); $i++) {
                         }, function(_data) {
                             hideMask();
                             if(_data && _data.success) {
-                                self.appendCustomItem(_label);
                                 hideMoeFormMask();
                                 $('[custom-item-form]').hide();
+                                $('.custom-items-container').closest('.visit-segment').find('.refresh-segment').trigger('click');
                             }
                             else {
                                 toastr.error(_data.message);
@@ -242,17 +242,6 @@ for ($i = 0; $i < count($fields); $i++) {
                         hideMoeFormMask();
                         $('div[moe]').hide();
                         return false;
-                    },
-                    appendCustomItem: function(_name) {
-                        this.customFields.push({
-                            label: _name,
-                            value: '',
-                            comments: '',
-                        });
-                        Vue.nextTick(function() {
-                            $('.custom-items-container [moe][initialized]').removeAttr('initialized');
-                            initMoes();
-                        });
                     }
                 }
             });