gaoluyang
81 分钟以前 1351e497ff256b325662f7d9e3632150ae9d19e9
feat(crm): 合同模块新增导出选中功能

- 合同列表新增 checkbox 列支持多选
- 新增"导出选中"按钮及 handleExportSelected 方法
- 后端合同查询接口支持按 ids 数组过滤
- 合同导出时设置不分页以导出全部数据
- 刷新表格时自动清除勾选状态
- 修复联系人导出 setPageNo 误用为 setPageSize 的问题
- 移除主数据中采购价列及客户列表中手机、电话、邮箱列
已修改4个文件
50 ■■■■■ 文件已修改
src/views/basicData/mdm/data.ts 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/contract/data.ts 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/contract/index.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/customer/data.ts 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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,
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',
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,
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,