Fix: debug for PR to "dev"

This commit is contained in:
hasyim_kai
2025-11-21 10:35:47 +07:00
parent 7bd743ce35
commit 29db4c8cf1
4 changed files with 395 additions and 195 deletions
@@ -1,192 +0,0 @@
<script setup lang="ts">
// Components
import Block from '~/components/pub/my-ui/doc-entry/block.vue'
import Cell from '~/components/pub/my-ui/doc-entry/cell.vue'
import Field from '~/components/pub/my-ui/doc-entry/field.vue'
import Label from '~/components/pub/my-ui/doc-entry/label.vue'
import Combobox from '~/components/pub/my-ui/combobox/combobox.vue'
// Types
import type { UnitPositionFormData } from '~/schemas/unit-position.schema'
// Helpers
import type z from 'zod'
import { toTypedSchema } from '@vee-validate/zod'
import { useForm } from 'vee-validate'
import { genBase } from '~/models/_base'
import { genUnitPosition } from '~/models/unit-position'
interface Props {
schema: z.ZodSchema<any>
unitId: string
employees: any[]
values: any
isLoading?: boolean
isReadonly?: boolean
}
const props = defineProps<Props>()
const isLoading = props.isLoading !== undefined ? props.isLoading : false
const isReadonly = props.isReadonly !== undefined ? props.isReadonly : false
const emit = defineEmits<{
submit: [values: UnitPositionFormData, resetForm: () => void]
cancel: [resetForm: () => void]
}>()
const { defineField, errors, meta } = useForm({
validationSchema: toTypedSchema(props.schema),
initialValues: genUnitPosition() as Partial<UnitPositionFormData>,
})
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
const [employee, employeeAttrs] = defineField('employee_id')
const [headStatus, headStatusAttrs] = defineField('headStatus')
// RadioGroup uses string values; expose a string computed that maps to the boolean field
const headStatusStr = computed<string>({
get() {
if (headStatus.value === true) return 'true'
if (headStatus.value === false) return 'false'
return ''
},
set(v: string) {
if (v === 'true') headStatus.value = true
else if (v === 'false') headStatus.value = false
else headStatus.value = undefined
},
})
// Fill fields from props.values if provided
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
if (props.values.employee_id !== undefined)
employee.value = props.values.employee_id ? Number(props.values.employee_id) : null
if (props.values.headStatus !== undefined) headStatus.value = !!props.values.headStatus
}
const resetForm = () => {
code.value = ''
name.value = ''
employee.value = null
headStatus.value = false
}
// Form submission handler
function onSubmitForm() {
const formData: UnitPositionFormData = {
...genBase(),
name: name.value || '',
code: code.value || '',
// readonly based on detail unit
unit_id: props.unitId,
employee_id: employee.value || null,
headStatus: headStatus.value !== undefined ? headStatus.value : undefined,
}
emit('submit', formData, resetForm)
}
// Form cancel handler
function onCancelForm() {
emit('cancel', resetForm)
}
</script>
<template>
<form
id="form-unit-position"
@submit.prevent
>
<Block
labelSize="thin"
class="!mb-2.5 !pt-0 xl:!mb-3"
:colCount="1"
>
<Cell>
<Label height="compact">Kode Jabatan</Label>
<Field :errMessage="errors.code">
<Input
id="code"
v-model="code"
v-bind="codeAttrs"
:disabled="isLoading || isReadonly"
/>
</Field>
</Cell>
<Cell>
<Label height="compact">Nama Jabatan</Label>
<Field :errMessage="errors.name">
<Input
id="name"
v-model="name"
v-bind="nameAttrs"
:disabled="isLoading || isReadonly"
/>
</Field>
</Cell>
<Cell>
<Label height="compact">Pengisi Jabatan</Label>
<Field :errMessage="errors.employee_id">
<Combobox
id="employee"
v-model="employee"
v-bind="employeeAttrs"
:items="employees"
:is-disabled="isLoading || isReadonly"
placeholder="Pilih Karyawan"
search-placeholder="Cari Karyawan"
empty-message="Item tidak ditemukan"
/>
</Field>
</Cell>
<Cell>
<Label height="compact">Status Kepala</Label>
<Field :errMessage="errors.headStatus">
<RadioGroup
v-model="headStatusStr"
v-bind="headStatusAttrs"
class="flex gap-4"
>
<div class="flex items-center space-x-2">
<RadioGroupItem
id="head-yes"
value="true"
/>
<Label for="head-yes">Ya</Label>
</div>
<div class="flex items-center space-x-2">
<RadioGroupItem
id="head-no"
value="false"
/>
<Label for="head-no">Tidak</Label>
</div>
</RadioGroup>
</Field>
</Cell>
</Block>
<div class="my-2 flex justify-end gap-2 py-2">
<Button
type="button"
variant="secondary"
class="w-[120px]"
@click="onCancelForm"
>
Kembali
</Button>
<Button
v-if="!isReadonly"
type="button"
class="w-[120px]"
:disabled="isLoading || !meta.valid"
@click="onSubmitForm"
>
Simpan
</Button>
</div>
</form>
</template>
+2 -2
View File
@@ -2,7 +2,7 @@ import { type Base, genBase } from './_base'
import type { Employee } from './employee'
export interface UnitPosition extends Base {
unit_id: string
unit_code: string
code: string
name: string
headStatus?: boolean
@@ -14,7 +14,7 @@ export interface UnitPosition extends Base {
export function genUnitPosition(): UnitPosition {
return {
...genBase(),
unit_id: '',
unit_code: '',
code: '',
name: '',
headStatus: false,
+372
View File
@@ -0,0 +1,372 @@
[
{
"heading": "Menu Utama",
"items": [
{
"title": "Dashboard",
"icon": "i-lucide-home",
"link": "/"
},
{
"title": "Rawat Jalan",
"icon": "i-lucide-stethoscope",
"children": [
{
"title": "Antrian Pendaftaran",
"link": "/outpatient/registration-queue"
},
{
"title": "Antrian Poliklinik",
"link": "/outpatient/polyclinic-queue"
},
{
"title": "Kunjungan",
"link": "/outpatient/encounter"
},
{
"title": "Konsultasi",
"link": "/outpatient/consultation"
}
]
},
{
"title": "IGD",
"icon": "i-lucide-zap",
"children": [
{
"title": "Triase",
"link": "/emergency/triage"
},
{
"title": "Kunjungan",
"link": "/emergency/encounter"
},
{
"title": "Konsultasi",
"link": "/emergency/consultation"
}
]
},
{
"title": "Rehab Medik",
"icon": "i-lucide-bike",
"children": [
{
"title": "Antrean Pendaftaran",
"link": "/rehab/registration-queue"
},
{
"title": "Antrean Poliklinik",
"link": "/rehab/polyclinic-queue"
},
{
"title": "Kunjungan",
"link": "/rehab/encounter"
},
{
"title": "Konsultasi",
"link": "/rehab/consultation"
}
]
},
{
"title": "Rawat Inap",
"icon": "i-lucide-building-2",
"children": [
{
"title": "Permintaan",
"link": "/inpatient/request"
},
{
"title": "Kunjungan",
"link": "/inpatient/encounter"
},
{
"title": "Konsultasi",
"link": "/inpatient/consultation"
}
]
},
{
"title": "Obat - Order",
"icon": "i-lucide-briefcase-medical",
"children": [
{
"title": "Permintaan",
"link": "/medication/order"
},
{
"title": "Standing Order",
"link": "/medication/standing-order"
}
]
},
{
"title": "Lab - Order",
"icon": "i-lucide-microscope",
"link": "/pc-lab-order"
},
{
"title": "Lab Mikro - Order",
"icon": "i-lucide-microscope",
"link": "/micro-lab-order"
},
{
"title": "Lab PA - Order",
"icon": "i-lucide-microscope",
"link": "/pa-lab-order"
},
{
"title": "Radiologi - Order",
"icon": "i-lucide-radio",
"link": "/radiology-order"
},
{
"title": "Gizi",
"icon": "i-lucide-egg-fried",
"link": "/nutrition-order"
},
{
"title": "Pembayaran",
"icon": "i-lucide-banknote-arrow-up",
"link": "/payment"
}
]
},
{
"heading": "Ruang Tindakan Rajal",
"items": [
{
"title": "Kemoterapi",
"icon": "i-lucide-droplets",
"link": "/outpation-action/cemotherapy"
},
{
"title": "Hemofilia",
"icon": "i-lucide-droplet-off",
"link": "/outpation-action/hemophilia"
}
]
},
{
"heading": "Ruang Tindakan Anak",
"items": [
{
"title": "Thalasemi",
"icon": "i-lucide-baby",
"link": "/children-action/thalasemia"
},
{
"title": "Echocardiography",
"icon": "i-lucide-baby",
"link": "/children-action/echocardiography"
},
{
"title": "Spirometri",
"icon": "i-lucide-baby",
"link": "/children-action/spirometry"
}
]
},
{
"heading": "Client",
"items": [
{
"title": "Pasien",
"icon": "i-lucide-users",
"link": "/client/patient"
},
{
"title": "Rekam Medis",
"icon": "i-lucide-file-text",
"link": "/client/medical-record"
}
]
},
{
"heading": "Integrasi",
"items": [
{
"title": "BPJS",
"icon": "i-lucide-circuit-board",
"children": [
{
"title": "SEP",
"icon": "i-lucide-circuit-board",
"link": "/integration/bpjs/sep"
},
{
"title": "Peserta",
"icon": "i-lucide-circuit-board",
"link": "/integration/bpjs/member"
},
{
"title": "Surat Kontrol",
"icon": "i-lucide-circuit-board",
"link": "/integration/bpjs/control-letter"
}
]
},
{
"title": "SATUSEHAT",
"icon": "i-lucide-database",
"link": "/integration/satusehat"
}
]
},
{
"heading": "Source",
"items": [
{
"title": "Peralatan dan Perlengkapan",
"icon": "i-lucide-layout-dashboard",
"children": [
{
"title": "Obat",
"link": "/tools-equipment-src/medicine"
},
{
"title": "Peralatan",
"link": "/tools-equipment-src/tools"
},
{
"title": "Perlengkapan (BMHP)",
"link": "/tools-equipment-src/equipment"
},
{
"title": "Metode Obat",
"link": "/tools-equipment-src/medicine-method"
},
{
"title": "Jenis Obat",
"link": "/tools-equipment-src/medicine-type"
},
{
"title": "Sediaan Obat",
"link": "/tools-equipment-src/medicine-form"
}
]
},
{
"title": "Pengguna",
"icon": "i-lucide-user",
"children": [
{
"title": "Pegawai",
"link": "/human-src/employee"
},
{
"title": "PPDS",
"link": "/human-src/specialist-intern"
}
]
},
{
"title": "Pemeriksaan Penunjang",
"icon": "i-lucide-layout-list",
"children": [
{
"title": "Checkup",
"link": "/mcu-src/mcu"
},
{
"title": "Prosedur",
"link": "/mcu-src/procedure"
},
{
"title": "Diagnosis",
"link": "/mcu-src/diagnose"
},
{
"title": "Medical Action",
"link": "/mcu-src/medical-action"
}
]
},
{
"title": "Layanan",
"icon": "i-lucide-layout-list",
"children": [
{
"title": "Counter",
"link": "/service-src/counter"
},
{
"title": "Public Screen (Big Screen)",
"link": "/service-src/public-screen"
},
{
"title": "Kasur",
"link": "/service-src/bed"
},
{
"title": "Kamar",
"link": "/service-src/chamber"
},
{
"title": "Ruang",
"link": "/service-src/room"
},
{
"title": "Depo",
"link": "/service-src/warehouse"
},
{
"title": "Lantai",
"link": "/service-src/floor"
},
{
"title": "Gedung",
"link": "/service-src/building"
}
]
},
{
"title": "Organisasi",
"icon": "i-lucide-network",
"children": [
{
"title": "Divisi",
"link": "/org-src/division"
},
{
"title": "Instalasi",
"link": "/org-src/installation"
},
{
"title": "Unit",
"link": "/org-src/unit"
},
{
"title": "Spesialis",
"link": "/org-src/specialist"
},
{
"title": "Sub Spesialis",
"link": "/org-src/subspecialist"
}
]
},
{
"title": "Umum",
"icon": "i-lucide-airplay",
"children": [
{
"title": "Uom",
"link": "/common/uom"
}
]
},
{
"title": "Keuangan",
"icon": "i-lucide-airplay",
"children": [
{
"title": "Item & Pricing",
"link": "/common/item"
}
]
}
]
}
]
+21 -1
View File
@@ -329,21 +329,41 @@
"title": "Divisi",
"link": "/org-src/division"
},
{
"title": "Divisi - Posisi",
"link": "/org-src/division-position"
},
{
"title": "Instalasi",
"link": "/org-src/installation"
},
{
"title": "Instalasi - Posisi",
"link": "/org-src/installation-position"
},
{
"title": "Unit",
"link": "/org-src/unit"
},
{
"title": "Unit - Posisi",
"link": "/org-src/unit-position"
},
{
"title": "Spesialis",
"link": "/org-src/specialist"
},
{
"title": "Spesialis - Posisi",
"link": "/org-src/specialist-position"
},
{
"title": "Sub Spesialis",
"link": "/org-src/subspecialist"
},
{
"title": "Sub Spesialis - Posisi",
"link": "/org-src/subspecialist-position"
}
]
},
@@ -369,4 +389,4 @@
}
]
}
]
]