diff --git a/app/components/content/document-upload/list.vue b/app/components/content/document-upload/list.vue
index c69ac96b..94f9dd9f 100644
--- a/app/components/content/document-upload/list.vue
+++ b/app/components/content/document-upload/list.vue
@@ -4,28 +4,31 @@ import { ActionEvents } from '~/components/pub/my-ui/data/types'
import type { HeaderPrep, } from '~/components/pub/my-ui/data/types'
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
import { usePaginatedList } from '~/composables/usePaginatedList'
-import { getList, remove } from '~/services/control-letter.service'
+import { getList, remove } from '~/services/supporting-document.service'
import { toast } from '~/components/pub/ui/toast'
import type { Encounter } from '~/models/encounter'
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
+import { genEncounterDocument } from '~/models/encounter-document'
// #endregion
// #region State
const props = defineProps<{
encounter?: Encounter
+ refresh: () => void
}>()
+
const route = useRoute()
const encounterId = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
-const { data, isLoading, paginationMeta, searchInput, handlePageChange, handleSearch, fetchData } = usePaginatedList({
- fetchFn: (params) => getList({ ...params, includes: 'specialist,subspecialist,doctor-employee-person', }),
- entityName: 'control-letter',
+const dummy = computed(() => {
+ return props.encounter?.encounterDocuments || []
})
const isRecordConfirmationOpen = ref(false)
const recId = ref
(0)
const recAction = ref('')
const recItem = ref(null)
+const timestamp = ref(0)
const headerPrep: HeaderPrep = {
title: "Upload Dokumen",
@@ -53,7 +56,7 @@ async function handleConfirmDelete(record: any, action: string) {
const result = await remove(record.id)
if (result.success) {
toast({ title: 'Berhasil', description: 'Data berhasil dihapus', variant: 'default' })
- await fetchData()
+ props.refresh()
} else {
toast({ title: 'Gagal', description: `Data gagal dihapus`, variant: 'destructive' })
}
@@ -63,6 +66,7 @@ async function handleConfirmDelete(record: any, action: string) {
}
}
+
function handleCancelConfirmation() {
// Reset record state when cancelled
recId.value = 0
@@ -75,13 +79,14 @@ function handleCancelConfirmation() {
provide('rec_id', recId)
provide('rec_action', recAction)
provide('rec_item', recItem)
+provide('timestamp', timestamp)
// #endregion
// #region Watchers
-watch([recId, recAction], () => {
+watch([recId, recAction, timestamp], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
- navigateTo("https://google.com", { external: true, open: { target: '_blank' } })
+ navigateTo(recItem.value.filePath, { external: true, open: { target: '_blank' } })
break
case ActionEvents.showEdit:
navigateTo({
@@ -99,7 +104,7 @@ watch([recId, recAction], () => {
-
+
@@ -111,11 +116,7 @@ watch([recId, recAction], () => {
Nama:
- {{ record.firstName }}
-
-
- Kode:
- {{ record.cellphone }}
+ {{ record.name }}
diff --git a/app/components/content/encounter/process.vue b/app/components/content/encounter/process.vue
index 7d178303..1f9a37a1 100644
--- a/app/components/content/encounter/process.vue
+++ b/app/components/content/encounter/process.vue
@@ -17,6 +17,7 @@ import EarlyMedicalRehabList from '~/components/content/soapi/entry.vue'
import PrescriptionList from '~/components/content/prescription/list.vue'
import Consultation from '~/components/content/consultation/list.vue'
import DocUploadList from '~/components/content/document-upload/list.vue'
+import { genEncounter } from '~/models/encounter'
const route = useRoute()
const router = useRouter()
@@ -30,12 +31,18 @@ const activeTab = computed({
})
const id = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
-const dataRes = await getDetail(id, {
- includes:
- 'patient,patient-person,patient-person-addresses,unit,Appointment_Doctor,Appointment_Doctor-employee,Appointment_Doctor-employee-person',
+const data = ref(genEncounter())
+
+async function fetchDetail() {
+ const res = await getDetail(id, {
+ includes: 'patient,patient-person,patient-person-addresses,unit,Appointment_Doctor,Appointment_Doctor-employee,Appointment_Doctor-employee-person,EncounterDocuments',
+ })
+ if(res.body?.data) data.value = res.body?.data
+}
+
+onMounted(() => {
+ fetchDetail()
})
-const dataResBody = dataRes.body ?? null
-const data = dataResBody?.data ?? null
const tabs: TabItem[] = [
{ value: 'status', label: 'Status Masuk/Keluar', component: Status, props: { encounter: data } },
@@ -73,7 +80,7 @@ const tabs: TabItem[] = [
{ value: 'resume', label: 'Resume' },
{ value: 'control', label: 'Surat Kontrol' },
{ value: 'screening', label: 'Skrinning MPP' },
- { value: 'supporting-document', label: 'Upload Dokumen Pendukung', component: DocUploadList, props: { encounter: data } },
+ { value: 'supporting-document', label: 'Upload Dokumen Pendukung', component: DocUploadList, props: { encounter: data, }, },
]
diff --git a/app/components/pub/my-ui/data/dropdown-action-dd.vue b/app/components/pub/my-ui/data/dropdown-action-dd.vue
new file mode 100644
index 00000000..a6a99c9a
--- /dev/null
+++ b/app/components/pub/my-ui/data/dropdown-action-dd.vue
@@ -0,0 +1,80 @@
+
+
+