feat/readiology-order: added mcu
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import type { Config } from '~/components/pub/my-ui/data-table'
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
|
||||
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
|
||||
|
||||
export const config: Config = {
|
||||
cols: [{}, {}, {}, { width: 50 }],
|
||||
|
||||
headers: [
|
||||
[
|
||||
{ label: 'Nama' },
|
||||
{ label: 'Jenis' },
|
||||
{ label: 'Catatan' },
|
||||
{ label: '' },
|
||||
],
|
||||
],
|
||||
|
||||
keys: ['mcuSrc.name', 'mcuSrc.mcuSrcCategory.name', 'note'],
|
||||
|
||||
delKeyNames: [
|
||||
{ key: 'mcuSrc.name', label: 'Nama' },
|
||||
],
|
||||
|
||||
components: {
|
||||
action(rec, idx) {
|
||||
return {
|
||||
idx,
|
||||
rec: rec as object,
|
||||
component: action,
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
htmls: {},
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import { config } from './list-entry.cfg'
|
||||
import type { McuOrderItem } from '~/models/mcu-order-item';
|
||||
|
||||
defineProps<{
|
||||
data: McuOrderItem[]
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
requestItem: []
|
||||
}>()
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PubMyUiDataTable class="border mb-3 2xl:mb-4"
|
||||
v-bind="config"
|
||||
:rows="data"
|
||||
/>
|
||||
<div class="-mx-1 [&_button]:mx-1">
|
||||
<Button @click="emit('requestItem')">
|
||||
<Icon name="i-lucide-plus" />
|
||||
Pilih Item
|
||||
</Button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,21 @@
|
||||
import type { Config } from '~/components/pub/my-ui/data-table'
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
|
||||
type SmallDetailDto = any
|
||||
|
||||
export const config: Config = {
|
||||
cols: [{}, {}],
|
||||
|
||||
headers: [
|
||||
[
|
||||
{ label: 'Nama' },
|
||||
{ label: 'Jenis' },
|
||||
],
|
||||
],
|
||||
|
||||
keys: ['mcuSrc.name', 'mcuSrcCategory.name'],
|
||||
|
||||
delKeyNames: [
|
||||
{ key: 'mcuSrc.name', label: 'Nama' },
|
||||
],
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
import type { McuOrderItem } from '~/models/mcu-order-item';
|
||||
import { config } from './list.cfg'
|
||||
|
||||
defineProps<{
|
||||
data: McuOrderItem[]
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
tambah: [mode: string]
|
||||
}>()
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PubMyUiDataTable class="border"
|
||||
v-bind="config"
|
||||
:rows="data"
|
||||
/>
|
||||
</template>
|
||||
@@ -0,0 +1,32 @@
|
||||
<script setup lang="ts">
|
||||
import * as DE from '~/components/pub/my-ui/doc-entry'
|
||||
import type { McuOrder } from '~/models/mcu-order';
|
||||
|
||||
const props = defineProps<{
|
||||
data: McuOrder
|
||||
}>()
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="text-sm 2xl:text-base font-semibold mb-3">
|
||||
Order {{ data?.createdAt?.substring(0, 10) }} - {{ data.status_code }}
|
||||
</div>
|
||||
<div class="max-w-[1000px]">
|
||||
<DE.Block mode="preview" :col-count=5 class="!mb-3">
|
||||
<DE.Cell :col-span="2">
|
||||
<DE.Label class="font-semibold">DPJP</DE.Label>
|
||||
<DE.Field>
|
||||
{{ data?.doctor?.employee?.person?.name || '.........' }}
|
||||
</DE.Field>
|
||||
</DE.Cell>
|
||||
<DE.Cell></DE.Cell>
|
||||
<DE.Cell :col-span="2">
|
||||
<DE.Label class="font-semibold">PPDS</DE.Label>
|
||||
<DE.Field>
|
||||
...........
|
||||
</DE.Field>
|
||||
</DE.Cell>
|
||||
</DE.Block>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,64 @@
|
||||
<script setup lang="ts">
|
||||
import * as DE from '~/components/pub/my-ui/doc-entry';
|
||||
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
||||
import Nav from '~/components/pub/my-ui/nav-footer/ca-ed-su.vue'
|
||||
|
||||
import type { McuOrder } from '~/models/mcu-order';
|
||||
import McuOrderItems from '~/components/app/mcu-order-item/list.vue';
|
||||
|
||||
interface Props {
|
||||
data: McuOrder[]
|
||||
paginationMeta: PaginationMeta
|
||||
}
|
||||
const props = defineProps<Props>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
cancel: [data: any]
|
||||
edit: [data: any],
|
||||
submit: [data: any]
|
||||
}>()
|
||||
|
||||
function navClick(type: 'cancel' | 'edit' | 'submit', data: McuOrder): void {
|
||||
if (type === 'cancel') {
|
||||
emit('cancel', data)
|
||||
} else if (type === 'edit') {
|
||||
emit('edit', data)
|
||||
} else if (type === 'submit') {
|
||||
emit('submit', data)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="data.length == 0" class="p-10 text-center">
|
||||
<div class="mb-4 xl:mb-5">Belum Ada Data</div>
|
||||
</div>
|
||||
<template v-for="item, idx in data">
|
||||
<div :class="'text-sm 2xl:text-base font-semibold ' + (item.status_code == 'new' ? 'mb-2' : 'mb-2')">
|
||||
Order #{{ data.length - idx }} - {{ item.createdAt?.substring(0, 10) }} - {{ item.status_code }}
|
||||
</div>
|
||||
<DE.Block mode="preview" :col-count=7 class="!mb-3">
|
||||
<DE.Cell :col-span="3">
|
||||
<DE.Label :class="'font-semibold ' + (item.status_code == 'new' ? 'pt-2' : '')">DPJP</DE.Label>
|
||||
<DE.Field :class="item.status_code == 'new' ? 'pt-2' : ''">
|
||||
{{ item.doctor?.employee?.person?.name || '........' }}
|
||||
</DE.Field>
|
||||
</DE.Cell>
|
||||
<DE.Cell :col-span="3">
|
||||
<DE.Label :class="'font-semibold ' + (item.status_code == 'new' ? 'pt-2' : '')">PPDS</DE.Label>
|
||||
<DE.Field :class="item.status_code == 'new' ? 'pt-2' : ''">
|
||||
...........
|
||||
</DE.Field>
|
||||
</DE.Cell>
|
||||
<div class="flex justify-end" >
|
||||
<Nav
|
||||
v-if="item.status_code == 'new'"
|
||||
:small-mode="true"
|
||||
:default-class="'flex gap-1'"
|
||||
@click="(type) => { navClick(type, item) }"
|
||||
/>
|
||||
</div>
|
||||
</DE.Block>
|
||||
<McuOrderItems :data="item.items || []" @click="console.log('click')" class="!mb-5" />
|
||||
</template>
|
||||
</template>
|
||||
@@ -0,0 +1,64 @@
|
||||
<script setup lang="ts">
|
||||
import * as DE from '~/components/pub/my-ui/doc-entry';
|
||||
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
||||
import Nav from '~/components/pub/my-ui/nav-footer/ca-ed-su.vue'
|
||||
|
||||
import type { McuOrder } from '~/models/mcu-order';
|
||||
import McuOrderItems from '~/components/app/mcu-order-item/list.vue';
|
||||
|
||||
interface Props {
|
||||
data: McuOrder[]
|
||||
paginationMeta: PaginationMeta
|
||||
}
|
||||
const props = defineProps<Props>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
cancel: [data: any]
|
||||
edit: [data: any],
|
||||
submit: [data: any]
|
||||
}>()
|
||||
|
||||
function navClick(type: 'cancel' | 'edit' | 'submit', data: McuOrder): void {
|
||||
if (type === 'cancel') {
|
||||
emit('cancel', data)
|
||||
} else if (type === 'edit') {
|
||||
emit('edit', data)
|
||||
} else if (type === 'submit') {
|
||||
emit('submit', data)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="data.length == 0" class="p-10 text-center">
|
||||
<div class="mb-4 xl:mb-5">Belum Ada Data</div>
|
||||
</div>
|
||||
<template v-for="item, idx in data">
|
||||
<div :class="'text-sm 2xl:text-base font-semibold ' + (item.status_code == 'new' ? 'mb-2' : 'mb-2')">
|
||||
Order #{{ data.length - idx }} - {{ item.createdAt?.substring(0, 10) }} - {{ item.status_code }}
|
||||
</div>
|
||||
<DE.Block mode="preview" :col-count=7 class="!mb-3">
|
||||
<DE.Cell :col-span="3">
|
||||
<DE.Label :class="'font-semibold ' + (item.status_code == 'new' ? 'pt-2' : '')">DPJP</DE.Label>
|
||||
<DE.Field :class="item.status_code == 'new' ? 'pt-2' : ''">
|
||||
{{ item.doctor?.employee?.person?.name || '........' }}
|
||||
</DE.Field>
|
||||
</DE.Cell>
|
||||
<DE.Cell :col-span="3">
|
||||
<DE.Label :class="'font-semibold ' + (item.status_code == 'new' ? 'pt-2' : '')">PPDS</DE.Label>
|
||||
<DE.Field :class="item.status_code == 'new' ? 'pt-2' : ''">
|
||||
...........
|
||||
</DE.Field>
|
||||
</DE.Cell>
|
||||
<div class="flex justify-end" >
|
||||
<Nav
|
||||
v-if="item.status_code == 'new'"
|
||||
:small-mode="true"
|
||||
:default-class="'flex gap-1'"
|
||||
@click="(type) => { navClick(type, item) }"
|
||||
/>
|
||||
</div>
|
||||
</DE.Block>
|
||||
<McuOrderItems :data="item.items || []" @click="console.log('click')" class="!mb-5" />
|
||||
</template>
|
||||
</template>
|
||||
@@ -0,0 +1,35 @@
|
||||
<script setup lang="ts">
|
||||
import * as DE from '~/components/pub/my-ui/doc-entry'
|
||||
import type { McuSrcCategory } from '~/models/mcu-src-category';
|
||||
|
||||
const model = defineModel()
|
||||
const props = defineProps<{
|
||||
data: McuSrcCategory[]
|
||||
}>()
|
||||
const emit = defineEmits<{
|
||||
pick: [category: McuSrcCategory]
|
||||
}>()
|
||||
|
||||
if (!model.value && props.data.length > 0) {
|
||||
model.value = props.data[0]?.code
|
||||
}
|
||||
|
||||
function pick(category: McuSrcCategory) {
|
||||
model.value = category.code
|
||||
emit('pick', category)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mb-5">
|
||||
<div class="font-semibold mb-1.5">
|
||||
Kategori
|
||||
</div>
|
||||
<div class="-mx-1 [&_button]:mx-1 ">
|
||||
<Button v-for="item, idx in data" :variant="model === item.code ? 'default' : 'outline'" @click="pick(item)">
|
||||
{{ item.name }}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,49 @@
|
||||
<script setup lang="ts">
|
||||
import type { McuSrc } from '~/models/mcu-src';
|
||||
import type { McuOrderItem } from '~/models/mcu-order-item';
|
||||
|
||||
const data = defineModel({ type: Array as PropType<McuOrderItem[]>, required: true })
|
||||
defineProps<{
|
||||
dataSource: McuSrc[]
|
||||
// data: number[]
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
pick: [item: McuSrc]
|
||||
}>()
|
||||
|
||||
function pick(item: McuSrc) {
|
||||
emit('pick', item)
|
||||
// if (data.value.some(e => e.mcuSrc_id === item.id)) {
|
||||
// const pos = data.value.map(e => e.mcuSrc_id).indexOf(item.id)
|
||||
// data.value.splice(pos, 1)
|
||||
// } else {
|
||||
// data.value.push({
|
||||
// id: 0,
|
||||
// mcuOrder_id: 0,
|
||||
// mcuSrc_id: item.id,
|
||||
// createdAt: "",
|
||||
// updatedAt: "",
|
||||
// })
|
||||
// }
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mb-5">
|
||||
<div class="font-semibold mb-1.5">
|
||||
Daftar Item
|
||||
</div>
|
||||
<div class="grid lg:grid-cols-4 2xl:grid-cols-5 gap-2 [&_button]:w-full">
|
||||
<div v-for="item, idx in dataSource" :key="idx" class="flex gap-2">
|
||||
<Button
|
||||
:variant="data.some(e => e.mcuSrc_id === item.id) ? 'default' : 'outline'"
|
||||
type="button"
|
||||
@click="pick(item)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user