feat: Add item and item price list components with their respective configurations.
This commit is contained in:
No files matched your search
@@ -3,27 +3,23 @@ import { defineAsyncComponent } from 'vue'
|
|||||||
|
|
||||||
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
|
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
|
||||||
|
|
||||||
const _doctorStatus = {
|
|
||||||
0: 'Tidak Aktif',
|
|
||||||
1: 'Aktif',
|
|
||||||
}
|
|
||||||
|
|
||||||
export const config: Config = {
|
export const config: Config = {
|
||||||
cols: [{}, {}, { width: 50 }],
|
cols: [{}, {}, {}, { width: 50 }],
|
||||||
|
|
||||||
headers: [
|
headers: [
|
||||||
[
|
[
|
||||||
{ label: 'Kode' },
|
{ label: 'Item' },
|
||||||
{ label: 'Nama' },
|
{ label: 'Harga' },
|
||||||
|
{ label: 'Perusahaan Asuransi' },
|
||||||
{ label: 'Aksi' },
|
{ label: 'Aksi' },
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
keys: ['code', 'name', 'action'],
|
keys: ['item_code', 'price', 'insuranceCompany_code', 'action'],
|
||||||
|
|
||||||
delKeyNames: [
|
delKeyNames: [
|
||||||
{ key: 'code', label: 'Kode' },
|
{ key: 'item_code', label: 'Item' },
|
||||||
{ key: 'name', label: 'Nama' },
|
{ key: 'insuranceCompany_code', label: 'Perusahaan Asuransi' },
|
||||||
],
|
],
|
||||||
|
|
||||||
parses: {},
|
parses: {},
|
||||||
@@ -39,9 +35,5 @@ export const config: Config = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
htmls: {
|
htmls: {},
|
||||||
patient_address(_rec) {
|
|
||||||
return '-'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,39 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// Components
|
||||||
|
import PaginationView from '~/components/pub/my-ui/pagination/pagination-view.vue'
|
||||||
|
|
||||||
|
// Types
|
||||||
|
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
||||||
|
|
||||||
|
// Configs
|
||||||
import { config } from './list-cfg'
|
import { config } from './list-cfg'
|
||||||
|
|
||||||
defineProps<{
|
interface Props {
|
||||||
data: any[]
|
data: any[]
|
||||||
|
paginationMeta: PaginationMeta
|
||||||
|
}
|
||||||
|
|
||||||
|
defineProps<Props>()
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
pageChange: [page: number]
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
function handlePageChange(page: number) {
|
||||||
|
emit('pageChange', page)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<PubMyUiDataTable
|
<div class="space-y-4">
|
||||||
v-bind="config"
|
<PubMyUiDataTable
|
||||||
:rows="data"
|
v-bind="config"
|
||||||
/>
|
:rows="data"
|
||||||
|
:skeleton-size="paginationMeta?.pageSize"
|
||||||
|
/>
|
||||||
|
<PaginationView
|
||||||
|
:pagination-meta="paginationMeta"
|
||||||
|
@page-change="handlePageChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import { Badge } from '~/components/pub/ui/badge'
|
|
||||||
|
|
||||||
const props = defineProps<{
|
|
||||||
rec: any
|
|
||||||
idx?: number
|
|
||||||
}>()
|
|
||||||
|
|
||||||
const doctorStatus = {
|
|
||||||
0: 'Tidak Aktif',
|
|
||||||
1: 'Aktif',
|
|
||||||
}
|
|
||||||
|
|
||||||
const statusText = computed(() => {
|
|
||||||
return doctorStatus[props.rec.status_code as keyof typeof doctorStatus]
|
|
||||||
})
|
|
||||||
|
|
||||||
const badgeVariant = computed(() => {
|
|
||||||
return props.rec.status_code === 1 ? 'default' : 'destructive'
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class="flex justify-center">
|
|
||||||
<Badge :variant="badgeVariant">
|
|
||||||
{{ statusText }}
|
|
||||||
</Badge>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
@@ -3,23 +3,22 @@ import { defineAsyncComponent } from 'vue'
|
|||||||
|
|
||||||
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
|
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
|
||||||
|
|
||||||
const _doctorStatus = {
|
|
||||||
0: 'Tidak Aktif',
|
|
||||||
1: 'Aktif',
|
|
||||||
}
|
|
||||||
|
|
||||||
export const config: Config = {
|
export const config: Config = {
|
||||||
cols: [{}, {}, { width: 50 }],
|
cols: [{}, {}, {}, {}, {}, {}, { width: 50 }],
|
||||||
|
|
||||||
headers: [
|
headers: [
|
||||||
[
|
[
|
||||||
{ label: 'Kode' },
|
{ label: 'Kode' },
|
||||||
{ label: 'Nama' },
|
{ label: 'Nama' },
|
||||||
|
{ label: 'Item Group' },
|
||||||
|
{ label: 'UOM' },
|
||||||
|
{ label: 'Infra' },
|
||||||
|
{ label: 'Stok' },
|
||||||
{ label: 'Aksi' },
|
{ label: 'Aksi' },
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
keys: ['code', 'name', 'action'],
|
keys: ['code', 'name', 'itemGroup_code', 'uom_code', 'infra_code', 'stock', 'action'],
|
||||||
|
|
||||||
delKeyNames: [
|
delKeyNames: [
|
||||||
{ key: 'code', label: 'Kode' },
|
{ key: 'code', label: 'Kode' },
|
||||||
@@ -39,9 +38,5 @@ export const config: Config = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
htmls: {
|
htmls: {},
|
||||||
patient_address(_rec) {
|
|
||||||
return '-'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,39 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// Components
|
||||||
|
import PaginationView from '~/components/pub/my-ui/pagination/pagination-view.vue'
|
||||||
|
|
||||||
|
// Types
|
||||||
|
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
||||||
|
|
||||||
|
// Configs
|
||||||
import { config } from './list-cfg'
|
import { config } from './list-cfg'
|
||||||
|
|
||||||
defineProps<{
|
interface Props {
|
||||||
data: any[]
|
data: any[]
|
||||||
|
paginationMeta: PaginationMeta
|
||||||
|
}
|
||||||
|
|
||||||
|
defineProps<Props>()
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
pageChange: [page: number]
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
function handlePageChange(page: number) {
|
||||||
|
emit('pageChange', page)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<PubMyUiDataTable
|
<div class="space-y-4">
|
||||||
v-bind="config"
|
<PubMyUiDataTable
|
||||||
:rows="data"
|
v-bind="config"
|
||||||
/>
|
:rows="data"
|
||||||
|
:skeleton-size="paginationMeta?.pageSize"
|
||||||
|
/>
|
||||||
|
<PaginationView
|
||||||
|
:pagination-meta="paginationMeta"
|
||||||
|
@page-change="handlePageChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import { Badge } from '~/components/pub/ui/badge'
|
|
||||||
|
|
||||||
const props = defineProps<{
|
|
||||||
rec: any
|
|
||||||
idx?: number
|
|
||||||
}>()
|
|
||||||
|
|
||||||
const doctorStatus = {
|
|
||||||
0: 'Tidak Aktif',
|
|
||||||
1: 'Aktif',
|
|
||||||
}
|
|
||||||
|
|
||||||
const statusText = computed(() => {
|
|
||||||
return doctorStatus[props.rec.status_code as keyof typeof doctorStatus]
|
|
||||||
})
|
|
||||||
|
|
||||||
const badgeVariant = computed(() => {
|
|
||||||
return props.rec.status_code === 1 ? 'default' : 'destructive'
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class="flex justify-center">
|
|
||||||
<Badge :variant="badgeVariant">
|
|
||||||
{{ statusText }}
|
|
||||||
</Badge>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
Reference in New Issue
Block a user