chore: add shared handlers
This commit is contained in:
No files matched your search
@@ -29,12 +29,11 @@ import {
|
||||
handleActionRemove,
|
||||
handleCancelForm,
|
||||
} from '~/handlers/material.handler'
|
||||
import { uoms, getUomList } from "~/handlers/_shared.handler"
|
||||
|
||||
// Services
|
||||
import { getMaterials, getMaterialDetail } from '~/services/material.service'
|
||||
import { getUoms } from '~/services/uom.service'
|
||||
|
||||
const uoms = ref<{ value: string; label: string }[]>([])
|
||||
const title = ref('')
|
||||
|
||||
const {
|
||||
@@ -93,14 +92,6 @@ const getCurrentMaterialDetail = async (id: number | string) => {
|
||||
}
|
||||
}
|
||||
|
||||
const getUomList = async () => {
|
||||
const result = await getUoms()
|
||||
if (result.success) {
|
||||
const currentUoms = result.body?.data || []
|
||||
uoms.value = currentUoms.map((uom: Uom) => ({ value: uom.code || uom.erp_id, label: uom.name }))
|
||||
}
|
||||
}
|
||||
|
||||
// Watch for row actions when recId or recAction changes
|
||||
watch([recId, recAction], () => {
|
||||
switch (recAction.value) {
|
||||
|
||||
Reference in New Issue
Block a user