参考iview的表格导出
- 导出表格需要有表头数据和具体数据
let columns = [
{
title: '品牌', key: 'brandName' },
{
title: '品种', key: 'breedName' },
{
title: '平均零售价', key: 'avgRetailPrice' },
{
title: '平均批发价', key: 'avgBatchPrice' },
{
title: '平均成本价', key: 'avgCostPrice' },
{
title: '预估折扣', key: 'discount' },
{
title: '加盟分成', key: 'franchiseeSharing' },
{
title: '总部毛利率', key: 'headquartersRossInterestRate' },
{
title: '加盟分成金额', key: 'franchiseeSharingAmount' },
{
title: '总部分成金额', key: 'headquartersSharingAmount' },
{
title: '总部分成利润', key: 'headquartersProfits' },
{
title: '总部分成', key: 'headquartersSharing' },
];
let datas = [
{
"franchiseeSharing": 0,
"brandName": "安姿",
"avgCostPrice": 36.1,
"discount": 1,
"headquartersRossInterestRate": 0.9118,
"categoryName": "太阳镜",
"avgBatchPrice": 44.81,
"headquartersSharing": 1,
"headquartersProfits": 373.25,
"avgRetailPrice": 409.35,
"headquartersSharingAmount": 409.35,
"franchiseeSharingAmount": 0