1.配置tableColumns数据
datapacket.js
// 导出数据配置
// 设置数据显示格式 type
/*
string
number 1.00 保留两位小数
date 2020-04-29
datetime 2020-04-29 14:31:02
key: "concat('https://jitong.kaopu.tech/assetDetal?id=',id)"
*/
const customerExprotExcel = [
{ header: "客户编码", key: "code", type: "string" },
{ header: "客户简称", key: "customerName", type: "string" },
{ header: "发票名称", key: "formalName", type: "string" },
{ header: "行业分类", key: "industryCategory", type: "string" },
{ header: "社会统一信用代码", key: "customerCode", type: "string" },
{ header: "开户行", key: "customerBank", type: "string" },
{ header: "开户行账号", key: "BankAccount", type: "string" },
{ header: "注册地址", key: "regAddress", type: "string" },
{ header: "联系电话", key: "telephone", type: "string" },
{ header: "客户分类", key: "customerType", type: "string" },
{ header: "现有车辆情况", key: "remark", type: "string" },
{ header: "省", key: "province", type: "string" },
{ header: "市", key: "city", type: "string" },
{ header: "区县", key: "county", type: "string" },
{ header: "详细地址", key: "detailAddress", type: "string" },
{ header: "客户等级", key: "customerGrade", type: "string" },
{ header: "创建时间 ", key: "creatTime", type: "datetime" },
{ header: "填报人 ", key: "creator", type: "string" }
]
2.组件 src\components\exportExcel.vue
<template>
<!-- 导出 -->
<span>
<a-button @click="exportExcel">
<a-icon :type="downLoading =