This commit is contained in:
zc
2026-03-17 10:47:57 +08:00
parent 5554cf1548
commit 722fbd988c
16 changed files with 700 additions and 27 deletions

View File

@@ -0,0 +1,22 @@
import { ref } from 'vue'
import { selectList } from '@/apis/materialProcess/materialProcess'
import type { LabelValueState } from '@/types/global'
/** 物料品类模块 */
export function materialProcess(options?: { onSuccess?: () => void }) {
const loading = ref(false)
const materialProcessList = ref<LabelValueState[]>([])
const getMaterialProcessSelect = async () => {
try {
loading.value = true
const res = await selectList()
materialProcessList.value = res.data
// eslint-disable-next-line ts/no-unused-expressions
options?.onSuccess && options.onSuccess()
} finally {
loading.value = false
}
}
return { materialProcessList, getMaterialProcessSelect, loading }
}

View File

@@ -0,0 +1,22 @@
import { ref } from 'vue'
import { selectList } from '@/apis/materialType/materialType'
import type { LabelValueState } from '@/types/global'
/** 物料品类模块 */
export function materialType(options?: { onSuccess?: () => void }) {
const loading = ref(false)
const materialTypeList = ref<LabelValueState[]>([])
const getMaterialTypeSelect = async () => {
try {
loading.value = true
const res = await selectList()
materialTypeList.value = res.data
// eslint-disable-next-line ts/no-unused-expressions
options?.onSuccess && options.onSuccess()
} finally {
loading.value = false
}
}
return { materialTypeList, getMaterialTypeSelect, loading }
}