Improved autocomplete widget

This commit is contained in:
2023-04-24 21:30:14 -04:00
parent 1d68749525
commit 6c263b00dc
2 changed files with 41 additions and 36 deletions

View File

@@ -1,7 +1,7 @@
<template>
<table class="table" style="font-family: monospace;" v-if="appointments && appointments.length > 0">
<thead>
<tr><th>Time</th><th>Clinic</th><th>Patient</th><th>Note</th><th>Assignee</th></tr>
<tr><th>Time</th><th>Clinic</th><th>Patient</th><th>Note</th><th style="width: 16rem;">Assignee</th></tr>
</thead>
<tbody>
<tr v-for="row in appointments" :style="{ backgroundColor: strHashHSL(row.Clinic, '90%') }">
@@ -10,7 +10,7 @@
<td v-if="production"><router-link :to="'/patient/$' + row.HRN">{{row.Name}} <span :title="row.HRN">{{row.HRN.slice(-4)}}</span></router-link></td>
<td v-else><router-link :title="strtr_unscramble(row.Name)" :to="'/patient/$' + row.Name.charAt(0) + row.HRN.slice(-4) + '?name=' + row.Name">{{row.Name}} ${{row.HRN}}</router-link></td>
<td>{{row.NOTE}} [{{row.APPT_MADE_BY}} on {{row.DATE_APPT_MADE}}]</td>
<td><Autocomplete :value="practitioner[row.Name]" @update:value="x => practitioner[row.Name] = x" :items="practitioner_list" /></td>
<td><Autocomplete :modelValue="practitioner[row.Name]" @update:modelValue="x => practitioner[row.Name] = x" :items="practitioner_list" /></td>
</tr>
</tbody>
</table>
@@ -48,7 +48,7 @@
return this.client.remotestate.practitioner || (this.client.remotestate.practitioner = {});
},
practitioner_list() {
return this.practitioner ? uniq(Object.values(this.practitioner)).sort() : [];
return this.practitioner ? uniq(Object.values(this.practitioner).filter(x => x)).sort() : [];
}
},
watch: {