fix: 采购退货

This commit is contained in:
weiwei committed 2025-08-11 17:31:18 +08:00
1 parent 370b2f80ab
commit 937e6065e6
7 files changed
+246 -386

No files matched your search

-37
View File
@@ -1,37 +0,0 @@
import { useMessage } from "./message"
export type tableRow = { id: string | undefined; checkStatus: number | string | undefined; processInstanceId: string | undefined | null }
type ICreate = () => void
type IEdit = (row: tableRow) => void
type IClose = () => void
// 采购流程(补货申请、采购订单、采购入库、采购退货、零售出库、零售退货) 表格操作列行为hook
export function useSmProcessTableAction(processFormState: { formId: string | undefined; formDisabled: boolean; showForm: boolean }): {
create: ICreate
edit: IEdit
close: IClose
} {
// 点击新增
const create: ICreate = () => {
processFormState.formDisabled = false
processFormState.showForm = true
}
// 点击编辑
const edit: IEdit = (row: tableRow) => {
row.id ? (processFormState.formId = row.id) : useMessage().warning("清单id不存在")
row.checkStatus == 2 ? (processFormState.formDisabled = true) : (processFormState.formDisabled = false)
processFormState.showForm = true
}
// 表单关闭
const close: IClose = () => {
processFormState.showForm = false
processFormState.formId = undefined
processFormState.formDisabled = true
}
return {
create,
edit,
close,
}
}