| | |
| | | <div class="btns"> |
| | | <p>汇总日期:2022-07-04 23:00:07</p> |
| | | <div> |
| | | <el-button type="primary" size="default" :icon="Download">导出</el-button> |
| | | <el-button type="primary" size="default" :icon="Download" @click="exportExcel('tab1', '会员明细.xlsx')">导出</el-button> |
| | | </div> |
| | | </div> |
| | | <el-table :data="tableData" style="width: 100%"> |
| | | <el-table :data="tableData" style="width: 100%" id="tab1"> |
| | | <el-table-column label="责任部门" align="center"> |
| | | <template #default="scope">{{ scope.row.departmentId }}</template> |
| | | </el-table-column> |
| | |
| | | import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext, FormInstance } from 'element-plus'; |
| | | import { Plus, Delete, Upload, Download, Refresh, View } from '@element-plus/icons-vue'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | |
| | | // import * as XLSX from 'xlsx'; |
| | | |
| | | export default defineComponent({ |
| | | components: { ElButton, ElInput }, |
| | | setup() { |
| | |
| | | ], |
| | | }, |
| | | ]; |
| | | |
| | | const exportExcel = (id:string,name:string) => { |
| | | let workbook = XLSX.utils.table_to_book(document.getElementById(id)); //需要在table上定义一个id |
| | | try { |
| | | XLSX.writeFile(workbook, name); |
| | | console.log('导出成功!'); |
| | | } catch (e) { |
| | | console.log('导出失败!'); |
| | | } |
| | | } |
| | | return { |
| | | ruleForm, |
| | | tableData, |
| | |
| | | Download, |
| | | Refresh, |
| | | View, |
| | | exportExcel |
| | | }; |
| | | }, |
| | | }); |