Pārlūkot izejas kodu

Rx - if no entries give 1 blank entry to start with

Vijayakrishnan 4 gadi atpakaļ
vecāks
revīzija
eb202c0d59

+ 7 - 12
resources/views/app/patient/canvas-sections/rx/form.blade.php

@@ -1,5 +1,5 @@
 <?php
-if(!$contentData) {
+if(!$contentData || !isset($contentData['items']) || !count($contentData['items'])) {
     $contentData = [
         "items" => [
             [
@@ -12,17 +12,6 @@ if(!$contentData) {
     ];
 }
 
-if(!isset($contentData['items'])){
-    $contentData['items'] =  [
-        [
-            "title" => "",
-            "strength" => "",
-            "frequency" => "",
-            "detail" => "",
-        ]
-    ];
-}
-
 $formID = rand(0, 100000);
 ?>
 <div id="rxSection">
@@ -61,6 +50,7 @@ $formID = rand(0, 100000);
             <td>
                 <input type="text" :data-index="index"
                        class="form-control form-control-sm"
+                       list="frequency-options"
                        data-field="frequency" v-model="item.frequency">
             </td>
             <td><textarea type="text" class="form-control form-control-sm"
@@ -83,6 +73,11 @@ $formID = rand(0, 100000);
     >+ New Entry</button>
     </div>
 
+    <datalist id="frequency-options">
+        <option value="Once a day">
+        <option value="Twice a day">
+    </datalist>
+
 </div>
 <script>
     (function() {