From 64a8cd04229f7b903913fc3dc7ef4aef267ac3bc Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 26 十月 2026 17:36:14 +0800
Subject: [PATCH] Merge branch 'dev_pro2.0' into dev_南通_苏珩
---
src/views/erp/purchase/invoice/index.vue | 56 +++++++++++++++++++++++++++++++-------------------------
1 files changed, 31 insertions(+), 25 deletions(-)
diff --git a/src/views/erp/purchase/invoice/index.vue b/src/views/erp/purchase/invoice/index.vue
index 2878f23..44cba30 100644
--- a/src/views/erp/purchase/invoice/index.vue
+++ b/src/views/erp/purchase/invoice/index.vue
@@ -4,10 +4,11 @@
import type { ErpPurchaseInvoiceAiApi } from '#/api/erp/purchase/invoice/ai';
import { Page, useVbenModal } from '@vben/common-ui';
+import { isAiEnable } from '@vben/hooks';
import { downloadFileFromBlobPart } from '@vben/utils';
import { Button, message, Tag } from 'ant-design-vue';
-import { nextTick, ref } from 'vue';
+import { computed, nextTick, ref } from 'vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
@@ -84,6 +85,34 @@
}
}
+/** 宸ュ叿鏍忔寜閽細璇嗗埆褰曞叆鍙� AI 鎬诲紑鍏虫帶鍒� */
+const toolbarActions = computed(() => [
+ {
+ label: $t('ui.actionTitle.create', ['鏉ョエ']),
+ type: 'primary' as const,
+ icon: ACTION_ICON.ADD,
+ auth: ['erp:purchase-invoice:create'],
+ onClick: handleCreate,
+ },
+ ...(isAiEnable()
+ ? [
+ {
+ label: '璇嗗埆褰曞叆',
+ type: 'primary' as const,
+ auth: ['erp:purchase-invoice:create'],
+ onClick: handleOcrCreate,
+ },
+ ]
+ : []),
+ {
+ label: $t('ui.actionTitle.export'),
+ type: 'primary' as const,
+ icon: ACTION_ICON.DOWNLOAD,
+ auth: ['erp:purchase-invoice:export'],
+ onClick: handleExport,
+ },
+]);
+
const [Grid, gridApi] = useVbenVxeGrid({
formOptions: {
schema: useGridFormSchema(),
@@ -121,30 +150,7 @@
<OcrUpload ref="ocrUploadRef" @success="handleOcrSuccess" />
<Grid table-title="鏉ョエ鍒楄〃">
<template #toolbar-tools>
- <TableAction
- :actions="[
- {
- label: $t('ui.actionTitle.create', ['鏉ョエ']),
- type: 'primary',
- icon: ACTION_ICON.ADD,
- auth: ['erp:purchase-invoice:create'],
- onClick: handleCreate,
- },
- {
- label: '璇嗗埆褰曞叆',
- type: 'primary',
- auth: ['erp:purchase-invoice:create'],
- onClick: handleOcrCreate,
- },
- {
- label: $t('ui.actionTitle.export'),
- type: 'primary',
- icon: ACTION_ICON.DOWNLOAD,
- auth: ['erp:purchase-invoice:export'],
- onClick: handleExport,
- },
- ]"
- />
+ <TableAction :actions="toolbarActions" />
</template>
<template #no="{ row }">
<Button type="link" @click="handleDetail(row)">
--
Gitblit v1.9.3