From 1351e497ff256b325662f7d9e3632150ae9d19e9 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 13 十月 2026 00:07:32 +0800
Subject: [PATCH] feat(crm): 合同模块新增导出选中功能
---
src/views/basicData/mdm/data.ts | 8 --------
src/views/crm/customer/data.ts | 15 ---------------
src/views/crm/contract/index.vue | 26 ++++++++++++++++++++++++++
src/views/crm/contract/data.ts | 1 +
4 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/src/views/basicData/mdm/data.ts b/src/views/basicData/mdm/data.ts
index ca625c3..b30e5e3 100644
--- a/src/views/basicData/mdm/data.ts
+++ b/src/views/basicData/mdm/data.ts
@@ -577,14 +577,6 @@
minWidth: 100,
},
{
- field: "purchasePrice",
- title: "閲囪喘浠�",
- minWidth: 100,
- formatter: ({ cellValue }) => {
- return cellValue != null ? `楼${Number(cellValue).toFixed(2)}` : "";
- },
- },
- {
field: "salesPrice",
title: "閿�鍞环",
minWidth: 100,
diff --git a/src/views/crm/contract/data.ts b/src/views/crm/contract/data.ts
index a31f414..d87c188 100644
--- a/src/views/crm/contract/data.ts
+++ b/src/views/crm/contract/data.ts
@@ -326,6 +326,7 @@
export function useGridColumns(): VxeTableGridOptions['columns'] {
return [
+ { type: 'checkbox', width: 50, fixed: 'left' },
{
title: '鍚堝悓缂栧彿',
field: 'no',
diff --git a/src/views/crm/contract/index.vue b/src/views/crm/contract/index.vue
index 66a35c4..c57bffe 100644
--- a/src/views/crm/contract/index.vue
+++ b/src/views/crm/contract/index.vue
@@ -41,6 +41,7 @@
/** 鍒锋柊琛ㄦ牸 */
function handleRefresh() {
+ gridApi.grid.clearCheckboxRow();
gridApi.query();
}
@@ -55,6 +56,24 @@
const formValues = await gridApi.formApi.getValues();
const data = await exportContract({
sceneType: sceneType.value,
+ ...formValues,
+ });
+ downloadFileFromBlobPart({ fileName: '鍚堝悓.xls', source: data });
+}
+
+/** 瀵煎嚭鍕鹃�夌殑鍚堝悓 */
+async function handleExportSelected() {
+ const rows: CrmContractApi.Contract[] =
+ gridApi.grid.getCheckboxRecords?.() ?? [];
+ const ids = rows.map((row) => row.id!);
+ if (ids.length === 0) {
+ message.warning('璇峰厛鍕鹃�夎瀵煎嚭鐨勫悎鍚�');
+ return;
+ }
+ const formValues = await gridApi.formApi.getValues();
+ const data = await exportContract({
+ sceneType: sceneType.value,
+ ids: ids.join(','),
...formValues,
});
downloadFileFromBlobPart({ fileName: '鍚堝悓.xls', source: data });
@@ -249,6 +268,13 @@
onClick: handleExport,
},
{
+ label: '瀵煎嚭閫変腑',
+ type: 'primary',
+ icon: ACTION_ICON.DOWNLOAD,
+ auth: ['crm:contract:export'],
+ onClick: handleExportSelected,
+ },
+ {
label: '瀵煎叆',
type: 'primary',
icon: ACTION_ICON.UPLOAD,
diff --git a/src/views/crm/customer/data.ts b/src/views/crm/customer/data.ts
index fc00aae..3a54242 100644
--- a/src/views/crm/customer/data.ts
+++ b/src/views/crm/customer/data.ts
@@ -276,21 +276,6 @@
},
},
{
- field: 'mobile',
- title: '鎵嬫満',
- minWidth: 120,
- },
- {
- field: 'telephone',
- title: '鐢佃瘽',
- minWidth: 130,
- },
- {
- field: 'email',
- title: '閭',
- minWidth: 180,
- },
- {
field: 'level',
title: '瀹㈡埛绾у埆',
minWidth: 135,
--
Gitblit v1.9.3