feat(material): create service get for material and uom

This commit is contained in:
riefive
2025-09-18 13:42:35 +07:00
parent 117e72fdce
commit 29b54b072c
4 changed files with 29 additions and 18 deletions
+6 -13
View File
@@ -7,6 +7,10 @@ import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
import AppEquipmentEntryForm from '~/components/app/equipment/entry-form.vue'
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
// Services
import { getSourceMaterials } from "~/services/source-material.service"
import { getSourceUoms } from "~/services/source-uom.service"
const isFormEntryDialogOpen = ref(false)
const isRecordConfirmationOpen = ref(false)
const recId = ref<number>(0)
@@ -24,17 +28,6 @@ const items = [
{ value: 'item-3', label: 'Item 3' },
]
// Fungsi untuk fetch data equipment
async function fetchEquipmentData(params: any) {
// const endpoint = transform('/api/v1/equipment', params)
// return await xfetch(endpoint)
return await xfetch('/api/v1/material')
}
async function fetchUom() {
return await xfetch('/api/v1/uom')
}
// Menggunakan composable untuk pagination
const {
data,
@@ -45,7 +38,7 @@ const {
handleSearch,
fetchData: getEquipmentList,
} = usePaginatedList({
fetchFn: fetchEquipmentData,
fetchFn: getSourceMaterials,
entityName: 'equipment',
})
@@ -176,7 +169,7 @@ const handleCancelConfirmation = () => {
}
onMounted(async () => {
await fetchUom()
await getSourceUoms()
})
</script>