From b8f94fd25b1510d24a93cb7104c88529f066d841 Mon Sep 17 00:00:00 2001 From: weiwei Date: Thu, 27 Mar 2025 20:26:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=95=86=E6=88=B7=E6=94=B6=E6=AC=BE?= =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/canteen/boxesInfo/index.vue | 2 +- src/views/wallet/mch-manage/index.vue | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/views/canteen/boxesInfo/index.vue b/src/views/canteen/boxesInfo/index.vue index 5f7a661..3639980 100644 --- a/src/views/canteen/boxesInfo/index.vue +++ b/src/views/canteen/boxesInfo/index.vue @@ -7,7 +7,7 @@ - 查询 + 查询 重置 diff --git a/src/views/wallet/mch-manage/index.vue b/src/views/wallet/mch-manage/index.vue index 72b8e0c..de7ddff 100644 --- a/src/views/wallet/mch-manage/index.vue +++ b/src/views/wallet/mch-manage/index.vue @@ -67,7 +67,10 @@ @@ -161,6 +164,7 @@ import { useDict } from "/@/hooks/dict" import FormDialog from "./form.vue" import Setting from "./setting.vue" import { useUserInfo } from "/@/stores/userInfo" +import { downBlobFile as downCollectionCodeBlobFile } from "/@/utils/other" const { merchant_type, wallet_type, yes_no_type } = useDict("merchant_type", "wallet_type", "yes_no_type") @@ -256,4 +260,10 @@ const handleDelete = async (ids: string[]) => { useMessage().error(err.msg) } } + +// 点击二维码下载 +const downloadCollectionCode = (row: any) => { + if (!row.collectionCode) return useMessage().error("二维码链接不存在") + downCollectionCodeBlobFile(row.collectionCode, {}, `${row.name} 收款二维码.png`) +} From 1dc74c9a4d8531b4cca2c43f7cef79bfd7c30718 Mon Sep 17 00:00:00 2001 From: weiwei Date: Fri, 28 Mar 2025 10:28:54 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B6=85=E5=B8=82=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=93=8D=E4=BD=9C=E8=A1=8C=E4=B8=BAhook?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/smProcessTableAction.ts | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/hooks/smProcessTableAction.ts diff --git a/src/hooks/smProcessTableAction.ts b/src/hooks/smProcessTableAction.ts new file mode 100644 index 0000000..1ba8b60 --- /dev/null +++ b/src/hooks/smProcessTableAction.ts @@ -0,0 +1,38 @@ +import { useMessage } from "./message" + +type tableRow = { id: string | undefined; checkStatus: number | string | undefined } +type ICreate = () => void +type IEdit = (row: tableRow) => void +type IFormClose = () => void + +// 采购流程(补货申请、采购订单、采购入库、采购退货、零售出库、零售退货) 表格操作列行为hook +export function useSmProcessTableAction(processFormState: { formId: string | undefined; formDisabled: boolean; showForm: boolean }): { + create: ICreate + edit: IEdit + formClose: IFormClose +} { + // 点击新增 + 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 formClose: IFormClose = () => { + processFormState.showForm = false + processFormState.formId = undefined + processFormState.formDisabled = true + } + + return { + create, + edit, + formClose, + } +}