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/crm/saleQuotation/index.vue | 43 +++++++++++++++++++++++++------------------
1 files changed, 25 insertions(+), 18 deletions(-)
diff --git a/src/views/crm/saleQuotation/index.vue b/src/views/crm/saleQuotation/index.vue
index cf01246..9b0f50f 100644
--- a/src/views/crm/saleQuotation/index.vue
+++ b/src/views/crm/saleQuotation/index.vue
@@ -19,7 +19,9 @@
import type { CrmSaleQuotationAiApi } from '#/api/crm/saleQuotation/ai';
-import { nextTick, ref } from 'vue';
+import { computed, nextTick, ref } from 'vue';
+
+import { isAiEnable } from '@vben/hooks';
import { QUOTATION_STATUS, useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
@@ -119,6 +121,27 @@
});
}
+/** 宸ュ叿鏍忔寜閽細璇嗗埆褰曞叆鍙� AI 鎬诲紑鍏虫帶鍒� */
+const toolbarActions = computed(() => [
+ {
+ label: $t('ui.actionTitle.create', ['鎶ヤ环鍗�']),
+ type: 'primary' as const,
+ icon: ACTION_ICON.ADD,
+ auth: ['crm:sale-quotation:create'],
+ onClick: handleCreate,
+ },
+ ...(isAiEnable()
+ ? [
+ {
+ label: '璇嗗埆褰曞叆',
+ type: 'default' as const,
+ auth: ['crm:sale-quotation:create'],
+ onClick: handleOcrCreate,
+ },
+ ]
+ : []),
+]);
+
const [Grid, gridApi] = useVbenVxeGrid({
formOptions: {
schema: useGridFormSchema(),
@@ -156,23 +179,7 @@
<OcrUpload ref="ocrUploadRef" @success="handleOcrSuccess" />
<Grid>
<template #toolbar-tools>
- <TableAction
- :actions="[
- {
- label: $t('ui.actionTitle.create', ['鎶ヤ环鍗�']),
- type: 'primary',
- icon: ACTION_ICON.ADD,
- auth: ['crm:sale-quotation:create'],
- onClick: handleCreate,
- },
- {
- label: '璇嗗埆褰曞叆',
- type: 'default',
- auth: ['crm:sale-quotation:create'],
- onClick: handleOcrCreate,
- },
- ]"
- />
+ <TableAction :actions="toolbarActions" />
</template>
<template #name="{ row }">
<Button type="link" @click="handleDetail(row)">
--
Gitblit v1.9.3