diff --git a/app/components/app/encounter/filter-form-prev.vue b/app/components/app/encounter/filter-form-prev.vue new file mode 100644 index 00000000..31ec4476 --- /dev/null +++ b/app/components/app/encounter/filter-form-prev.vue @@ -0,0 +1,114 @@ + + + + + onSubmitForm(values, { resetForm }))"> + + + + Cara Bayar + + + + + + + + + + + + + Poliklinik + + + + + + + + + + + + + Kunjungan + + + + + + + + + + + + + + + + diff --git a/app/components/app/encounter/filter-form.vue b/app/components/app/encounter/filter-form.vue index 31ec4476..9ae0123b 100644 --- a/app/components/app/encounter/filter-form.vue +++ b/app/components/app/encounter/filter-form.vue @@ -1,114 +1,107 @@ - - onSubmitForm(values, { resetForm }))"> - - - - Cara Bayar - - - - - - - - - - - - - Poliklinik - - - - - - - - - - - - - Kunjungan - - - - - - - - - - - - - - - + + + + Cara Bayar + + + + + + + Poliklinik + + + + + + + Kunjungan + + + + + + + + + + Reset + + + + Terapkan + + + diff --git a/app/components/app/encounter/filter-nav.vue b/app/components/app/encounter/filter-nav.vue index 8f4c850e..30b95b96 100644 --- a/app/components/app/encounter/filter-nav.vue +++ b/app/components/app/encounter/filter-nav.vue @@ -20,11 +20,13 @@ const props = defineProps<{ const emit = defineEmits<{ apply: [filters: { personName: string; startDate: string; endDate: string }] + click: [] }>() const searchQuery = ref('') const isRoleRegistration = props.activePositon === 'registration' const isRoleMedical = props.activePositon === 'medical' +const debouncedSearchQuery = refDebounced(searchQuery, 500) const df = new DateFormatter('en-US', { dateStyle: 'medium', @@ -43,14 +45,18 @@ const oneMonthAgoCalendar = new CalendarDate( oneMonthAgo.getDate(), ) -const value = ref({ +const dateRange = ref({ start: oneMonthAgoCalendar, end: todayCalendar, }) as Ref function onFilterClick() { - const startDate = value.value.start ? value.value.start.toString() : '' - const endDate = value.value.end ? value.value.end.toString() : startDate + emit('click') +} + +function onFilterApply() { + const startDate = dateRange.value.start ? dateRange.value.start.toString() : '' + const endDate = dateRange.value.end ? dateRange.value.end.toString() : startDate emit('apply', { personName: searchQuery.value, @@ -58,6 +64,18 @@ function onFilterClick() { endDate, }) } + +watch(debouncedSearchQuery, () => { + onFilterApply() +}) + +watch( + dateRange, + () => { + onFilterApply() + }, + { deep: true }, +) @@ -76,18 +94,18 @@ function onFilterClick() { - - - {{ df.format(value.start.toDate(getLocalTimeZone())) }} - - {{ df.format(value.end.toDate(getLocalTimeZone())) }} + + + {{ df.format(dateRange.start.toDate(getLocalTimeZone())) }} - + {{ df.format(dateRange.end.toDate(getLocalTimeZone())) }} - {{ df.format(value.start.toDate(getLocalTimeZone())) }} + {{ df.format(dateRange.start.toDate(getLocalTimeZone())) }} Pick a date @@ -95,10 +113,10 @@ function onFilterClick() { (value.start = startDate)" + @update:start-value="(startDate) => (dateRange.start = startDate)" /> diff --git a/app/components/content/encounter/list.vue b/app/components/content/encounter/list.vue index 5cff930a..84e6026f 100644 --- a/app/components/content/encounter/list.vue +++ b/app/components/content/encounter/list.vue @@ -10,6 +10,9 @@ import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confi import FileUpload from '~/components/pub/my-ui/form/file-field.vue' import { useSidebar } from '~/components/pub/ui/sidebar/utils' +// Constants +import { paymentTypes } from '~/lib/constants.vclaim' + // App libs import { getServicePosition } from '~/lib/roles' // previously getPositionAs @@ -19,6 +22,7 @@ import { remove as removeEncounter, cancel as cancelEncounter, } from '~/services/encounter.service' +import { getValueLabelList as getUnits } from '~/services/unit.service' // Handlers import { uploadAttachmentCustom } from '~/handlers/supporting-document.handler' @@ -64,6 +68,12 @@ const isFilterFormDialogOpen = ref(false) const isRecordConfirmationOpen = ref(false) const isRecordCancelOpen = ref(false) const uploadFile = ref(null) +const payments = ref([]) +const units = ref([]) +const visits = ref([ + { label: 'Rujukan Internal', value: 'ri' }, + { label: 'SEP Rujukan', value: 'sr' }, +]) // Headers const hreaderPrep: CH.Config = { @@ -80,31 +90,6 @@ if (!props.canCreate) { delete hreaderPrep.addNav } -// Filters -const filter = ref<{ - installation: { - msg: { - placeholder: string - } - items: { - value: string - label: string - code: string - }[] - } - schema: any - initialValues?: Partial - errors?: any -}>({ - installation: { - msg: { - placeholder: 'Pilih', - }, - items: [], - }, - schema: {}, -}) - // Recrod reactivities provide('activeServicePosition', activeServicePosition) provide('rec_id', recId) @@ -153,8 +138,13 @@ watch([recSepId, recSepMenu, recSepSubMenu], (value) => { } }) -onMounted(() => { +onMounted(async () => { getPatientList() + units.value = await getUnits({}, true) + payments.value = Object.keys(paymentTypes).map((item) => ({ + value: item.toString(), + label: paymentTypes[item], + })) as any }) /////// Functions @@ -350,6 +340,7 @@ function handleRemoveConfirmation() { (isFilterFormDialogOpen = true)" @onExportPdf="() => {}" @onExportExcel="() => {}" @nExportCsv="() => {}" @@ -364,11 +355,15 @@ function handleRemoveConfirmation() { - +