From cdebdb8995525fd91a8e564ccc9692ae866a5314 Mon Sep 17 00:00:00 2001 From: Abizrh Date: Sun, 7 Sep 2025 22:50:15 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat=20(item):=20add=20item=20and?= =?UTF-8?q?=20item=20price=20modules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/app/item-price/entry-form.vue | 50 +++++++++++++ app/components/app/item-price/list-cfg.ts | 46 ++++++++++++ app/components/app/item-price/list.vue | 19 +++++ app/components/app/item-price/picker.vue | 0 app/components/app/item-price/search.vue | 0 .../app/item-price/status-badge.vue | 29 ++++++++ app/components/app/item/entry-form.vue | 68 ++++++++++++++++++ app/components/app/item/list-cfg.ts | 46 ++++++++++++ app/components/app/item/list.vue | 19 +++++ app/components/app/item/picker.vue | 0 app/components/app/item/search.vue | 0 app/components/app/item/status-badge.vue | 29 ++++++++ app/components/flow/item-price/list.vue | 71 +++++++++++++++++++ app/components/flow/item/list.vue | 71 +++++++++++++++++++ app/components/flow/medicine-group/list.vue | 5 ++ app/models/item-price.ts | 39 ++++++++++ app/models/item.ts | 48 +++++++++++++ app/pages/_dev/index.vue | 2 +- 18 files changed, 541 insertions(+), 1 deletion(-) create mode 100644 app/components/app/item-price/entry-form.vue create mode 100644 app/components/app/item-price/list-cfg.ts create mode 100644 app/components/app/item-price/list.vue create mode 100644 app/components/app/item-price/picker.vue create mode 100644 app/components/app/item-price/search.vue create mode 100644 app/components/app/item-price/status-badge.vue create mode 100644 app/components/app/item/entry-form.vue create mode 100644 app/components/app/item/list-cfg.ts create mode 100644 app/components/app/item/list.vue create mode 100644 app/components/app/item/picker.vue create mode 100644 app/components/app/item/search.vue create mode 100644 app/components/app/item/status-badge.vue create mode 100644 app/components/flow/item-price/list.vue create mode 100644 app/components/flow/item/list.vue create mode 100644 app/models/item-price.ts create mode 100644 app/models/item.ts diff --git a/app/components/app/item-price/entry-form.vue b/app/components/app/item-price/entry-form.vue new file mode 100644 index 00000000..e0c97dc8 --- /dev/null +++ b/app/components/app/item-price/entry-form.vue @@ -0,0 +1,50 @@ + + + diff --git a/app/components/app/item-price/list-cfg.ts b/app/components/app/item-price/list-cfg.ts new file mode 100644 index 00000000..e2c72f9c --- /dev/null +++ b/app/components/app/item-price/list-cfg.ts @@ -0,0 +1,46 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/custom-ui/data/types' +import { defineAsyncComponent } from 'vue' + +const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/data/dropdown-action-dud.vue')) + +const _doctorStatus = { + 0: 'Tidak Aktif', + 1: 'Aktif', +} + +export const cols: Col[] = [{}, {}, { width: 50 }] + +export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Aksi' }]] + +export const keys = ['code', 'name', 'action'] + +export const delKeyNames: KeyLabel[] = [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, +] + +export const funcParsed: RecStrFuncUnknown = {} + +export const funcComponent: RecStrFuncComponent = { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, +} + +export const funcHtml: RecStrFuncUnknown = { + patient_address(_rec) { + return '-' + }, +} diff --git a/app/components/app/item-price/list.vue b/app/components/app/item-price/list.vue new file mode 100644 index 00000000..5b8778d9 --- /dev/null +++ b/app/components/app/item-price/list.vue @@ -0,0 +1,19 @@ + + + diff --git a/app/components/app/item-price/picker.vue b/app/components/app/item-price/picker.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/item-price/search.vue b/app/components/app/item-price/search.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/item-price/status-badge.vue b/app/components/app/item-price/status-badge.vue new file mode 100644 index 00000000..32cdfbca --- /dev/null +++ b/app/components/app/item-price/status-badge.vue @@ -0,0 +1,29 @@ + + + diff --git a/app/components/app/item/entry-form.vue b/app/components/app/item/entry-form.vue new file mode 100644 index 00000000..8f6d3abf --- /dev/null +++ b/app/components/app/item/entry-form.vue @@ -0,0 +1,68 @@ + + + diff --git a/app/components/app/item/list-cfg.ts b/app/components/app/item/list-cfg.ts new file mode 100644 index 00000000..e2c72f9c --- /dev/null +++ b/app/components/app/item/list-cfg.ts @@ -0,0 +1,46 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/custom-ui/data/types' +import { defineAsyncComponent } from 'vue' + +const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/data/dropdown-action-dud.vue')) + +const _doctorStatus = { + 0: 'Tidak Aktif', + 1: 'Aktif', +} + +export const cols: Col[] = [{}, {}, { width: 50 }] + +export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Aksi' }]] + +export const keys = ['code', 'name', 'action'] + +export const delKeyNames: KeyLabel[] = [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, +] + +export const funcParsed: RecStrFuncUnknown = {} + +export const funcComponent: RecStrFuncComponent = { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, +} + +export const funcHtml: RecStrFuncUnknown = { + patient_address(_rec) { + return '-' + }, +} diff --git a/app/components/app/item/list.vue b/app/components/app/item/list.vue new file mode 100644 index 00000000..5b8778d9 --- /dev/null +++ b/app/components/app/item/list.vue @@ -0,0 +1,19 @@ + + + diff --git a/app/components/app/item/picker.vue b/app/components/app/item/picker.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/item/search.vue b/app/components/app/item/search.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/item/status-badge.vue b/app/components/app/item/status-badge.vue new file mode 100644 index 00000000..32cdfbca --- /dev/null +++ b/app/components/app/item/status-badge.vue @@ -0,0 +1,29 @@ + + + diff --git a/app/components/flow/item-price/list.vue b/app/components/flow/item-price/list.vue new file mode 100644 index 00000000..9a5f567b --- /dev/null +++ b/app/components/flow/item-price/list.vue @@ -0,0 +1,71 @@ + + + diff --git a/app/components/flow/item/list.vue b/app/components/flow/item/list.vue new file mode 100644 index 00000000..41c7311f --- /dev/null +++ b/app/components/flow/item/list.vue @@ -0,0 +1,71 @@ + + + diff --git a/app/components/flow/medicine-group/list.vue b/app/components/flow/medicine-group/list.vue index 9a5f567b..0885b57f 100644 --- a/app/components/flow/medicine-group/list.vue +++ b/app/components/flow/medicine-group/list.vue @@ -2,10 +2,14 @@ import type { DataTableLoader } from '~/components/pub/base/data-table/type' import type { HeaderPrep, RefSearchNav } from '~/components/pub/custom-ui/data/types' import Modal from '~/components/pub/base/modal/modal.vue' +import Pagination from '~/components/pub/base/pagination/pagination.vue' import Header from '~/components/pub/custom-ui/nav-header/prep.vue' const data = ref([]) const entry = ref({}) +const page = ref(1) +const rowsPerPage = ref(10) +const totalPages = 20 const refSearchNav: RefSearchNav = { onClick: () => { @@ -63,6 +67,7 @@ provide('table_data_loader', isLoading)
+
diff --git a/app/models/item-price.ts b/app/models/item-price.ts new file mode 100644 index 00000000..fb474109 --- /dev/null +++ b/app/models/item-price.ts @@ -0,0 +1,39 @@ +export interface ItemPrice { + id: string + item_id: number + price: number + insuranceCompany_code: string +} + +export interface CreateDto { + item_id: number + price: number + insuranceCompany_code: string +} + +export interface GetListDto { + page: number + size: number + name?: string + code?: string +} + +export interface GetDetailDto { + id?: string +} + +export interface UpdateDto extends CreateDto { + id?: number +} + +export interface DeleteDto { + id?: string +} + +export function genMedicine(): CreateDto { + return { + item_id: 1, + price: 1, + insuranceCompany_code: 'test', + } +} diff --git a/app/models/item.ts b/app/models/item.ts new file mode 100644 index 00000000..851ff11d --- /dev/null +++ b/app/models/item.ts @@ -0,0 +1,48 @@ +export interface Item { + id: string + name: string + code: string + itemGroup_code: string + uom_code: string + infra_id: number + stock: number +} + +export interface CreateDto { + name: string + code: string + itemGroup_code: string + uom_code: string + infra_id: number + stock: number +} + +export interface GetListDto { + page: number + size: number + name?: string + code?: string +} + +export interface GetDetailDto { + id?: string +} + +export interface UpdateDto extends CreateDto { + id?: number +} + +export interface DeleteDto { + id?: string +} + +export function genMedicine(): CreateDto { + return { + name: 'test', + code: 'test', + itemGroup_code: 'test', + uom_code: 'test', + infra_id: 1, + stock: 1, + } +} diff --git a/app/pages/_dev/index.vue b/app/pages/_dev/index.vue index 3f67f9f8..90928bc6 100644 --- a/app/pages/_dev/index.vue +++ b/app/pages/_dev/index.vue @@ -49,7 +49,7 @@ const navMenu = ref({ { title: 'Test Medicine List', icon: 'i-lucide-user', - component: defineAsyncComponent(() => import('~/components/flow/medicine-method/list.vue')), + component: defineAsyncComponent(() => import('~/components/flow/item/list.vue')), }, ], })