chore: add shared handlers

This commit is contained in:
riefive
2025-10-04 08:30:16 +07:00
parent e78342829e
commit 59847dce34
6 changed files with 110 additions and 29 deletions

No files matched your search

+1 -10
View File
@@ -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) {