From 256238c571db0d3b33fbd87d9a94febfe0774260 Mon Sep 17 00:00:00 2001 From: weiwei Date: Fri, 28 Mar 2025 15:29:07 +0800 Subject: [PATCH] 1 --- src/hooks/smProcessTableAction.ts | 25 ++++++++++++++++++++++--- src/views/wallet/mch-manage/form.vue | 1 - 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/hooks/smProcessTableAction.ts b/src/hooks/smProcessTableAction.ts index 1ba8b60..4f3fe9f 100644 --- a/src/hooks/smProcessTableAction.ts +++ b/src/hooks/smProcessTableAction.ts @@ -1,15 +1,24 @@ +import { Ref } from "vue" import { useMessage } from "./message" -type tableRow = { id: string | undefined; checkStatus: number | string | undefined } +type tableRow = { id: string | undefined; checkStatus: number | string | undefined; processInstanceId: string | undefined | null } type ICreate = () => void type IEdit = (row: tableRow) => void type IFormClose = () => void +type IDeal = (row: tableRow) => void +type ITaskSubmitEvent = () => void // 采购流程(补货申请、采购订单、采购入库、采购退货、零售出库、零售退货) 表格操作列行为hook -export function useSmProcessTableAction(processFormState: { formId: string | undefined; formDisabled: boolean; showForm: boolean }): { +export function useSmProcessTableAction( + processFormState: { formId: string | undefined; formDisabled: boolean; showForm: boolean }, + processDrawerRef: Ref, + fetchList: () => void, +): { create: ICreate edit: IEdit formClose: IFormClose + deal: IDeal + taskSubmitEvent: ITaskSubmitEvent } { // 点击新增 const create: ICreate = () => { @@ -22,17 +31,27 @@ export function useSmProcessTableAction(processFormState: { formId: string | und row.checkStatus == 2 ? (processFormState.formDisabled = true) : (processFormState.formDisabled = false) processFormState.showForm = true } - // 表单关闭 const formClose: IFormClose = () => { processFormState.showForm = false processFormState.formId = undefined processFormState.formDisabled = true } + // 点击开始处理 + const deal = (row: tableRow) => { + if (!row.processInstanceId) return useMessage().warning("流程id不存在") + processDrawerRef.value.openProcessDrawer(row) + } + // 审批提交事件 + const taskSubmitEvent = () => { + fetchList() + } return { create, edit, formClose, + deal, + taskSubmitEvent, } } diff --git a/src/views/wallet/mch-manage/form.vue b/src/views/wallet/mch-manage/form.vue index aa303cd..effc6a6 100644 --- a/src/views/wallet/mch-manage/form.vue +++ b/src/views/wallet/mch-manage/form.vue @@ -118,7 +118,6 @@ import { useDict } from "/@/hooks/dict" import { useMessage } from "/@/hooks/message" import { getObj, addObj, putObj } from "/@/api/wallet/mch-manage" const emit = defineEmits(["refresh"]) -import { useUserInfo } from "/@/stores/userInfo" // 定义变量内容 const dataFormRef = ref()