✨ feat (soapi): integrate early,rehab,function
This commit is contained in:
@@ -1,9 +1,32 @@
|
||||
<script setup lang="ts">
|
||||
import { z } from 'zod'
|
||||
import Entry from '~/components/app/soapi/entry.vue'
|
||||
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
|
||||
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
||||
import { EarlySchema } from '~/schemas/soapi.schema'
|
||||
import { toast } from '~/components/pub/ui/toast'
|
||||
import { handleActionSave, handleActionEdit } from '~/handlers/soapi-early.handler'
|
||||
|
||||
const isOpen = ref(false)
|
||||
const data = ref([])
|
||||
const schema = EarlySchema
|
||||
|
||||
const model = ref({
|
||||
'prim-compl': '',
|
||||
'cur-disea-hist': '',
|
||||
'syst-bp': '',
|
||||
'diast-bp': '',
|
||||
pulse: '',
|
||||
'resp-rate': '',
|
||||
temp: '',
|
||||
weight: '',
|
||||
height: '',
|
||||
'reflect-fisio': '',
|
||||
'reflect-pato': '',
|
||||
'autonom-neuron': '',
|
||||
'medical-act': '',
|
||||
therapy: '',
|
||||
})
|
||||
const isLoading = reactive<DataTableLoader>({
|
||||
isTableLoading: false,
|
||||
})
|
||||
@@ -21,16 +44,42 @@ onMounted(() => {
|
||||
getPatientList()
|
||||
})
|
||||
|
||||
function handleClick(type: string) {
|
||||
function handleOpen(type: string) {
|
||||
console.log(type)
|
||||
isOpen.value = true
|
||||
}
|
||||
|
||||
const entryRef = ref()
|
||||
async function actionHandler(type: string) {
|
||||
console.log(type)
|
||||
const result = await entryRef.value?.validate()
|
||||
if (result?.valid) {
|
||||
console.log('✅ Valid data:', result.data)
|
||||
handleActionSave(result.data, {}, toast)
|
||||
} else {
|
||||
console.log('❌ Ada error di form', result)
|
||||
}
|
||||
}
|
||||
|
||||
provide('table_data_loader', isLoading)
|
||||
</script>
|
||||
<template>
|
||||
<Entry type="early" :exclude-fields="['prim-compl', 'sec-compl']" @click="handleClick" />
|
||||
<Dialog v-model:open="isOpen" title="Pilih Prosedur" size="xl" prevent-outside>
|
||||
<Entry
|
||||
ref="entryRef"
|
||||
v-model="model"
|
||||
:schema="schema"
|
||||
type="early"
|
||||
@modal="handleOpen"
|
||||
/>
|
||||
<div class="my-2 flex justify-end py-2">
|
||||
<Action @click="actionHandler" />
|
||||
</div>
|
||||
<Dialog
|
||||
v-model:open="isOpen"
|
||||
title="Pilih Prosedur"
|
||||
size="xl"
|
||||
prevent-outside
|
||||
>
|
||||
<AppIcdMultiselectPicker :data="data" />
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user